Browse documentation

Agents & API

Integrator fees

Adding a fee

You can add a fee of your own on top of oxley’s. Send integratorFee in the body of POST /v1/swap/build, POST /v1/bridge/quote or POST /v1/bridge/build. On GET /v1/swap/price, send it as the query parameters integratorFeeRecipient and integratorFeeBps.

The fee always goes straight to recipient. oxley never holds it. A fee that is not valid is refused with 400 and the code INVALID_INTEGRATOR_FEE.

  • recipient The address that receives the fee.
  • bps The fee in basis points: a whole number from 1 up to your tier’s integrator fee cap, which is 2% (200 basis points) on every tier.
A swap build with a 0.25% fee (replace the addresses)
{
  "sellToken": "0xb47c4c8f73f009cc0c0d3f92b388d13e293f0b65",
  "buyToken": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
  "sellAmount": "10000000",
  "taker": "0x1111111111111111111111111111111111111111",
  "integratorFee": {
    "recipient": "0x2222222222222222222222222222222222222222",
    "bps": 25
  }
}

How the fee is taken

How the fee is taken depends on the route that carries the transaction.

RouteHow the fee is taken
Swap through 0x0x takes it inside the swap, as part of its multi-fee: your fee goes in its swapFeeRecipient and swapFeeBps lists. oxley’s own fee, when a schedule is set, comes first.
Swap through NestA separate transfer step, sent first.
Bridge legA separate transfer step, sent first. This is the same on every bridge leg: Enso, Relay, oxley’s own Uniswap v4 leg and Orbit.

The transfer step

On a Nest pool route and on every bridge leg, the fee is a separate step: an ERC-20 transfer of its share of the input token, or a native send when the input is the native coin, from the sender straight to recipient. It is sent first, before the main transaction, and costs one more transaction’s gas.

The route is quoted and built on what is left after the fee. The transfer is the first of the build’s steps: send the steps in the order they are returned. The recipient is paid when the transfer lands, so there is nothing to claim afterwards.

What an answer shows

Quoted amounts are after every fee. The answer lists each fee: oxley’s, yours as the integrator, and third parties’ where they are known.

Your fee comes back in the answer under a name that depends on the call:

  • partnerFee On swap answers: { recipient, bps, amount, token, method }. method is 0x when 0x takes the fee inside the swap, and transfer when it is a separate step.
  • integratorFee On bridge quote and build answers: { recipient, bps, amount, token, chainId }.

oxley’s own fees

oxley’s own swap fee is currently none. It may be set later. When it is, it is taken inside the swap on every route: by 0x on a 0x route, and on a Nest pool route in the swap’s own transaction, so a swap that fails pays nothing. It never adds a step.

On Enso bridge legs, oxley’s own fee follows the schedule on the Bridge page, which starts at 0.25%. Your fee is on top of it.