Skip to main content
You place an order by naming a quote you hold. TetraFi kept the quote’s terms when it returned them, so the order body is the quote id plus anything only you can supply, such as the least you accept to receive.
The API may change until launch. Every change is listed in the Changelog.

Basic and Advanced orders

Every quote names how it executes in legs[].venue.integrationMode:
Advanced execution is not open yet: an order on an Advanced quote answers 403 ADVANCED_MODE_DISABLED, and Advanced venues are listed in sources as unavailable with the reason advancedModeDisabled. This page describes Basic orders, the ones you can place today.
The quote’s next tells you the next call: order means place the order now; preflight, sign and transact appear only on Advanced quotes; fund means the paying account is short; requote means ask the venue again (Requotes and expiry).

Place an order

POST /api/v1/orders Leave out signature and priceProtectionBps: they are for Advanced quotes, and a Basic quote refuses them. An API key must send an Idempotency-Key header with every order. A retry with the same key and body returns the first answer instead of placing a second order (Idempotency).
A Basic quote answers "kind": "basicTrade" with the venue trade it created:
Response (shortened)
Every order answer carries status, terminal and statusUrl, and GET /api/v1/orders/{id} at statusUrl answers the same envelope. Each quote can be ordered once. Follow the order with Order status. The answer comes as soon as the order is recorded, not when it completes. A Basic order on an on-chain venue answers working before its wallet signs. If the wallet then refuses to sign, nothing is sent and the order ends unfilled, with the cause in operation.dispatch.notSentCause, rather than as a refusal of the request. Follow every order to terminal, by polling statusUrl or with webhooks. A 2xx answer only means the order exists.

Basic orders

A Basic order is executed for you, on your venue account with that account’s balance, or from an organisation wallet granted to your key, only inside the limited grant that wallet’s owners approved. You need an API key with venue trading and request signing (Trading on your venue accounts), and the account or wallet must hold what you sell. If a venue account holds less, the order is refused with 409 FUNDING_SHORTFALL and next.kind: "fund": fund the account, then get a new price. A signature is refused with 400 SIGNATURE_NOT_ACCEPTED.

Venue quotes that execute within your limit

Some venues execute within your limit: you name the least you accept, and the venue is asked for its price when you order. They are:
  • desks whose firm prices last only a few seconds, too short to confirm;
  • on-chain venues, such as bridges, that TetraFi trades for you from an organisation wallet, inside the limited grant its owners approved.
Their quotes are often indicative with next.kind: "order". On such a venue, a quote that is not firm reads minReceiveRequired: true and must be ordered with minReceive: the order trades only if the venue delivers at least that. Without minReceive, it is refused with 400 MIN_RECEIVE_REQUIRED, with details.field minReceive, and nothing is sent. Read the flag rather than working it out from firm and expiresAt. You can also send minReceive on any other Basic quote to set your own floor, and the order then trades only at or above it. If the venue’s held firm price already delivers less, the order is refused with 409 VENUE_QUOTE_OUTSIDE_BOUNDS and nothing is sent.

Price protection and minimum receive

Which field applies where:

Cancel an order

POST /api/v1/orders/{id}/cancel cancels an order that has not been sent to a venue yet, or a pay-in still waiting for your funds. It answers the order envelope with status cancelled and terminal true, and cancelling it again changes nothing. Send an Idempotency-Key, as when you place it; the key needs Submit orders. Once the order has been sent to a venue, its funding or delivery has moved, or it has ended, the cancel is refused with 409 ORDER_NOT_CANCELLABLE and the order’s status in details.status. TetraFi never cancels at the venue and never refunds: a Basic venue trade is sent as soon as it is placed, so in practice you can cancel one only while it waits for a pay-in.
Output on test networks

Refusals

A refused order answers the standard error body: error, message, and next or details where present. Unless the table says otherwise, nothing was sent.

In the app

On the Trade page, choosing a quote and confirming it in Review places this same order.