Overview
Different protocols use different fee models for cross-chain swaps. This reference provides the exact formulas and calculations used by each protocol.THORChain Fee Structure
THORChain fees consist of three main components: affiliate fees, outbound fees, and liquidity fees (slippage).Fee Components
| Fee Type | Description | Calculation | Variable |
|---|---|---|---|
| Affiliate Fee | Revenue share to integrator | (inputAmount × affiliateBps) / 10000 | Optional |
| Outbound Fee | Network fee for destination | Fixed per chain from API | Required |
| Liquidity Fee | Pool slippage cost | (inputAmount × slippageBps) / 10000 | Required |
Formula
Example Calculation
Swap 1 BTC → ETH.USDC with 30 BPS affiliate fee and 150 BPS slippage:Basis Points (BPS) Explained
| BPS | Percentage | Decimal |
|---|---|---|
| 1 | 0.01% | 0.0001 |
| 10 | 0.1% | 0.001 |
| 30 | 0.3% | 0.003 |
| 100 | 1% | 0.01 |
| 150 | 1.5% | 0.015 |
| 300 | 3% | 0.03 |
| 10000 | 100% | 1.0 |
Slippage Calculation
Streaming Swap Fee Impact
Streaming swaps reduce slippage by splitting large swaps into smaller chunks:- Reduced price impact per sub-swap
- Better average execution price
- Lower total slippage for large amounts
MAYAChain Fee Structure
MAYAChain uses a similar fee model to THORChain with some differences.Fee Components
Same as THORChain but with MAYAChain-specific parameters:CACAO Decimal Handling
Critical: MAYA.CACAO uses 10 decimals instead of 8!Tolerance Parameter Validation
MAYAChain requires only one tolerance parameter:Chainflip Fee Structure
Chainflip uses multiple fee types with different multipliers.Fee Types
| Type | Display Name | Multiplier | Description |
|---|---|---|---|
| INGRESS | Deposit Fee | 1x | Fee to deposit to Chainflip vault |
| NETWORK | Network Fee | 1x | Blockchain network fees |
| EGRESS | Broadcast Fee | 1x | Fee to send from vault to destination |
| BROKER | Affiliate Fee | 1.5x | Partner commission (multiplied by 1.5) |
Formula
Example Calculation
DCA (Dollar Cost Averaging) Impact
Chainflip supports DCA to reduce price impact:Boost Fee
Optional boost fee for faster execution:Low Liquidity Warning
WhenlowLiquidityWarning: true:
Relay Fee Structure
Relay uses a comprehensive fee model with multiple components.Fee Components
| Fee Type | Description | Source |
|---|---|---|
| Gas | Blockchain gas fees | Per transaction |
| Relayer | Bridge relayer fee | Per bridge |
| Relayer Gas | Gas for relayer operations | Per bridge |
| Relayer Service | Service fee for relaying | Per bridge |
| App | Application/affiliate fee | Optional |
Formula
Example Calculation
App Fee Configuration
Set custom affiliate fees:Price Impact Calculation
Relay differentiates between total impact and swap impact:Multi-Step Route Fees
Each step in a multi-hop route has separate fees:NEAR Fee Structure
NEAR uses a simplified fee model based on USD value difference.Formula
Example Calculation
Gas Fees
NEAR uses fixed gas amounts:Fee Comparison Example
Same swap across different protocols:Scenario: 1 BTC → ETH.USDC
| Protocol | Affiliate | Outbound | Liquidity | Other | Total USD |
|---|---|---|---|---|---|
| THORChain | $20 (30 BPS) | $65 | $100 (150 BPS) | - | $185 |
| MAYAChain | $20 (30 BPS) | $60 | $95 (150 BPS) | - | $175 |
| Chainflip | $30 (BROKER) | - | - | $25 (fees) | $55 |
| Relay | - | - | - | $45 (all) | $45 |
Fee Optimization Strategies
Minimize Slippage
Choose Optimal Protocol
Balance Speed vs Cost
Best Practices
- Always display total fees in USD for user transparency
- Break down fee components to help users understand costs
- Show price impact separately from network fees
- Use protocol-recommended slippage for low liquidity pools
- Cache outbound fees from THORChain/MAYA APIs (update hourly)
- Account for decimal differences (especially MAYA.CACAO’s 10 decimals)
- Multiply BROKER fees by 1.5x for Chainflip calculations
- Compare effective rates (output/input) across protocols, not just fees
- Warn users about high price impact (>5%) before swap execution
- Update gas prices frequently (every 1-2 minutes) for accurate estimates