Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 25 additions & 23 deletions references/api/api_core_concepts/fees.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -113,33 +113,19 @@ If you are interested in learning how app fees work, and how you can add them to

_Please note that the above fee structure applies to standard cases. In certain cases, such as route-specific campaigns or promotions, different fees may apply._

## Fees Object
## Fees in the API

The Fees object is returned from the quote API and the requests API. These fees are only the Relay related fee, and are segmented as the following fees:
Both the quote API and the requests API return a request's fees in the `expandedPriceImpact` object, which breaks them down into the following components:

**relayerService**: The service fee paid to the relayer to facilitate execution.

**relayerGas**: The gas fee given to the solver to pay gas fees on the destination chain.

**relayer**: The sum of the relayerService and the relayerGas.

**app**: Third party fees added on top of the existing fees, this fee is added by app developers and accrues offchain to minimize gas costs.
**execution** - Execution fees covering network gas on the origin and/or destination chain plus the flat fee.

**subsidized**: The Fees in the order that are subsidized by the integrator.

## Price Impact

If you are interested in understanding or showing your user the fees of the order more broadly, it's best to look at the `expandedPriceImpact` object which reports:

**execution** - the price impact that results from execution fees (gas and flat fee). This covers the cost of executing the transaction on the origin and destination chains.
**swap** - Swap costs from cross-currency and cross-chain exchange, including DEX fees, swap slippage, and solver rebalancing.

**swap** - the price impact that results from cross-currency and cross-chain token exchange. This includes DEX fees, swap slippage, and solver rebalancing costs.
**relay** - The Relay fee, the flat basis-point fee charged by Relay for routing and meta-aggregation services.

**relay** - the price impact that results from the Relay API fee. This is the flat bps fee charged by Relay for routing and meta-aggregation services.
**app** - App fees added on top by the integrator, when present.

**app** - the price impact that results from the app fees (if applicable).

**sponsored** - the price impact that is covered by the integrator via [Fee Sponsorship](/features/fee-sponsorship). This reflects the portion of fees subsidized on behalf of the user.
**sponsored** - The portion of fees the integrator subsidizes on behalf of the user via [Fee Sponsorship](/features/fee-sponsorship).

<Tip>
When displaying fees to users, we recommend mapping the `expandedPriceImpact` fields as follows:
Expand All @@ -154,8 +140,24 @@ Integrators with [Fee Sponsorship](/features/fee-sponsorship) enabled can subsid

For more granular control, use the **`sponsoredFeeComponents`** parameter in the quote request to choose which specific fee components to sponsor. This allows you to sponsor some fees (e.g. execution and relay fees) while letting the user pay others (e.g. swap fees).

See the [Fee Sponsorship Doc](/features/fee-sponsorship) for setup details.

## Deprecated: Fees Object

<Warning>
Deposit addresses do not support `sponsoredFeeComponents`.
The `fees` object is deprecated. It is still returned from the quote API and the [`GET /requests/v2`](/references/api/get-requests) API for backwards compatibility, but it only reports Relay-related fees and does not reflect the full cost of a request. Do not rely on it for new integrations.

To understand or display the complete fee breakdown of a request, use the [`expandedPriceImpact`](#fees-in-the-api) object instead, which covers execution, swap, relay, app, and sponsored fees.
</Warning>

See the [Fee Sponsorship Doc](/features/fee-sponsorship) for setup details.
The deprecated `fees` object is segmented into the following fields:

**relayerService**: The service fee paid to the relayer to facilitate execution.

**relayerGas**: The gas fee given to the solver to pay gas fees on the destination chain.

**relayer**: The sum of the relayerService and the relayerGas.

**app**: Third party fees added on top of the existing fees, this fee is added by app developers and accrues offchain to minimize gas costs.

**subsidized**: The Fees in the order that are subsidized by the integrator.
2 changes: 1 addition & 1 deletion script.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function enhanceGetQuotePage() {
addLearnMore(
"response-fees",
"/references/api/api_core_concepts/fees",
"Learn more about fees",
"Learn more about fees - [DEPRECATED]",
"learn-more-fees",
"before",
);
Expand Down
Loading