The main components of the application are

  1. GammaPoolFactory
    1. Constructor
    2. Description
    3. Registering GammaPool Implementations
    4. Creating GammaPools
    5. Data Flow
    6. Fees
    7. Dynamic Origination Fees and External Swap Fees
    8. Pausing & Unpausing GammaPool Functions
    9. Rate Params
    10. Inheritance Tree
  2. GammaPool
    1. Constructor
    2. Description
    3. Data Flow
    4. Inheritance Tree
    5. Storage Global State Variables
    6. Loan State Variable
    7. Loan Creation
    8. Loan TokenId Authentication
    9. Interest Rate Model
    10. Origination Fee Model
  3. PoolViewer
    1. Description
    2. Inheritance Tree
    3. Functions
  4. GammaPoolExternal
    1. Description
    2. Functions
    3. Inheritance Tree
  5. AbstractRateModel
    1. Description
    2. Utilization Rate
    3. Abstract functions
    4. Inheritance Tree
  6. LogDerivativeRateModel
    1. Description
    2. Constructor
    3. Borrow Rate Formula
    4. Parameter Validation
    5. Inheritance Tree
  7. AbstractRateParamsStore
    1. Description
    2. RateParams Struct
    3. Validate & Set Parameters
    4. Get Parameters
    5. Inheritance Tree
  8. BaseStrategy
    1. Description
    2. Interest index Updates
    3. Protocol Fees (Mint to Devs)
    4. Loan interest update
    5. Abstract Rate Model
    6. Abstract Function descriptions
    7. Inheritance Tree of Strategy implementations
  9. BaseLongStrategy
    1. Description
    2. Hash Margin
    3. Opening Loan
    4. Paying Loan
    5. Updating Collateral
    6. Abstract Function Descriptions
  10. BaseRebalanceStrategy
    1. Description
    2. Check Margin
    3. Rebalance Collateral
    4. Withdraw Collateral
    5. Abstract Functions
  11. BaseBorrowStrategy
    1. Description
    2. Opening Loan
    3. Calculate Origination Fee
    4. Mint Origination Fee to Devs
  12. BaseRepayStrategy
    1. Description
    2. Paying Loan
    3. Writing Down Debt
  13. ShortStrategy
    1. Description
    2. Depositing Liquidity
    3. First Deposit Mint to Zero Address
    4. Withdrawing Liquidity
    5. Total Assets
    6. Abstract Function Descriptions
    7. Inheritance tree of short strategy Implementations
  14. ShortStrategyERC4626
    1. Description
    2. ERC4626 Functions
    3. Inheritance Tree
  15. ShortStrategySync
    1. Description
    2. Synchronizing
  16. BorrowStrategy
    1. Description
    2. Creating a Loan
    3. Adding Collateral
    4. Removing Collateral
    5. Borrowing Liquidity