Fee Manager

1. Fee Collection

The FeeManager serves as the central collection point for protocol fees across the Curvance ecosystem. It acts as a unified hub for aggregating fees generated from various protocol operations.

  • Protocol Revenue Streams: Fees collected from lending/borrowing operations, liquidations, and other protocol services flow into the FeeManager.

  • Reward Token Registry: The contract maintains a registry of valid reward tokens that can be accepted as fees, enabling flexibility in fee collection.

Storage Architecture:

  • rewardTokens: Array of supported token addresses.

  • rewardTokenInfo: Mapping tracking token status (including OTC eligibility).

Fee Transformation (Swaps/OTC)

Before cross-chain distribution, collected fees may need transformation into the protocol's primary fee token.

Fee Token Swaps

  • Permissioned Swap Execution: Authorized harvesters can initiate swaps through the multiSwap function.

  • OTC Protection: Tokens marked for OTC are protected from automated swaps.

  • Token Verification: Ensures input tokens are registered reward tokens and output is the fee token.

DAO OTC Mechanism

  • Price Oracle Integration: Uses Oracle Manager to determine fair market value for OTC transactions.

  • Token Earmarking: Tokens can be marked as "for OTC" (value=2), preventing them from being swapped.

  • Price Protection: Includes slippage control and deadline validation to ensure fair execution.

3. Cross-Chain Fee Distribution

The cross-chain distribution of fees is coordinated between the FeeManager and MessagingHub.

Distribution Flow

  1. MessagingHub Pull: The MessagingHub calls pullFees() to retrieve the collected fee tokens

  2. Fee Allocation:

    1. Compounding fees are allocated to DAO address for harvester bot operations.

    2. Remaining fees are sent to MessagingHub for cross-chain distribution.

  3. Cross-Chain Transfer:

    1. MessagingHub uses Circle's CCTP (Cross-Chain Transfer Protocol) and Wormhole for secure cross-chain messaging.

    2. Tokens are distributed proportionally based on points across chains.

  4. Epoch Management:

    1. Rewards are distributed during epoch executions based on points on each chain.

    2. Wormhole's Cross-Chain Query (CCQ) gathers data about locked tokens across chains.

Technology Stack

  • Circle CCTP: Used for transferring fee tokens across chains.

  • Wormhole: Provides the messaging infrastructure for cross-chain communications.

  • Wormhole CCQ: Enables querying of lock points data from other chains.

4. Integration with 1inch/Solvers

FeeManager leverages external liquidity sources to optimize token swaps.

  • Offchain Solvers: Integration with 1inch and potentially other solvers for optimized swap routing

  • Swap Safety:

    • SwapperLib.swapSafe() enforces validation rules.

    • External calldata checker verifies swap transactions.

    • Token approvals are managed automatically.

  • Permissioned Access: Only authorized harvester addresses can execute swaps.

  • Swap Verification:

    • Validates input/output tokens match expected values.

    • Strict swap parameter validation prevents malicious transactions.


The FeeManager's cross-chain architecture enables Curvance to maintain a unified fee management system across multiple blockchains, ensuring proportional reward distribution and efficient token handling throughout the protocol ecosystem.

Last updated