Fees

Overview

There are 4 different fees the user should know about.

  1. Inbound Fee (sourceChain: gasRate * txSize)
  2. Affiliate Fee (affiliateFee * swapAmount)
  3. Liquidity Fee (swapSlip * swapAmount)
  4. Outbound Fee (destinationChain: gasRate * txSize)

Key Terms

TermDescription
Source ChainChain the user is sending funds from
Destination ChainChain the user is receiving funds on
txSizeSize of the transaction in bytes or gas units
gasRateGas price (e.g. sats/byte, gwei) for a chain
swapAmountAmount sent by the user
swapSlipPool-based slip incurred by the swap
affiliateFeeOptional fee taken as a basis point skim

Fee Ordering for Swaps

Fees are taken in the following order when conducting a swap.

  1. Inbound Fee — paid directly on the source chain
  2. Swap Fee — deducted by THORChain during the swap (in output asset)
  3. Affiliate Fee — skimmed post-swap (in output asset)
  4. Outbound Fee — charged from the swap output to cover final delivery

Info

With streaming swaps, the Affiliate Fee is applied before the Swap Fee. This ensures that if the swap is later refunded, the full amount (including the affiliate portion) is returned to the user. It prevents cases where an affiliate fee is deducted even when the swap does not complete.

To work out the total fees, fees should be converted to a common asset (e.g. RUNE or USD) then added up. Total fees should be less than the input else it is likely to result in a refund.

1. Inbound Fee

This is the fee the user pays to make a transaction on the source chain, which the user pays directly themselves. The gas rate recommended to use is fast where the tx is guaranteed to be committed in the next block. Any longer and the user will be waiting a long time for their swap and their price will be invalid (thus they may get an unnecessary refund).

Info

THORChain publishes current gas rates at /thorchain/inbound_addresses

  • gasRate is derived from the max of the last 10 blocks, then scaled via OFM
  • txSize is estimated per chain (e.g. 250 bytes for UTXO, 21,000 gas for ETH)

Warning

Always use a "fast" or "fastest" fee, if the transaction is not confirmed in time, it could be abandoned by the network or failed due to old prices. You should allow your users to cancel or re-try with higher fees.

2. Liquidity Fee

This is simply the slip created by the transaction multiplied by its amount. It is priced and deducted from the destination amount automatically by the protocol.

See more information in the Liquidity Section

Warning

A minimum swap fee in basis points (bps) applies for different asset types, governed by the mimir network settings.

3. Affiliate Fee

Within the transactions you build for your users you can include an affiliate for your exchange.

  • Affiliate fees are possible for: swaps, saving despoit, lending addition, RUNEPool withdrawal.
  • The affiliate fee is in basis points (0-10,000) and will be deducted from the inbound or outbound transaction amount.
  • A THORName is required to collect affiliate address. See a guide on creating THORNames here.
  • Affiliates are paid in $RUNE by default however a preferred asset can be specified within the THORName.
  • Mupiple Affiliates are possible for swaps.

See the Affiliate Fee Guide for more information.

4. Outbound Fee

The Outbound Fee is what THORChain charges to deliver the final asset to the user on thedestination chai. It covers the actual L1 gas costs*(paid by nodes), and helps sustain the network's infrastructure — including TSS signing, compute, and state management.

To ensure long-term sustainability, the outbound fee is marked up by a dynamic value called the Outbound Fee Multiplier (OFM). This allows the protocol to collect slightly more than it spends, building a buffer (or "surplus") of RUNE to cover fluctuations in network cost.

Why It's Dynamic

The Outbound Fee Multiplier moves between a maximum and minimum value, depending on the current fee "surplus" for a chain:

  • Surplus = Fees Withheld – Fees Spent
  • If the surplus is above target, the OFM decreases (users pay closer to actual gas costs)
  • If the surplus is below target, the OFM increases (users pay more to replenish reserves)

This dynamic model ensures users pay fair outbound fees while keeping the protocol solvent.

The outbound fee "surplus" is the cumulative difference (in $RUNE) between what the users are charged for outbound fees and what the nodes actually pay. As the network books a "surplus" the OFM slowly decreases from the Max to the Min.

Outbound Fee Formula

outboundFee = txSize × gasRate × Outbound Fee Multiplier (OFM)
  • The gasRate and txSize come from live on-chain data
  • The OFM ranges from 1.0x to 3.0x and is dynamically calculated using the following Mimir values:
