FXD Smart Contract Architecture

Fathom Protocol Smart Contract Architecture

The structure comprises distinct modules, each responsible for a set of defined operations.

Core Components

  1. Proxy Module: Interfaces for the core contracts of the protocol.

    • ProxyWallet: Calls functions within the FathomProxyActions contract for user interactions.

    • ProxyActionsStorage: Stores the address of the FathomProxyActions contract.

    • ProxyWalletRegistry: Oversees the creation of proxy wallets owned by users.

  2. Position Module: Handles the creation and tracking of user positions.

    • PositionManager: Initiates user positions and maintains a record of them.

  3. Stablecoin Core Module: Central to the management of the FXD stablecoin's lifecycle.

    • BookKeeper: Monitors and manages each position's locked collateral and debt share.

    • CollateralPoolConfig: Manages configurations for collateral pools.

    • StablecoinAdapter: Oversees the minting and burning functions of the FathomStablecoin contract.

  4. StableSwapModule: Supports the provision of liquidity and the execution of FXD<->xUSDT 1:1 swaps.

    • StableSwapModuleWrapper: Integrates and administers the protocol's liquidity pools.

  5. Price Module: Delivers accurate price information for assets.

    • PriceFeed: Gathers price data from price source and feeds it into the protocol.

    • PriceOracle: Transforms raw price from PriceFeed to include a safety margin, using the LTV ratio.

  6. Liquidation Module: Maintains the protocol's financial health by managing under-collateralized positions.

    • LiquidationEngine: Carries out the liquidation process according to predefined rules.

    • FixedSpreadLiquidationStrategy: Directs liquidation activities, ensuring consistency through a fixed spread.

  7. Emergency Module: Pause or Terminate the protocol.

    • ShowStopper: Stops and terminates the whole protocol and executes the emergency shutdown process to return collateral

    • AdminControls: Pauses the protocol at once.

Last updated

Copyright© Fathom App 2024.