Skip to main contentThe new DFlow Trading API exposes two types of transactions that users are able
to send: async trade transactions and sync trade transactions. These transactions
provide additional expressiveness in the types of liquidity traders are able to interact with.
Specifically, traders using the DFlow Trading API are now able to interact with offchain liquidity
through Concurrent Liquidity Program instances.
Sync Trade Transactions
Transactions that execute the full trade atomically in a single transaction are known as sync trade
transactions. In these transactions, the user is signing a route plan which may adjust just-in-time
(JIT) through DFlow JIT routing onchain.
Sync trade transactions are fully backwards compatible with a UX that network users are familiar with today.
Async Trade Transactions
Transactions that execute in two or more transactions are known as async trade transactions. In the first
of these transactions, the user is signing an instruction to escrow funds into a permissionless and
frozen escrow contract. This first transaction may also optionally contain a route plan that converts
their input token into a different mint at the fair market rate prior to escrow.
All subsequent transactions either contain zero or more fills. If there are zero fills, the order is
canceled, the trade is reverted, with the funds returning to the user entirely. If the first transaction
contains a route plan to convert an input mint into an escrow mint, the tokens which are escrowed are
returned as-is. For the avoidance of doubt, in this case, the tokens are not returned in the same mint
as originally held by the user.
