rfqFill quote settles sync, in one transaction on the RFQ order program. The first instruction opens an order that escrows the user’s input, directly or through a swap. The second, fill_rfq_order_in_transaction, fills that order from the maker’s inventory. When a swap opens the order, the second instruction is fill_rfq_order. The user signs, then DFlow sends the transaction to the maker’s /submit-transaction. The maker co-signs and submits, and answers within 8 seconds.
Selected Quote
DFlow callsPOST /selected when it hands the transaction to the user. The call is a notification: DFlow does not wait for the answer, and the maker cannot refuse the selection. The maker declines at last look.
quoteId is one of its live quotes and stores the orderAddress against that quote. The fill must name that order.
- Idempotent: the same
quoteIdandorderAddresscan arrive more than once. - Delivery: DFlow retries once after 250 ms on a transport error, a timeout,
429or5xx, with the same body, within 0.9 seconds. It logs any answer and the selection stands. - Unknown order: a maker that has not stored the fill’s order address rejects the fill at last look.
Read the Fill Instruction
The fill is the RFQ order program’sfill_rfq_order_in_transaction 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’s terms are met or improved on. The maker co-signs only values it approves, and 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
quoted_inis above zero and at most the order’squoted_in, andquoted_outis at least the order’squoted_out, see Price Improvement. DFlow builds this instruction with the order’s own values, and the maker signs only values it approves of swapping, as in check 5 below. - 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 19 fixed accounts. Accounts 0 to 15 are those of the asyncfill_rfq_order. These differ:
The program reverts the fill with
RfqOrderMakerWritable if the maker’s wallet is writable in the transaction, and with RfqOrderMissingOpen unless the previous instruction is the order’s open_rfq_order. The fee and hook accounts follow account 18, in the same order as in fill_rfq_order.
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 /submit-transaction with the user-signed transaction.
fill_rfq_order_in_transaction 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_in_transaction. - The maker’s wallet is read-only in the transaction: it is not the fee payer and no instruction marks it writable.
- The fill names the
orderAddressthe maker stored from/selected. A fill for an unknown order is rejected. - The quote has not been co-signed already. An exact repeat of the same transaction bytes returns the same
txSignature. Different bytes for a quote already used 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.
/submit-transaction.
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: