source and deliverTo on a quote request or a requote.
Every value you send is a financialAccountId, and you never invent one: each quote set lists the ids you may name in sourceOptions.
The examples on this page come from one script, samples/http/wallets.sh. It only asks for quotes and requotes: nothing is ordered.
The API may change until launch. Every change is listed in the Changelog.
What a quote trades from
Each quote carries one source block, decided by its venue:
A quote that cannot execute from any source you may use carries
sourceRefusal instead of a usable source: its code says why, venueId names the venue and fix names the next step.
Read these fields on every quote. Two quotes from the same venue can trade from different sources, so never infer the source from the venue’s name.
Output shape with a granted wallet (ids shortened)
Quote with your defaults
Leavesource out and every venue prices with your defaults. TetraFi fills each part in this order:
- what the request names in
source; - each venue account’s default organisation wallet, for on-chain venues that trade through that account;
- your own defaults: an API key’s own defaults, or a signed-in member’s;
- the workspace’s defaults.
walletSelection says, per chain, why each wallet was chosen. Its reason is accountDefault, preference or explicit. It is a record of the choice and grants nothing.
Read sourceOptions
Every quote set, and every quote in it, lists insourceOptions what you may name. Each entry has a kind and its candidates:
Each candidate carries its
financialAccountId, kind, displayName and isDefault. A wallet also carries its address and network. When present, balance is the sold asset held there ("kind": "known") or "kind": "unavailable". A balance that could not be read is never shown as 0, and null means it was not observed.
An empty list means there is nothing else to choose. The script reads the trading wallets for each USDC chain, preferring the candidate marked isDefault:
Output shape with a granted wallet (ids shortened)
Output on test networks, no wallet granted (shortened)
unavailable with the reason apiKeyOrganisationWalletScopeRequired or onchainWalletNotUsable: the second means the venue account’s saved wallet is not visible to the key. See Give a key organisation wallets.
Choose with source
source has three parts. Each is optional, and a part you leave out takes your default.
Chains belong to one of three families, and each value must be a wallet that can trade on its chain:
The script names the wallets it read. With two chains it moves USDC between them; with one, it swaps USDC for ETH on that chain:
Request sent (shortened)
preferredWallets is a softer choice. It is keyed the same way, but it is only a preference. A venue account uses that wallet only when it is one of the account’s linked wallets on the venue’s network; otherwise it quotes from its own default. A preference never makes a venue refuse. source.tradingWallets is the explicit choice and wins on its chain.
An API key uses your company’s self-managed and custodian wallets, and the organisation wallets created in TetraFi that an owner has granted to that key. It cannot use or link a personal wallet: only a signed-in member can link one. In the app, a member can choose a personal wallet for a single request on the trade page while Advanced filters is open. Despite its name, Advanced filters only opens more search filters: it is not Advanced execution.
When TetraFi refuses a source
A wallet or account you may not use at all is refused before any venue is asked, so nothing is quoted or reserved. Trading wallets insource.tradingWallets are different: one a venue account has not linked is not refused. That venue reads unavailable with the reason tradingSourceNotLinked, and the others still quote. The script prints either case:
Output shape of a refusal (shortened)
Your workspace has one account at each venue, so a venue quote’s
venueAccount option lists that account only.
Where the output goes
deliverTo is a top-level field of the request, tagged by kind:
The shape also has a
payee kind, but no trade can deliver to a payee yet: deliver to an address or one of your own accounts.
destinationTag is the tag or memo an address needs, such as an XRP destination tag, a Stellar memo or an exchange deposit memo. Leaving it out means no tag: TetraFi never fills one in for you.
On a venue quote, delivering to a wallet asks TetraFi to withdraw the output from your venue account once the order fills. The wallet must be one of your workspace’s wallets, approved as a withdrawal destination of that venue account for the asset you buy, with exactly the tag it was approved with. The quote then carries a network fee line for the venue’s withdrawal fee (the most the order will pay) and a buy.amount net of it.
Delivering a venue quote to a wallet needs a signed-in member who can view the workspace’s wallets. With an API key, a venue quote’s output stays on the venue account: a requote that names another destination is refused with the reason deliverToNotPermitted.
When a venue cannot deliver where you asked, a new quote request lists that venue in sources as unavailable with the reason. A requote is refused with 409 REQUOTE_REFUSED and the reason in details.reason:
The script requotes an off-chain quote with
deliverTo naming the trading wallet it read, and records the outcome. When no off-chain quote came back, it skips the requote. It never guesses a destination.
Output when no off-chain quote came back
Requote with a different source
To change the source of a quote you hold, requote it. SendPOST /api/v1/quotes with requote set to the quote id, plus source or deliverTo with the parts you change. Only that quote’s venue is asked again, for the same pair, amount and side. You get back one new quote whose requoteOf names the original. The original stays orderable until its own expiresAt. Requotes and expiry covers requotes in full.
Request
quote_request helper waits for Retry-After once when it gets 429 QUOTE_RATE_LIMITED.
When a quote needs a wallet
Some venues can only quote once they know which wallet trades. You can see this in three places. A quote’s next step is a requote.next reads {"kind": "requote", "needs": [...]}. Each entry in needs is a slot to fill: wallet:evm, wallet:solana, wallet:tron, account, bankAccount or deliverTo. Requote the quote with source or deliverTo filling those slots, choosing from sourceOptions. An empty needs means requote it as it is.
A venue reads needsWallet in sources. It has no wallet of that family (evm, solana or tron) to ask with. Send the request again with source.tradingWallets naming a wallet on the chain you sell from, or set a default for that family.
A venue reads walletRefused in sources. The wallet in wallet cannot trade there, for example because it was revoked or screening confirmed a sanctions match. reason says why when TetraFi can. Sometimes the refused wallet is an organisation wallet you chose that is not linked to the venue account. Then recovery carries the wallet, a linkHref where it can be linked, and defaultWallets: the account’s default wallet for each chain, which you can send as source.tradingWallets for this request instead.
With an API key, on-chain venues may also read unavailable with the reason apiKeyOrganisationWalletScopeRequired or onchainWalletNotUsable. The key has no organisation wallet granted to it yet: grant one from the key’s Wallets tab (see below).
Give a key organisation wallets
An API key trades through organisation wallets only when they are granted to it. The key must already be able to trade on venue accounts (Trading on your venue accounts). Create API key with venue trading already grants your workspace’s default organisation wallets that you hold a Trade right on. To change the grant later, open Personal API keys (Settings, then Open API keys under Your account), expand the key and choose its Wallets tab:- Grant adds a wallet. The tab offers only the organisation wallets you hold a Trade right on.
- Revoke removes one.
- The key’s owner, with permission to request quotes and place orders, can add the workspace’s default organisation wallets they hold a Trade right on, and can revoke any grant. Any other wallet is refused with
API_KEY_ORGANISATION_WALLET_NOT_A_DEFAULT, and one without your Trade right withAPI_KEY_ORGANISATION_WALLET_TRADE_RIGHT_REQUIRED. - A workspace owner, or an admin who manages credentials, can grant any active organisation wallet of the workspace through the API below; the tab still offers only the wallets they hold a Trade right on, since the key trades only through wallets its owner can trade.
MFA_REQUIRED), and the tab shows each refusal with its reason. Behind it, PUT /api/v1/workspaces/{workspaceId}/api-keys/{keyId}/organisation-wallets takes the key’s complete list: a new list replaces the previous one, and an empty list revokes them all. The key itself cannot make or change its grant.
Once granted, the wallets appear in the key’s sourceOptions, and their ids are what the key sends in source.tradingWallets. At trade time the key also needs venue trading switched on and a valid request signature, and you, the key’s owner, still need trading rights on the wallet.
Connect a venue account
Exchange and OTC venue accounts are connected in the app by someone who can manage your workspace’s venues:- Open Counterparties and choose the venue’s liquidity provider.
- Select Set up <provider> account.
- Work through Integration mode, Account and Venues, entering the credentials the venue asks for.
- In Verification, TetraFi checks each venue you added. Select Check again to repeat a check, then Review setup.
tradingSource.kind reading venueAccount.
In the app, the Pay from, Account and Deliver choices on a quote card each send one of these requotes.
Next steps
Requotes and expiry
Change a quote’s corridor or price protection, or refresh one that expired.
Authentication
Venue trading, request signing and rate limits for your key.