Integrators will use this function to estimate the relayer fee that goes into xcall.
Proposed Solution
estimateRelayerFee should:
Fetch native token conversion rates for origin/destination and relayer fee estimates from Gelato
Fetch hardcoded gas limits from chaindata
Apply a configurable relayer buffer (20% default) on top of the estimated fee
Accept price inputs for native token prices (e.g. if both origin and destination native prices are supplied, there is no need to fetch the conversion rate, saving an external call)
Accept priceIn to select whether the estimate should be denominated in native asset or USD (this is so relayer fee can be paid in transacting asset)
Acceptance Criteria
[ ] estimateRelayerFee returns the relayer fee estimate denominated in either the native asset or in USD
Open questions
Can we supply any asset into the Gelato conversion rate? If we can denominate the relayer fee in the transactingAsset, this saves integrators the step of converting USD -> transactingAsset amount.
Problem
Implement the functions:
estimateRelayerFee
Impact
Integrators will use this function to estimate the relayer fee that goes into
xcall
.Proposed Solution
estimateRelayerFee
should:priceIn
to select whether the estimate should be denominated in native asset or USD (this is so relayer fee can be paid in transacting asset)Acceptance Criteria
estimateRelayerFee
returns the relayer fee estimate denominated in either the native asset or in USDOpen questions
transactingAsset
, this saves integrators the step of converting USD ->transactingAsset
amount.