Skip to main content
The TetraFi API lets your backend do what your team does in the TetraFi app: get quotes, place orders and follow them to the end.
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.
You get back comparable quotes, best first, each one net of its fees. Every venue that was considered is listed with its outcome, so when a venue did not quote, the response says why. The lifecycle has four calls: 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 in legs[].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.
In the app, the same quotes appear on the trade page, and each quote’s details show whether it is Basic or Advanced. The trade page’s Advanced filters button only opens more search filters: it does not choose Advanced execution.

Base URL

Production is https://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.