deepbook-margin-pool
Installation
SKILL.md
DeepBook Margin: Margin Pool & Interest Rates
The MarginPool is a shared object that manages lending liquidity for a specific asset type. Suppliers deposit assets to earn variable interest compounded dynamically on every state-changing operation.
1. Interest Rate & Utilization Model
DeepBook Margin implements a piecewise linear ("kinked") interest rate curve:
Formula
- If $\text{Utilization} < \text{OptimalUtilization}$: $$\text{BorrowRate} = \text{BaseRate} + \text{Utilization} \times \text{BaseSlope}$$
- If $\text{Utilization} \ge \text{OptimalUtilization}$: $$\text{BorrowRate} = \text{BaseRate} + \text{OptimalUtilization} \times \text{BaseSlope} + (\text{Utilization} - \text{OptimalUtilization}) \times \text{ExcessSlope}$$