rfq-fill route, for tokenized stocks against USDC on Solana. See RFQ orders for how that route works.
This recipe builds on the swap recipe and the RFQ orders recipe. It uses the same headers, account, stock, and signing code.
How it works
- Fee. Send
integratorFeeBpsandintegratorFeeRecipientAddresswithPOST /v1/quotes. The quote comes back with the fee built into its transaction. When the order fills, the fee goes to the recipient wallet. - Memo. Sunrise sets a memo on your API key. Every
rfq-filltransaction quoted with your key includes it as a Solana Memo instruction. You don’t send the memo yourself.
Step 1: Get your key set up for fees
Contact contact@sunrise.xyz to enable fees on your API key. For each wallet you want to receive fees, send:- The Solana wallet address.
- The highest fee rate you want to charge to it, in basis points. 100 basis points is 1%.
rfq-fill route. Changes to your key can take up to five minutes to apply.
You don’t need any setup to trade without a fee.
Step 2: Get a quote with a fee
Add the two fee fields to the quote request from RFQ orders:
Send both fields for a fee. To trade without a fee, leave both out or send
integratorFeeBps: 0.
A request with a fee above 0 gets quotes only from rfq-fill. Other routes can’t charge the fee, so they’re skipped and listed in unavailableRoutes with the code integrator_fee_not_supported. If rfq-fill gives no quote, unavailableRoutes says why.
The fee wallet needs no setup. Its token accounts are created on its first trade with a fee, with a small one-time SOL rent cost to your user.
Step 3: Check the fee on the quote
Each quote with a fee includesintegratorFee:
fromAmount, so toAmount is what your user gets after the fee. Show your user the fee before they sign.
The fee applies only to the part of the order that fills. Anything refunded carries no fee.
Step 4: Sign and execute
Sign and execute the quote as in RFQ orders. Nothing changes for a quote with a fee. Sign theunsignedTransaction exactly as returned. It carries the fee and your memo. If the transaction is changed, for example to remove or edit the memo, execute refuses it.
Attribution with a memo
Your memo is a short code, for examplesun-Ab12, that Sunrise sets on your API key. It’s included in every rfq-fill transaction quoted with your key, whether or not you charge a fee. Anyone can read it onchain to see which trades came through you.
- One memo per key. By default, every trade from your key carries the same memo.
- One memo per wallet. Sunrise can also set a separate memo for each approved fee wallet. A quote that names that wallet in
integratorFeeRecipientAddressuses its memo instead. - Attribution without a fee. To pick a wallet’s memo without charging a fee, send
integratorFeeBps: 0and that wallet inintegratorFeeRecipientAddress. If the wallet has no memo of its own, the key’s memo is used.
rfq-fill don’t include the memo.
To get a memo set on your key, or one per wallet, contact contact@sunrise.xyz.
Fee errors
See Errors for every other code.

