CCIP v1.5.1 FeeQuoter API Reference
FeeQuoter
The FeeQuoter contract stores gas and token prices in USD, manages chain-specific fee calculations, and provides fee estimation for cross-chain messages.
Errors
TokenNotSupported
error TokenNotSupported(address token);
Parameters
| Name | Type | Description |
|---|---|---|
token | address | The unsupported token address |
FeeTokenNotSupported
error FeeTokenNotSupported(address token);
Parameters
| Name | Type | Description |
|---|---|---|
token | address | The unsupported fee token address |
StaleGasPrice
error StaleGasPrice(uint64 destChainSelector, uint256 threshold, uint256 timePassed);
Parameters
| Name | Type | Description |
|---|---|---|
destChainSelector | uint64 | The destination chain selector |
threshold | uint256 | The staleness threshold in seconds |
timePassed | uint256 | The time passed since last update in seconds |
StaleKeystoneUpdate
error StaleKeystoneUpdate(address token, uint256 feedTimestamp, uint256 storedTimeStamp);
Parameters
| Name | Type | Description |
|---|---|---|
token | address | The token address |
feedTimestamp | uint256 | The timestamp from the feed update |
storedTimeStamp | uint256 | The currently stored timestamp |
DataFeedValueOutOfUint224Range
error DataFeedValueOutOfUint224Range();
InvalidDestBytesOverhead
error InvalidDestBytesOverhead(address token, uint32 destBytesOverhead);
Parameters
| Name | Type | Description |
|---|---|---|
token | address | The token address |
destBytesOverhead | uint32 | The invalid destination bytes overhead |
MessageGasLimitTooHigh
error MessageGasLimitTooHigh();
DestinationChainNotEnabled
error DestinationChainNotEnabled(uint64 destChainSelector);
Parameters
| Name | Type | Description |
|---|---|---|
destChainSelector | uint64 | The disabled destination chain selector |
ExtraArgOutOfOrderExecutionMustBeTrue
error ExtraArgOutOfOrderExecutionMustBeTrue();
InvalidExtraArgsTag
error InvalidExtraArgsTag();
SourceTokenDataTooLarge
error SourceTokenDataTooLarge(address token);
Parameters
| Name | Type | Description |
|---|---|---|
token | address | The token with oversized source data |
InvalidDestChainConfig
error InvalidDestChainConfig(uint64 destChainSelector);
Parameters
| Name | Type | Description |
|---|---|---|
destChainSelector | uint64 | The destination chain selector with invalid config |
MessageFeeTooHigh
error MessageFeeTooHigh(uint256 msgFeeJuels, uint256 maxFeeJuelsPerMsg);
Parameters
| Name | Type | Description |
|---|---|---|
msgFeeJuels | uint256 | Calculated message fee in Juels |
maxFeeJuelsPerMsg | uint256 | Maximum allowed fee in Juels per message |
InvalidStaticConfig
error InvalidStaticConfig();
MessageTooLarge
error MessageTooLarge(uint256 maxSize, uint256 actualSize);
Parameters
| Name | Type | Description |
|---|---|---|
maxSize | uint256 | Maximum allowed message size |
actualSize | uint256 | Actual message size that was too large |
UnsupportedNumberOfTokens
error UnsupportedNumberOfTokens();
Events
FeeTokenAdded
event FeeTokenAdded(address indexed feeToken);
Parameters
| Name | Type | Description |
|---|---|---|
feeToken | address | The fee token that was added |
FeeTokenRemoved
event FeeTokenRemoved(address indexed feeToken);
Parameters
| Name | Type | Description |
|---|---|---|
feeToken | address | The fee token that was removed |
UsdPerUnitGasUpdated
event UsdPerUnitGasUpdated(uint64 indexed destChain, uint256 value, uint256 timestamp);
Parameters
| Name | Type | Description |
|---|---|---|
destChain | uint64 | The destination chain selector |
value | uint256 | The new gas price in USD (18 decimals) |
timestamp | uint256 | The timestamp of the update |
UsdPerTokenUpdated
event UsdPerTokenUpdated(address indexed token, uint256 value, uint256 timestamp);
Parameters
| Name | Type | Description |
|---|---|---|
token | address | The token address |
value | uint256 | The new token price in USD (18 decimals) |
timestamp | uint256 | The timestamp of the update |
PriceFeedPerTokenUpdated
event PriceFeedPerTokenUpdated(address indexed token, TokenPriceFeedConfig priceFeedConfig);
Parameters
| Name | Type | Description |
|---|---|---|
token | address | The token address |
priceFeedConfig | TokenPriceFeedConfig | The new price feed configuration |
TokenTransferFeeConfigUpdated
event TokenTransferFeeConfigUpdated(
uint64 indexed destChainSelector,
address indexed token,
TokenTransferFeeConfig tokenTransferFeeConfig
);
Parameters
| Name | Type | Description |
|---|---|---|
destChainSelector | uint64 | The destination chain selector |
token | address | The token address |
tokenTransferFeeConfig | TokenTransferFeeConfig | The new token transfer fee configuration |
TokenTransferFeeConfigDeleted
event TokenTransferFeeConfigDeleted(uint64 indexed destChainSelector, address indexed token);
Parameters
| Name | Type | Description |
|---|---|---|
destChainSelector | uint64 | The destination chain selector |
token | address | The token address |
PremiumMultiplierWeiPerEthUpdated
event PremiumMultiplierWeiPerEthUpdated(address indexed token, uint64 premiumMultiplierWeiPerEth);
Parameters
| Name | Type | Description |
|---|---|---|
token | address | The token address |
premiumMultiplierWeiPerEth | uint64 | The new premium multiplier (wei per ETH) |
DestChainConfigUpdated
event DestChainConfigUpdated(uint64 indexed destChainSelector, DestChainConfig destChainConfig);
Parameters
| Name | Type | Description |
|---|---|---|
destChainSelector | uint64 | The destination chain selector |
destChainConfig | DestChainConfig | The new destination chain configuration |
DestChainAdded
event DestChainAdded(uint64 indexed destChainSelector, DestChainConfig destChainConfig);
Parameters
| Name | Type | Description |
|---|---|---|
destChainSelector | uint64 | The destination chain selector |
destChainConfig | DestChainConfig | The destination chain configuration |
Structs
TokenPriceFeedConfig
Token price data feed configuration.
struct TokenPriceFeedConfig {
address dataFeedAddress;
uint8 tokenDecimals;
}
Properties
| Name | Type | Description |
|---|---|---|
dataFeedAddress | address | AggregatorV3Interface contract address (0 if feed is unset) |
tokenDecimals | uint8 | Decimals of the token that the feed represents |
TokenPriceFeedUpdate
Token price data feed update.
struct TokenPriceFeedUpdate {
address sourceToken;
TokenPriceFeedConfig feedConfig;
}
Properties
| Name | Type | Description |
|---|---|---|
sourceToken | address | Source token to update feed for |
feedConfig | TokenPriceFeedConfig | Feed config update data |
StaticConfig
Struct that contains the static configuration.
struct StaticConfig {
uint96 maxFeeJuelsPerMsg;
address linkToken;
uint32 tokenPriceStalenessThreshold;
}
Properties
| Name | Type | Description |
|---|---|---|
maxFeeJuelsPerMsg | uint96 | Maximum fee that can be charged for a message |
linkToken | address | LINK token address |
tokenPriceStalenessThreshold | uint32 | Time (seconds) a token price can be stale before considered invalid |
ReceivedCCIPFeedReport
The struct representing the received CCIP feed report from Keystone IReceiver.onReport().
struct ReceivedCCIPFeedReport {
address token;
uint224 price;
uint32 timestamp;
}
Properties
| Name | Type | Description |
|---|---|---|
token | address | Token address |
price | uint224 | Price of the token in USD with 18 decimals |
timestamp | uint32 | Timestamp of the price update |
DestChainConfig
Struct to hold the fee & validation configs for a destination chain.
struct DestChainConfig {
bool isEnabled;
uint16 maxNumberOfTokensPerMsg;
uint32 maxDataBytes;
uint32 maxPerMsgGasLimit;
uint32 destGasOverhead;
uint16 destGasPerPayloadByte;
uint32 destDataAvailabilityOverheadGas;
uint16 destGasPerDataAvailabilityByte;
uint16 destDataAvailabilityMultiplierBps;
uint16 defaultTokenFeeUSDCents;
uint32 defaultTokenDestGasOverhead;
uint32 defaultTxGasLimit;
uint64 gasMultiplierWeiPerEth;
uint32 networkFeeUSDCents;
uint32 gasPriceStalenessThreshold;
bool enforceOutOfOrder;
bytes4 chainFamilySelector;
}
Properties
| Name | Type | Description |
|---|---|---|
isEnabled | bool | Whether this destination chain is enabled |
maxNumberOfTokensPerMsg | uint16 | Maximum number of distinct ERC20 tokens transferred per message |
maxDataBytes | uint32 | Maximum payload data size in bytes |
maxPerMsgGasLimit | uint32 | Maximum gas limit for messages targeting EVMs |
destGasOverhead | uint32 | Gas charged on top of gasLimit to cover destination chain costs |
destGasPerPayloadByte | uint16 | Destination chain gas charged for passing each byte of data payload to receiver |
destDataAvailabilityOverheadGas | uint32 | Extra data availability gas charged on top of the message, e.g. for OCR |
destGasPerDataAvailabilityByte | uint16 | Amount of gas to charge per byte of message data that needs availability |
destDataAvailabilityMultiplierBps | uint16 | Multiplier for data availability gas, multiples of bps, or 0.0001 |
defaultTokenFeeUSDCents | uint16 | Default token fee charged per token transfer (overridable per token) |
defaultTokenDestGasOverhead | uint32 | Default gas charged to execute token transfer on destination chain (overridable) |
defaultTxGasLimit | uint32 | Default gas limit for a transaction |
gasMultiplierWeiPerEth | uint64 | Multiplier for gas costs, 1e18 based (e.g., 11e17 = 10% extra cost) |
networkFeeUSDCents | uint32 | Flat network fee to charge for messages, multiples of 0.01 USD |
gasPriceStalenessThreshold | uint32 | Time (seconds) a gas price can be stale before invalid (0 means disabled) |
enforceOutOfOrder | bool | Whether to enforce the allowOutOfOrderExecution extraArg value to be true |
chainFamilySelector | bytes4 | Selector identifying the destination chain's family (determines validations) |
DestChainConfigArgs
Struct to hold the configs and its destination chain selector.
struct DestChainConfigArgs {
uint64 destChainSelector;
DestChainConfig destChainConfig;
}
Properties
| Name | Type | Description |
|---|---|---|
destChainSelector | uint64 | Destination chain selector |
destChainConfig | DestChainConfig | Config to update for the chain selector |
TokenTransferFeeConfig
Struct to hold the transfer fee configuration for token transfers.
struct TokenTransferFeeConfig {
uint32 minFeeUSDCents;
uint32 maxFeeUSDCents;
uint16 deciBps;
uint32 destGasOverhead;
uint32 destBytesOverhead;
bool isEnabled;
}
Properties
| Name | Type | Description |
|---|---|---|
minFeeUSDCents | uint32 | Minimum fee to charge per token transfer, multiples of 0.01 USD |
maxFeeUSDCents | uint32 | Maximum fee to charge per token transfer, multiples of 0.01 USD |
deciBps | uint16 | Basis points charged on token transfers, multiples of 0.1bps, or 1e-5 |
destGasOverhead | uint32 | Gas charged to execute the token transfer on the destination chain |
destBytesOverhead | uint32 | Extra data availability bytes from source pool sent to destination pool. Must be >= Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES |
isEnabled | bool | Whether this token has custom transfer fees |
TokenTransferFeeConfigSingleTokenArgs
Struct to hold the token transfer fee configurations for a token.
struct TokenTransferFeeConfigSingleTokenArgs {
address token;
TokenTransferFeeConfig tokenTransferFeeConfig;
}
Properties
| Name | Type | Description |
|---|---|---|
token | address | Token address |
tokenTransferFeeConfig | TokenTransferFeeConfig | Transfer fee configuration for token |
TokenTransferFeeConfigArgs
Struct to hold the token transfer fee configurations for a destination chain and a set of tokens.
struct TokenTransferFeeConfigArgs {
uint64 destChainSelector;
TokenTransferFeeConfigSingleTokenArgs[] tokenTransferFeeConfigs;
}
Properties
| Name | Type | Description |
|---|---|---|
destChainSelector | uint64 | Destination chain selector |
tokenTransferFeeConfigs | TokenTransferFeeConfigSingleTokenArgs[] | Array of token transfer fee configurations |
TokenTransferFeeConfigRemoveArgs
Struct to hold a pair of destination chain selector and token address.
struct TokenTransferFeeConfigRemoveArgs {
uint64 destChainSelector;
address token;
}
Properties
| Name | Type | Description |
|---|---|---|
destChainSelector | uint64 | Destination chain selector |
token | address | Token address |
PremiumMultiplierWeiPerEthArgs
Struct to hold the fee token configuration for a token.
struct PremiumMultiplierWeiPerEthArgs {
address token;
uint64 premiumMultiplierWeiPerEth;
}
Properties
| Name | Type | Description |
|---|---|---|
token | address | Token address |
premiumMultiplierWeiPerEth | uint64 | Multiplier for destination chain specific premiums |
State Variables
FEE_BASE_DECIMALS
uint256 public constant FEE_BASE_DECIMALS = 36;
KEYSTONE_PRICE_DECIMALS
uint256 public constant KEYSTONE_PRICE_DECIMALS = 18;
typeAndVersion
string public constant override typeAndVersion = "FeeQuoter 1.6.0-dev";