fill_rfq_order, fills that order from the maker’s inventory. The user signs, then DFlow sends the transaction to the maker’s /swap. The maker co-signs and submits.
Selected Quote
DFlow callsPOST /selected before it hands the transaction to the user.
quoteId is one of its live quotes and records a ticket: the orderAddress that the fill must name. To refuse, the maker returns 409 (or 422) with { "reason": "<text>" }. Any 2xx accepts.
- Idempotent: the same
quoteIdandorderAddresscan arrive more than once. - Budget: 0.9 seconds including retries. DFlow retries once after 250 ms on a transport error, a timeout,
429or5xx, with the same body. - Failure: any answer other than a 2xx fails the selection, so the user never receives a transaction the maker will not sign.
Read the Fill Instruction
The fill is the orchestrator’sfill_rfq_order instruction. A maker can decide whether to co-sign from this instruction alone. Its data states the price and the most the maker receives, and the program reverts the fill unless the order carries the same terms. The instruction that opens the order cannot change them.
Fill Instruction Data
The data is 24 bytes:What the Fill Data Guarantees
- Price:
quoted_out ÷ quoted_in. Platform fees never enter it. - Ceiling: the maker receives at most
quoted_inof the input mint and pays at mostquoted_outof the output mint. - Payment: the maker pays
received × quoted_out ÷ quoted_in, rounded down, wherereceivedis what its receiving account gained. A smaller fill pays the same price. A fill that receives nothing reverts. - Terms: the program reverts the fill unless the order’s
quoted_inandquoted_outequal these two values. - What the opening instruction controls: how much input the user escrowed, which sets how much arrives, up to the ceiling. It cannot change the price or the ceiling.
- Destination: where the payment goes does not change what the maker pays or receives.
Fill Instruction Accounts
The instruction has 18 fixed accounts. The program pins each one to the order or to a known program id, except the maker’s own token accounts, 12 and 13.
When the order has a platform fee, the next three accounts are the fee recipient, which must be the order’s fee account, DFlow’s fee token account, and DFlow’s fee authority. Any Token-2022 transfer hook accounts follow.
DFlow keeps accounts 0, 1, 3, 4, 12 and 13 as static keys in the transaction. The others may come from address lookup tables, so the maker resolves lookups before reading them.
Example: Reading a Fill
This instruction data is 24 bytes, shown by field:quoted_in is 201,000,000 and quoted_out is 1,005,000,000, so the price is 5. The maker pays for the input its account receives:
Last Look
DFlow callsPOST /swap with the user-signed transaction.
fill_rfq_order instruction, described in Read the Fill Instruction. Before co-signing, the maker checks that:
- Exactly one instruction names the maker’s wallet, and it is a
fill_rfq_order. - The fill names the ticket’s
orderAddress. A fill for an unknown order is rejected. - The ticket has not been co-signed already. An exact repeat of the same transaction bytes returns the same
txSignature. Different bytes for a used ticket are rejected. quoted_inis the quote request’smaxAmountIn, or itsamountwhen the request has none, andquoted_outisquoted_in × amountOut ÷ amountIn, rounded down.- The fill’s mint accounts are the quote’s
tokenInandtokenOut, and its token accounts are the quote’smakerInputTokenAccountandmakerOutputTokenAccount. - The quote has not expired.
- If the maker pays fees, the compute budget and priority fee instructions are within the maker’s limits.
/swap.
accepted requires txSignature. DFlow checks that it belongs to the transaction and does not confirm it. rejectionReason is logged and never shown to the integrator. rejectionCode is the only rejection detail the integrator sees: