# CCIP v1.6.1 FeeQuoter API Reference
Source: https://docs.chain.link/ccip/api-reference/evm/v1.6.1/fee-quoter
Last Updated: 2025-11-05

> For the complete documentation index, see [llms.txt](/llms.txt).

<Aside type="note" title="Integrate Chainlink CCIP v1.6.1 into your project">
  <Tabs sharedStore="ccip-v1-6-1-package" client:visible>
    <Fragment slot="tab.1">npm</Fragment>
    <Fragment slot="tab.2">yarn</Fragment>
    <Fragment slot="tab.3">foundry</Fragment>

    <Fragment slot="panel.1">
      If you use [NPM](https://www.npmjs.com/), install the [@chainlink/contracts-ccip NPM package](https://www.npmjs.com/package/@chainlink/contracts-ccip):

      ```shell
      npm install @chainlink/contracts-ccip@1.6.1
      ```
    </Fragment>

    <Fragment slot="panel.2">
      If you use [Yarn](https://yarnpkg.com/), install the [@chainlink/contracts-ccip NPM package](https://www.npmjs.com/package/@chainlink/contracts-ccip):

      ```shell
      yarn add @chainlink/contracts-ccip@1.6.1
      ```
    </Fragment>

    <Fragment slot="panel.3">
      If you use [Foundry](https://book.getfoundry.sh/), install the package:

      ```shell
      forge install smartcontractkit/chainlink-ccip@bbab0601244ce58e2ffac0dbc178a80aab1fa4a3
      ```
    </Fragment>
  </Tabs>
</Aside>

## FeeQuoter

The FeeQuoter contract stores gas and token prices in USD, manages chain-specific fee calculations, and provides fee estimation for cross-chain messages.

[Git Source](https://github.com/smartcontractkit/chainlink-ccip/tree/contracts-ccip-v1.6.1/chains/evm/contracts/FeeQuoter.sol)

## Errors

### TokenNotSupported

```solidity
error TokenNotSupported(address token);
```

<Aside>Thrown when attempting to get the price or fee for an unsupported token.</Aside>

**Parameters**

| Name    | Type      | Description                   |
| ------- | --------- | ----------------------------- |
| `token` | `address` | The unsupported token address |

### FeeTokenNotSupported

```solidity
error FeeTokenNotSupported(address token);
```

<Aside>Thrown when attempting to use an unsupported token for fee payment.</Aside>

**Parameters**

| Name    | Type      | Description                       |
| ------- | --------- | --------------------------------- |
| `token` | `address` | The unsupported fee token address |

### StaleGasPrice

```solidity
error StaleGasPrice(uint64 destChainSelector, uint256 threshold, uint256 timePassed);
```

<Aside>Thrown when the gas price for a destination chain is stale.</Aside>

**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 |

### MessageGasLimitTooHigh

```solidity
error MessageGasLimitTooHigh();
```

<Aside>Thrown when the message gas limit exceeds the maximum allowed for the destination chain.</Aside>

### MessageComputeUnitLimitTooHigh

```solidity
error MessageComputeUnitLimitTooHigh();
```

<Aside>Thrown when the message compute unit limit exceeds the maximum allowed for Solana VM chains.</Aside>

### DestinationChainNotEnabled

```solidity
error DestinationChainNotEnabled(uint64 destChainSelector);
```

<Aside>Thrown when attempting to send a message to a disabled destination chain.</Aside>

**Parameters**

| Name                | Type     | Description                             |
| ------------------- | -------- | --------------------------------------- |
| `destChainSelector` | `uint64` | The disabled destination chain selector |

### ExtraArgOutOfOrderExecutionMustBeTrue

```solidity
error ExtraArgOutOfOrderExecutionMustBeTrue();
```

<Aside>Thrown when a destination chain enforces out-of-order execution but the extra args specify otherwise.</Aside>

### InvalidExtraArgsTag

```solidity
error InvalidExtraArgsTag();
```

<Aside>Thrown when the extra args tag is invalid or unsupported.</Aside>

### InvalidExtraArgsData

```solidity
error InvalidExtraArgsData();
```

<Aside>Thrown when extra args data is missing or malformed.</Aside>

### MessageTooLarge

```solidity
error MessageTooLarge(uint256 maxSize, uint256 actualSize);
```

<Aside>Thrown when the message data payload exceeds the maximum allowed size.</Aside>

**Parameters**

| Name         | Type      | Description                            |
| ------------ | --------- | -------------------------------------- |
| `maxSize`    | `uint256` | Maximum allowed message size           |
| `actualSize` | `uint256` | Actual message size that was too large |

### UnsupportedNumberOfTokens

```solidity
error UnsupportedNumberOfTokens(uint256 numberOfTokens, uint256 maxNumberOfTokensPerMsg);
```

<Aside>Thrown when the number of tokens in a message exceeds the maximum allowed.</Aside>

**Parameters**

| Name                      | Type      | Description                                  |
| ------------------------- | --------- | -------------------------------------------- |
| `numberOfTokens`          | `uint256` | Number of tokens in the message              |
| `maxNumberOfTokensPerMsg` | `uint256` | Maximum allowed number of tokens per message |

### MessageFeeTooHigh

```solidity
error MessageFeeTooHigh(uint256 msgFeeJuels, uint256 maxFeeJuelsPerMsg);
```

> \*\*NOTE\*\*
>
>
>
> Thrown when the calculated message fee exceeds the maximum allowed fee (see
> [`StaticConfig.maxFeeJuelsPerMsg`](#staticconfig)).

**Parameters**

| Name                | Type      | Description                              |
| ------------------- | --------- | ---------------------------------------- |
| `msgFeeJuels`       | `uint256` | Calculated message fee in Juels          |
| `maxFeeJuelsPerMsg` | `uint256` | Maximum allowed fee in Juels per message |

### InvalidTokenReceiver

```solidity
error InvalidTokenReceiver();
```

> \*\*NOTE\*\*
>
>
>
> Thrown when the token receiver is invalid for SVM or SUI chains, typically when it's zero and tokens are being
> transferred.

### TooManySVMExtraArgsAccounts

```solidity
error TooManySVMExtraArgsAccounts(uint256 numAccounts, uint256 maxAccounts);
```

<Aside>Thrown when too many accounts are specified in SVM (Solana) extra args.</Aside>

**Parameters**

| Name          | Type      | Description                        |
| ------------- | --------- | ---------------------------------- |
| `numAccounts` | `uint256` | Number of accounts provided        |
| `maxAccounts` | `uint256` | Maximum allowed number of accounts |

### InvalidSVMExtraArgsWritableBitmap

```solidity
error InvalidSVMExtraArgsWritableBitmap(uint64 accountIsWritableBitmap, uint256 numAccounts);
```

<Aside>Thrown when the SVM writable bitmap is invalid for the number of accounts.</Aside>

**Parameters**

| Name                      | Type      | Description                          |
| ------------------------- | --------- | ------------------------------------ |
| `accountIsWritableBitmap` | `uint64`  | The provided writable bitmap         |
| `numAccounts`             | `uint256` | Number of accounts in the extra args |

### InvalidChainFamilySelector

```solidity
error InvalidChainFamilySelector(bytes4 chainFamilySelector);
```

> \*\*NOTE\*\*
>
>
>
> Thrown when the destination chain's
> [`chainFamilySelector`](/ccip/api-reference/evm/v1.6.1/internal#chain_family_selector_evm) is invalid or unsupported.

**Parameters**

| Name                  | Type     | Description                       |
| --------------------- | -------- | --------------------------------- |
| `chainFamilySelector` | `bytes4` | The invalid chain family selector |

## Structs

### TokenTransferFeeConfig

Structure defining the fee configuration for token transfers.

```solidity
struct TokenTransferFeeConfig {
  uint32 minFeeUSDCents;
  uint32 maxFeeUSDCents;
  uint16 deciBps;
  uint32 destGasOverhead;
  uint32 destBytesOverhead;
  bool isEnabled;
}
```

> \*\*NOTE\*\*
>
>
>
> Referenced in [`DestChainConfig`](#destchainconfig) for default values and can be set per-token via `applyTokenTransferFeeConfigUpdates`.

**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` | Data availability bytes returned from source pool, must be >= Pool.CCIP\_LOCK\_OR\_BURN\_V1\_RET\_BYTES |
| `isEnabled`         | `bool`   | Whether this token has custom transfer fees                                                             |

### DestChainConfig

Structure containing all configuration for a destination chain.

```solidity
struct DestChainConfig {
  bool isEnabled;
  uint16 maxNumberOfTokensPerMsg;
  uint32 maxDataBytes;
  uint32 maxPerMsgGasLimit;
  uint32 destGasOverhead;
  uint8 destGasPerPayloadByteBase;
  uint8 destGasPerPayloadByteHigh;
  uint16 destGasPerPayloadByteThreshold;
  uint32 destDataAvailabilityOverheadGas;
  uint16 destGasPerDataAvailabilityByte;
  uint16 destDataAvailabilityMultiplierBps;
  bytes4 chainFamilySelector;
  bool enforceOutOfOrder;
  uint16 defaultTokenFeeUSDCents;
  uint32 defaultTokenDestGasOverhead;
  uint32 defaultTxGasLimit;
  uint64 gasMultiplierWeiPerEth;
  uint32 gasPriceStalenessThreshold;
  uint32 networkFeeUSDCents;
}
```

> \*\*NOTE\*\*
>
>
>
> Contains fee & validation configs for a destination chain. Retrieved via [`getDestChainConfig`](#getdestchainconfig).

**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 data payload size in bytes                                                                                                                |
| `maxPerMsgGasLimit`                 | `uint32` | Maximum gas limit for messages targeting EVMs                                                                                                     |
| `destGasOverhead`                   | `uint32` | Gas charged on top of the gasLimit to cover destination chain costs                                                                               |
| `destGasPerPayloadByteBase`         | `uint8`  | Default dest-chain gas charged per byte of `data` payload                                                                                         |
| `destGasPerPayloadByteHigh`         | `uint8`  | High dest-chain gas charged per byte of `data` payload (for EIP-7623)                                                                             |
| `destGasPerPayloadByteThreshold`    | `uint16` | The value at which billing switches from base to high rate                                                                                        |
| `destDataAvailabilityOverheadGas`   | `uint32` | Data availability gas charged for overhead costs (e.g., OCR)                                                                                      |
| `destGasPerDataAvailabilityByte`    | `uint16` | Gas units charged per byte of message data requiring availability                                                                                 |
| `destDataAvailabilityMultiplierBps` | `uint16` | Multiplier for data availability gas, multiples of bps (0.0001)                                                                                   |
| `chainFamilySelector`               | `bytes4` | Selector identifying the destination chain's family (see [`Internal` library](/ccip/api-reference/evm/v1.6.1/internal#chain_family_selector_evm)) |
| `enforceOutOfOrder`                 | `bool`   | Whether to enforce allowOutOfOrderExecution extraArg to be true                                                                                   |
| `defaultTokenFeeUSDCents`           | `uint16` | Default token fee charged per token transfer                                                                                                      |
| `defaultTokenDestGasOverhead`       | `uint32` | Default gas charged to execute a token transfer on the destination chain                                                                          |
| `defaultTxGasLimit`                 | `uint32` | Default gas limit for a tx                                                                                                                        |
| `gasMultiplierWeiPerEth`            | `uint64` | Multiplier for gas costs, 1e18 based (e.g., 11e17 = 10% extra cost)                                                                               |
| `gasPriceStalenessThreshold`        | `uint32` | Time in seconds a gas price can be stale before invalid (0 means disabled)                                                                        |
| `networkFeeUSDCents`                | `uint32` | Flat network fee to charge for messages, multiples of 0.01 USD                                                                                    |

### StaticConfig

Structure containing the static configuration of the FeeQuoter contract.

```solidity
struct StaticConfig {
  uint96 maxFeeJuelsPerMsg;
  address linkToken;
  uint32 tokenPriceStalenessThreshold;
}
```

> \*\*NOTE\*\*
>
>
>
> Contains immutable configuration values set at contract deployment. Retrieved via [`getStaticConfig`](#getstaticconfig).

**Properties**

| Name                           | Type      | Description                                               |
| ------------------------------ | --------- | --------------------------------------------------------- |
| `maxFeeJuelsPerMsg`            | `uint96`  | Maximum fee that can be charged for a message             |
| `linkToken`                    | `address` | LINK token address                                        |
| `tokenPriceStalenessThreshold` | `uint32`  | Time in seconds a token price can be stale before invalid |

## State Variables

### FEE\_BASE\_DECIMALS

```solidity
uint256 public constant FEE_BASE_DECIMALS = 36;
```

<Aside>The base decimals for cost calculations.</Aside>

### typeAndVersion

```solidity
string public constant typeAndVersion = "FeeQuoter 1.6.1";
```

<Aside>Returns the contract type and version identifier.</Aside>

## Functions

### convertTokenAmount

Converts a token amount from the token's decimals to a fee-denominated amount.

```solidity
function convertTokenAmount(
  address fromToken,
  uint256 fromTokenAmount,
  address toToken
) external view returns (uint256);
```

> \*\*NOTE\*\*
>
>
>
> This function converts token amounts based on their relative prices and decimals. Used for calculating fees when tokens with different decimal places are involved.

**Parameters**

| Name              | Type      | Description                        |
| ----------------- | --------- | ---------------------------------- |
| `fromToken`       | `address` | The token to convert from          |
| `fromTokenAmount` | `uint256` | The amount of fromToken to convert |
| `toToken`         | `address` | The token to convert to            |

**Returns**

| Type      | Description                      |
| --------- | -------------------------------- |
| `uint256` | The equivalent amount in toToken |

### getFeeTokens

Returns the list of tokens that can be used to pay fees.

```solidity
function getFeeTokens() external view returns (address[] memory);
```

**Returns**

| Type        | Description                  |
| ----------- | ---------------------------- |
| `address[]` | Array of fee token addresses |

### getValidatedFee

Calculates and validates the fee for a CCIP message.

```solidity
function getValidatedFee(
  uint64 destChainSelector,
  Client.EVM2AnyMessage calldata message
) external view returns (uint256);
```

> \*\*NOTE\*\*
>
>
>
> This is the primary function for fee calculation. It validates the message and destination chain, then calculates the total fee including execution costs, data availability costs, and token transfer fees.

**Parameters**

| Name                | Type                    | Description                           |
| ------------------- | ----------------------- | ------------------------------------- |
| `destChainSelector` | `uint64`                | The destination chain selector        |
| `message`           | `Client.EVM2AnyMessage` | The CCIP message to calculate fee for |

**Returns**

| Type      | Description                                         |
| --------- | --------------------------------------------------- |
| `uint256` | The total fee in the smallest unit of the fee token |

### getTokenTransferFeeConfig

Returns the token transfer fee configuration for a specific token and destination chain.

```solidity
function getTokenTransferFeeConfig(
  uint64 destChainSelector,
  address token
) external view returns (TokenTransferFeeConfig memory);
```

> \*\*NOTE\*\*
>
>
>
> Returns the custom [`TokenTransferFeeConfig`](#tokentransferfeeconfig) for a token if set, otherwise returns the default configuration from [`DestChainConfig`](#destchainconfig).

**Parameters**

| Name                | Type      | Description                    |
| ------------------- | --------- | ------------------------------ |
| `destChainSelector` | `uint64`  | The destination chain selector |
| `token`             | `address` | The token address              |

**Returns**

| Type                                                | Description                          |
| --------------------------------------------------- | ------------------------------------ |
| [`TokenTransferFeeConfig`](#tokentransferfeeconfig) | The token transfer fee configuration |

### getDestChainConfig

Returns the destination chain configuration for a given chain selector.

```solidity
function getDestChainConfig(
  uint64 destChainSelector
) external view returns (DestChainConfig memory);
```

> \*\*NOTE\*\*
>
>
>
> Retrieves the complete [`DestChainConfig`](#destchainconfig) containing all fee and validation parameters for the destination chain.

**Parameters**

| Name                | Type     | Description                    |
| ------------------- | -------- | ------------------------------ |
| `destChainSelector` | `uint64` | The destination chain selector |

**Returns**

| Type                                  | Description                         |
| ------------------------------------- | ----------------------------------- |
| [`DestChainConfig`](#destchainconfig) | The destination chain configuration |

### getStaticConfig

Returns the static configuration of the FeeQuoter contract.

```solidity
function getStaticConfig() external view returns (StaticConfig memory);
```

> \*\*NOTE\*\*
>
>
>
> Retrieves the immutable [`StaticConfig`](#staticconfig) values set at contract deployment.

**Returns**

| Type                            | Description              |
| ------------------------------- | ------------------------ |
| [`StaticConfig`](#staticconfig) | The static configuration |