Spot FX through OANDA's v20 API for an Open Meridian deployment. The plugin holds three roles:
-
connectivity(contract v23): it places the placements that name it at OANDA and reports what OANDA did with them: acknowledgements, rejections, fills, financing charges and each daily value-date roll. It also reports fills of orders taken in OANDA's own platform or app, on no placement. -
custody: it reads the account chosen on Connections, or the one itsaccount_idsetting names, as the custodian's view, covering the account, its sync status, a statement per read and its activity. -
data(from 0.5.0): it records OANDA's prices in the lake, of the lake's existing kinds, prices and quotes.live: each currency pair's best bid and ask with their liquidity, as a quote, and their mid, as a price of kindmid, from OANDA's pricing stream for a standing want, at most once a second a pair, and from a price read now for the latest, a gap in it not fetched again (stream_only).daily: each pair's close, the mid of OANDA's daily candle, on its day ending at 17:00 New York (ruled 2026-10-13: "later, in the same repository").
Version 0.10.0 is built on open-meridian 0.37.0: a placement is sent at
most once across a takeover, each noted as a marker of its own
(state/sent/<placement>, the SDK's connectivity.Sent), and the plugin
reads its storage once registered -- on an instance run as shards or with a
standby pod, the shard's own folder -- and afresh each time it is registered
again. The state/sent.json 0.9.1 and earlier wrote is read as it stands.
Once on 0.10.0, an instance is never rolled back below it: an earlier
release would not see the markers, and could send a placement again.
Version 0.9.1 keeps the plugin within its share at its sidecar
(sidecar.limits.inFlight): one read of the account at a time, each of its
loops once however often a class is started again, and a read stopped for
load carried to the next, never sent twice.
Version 0.9.0 is built on open-meridian 0.36.0, contract 30: each dataset
describes OANDA's API License Agreement in words (declared.TERMS; ruling
1032), declares no licence, and says how a gap in it is recovered. From
contract v29: its work is one class for each role it holds, registered with meridian.run. From
contract v28: its sessions' latency and feed delay reported, its quotes
judged at the edge. From
contract v27: one Connection for its data and connectivity roles, the SDK's, tabbed (ruling 457),
with its Raw records; the live dataset's liveness from the pricing stream's
heartbeats and no declared delay; each session's latency, recorded and
shown; and its
placement types on its catalogue, direct market access alone. Its whole
declaration -- its settings, pages and tools, the accounts it names by
OANDA's IDs, its storage and its catalogue -- and its documentation are in
docs/, which a deployment shows on the plugin's Documentation tab.
OANDA is a trademark of its owner. This project is not affiliated with or endorsed by OANDA. It connects to OANDA's published API with an access token that the deployment's administrator supplies. Which broker a person may trade with is between that person and the broker, and the API's terms are settled by the deployment admin.
| Setting | What it is |
|---|---|
environment |
The role-common setting (contract v26): paper, labelled Practice, OANDA's practice host, or live. Practice until a person chooses Live. A value saved before 0.5.0, practice, is refused by the SDK (0.31.1) and delivered unset: the plugin then reaches the practice host, never the live one, the agents' guard counts the connection live, and Connections asks for it to be saved again. |
token |
Secret. The personal access token made in OANDA's hub. It is never shown, logged or kept. OANDA does not keep it either: if it is lost, revoke it and make a new one. |
account_id |
Optional. Leave it empty and choose the account on Connections, from the v20 accounts the token reaches. Given, for example 101-001-1234567-001, it is the account, as before 0.3.0, and Connections offers no choice. |
poll_seconds |
How often the account is read (custody). |
stale_after_hours |
How old the last good read may be, while OANDA does not answer, before the account is reported stale. |
sample_data |
Developer setting. Trades with, reads and takes prices from a synthetic OANDA built into the plugin, so you can develop before any token exists. Nothing reaches OANDA. |
The token, the account and the environment serve all three roles.
The SDK also declares a window setting and a past-the-window setting for each
kind of raw record: activity (seven years), responses (30 days),
trading (seven years) and, from 0.5.0, prices (a week), what OANDA's
pricing answered the data role.
- In OANDA's hub, make a personal access token for the account's login.
- On the plugin's Settings, choose the
environment(practice first) and enter thetoken. Leaveaccount_idempty. - On Connections, under Account, the plugin lists the v20 accounts the
token reaches (OANDA's
GET /v3/accounts). A v1 account, whose ID is digits only, is listed as unusable, with the reason: this plugin speaks only the v20 API. Choose the account and press "Use this account". Where the token reaches exactly one usable account it is preselected, but nothing is read or traded until an admin confirms it. Choosing needs admin on bothcustodyandconnectivity, the roles that trade and read the account. Agents useread_connectionsandchoose_account(checked bycheck_choose_account). Who chose which account, and when, is kept in the plugin's storage. - On Account links, link the OANDA account to one of the deployment's accounts.
- To trade, an admin of
connectivityenables trading on the connection (below).
An account_id setting from before 0.3.0 keeps working: while it is set, it
is the account, and Connections lists the accounts without offering a
choice. Clear it to choose on Connections instead.
The environment setting is one key of the agents' demo-only guard
(contract v26, G1): a connection is Demo only while the setting says
paper and the environment the session reached says paper too. The
plugin reads the second from the host it calls, api-fxpractice.oanda.com
paper and api-fxtrade.oanda.com live, and publishes it on its venue
catalogue (VenueCatalogue.environment). The synthetic OANDA reaches no
venue and reports paper. Anything else, a mismatch among it, counts as
live. Connection and Connections show the badge, Demo, Live, or "Live
(environment not confirmed)".
- A pair is two cash instruments: a row's subject is the base
currency's record, the one the lake asked for, its price a
Moneyin the quote currency, as OANDA quotes it. Nothing is inverted or crossed, so the yen's own record is declined as not covered (OANDA quotes USD_JPY). Only OANDA's currency pairs are served. - Each currency is resolved by its ISO 4217 code, a miss reported once;
a subject is named by its record's
iso4217identifier. - The venue is OANDA, by its own name in the venue master; a venue not held is reported once and each row names it as reported.
- Wants: the latest of
live, a price read now; a business date, a range or the latest week ofdaily. A standing want ofliveis kept current from the pricing stream, one stream for every pair kept current, opened again when that changes, after a drop waiting longer each time, a minute at most; one ofdaily, its forming day every five minutes. Declinednot_covered,beyond_history(a past range oflive: OANDA keeps no history of its quotes) orsource_silent. - A restart cannot read back a gap in
live: OANDA keeps no quote history. The stream opens again from each pair's price now; a row is keyed by the pair and OANDA's own time, so one recorded before is unchanged. - Raw records: each answer a row was read from is kept first, in the
kind
prices, the SDK's raw store, a unit a UTC day; the stream's messages a row was read from as lines of the day's file per pair. - Not carried: OANDA's closeout bid and ask, counted on the heartbeat.
- Liveness (from 0.6.0, contract v27): OANDA's pricing stream sends a
price only on change, and a heartbeat every five seconds. The latest
price or heartbeat is the live dataset's sign of life, recorded once a
pass at OANDA's own time for OANDA's venue (RecordLiveness), so a quote
in force is confirmed though it has not changed. Neither dataset declares
a delay (
declared_delay_ns0): OANDA's prices are its own, in real time. A quote's age runs from its OANDAtime(itseventsource time), or from the liveness after it. - Latency (from 0.6.0): the
pricing-streamsession's sign of life, clock skew from the heartbeat's time, reconnects, 429s and round trip (the REST pricing calls', the stream having no ping), and each row's age at the edge, its feed delay; and theorderssession's round trips, order acknowledgements and fill delays. Shown on Connection's Sessions, and from 0.7.0 (contract v28, ruling 518) reported every 10 seconds (ReportLatency).
A new connection is read-only. An admin of the connectivity role
enables trading on it on Connection, "Enable trading" beside the account in
use (enable_trading, by its venue account code). Until then, every
placement on it is rejected unsupported. The connection is the
environment together with the account (chosen on Connections, or named by
account_id), so changing either makes a new connection, which is
read-only again. Switching away from a connection also turns trading off
on it, whether by choosing another account on Connections or by changing
the account_id or environment setting. Returning to it finds it
read-only, and a person enables trading on it again: trading never comes
back on by itself. Each time this happens it is recorded in the plugin's
storage, with the change that caused it, who made it and when. Connection
and read_connection say so for the connection in use.
Placement types (from 0.6.0, contract v27): direct market access alone,
on its catalogue while trading is enabled. OANDA is the counterparty to every
order, at the price it streams, so a request for quote, or any other type,
is rejected unsupported, nothing sent.
- An FX order is an order in the base currency's cash instrument, with
its limit or stop price in the quote currency. From contract v23 the order
names its quote currency (
quote_currency), so a market order names its pair too. The plugin finds the pair OANDA quotes in its pair map. It never turns a pair round: an order in USD priced in EUR is rejected, and the rejection names EUR_USD. - What is sent: OANDA's signed units of the base currency, the placement's ID as the order's client extension ID, and market (FOK, IOC), limit or stop orders (GTC, GTD, day as OANDA's GFD, FOK, IOC).
- Facts come from the account's transaction stream. Every poll also reads the transactions since the last one taken, and that cursor is kept in storage.
- A fill's value date is the pair's spot date from the date read (core's
ComputeDate). OANDA's fill states no value date. If the date read gives no answer, the fill waits and is asked about again on each poll. It is never sent with a guessed date. - The roll. At each 17:00 New York OANDA rolls every open trade to the next spot date. The plugin reports each trade's financing as a charge of kind financing on the placement whose fill opened it. It then reports a value-date roll for each pair, moving the pending lines from their value date to the date read's answer for the roll's moment, linked to those charges. A fill reported after OANDA rolled it (one that waited for its value date, or an accepted fill from OANDA's app) gets a catch-up roll.
- Commission on a fill is a fee of kind commission.
- Orders taken outside the platform, in OANDA's app or by OANDA itself
(a stop loss, a margin closeout), are never recorded as orders. Their
fills in a currency pair are reported on no placement, so the desk's
emsaccepts them or answers them DK. Their financing is kept unplaced until an accept, then charged again on the placement the accept made. OANDA takes no execution acknowledgement, and the catalogue says so. - An unanswered send is resolved by asking OANDA for the order by its client ID. It is never sent again.
- Cancel and replace are taken from the placement's change requests.
- Pause and stop are honoured. A stop cancels at OANDA at once.
Each open trade is shown as two cash legs: its units of the base currency, and the units times its price, negated, of the quote currency. Each leg is pending to the value date the position now rolls to. The account's currency also carries the balance, settled. This follows the rolling-spot ruling of 2026-10-13.
Activity is each transaction that moved cash, with these kinds:
- fills are purchases or sales;
- commissions are fees;
- a profit in a quote currency, converted to the account's currency, is a journal;
- each roll's financing is interest;
- funds moved in or out are contributions, withdrawals or transfers.
make e2e runs the plugin on the synthetic OANDA, on the plugin harness that
the Makefile pins beside its core. It chooses the account on Connections,
the synthetic token's one usable account preselected and confirmed and its
v1 account listed unusable, links it through the plugin's own Account links
form, holds the street to e2e/expected.street and
e2e/expected.activity, and then runs the order path with a desk stand-in
(e2e/desk.py, e2e/orders.py): a limit and a market order filled and
pending to their value date, an order from OANDA's app reported on no
placement, a roll, the desk's accept and its catch-up roll, a replace, a
cancel, a pause, a stop and a restart. On a controlled clock (decision
66): before the order path, the e2e sets the synthetic OANDA's clock to the
coming Tuesday at 12:00 New York, so its fills trade on a Tuesday and its
roll is that day's 17:00, whatever day the e2e runs; the clock runs on from
there and is only ever set forward. Trading is enabled on Connection, by
the account's venue account code. The Makefile pins core v27's runtime and
harness as published (core a5da59a, merged as 6d346b3, chart 0.1.310);
make e2e RUNTIME_IMAGE=... HARNESS_IMAGE=... tries another.
Safety: tests and make e2e use the synthetic OANDA only. Any run on a
real practice account is the product owner's, done by hand.
make ci-local runs lint, the tests, meridian plugin check, the image and
make e2e, all in containers. See AGENTS.md for the rest.