The API may change until launch. Every change is listed in the Changelog.
What the API does
You send one quote request: the asset you pay, the asset you receive, an amount and whether that amount is what you pay or what you receive. TetraFi asks every venue your workspace can use, at the same time:- on-chain protocols and DEXs;
- bridges;
- solvers;
- the exchange and OTC venue accounts your workspace has connected.
Each quote also says what you do next in its
next field: order (order it now), fund (the paying account is short) or requote (ask the venue again). preflight, sign and transact appear only on Advanced quotes.
Basic and Advanced execution
Every venue offers one or both ways to execute. A quote tells you which inlegs[].venue.integrationMode.
Basic
TetraFi executes the trade for you, from one of your workspace’s exchange or OTC venue accounts or from an organisation wallet granted to your API key, and only inside the limited grant that wallet’s owners approved. You place the order with the key and TetraFi does the rest. The order answers
"kind": "basicTrade".Advanced
Your own wallet signs and settles on-chain through TetraFi’s settlement contracts. Not open yet: it will be documented here when it opens.
Advanced execution is not open yet. Advanced venues are listed in
sources as unavailable with the reason advancedModeDisabled and are not asked, and an order on an Advanced quote answers 403 ADVANCED_MODE_DISABLED. Every sample on this site uses Basic quotes.Base URL
Production ishttps://api.tetrafi.io. Every sample on this site reads the base URL from the TETRAFI_BASE_URL environment variable, so the same sample runs against any TetraFi environment you have access to.
Next steps
Authentication
Create an API key, choose its permissions and send it with every request.
Quickstart
List assets, get quotes and place an order from your terminal.