Reading the Charts
- Offchain: the grey group. The user’s app, DFlow, the maker’s HTTP endpoints and the maker’s own systems.
- Onchain: the blue group. Solana and the orchestrator program, which holds the order and its escrow.
- Crossing the line: an arrow from the offchain group to Solana is a transaction or an account read, and an arrow back is something the offchain side observes. DFlow never sends a transaction for the maker.
- Arrows: solid arrows are requests or transactions, dashed arrows are replies or observed results, and open-headed arrows are notifications that nobody waits on.
Direct Fill: Buying an Equity
The maker quotesrfqFill, so it holds the equity. The user’s transaction opens an order and fills it in the same transaction, and the maker co-signs the fill.
- Quote: the maker answers
/quote. The quote names the maker’s own input and output token accounts. - Selection: DFlow builds the transaction after it picks the quote. The order address exists only from this point, so
/selectedcarries it. DFlow does not wait for the answer. - User signature: the user signs before the maker sees the transaction.
- Last look: the maker checks the transaction against the quote ID and order address it stored from the notice. Nothing is onchain yet, so a rejection costs nobody anything.
- Settlement: the maker co-signs and submits. The order opens, fills and closes in one atomic transaction. The user never holds an open order.
Direct Fill: Selling an Equity
A sell is always a direct fill. The maker pays USDC from its inventory, so it needs the settlement mint on hand. The flow matches a buy with the token directions reversed.Escrow Fill: Buying an Equity
The maker quotesrfqOrder because it does not hold the equity. The user’s transaction only opens the order and escrows the USDC. The maker acquires the equity offchain, then fills the order in a transaction of its own.
- Quote: the quote carries no token accounts, because the maker picks them when it fills.
- Selection:
/selectedarrives before the user signs. The order account may never exist if the user declines or the transaction fails, so the maker waits for it and does not refuse the notification. - Transaction 1: the user’s app submits it to Solana itself. DFlow does not forward it, and the maker does not co-sign it. Its orchestrator instruction only opens the order and escrows the USDC.
- Acquisition: the maker starts once it sees the order account. The purchase is offchain, but the equity must then arrive as tokens in the maker’s output token account, which is an onchain step. The next section describes both.
- Transaction 2: the maker fills the order with its own transaction. DFlow does not call
/submit-transactionfor anrfqOrderquote. - Outcome: the order ends in a fill, a cancel or an expiry. The app watches transactions that mention the order for its final
RfqOrderEvent. Detecting Escrow Fill Outcomes describes how.
Acquiring the Equity Offchain
DFlow sees none of the acquisition. The maker buys the equity through whatever source it uses, in its own systems and on its own terms. Everything the maker needs to size and time the purchase is onchain in the order account and its escrow. The acquisition has an onchain half. A purchase offchain gives the maker no way to pay the user until the equity exists as tokens in the token account the fill pays from. Your source or your own systems must mint or transfer those tokens to that account with a Solana transaction, and the maker confirms the balance before it fills.- Amount: the maker pays
received × quoted_out ÷ quoted_in, rounded down, wherereceivedis the USDC that reaches its account after any platform fee or Token-2022 transfer fee. The escrow can be smaller than the quote’s ceiling, so the maker sizes the purchase from the escrow it reads. - Price risk: the price is fixed by the quote and the maker alone bears any move in the market while it acquires the equity.
- Deadline: the fill must land by
last_fillable_slot. The maker also needs the equity in the token account it pays from before it submits, because the transaction reverts if that account cannot cover the payment. - Failure: a maker that cannot acquire the equity closes the order by
last_fillable_slotinstead of leaving it to expire. The close returns the user’s USDC at once.
Order Lifecycle
An order has one onchain account. Each transition emits anRfqOrderEvent. A fill, cancel or expiry also closes the account.
The user cannot close the order.
last_fillable_slot is the earlier of the slot of the quote’s expiry and the open slot plus up to 150 slots. Fill Deadline describes how it is set.