Skip to main content

How it works

Approved integrators can charge their own fee on top of Rialto’s on every swap they route. The fee is collected as part of the swap and paid to your wallet in the same onchain transaction. There is no separate claim step, no fee contract to deploy, and no settlement to run yourself.
  1. You request a quote with a swap_fee_bps value, your fee in basis points.
  2. Rialto adds your fee on top of its own and returns the full breakdown.
  3. The same quote includes one executable transaction that, on execution, pays both Rialto’s treasury and your wallet atomically.
  4. The taker signs or approves as needed, then submits the quote’s tx directly or signs Permit2 for gasless relay.
Your fee is additive. Rialto charges its standard fee, and your fee is taken on top. Rialto does not take any cut of your portion.

What is bound to your key

Bound to your keyMeaning
Payout walletThe address your fees are sent to.
Maximum fee in bpsA per-key cap, the largest swap_fee_bps you may set.
Integrator idAn identifier used to attribute the swaps you route.
Because these are bound to the key and not the request, a leaked or tampered request can never redirect your fees or raise your fee above your cap.

Setting your fee

Add swap_fee_bps to the standard quote request. Your payout wallet and cap come from your key, so you do not pass them on the request.
ParamDescription
swap_fee_bpsYour fee in basis points, applied on top of Rialto’s fee. 30 = 0.30%. swapFeeBps is also accepted.
INTEGRATOR_KEY='rialto_live_integrator.redacted_secret'

curl -sS 'https://rialto-trade-api.rialto.xyz/quote?sell_token=WETH&buy_token=USDC&sell_amount=0.01&taker=0x1111111111111111111111111111111111111111&slippage_bps=50&swap_fee_bps=30' \
  -H "Authorization: Bearer $INTEGRATOR_KEY"

Reading the fee in the response

A quote with an integrator fee gains two things: an integrator_fee block echoing your fee, payout wallet, and integrator id; and extra entries in platform_fee.fees, one line per recipient, each showing the token the fee is taken in and the exact amount. Rialto selects the most suitable fee token in the swap automatically, so you do not choose a fee token.
{
  "buy_amount": "19800022",
  "platform_fee": {
    "total_bps": 80,
    "fees": [
      {
        "side": "source",
        "token": "<sell_token_address>",
        "symbol": "WETH",
        "decimals": 18,
        "bps": "50",
        "amount": "50000000000000",
        "amount_decimal": "0.00005",
        "recipient": "<rialto_fee_recipient_address>"
      },
      {
        "side": "source",
        "token": "<sell_token_address>",
        "symbol": "WETH",
        "decimals": 18,
        "bps": "30",
        "amount": "30000000000000",
        "amount_decimal": "0.00003",
        "recipient": "<integrator_fee_recipient_address>"
      }
    ]
  },
  "integrator_fee": {
    "bps": 30,
    "recipient": "<integrator_fee_recipient_address>",
    "id": "your-integrator-id"
  }
}
In this example Rialto’s fee is 50 bps and your fee is 30 bps, for a combined total_bps of 80. The recipient on the second line is your payout wallet. The token and amount fields tell you exactly which token the fee is taken in and how much.

Caps and rules

RuleBehavior
Fee above your key’s capswap_fee_bps greater than your configured maximum is rejected with 400.
Combined fee too highRialto’s fee plus your fee must not exceed the protocol maximum, currently 100 bps total. Over the limit is rejected with 400.
Non-integrator keyA key without integrator access that sends swap_fee_bps is rejected with 403.
No fee requestedOmit swap_fee_bps or send 0 for a standard swap with no integrator fee.
Execute an integrator-fee quote exactly like any other quote. The fee recipient and cap are key-bound server-side, and the fee split is encoded into the transaction Rialto returns.