Skip to content

Module 8 - Fee Management

Fee Payer Considerations

The Fee associated with any cross-chain Request initiated by a dApp is Paid by the dApp’s corresponding Fee Payer account on the Router Chain. This Fee Payer account is set by the dApp for all the Integrated Chains and can be changed anytime. Any Fee refunds are also credited to this account.

  • To Designate the Fee Payer for any Chain or to modify the Fee Payer address, the application must Invoke the setDappMetadata() function on that Chain’s Gateway Contract and provide a valid address on the Router Chain.

  • To Prevent Unauthorized usage of someone else’s address as the Fee Payer, the Designated Fee Payer address must Perform a Fee Payer approval Transaction on the Router Chain.

  • The approval as a Fee Payer can be provided by accessing the Explorer.

Gas Considerations

  • The Gas Price for the execution of incoming cross-chain Transactions on the Router Chain is decided via Governance and included directly in the Chain Configuration.

  • To ensure the Proper execution of CrossTalk Requests on the Destination Chain, users must specify the Gas Price and Gas Limit in their Request Metadata. This Information is used to Calculate the Fees required for the Transaction. If the Gas Price is not specified, the Gas Price Oracle on the Router Chain will estimate it.

  • While exercising the option to run their Own Relayer, applications might want to leave the Task of Gas limit estimation to the Relayers. In such a Scenario, they can pass the Gas Limit as 0.

Incoming Request Fee Structure

To execute an Incoming Request on the Router Chain, users are required to Configure a gasLimit Parameter in their Request Metadata. This gasLimit is multiplied by the gasPrice present in the Router Chain Configuration to Calculate the amount of ROUTE Tokens to be Deducted from the Userspecified feePayerAddress. This Fee is used to cover the Cost of Transaction execution (bridge contract call) on the Router Chain. Note that if your Fee Payer does not have Sufficient ROUTE Balance, the Transaction will not be executed. Since the feePayerAddress cannot be changed once set, you will have to top up the feePayerAddress to ensure the execution of your Request.

Outgoing Request Fee Structure

The Bridge Contract must pass reasonable gasPrice and gasLimit Parameters to Cover the Cost of executing any outgoing cross-chain Request on the Destination Chain. Once the Router Chain receives the outgoing Request, it Queries the Oracle Module for the Latest Price of the ROUTE Token and the Native Gas Token of the specified Destination Chain. It uses the Gas Price fetched using the Gas Price Oracle, and the Token Prices fetched using the Token Price Oracle to convert the Gas Cost involved in the execution of the Outgoing Request from the Destination Chain Native Token to the ROUTE Token.

CrossTalk Fee Structure

CrossTalk works on a prepaid Fee Model. Upon receiving a CrossTalk Request, the Router Chain will Calculate the estimated Fee for executing the Transaction on the Destination Chain in terms of ROUTE Tokens and Deduct the Fee plus Incentive from the feePayerAddress Upfront.

EstimatedFeeInRoute = EstimatedFeeInDestNativeToken * PriceRatio

where:

EstimatedFeeInDestNativeToken = DestGasLimit * GasPriceInDestNativeToken
PriceRatio = DestNativeTokenPrice / RouteTokenPrice

Other Fee Considerations

  • Fee and Relayer Incentive for any cross-chain Request on Router have to be Paid in ROUTE Tokens only.

  • To prevent Sybil Attacks on the Router cCain, Router’s Gateway Contract on the Source Chain charges a Minimal Fee from the application Contract to Cover the Cost of Orchestrator Validation. This Fee is Paid in the Source Chain’s Native Token.

Handling Refunds

Once the Router Chain receives the acknowledgment generated by the Destination Chain’s Gateway Contract, it (a) pays the Fee used along with the Relayer Incentive to the Relayer from the already Deducted Fee, and (b) refunds the Surplus fee back to the feePayerAddress. This Mechanism ensures the following -

  • The Relayers receive their Incentive automatically without any Delay.

  • The applications can Send extra Gas Limit as a buyer since they will get Automatic Refunds in case of a Surplus Fee.