RFQ Subscribe and Redeem
During the RFQ session, buy vault shares with USDC or sell vault shares for USDC at a maker quote. The session comes from trading status. When channel is batch, use Vault Lifecycle instead.
A buy escrows USDC and later delivers vault shares. A sell escrows vault shares and later delivers USDC. The quote is filled by calling buy or sell on TigrisRFQ before it expires. Settlement is a later claim. A successful buy or sell does not transfer the quoted proceeds in that transaction.
Mainnet base URL: https://mainnet-gw.sodex.dev/api/v1/wealth
Field definitions and rejection codes are on Trading.
1. Confirm the session
curl -sS "https://mainnet-gw.sodex.dev/api/v1/wealth/funds/CXMT/trading-status" \
-H "Accept: application/json"Submit only when data.channel is rfq and data.rfq.quotable is true. data.rfq.address is the TigrisRFQ contract for this call. minBuyAmount and minSellAmount are the raw-unit minimums. expectedDeliveryAt is the expected delivery time for orders submitted in this session.
data.vault is the vault. The USDC for a buy must already be on ValueChain. If it is still on another network, move it with Mirror Protocol first. The owner wallet pays SOSO gas.
2. Request a quote
side is buy or sell. owner is the wallet that will call buy or sell. payAmount is a positive base-10 integer in raw chain units: USDC for a buy, vault shares for a sell.
curl -sS "https://mainnet-gw.sodex.dev/api/v1/wealth/funds/CXMT/rfq/quote" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"side":"buy","owner":"0x1111111111111111111111111111111111111111","payAmount":"1000000"}'code -1 is a gateway error. code 0 with data.quotable false is a desk rejection. Read data.reason.code and request another quote. detail is the maker's original phrase.
A quotable response includes vault, payAmount, receiveAmount, nonce, deadline, signature, and orderHash. Submit those values unchanged. deadline is a Unix timestamp in seconds. expiresInMs is the remaining lifetime in milliseconds. expiresInMs 0 means the quote just expired.
The signature binds this nonce. Submit it before requesting another quote for the same owner. The contract consumes that nonce inside buy or sell. Nonce 0 is the wallet's first quote.
3. Submit the order
Approve the token the order escrows, then call TigrisRFQ from the owner wallet. msg.sender must be owner. A buy approves the vault underlying (getAsset()) for payAmount. A sell approves the vault share token for payAmount. The spender is data.rfq.address.
The five-argument calls attach no builder fee. The six-argument form adds builderFeeData. Encoding is in Builder Integration.
Install viem and tsx. Set PRIVATE_KEY, FUND_ID, SIDE (buy or sell), and PAY_AMOUNT. Save as rfq-order.mts and run npx tsx rfq-order.mts.
Save txHash and orderId. BuySubmitted or SellSubmitted on the receipt carries the same orderId. The indexed topics are vault, owner, and orderId.
After the receipt, the escrow is on TigrisRFQ and the order is PENDING. The owner cannot cancel it. deadline expires the quote. It does not expire an order that was already accepted.
buyOnBehalf and sellOnBehalf pull the escrow with an ERC-2612 permit and require RELAYER_ROLE on msg.sender. The permit spender is TigrisRFQ. A permit that fails is ignored when the allowance is already in place. The owner wallet calls buy or sell directly.
4. Claim the result
The operator records one fill. A full fill pays receiveAmount. A partial fill pays receiveAmount * filledPayAmount / payAmount. A rejection leaves the fill at zero. The settler then marks a filled order SETTLED. A rejected order can be claimed while it is still REJECTED.
PENDING, PARTIALLY_FILLED, FILLED
Wait.
SETTLED or REJECTED, and claimed is false
claimBuy(vault, orderId) or claimSell(vault, orderId).
delayedStatus is SETTLED and delayedClaimed is false
claimDelayedBuy(vault, orderId) or claimDelayedSell(vault, orderId).
The immediate claim pays the filled amount minus any delayed portion, and refunds the unfilled escrow. Tokens are sent to the order owner. A delayed portion stays on the order until claimDelayedBuy or claimDelayedSell. A sell claim deducts a builder fee when one was stored. A buy claim does not. See Builder Integration.
Read the order with getBuyOrder(vault, orderId) or getSellOrder(vault, orderId).
The same order appears in User Fund History with channel rfq. Match txHash to the submit transaction. claimable on that entry is the immediate leg. delayedPending means the delayed leg is still outstanding. Those flags are independent. An omitted flag means that aspect is unknown.
Last updated