FXD Smart Contract Architecture
Last updated
Last updated
Copyright© Fathom App 2024.
The structure comprises distinct modules, each responsible for a set of defined operations.
Core Components
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.
Position Module: Handles the creation and tracking of user positions.
PositionManager: Initiates user positions and maintains a record of them.
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.
StableSwapModule: Supports the provision of liquidity and the execution of FXD<->xUSDT 1:1 swaps.
StableSwapModuleWrapper: Integrates and administers the protocol's liquidity pools.
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.
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.
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.