Mimir KeyDescriptionDefault
TARGETOUTBOUNDFEESURPLUSRUNETarget surplus (in RUNE) the protocol aims to maintain5,000 RUNE
MAXOUTBOUNDFEEMULTIPLIERBASISPOINTSMax fee multiplier in basis points30000 = 3.0x
MINOUTBOUNDFEEMULTIPLIERBASISPOINTSMin fee multiplier in basis points1000 = 1.0x

Info

Values can change. Current OFM values are published at /thorchain/network

How the OFM works

  • THORChain tracks the gas fees spent and fees withheld for each chain

  • The surplus is defined as:

    surplus = feesWithheld - feesSpent
    
  • If the surplus exceeds the target, the multiplier drops toward the min

  • If below target, the multiplier rises toward the max

  • This ensures the network collects enough to cover real costs without overcharging users

OFM = Max - ((surplus / targetSurplus) × (Max - Min))

It is recalculated every block, per chain and per asset.

Refunds and Minimum Swappable Amount

If a transaction fails, it is refunded, thus it will pay the outboundFee for the SourceChain not the DestinationChain. Thus devs should always swap an amount that is a maximum of the following, multiplier by a buffer of at least 4x to allow for sudden gas spikes:

  1. The Destination Chain outbound_fee
  2. The Source Chain outbound_fee
  3. $1.00 (the minimum)

The outbound_fee for each chain is returned on the Inbound Addresses endpoint, priced in the gas asset.

It is strongly recommended to use the recommended_min_amount_in value that is included on the Swap Quote endpoint, which is the calculation described above. This value is priced in the inbound asset of the quote request (in 1e8). This should be the minimum-allowed swap amount for the requested quote. The swap quote endpoint will return a helpful error message including this value if the swap amount is insufficient.

Info

Remember, if the swap limit is not met or the swap is otherwise refunded the outbound_fee of the Source Chain will be deducted from the input amount, so give your users enough room.

Understanding gas_rate

THORNode keeps track of current gas prices. Access these at the /inbound_addresses endpoint of the THORNode API. The response is an array of objects like this:

{
    "chain": "ETH",
    "pub_key": "thorpub1addwnpepqfzafst6y2f33pdvheq6qe25xyzrwy542m4tq0nfnh6cn67d56n3g3lfwej",
    "address": "0x215520b3943c89e4fa501902ef7b76fdd199023b",
    "router": "0xD37BbE5744D730a1d98d8DC97c42F0Ca46aD7146",
    "halted": false,
    "global_trading_paused": false,
    "chain_trading_paused": false,
    "chain_lp_actions_paused": false,
    "gas_rate": "60",
    "gas_rate_units": "gwei",
    "outbound_tx_size": "100000",
    "outbound_fee": "180200",
    "dust_threshold": "0
}

The gas_rate property can be used to estimate network fees for each chain the swap interacts with. For example, if the swap is BTC -> ETH the swap will incur fees on the bitcoin network and Ethereum network. The gas_rate property works differently on each chain "type" (e.g. EVM, UTXO, BFT).

The gas_rate_units explain what the rate is for chain, as a prompt to the developer.

The outbound_tx_size is what THORChain internally budgets as a typical transaction size for each chain.

The outbound_fee is gas_rate * outbound_tx_size * OFM and developers can use this to budget for the fee to be charged to the user. The current Outbound Fee Multiplier (OFM) can be found on the Network Endpoint.

Keep in mind the outbound_fee is priced in the gas asset of each chain. For chains with tokens, be sure to convert the outbound_fee to the outbound token to determine how much will be taken from the outbound amount. To do this, use the getValueOfAsset1InAsset2 formula described in the Math section.

Fee Calculation by Chain

THORChain (Native Rune)

The THORChain blockchain has a set 0.02 RUNE fee. This is set within the THORChain Constants by NativeTransactionFee. As THORChain is 1e8, 2000000 TOR = 0.02 RUNE

UTXO Chains like Bitcoin

For UXTO chains link Bitcoin, gas_rateis denoted in Satoshis. The gas_rate is calculated by looking at the average previous block fee seen by the THORNodes.

All THORChain transactions use BECH32 so a standard tx size of 250 bytes can be used. The standard UTXO fee is then gas_rate* 250.

EVM Chains like Ethereum

For EVM chains like Ethereum, gas_rateis denoted in GWEI. The gas_rate is calculated by looking at the average previous block fee seen by the THORNodes

An Ether Tx fee is: gasRate * 10^9 (GWEI) * 21000 (units).

An ERC20 Tx is larger: gasRate * 10^9 (GWEI) * 70000 (units)

Success

THORChain calculates and posts gas fee rates at https://thornode.ninerealms.com/thorchain/inbound_addresses