The main components of the application are
- GammaPoolFactory - instantiates GammaPools for different CFMMs
- GammaPools - smart contracts that interact with CFMMs. There’s a GammaPool per CFMM per protocolId.
- Srategies - They define the behavior of the GammaPool through delegated function calls
- PositionManager - aggregates function calls to the GammaPools to ensure a safe atomic execution.
- Observers - Extend functionality of the GammaPools using other contracts
- GammaPoolFactory
- Constructor
- Description
- Registering GammaPool Implementations
- Creating GammaPools
- Data Flow
- Fees
- Dynamic Origination Fees and External Swap Fees
- Pausing & Unpausing GammaPool Functions
- Rate Params
- Inheritance Tree
- GammaPool
- Constructor
- Description
- Data Flow
- Inheritance Tree
- Storage Global State Variables
- Loan State Variable
- Loan Creation
- Loan TokenId Authentication’
- Interest Rate Model
- Origination Fee Model
- PoolViewer
- Description
- Inheritance Tree
- Functions
- GammaPoolExternal
- Description
- Functions
- Inheritance Tree
- AbstractRateModel
- Description
- Utilization Rate
- Abstract functions
- Inheritance Tree
- LogDerivativeRateModel
- Description
- Constructor
- Borrow Rate Formula
- Parameter Validation
- Inheritance Tree
- AbstractRateParamsStore
- Description
- RateParams Struct
- Validate & Set Parameters
- Get Parameters
- Inheritance Tree
- BaseStrategy
- Description
- Interest index Updates
- Protocol Fees (Mint to Devs)
- Loan interest update
- Abstract Rate Model
- Abstract Function descriptions
- Inheritance Tree of Strategy implementations
- BaseLongStrategy
- Description
- Hash Margin
- Opening Loan
- Paying Loan
- Updating Collateral
- Abstract Function Descriptions
- BaseRebalanceStrategy
- Description
- Check Margin
- Rebalance Collateral
- Withdraw Collateral
- Abstract Functions
- BaseBorrowStrategy
- Description
- Opening Loan
- Calculate Origination Fee
- Mint Origination Fee to Devs
- BaseRepayStrategy
- Description
- Paying Loan
- Writing Down Debt
- ShortStrategy
- Description
- Depositing Liquidity
- First Deposit Mint to Zero Address
- Withdrawing Liquidity
- Total Assets
- Abstract Function Descriptions
- Inheritance tree of short strategy Implementations
- ShortStrategyERC4626
- Description
- ERC4626 Functions
- Inheritance Tree
- ShortStrategySync
- Description
- Synchronizing
- BorrowStrategy
- Description
- Creating a Loan
- Adding Collateral
- Removing Collateral
- Borrowing Liquidity