Skip to main content
When a user’s preferred fee token differs from the validator’s preferred fee token, the protocol automatically converts between them using the Fee AMM, a set of constant-product pools embedded in the Fee Manager precompile.

How It Works

  • Pre-check: Before a transaction is admitted to the mempool, the protocol verifies that an AMM pool exists for the (user_token, validator_token) pair and that it has sufficient liquidity for the worst-case fee.
  • Pre-charge: The user’s fee token is deducted at the maximum possible amount.
  • Execution: The transaction runs.
  • Post-settlement: The actual fee is calculated. If the user’s token differs from the validator’s, an atomic swap is executed through the Fee AMM pool. The validator is credited in their preferred token.

Use Case: Cross-Stablecoin Settlement

A user’s wallet is configured to pay fees in USDC. The current block’s validator prefers USDT. The user submits a transaction as normal:
  1. Protocol deducts max fee in USDC from the user.
  2. Transaction executes.
  3. The actual fee is 0.004 USDC. The Fee AMM swaps 0.004 USDC for ~0.00399 USDT (after the 0.25% fee).
  4. Validator receives 0.00399 USDT. Excess USDC is refunded to the user.
This is entirely transparent to both the user and the validator, neither needs to hold or manage the other’s preferred token.