What are App Fees?

App fees are additional fees set by third-party developers on top of existing fees. These fees are specified when generating a quote. To improve the gas costs of fee setting, App fees are not paid out in real-time. Rather, App Fees accrue in base USDC, and can be claimed as desired at your convenience.

Setting App Fees

App Fees are measured in basis points (bps) based on the input value of an order. When setting an app fee, an EVM-based claim address must be provided, which will be used for withdrawing accumulated fees. A single quote can include multiple App fees. You can accrue fees by including AppFees in the Quote API:
"appFees": [
    {
      "recipient": "0x999999cf1046e68e36E1aA2E0E07105eDDD1f08E", //EVM Claim Address
      "fee": "100" //App Fee (in BPS of input token)
    }
  ]

Additional Considerations

  • On same-chain operations where the solver holds neither the input or output currency, an extra swap is added within the transaction to swap from the input currency into a currency accepted by the solver for App Fees
    • For this to occur, the fee to be taken needs to be greater than $0.025. This is to prevent the situation where the action of taking the app fee will consume more in gas than the fee itself.
  • App Fee Recipients must be an EVM compatible wallet address, even for non-EVM chains.
  • App fees can be an array, for setting multiple fees at once

Claiming App Fees

App fees accrue in USDC, and can be claimed on any chain. Fees are free to claim on Base, and Relay exchange fees apply to claim on any other chain or in any other currency. The easiest way to claim your App fees is to use the Relay App. The Relay App also works for claiming via a multisig. Here’s how you can claim via API:

Check App Fees Balance

To check your accrued App fees, use the App fee balances API. Here’s an example curl command:
curl --location 'https://api.relay.link/app-fees/0x03508bb71268bba25ecacc8f620e01866650532c/balances'
The response includes the balances.currency field reflecting your off-chain balance for each currency accumulated:
 {
      "currency": {
        "chainId": 8453,
        "address": "0x0000000000000000000000000000000000000000",
        "symbol": "USDC",
        "name": "USDC",
        "decimals": 6,
        "metadata": {
          "logoURI": "https://assets.relay.link/icons/1/light.png",
          "verified": false,
          "isNative": false
        }
      },
      "amount": "75021651210714015",
      "amountFormatted": "0.075021651210714015",
      "amountUsd": "116.235557",
      "minimumAmount": "75021651210714015"
    }

How to claim your off-chain balance?

To claim your app fees, use the app fees claim API. If using the API, the response will guide you through signing and submitting a message to the /execute/permit endpoint to verify ownership of your claim address. The SDK automates this process for you. API/SDK
curl --request POST \
  --url https://api.relay.link/app-fees/0x03508bb71268bba25ecacc8f620e01866650532c/claim \
  --header 'Content-Type: application/json' \
  --data '{
    "chainId": 8453,
    "currency": "0x0000000000000000000000000000000000000000",
    "recipient": "0x03508bb71268bba25ecacc8f620e01866650532c"
}'
An example response from the API would be:
{
    "steps": [
        {
            "id": "authorize",
            "action": "Sign authorization",
            "description": "Authorize claiming funds",
            "kind": "signature",
            "items": [
                {
                    "status": "incomplete",
                    "data": {
                        "sign": {
                            "signatureKind": "eip191",
                            "message": "0xa344c6123e3da9fc3f9c81edeab0b2eb39f2ea80ba54a6e0ad00123dc180619c"
                        },
                        "post": {
                            "endpoint": "/execute/permits",
                            "method": "POST",
                            "body": {
                                "kind": "claim",
                                "requestId": "0xa344c6123e3da9fc3f9c81edeab0b2eb39f2ea80ba54a6e0ad00123dc180619c"
                            }
                        }
                    }
                }
            ]
        }
    ]
}
You can then send a request to /execute/permit with the requestId and signature to claim your fees. An example request would be:
curl --request POST \
  --url `https://api.relay.link/execute/permits?signature=${signature}` \
  --header "Content-Type: application/json" \
  --data '{
    "kind": "request",
    "requestId": "0xa344c6123e3da9fc3f9c81edeab0b2eb39f2ea80ba54a6e0ad00123dc180619c"
  }'
Once done, you can check your balance again to verify the claim.