Reserve parameters
Each asset in a pool is a reserve with its own configuration. All of these values freeze when the pool leaves setup, and the only change possible afterwards is switching the reserve off.
Rates and factors are stored with 7 decimals, so 10000000 means 100% and 1000 means 0.01%.
| Parameter | What it does |
|---|---|
index |
The reserve's position in the pool's list |
decimals |
The token's decimals. Read this from the token rather than assuming 7: deJAAA has 18 |
c_factor |
Share of the asset's value that counts as collateral. 0 means the asset cannot back a loan |
l_factor |
Scales borrowed value. Debt counts as value / l_factor, and 0 means the asset cannot be borrowed |
util |
Target utilization, where the interest curve first steepens |
max_util |
Borrows that would take utilization above this fail |
r_base, r_one, r_two, r_three |
Interest curve, below |
reactivity |
How fast the rate modifier responds to utilization. 0 keeps the curve fixed |
supply_cap |
Largest total supply, enforced on deposits. It can never be lowered, so an unsized cap stays unsized |
min_position |
Smallest non-zero collateral position, in the token's own units. 0 disables the check |
enabled |
Whether new deposits and borrows are accepted. It can only go from on to off |
Choosing factors
The maximum loan-to-value on-chain is c_factor x l_factor. With l_factor at 100%, that equals the collateral factor.
c_factor also bounds the lenders' side. Once a position can be liquidated, the collateral can fall a further 1 - c_factor before the debt exceeds it: 20% at 80%, and only 5% at 95%. A high c_factor only makes sense for an asset that moves very little and can be sold within the auction clock of about 35 minutes.
The maximum liquidation incentive follows from the same number: (1 - c_factor) / 2, which is 10% at 80% and 2.5% at 95%.
Interest curve
The borrow rate depends on utilization, the share of the reserve that is lent out:
| Utilization | Borrow rate before the modifier |
|---|---|
Up to util |
r_base + (utilization / util) x r_one |
util to 95% |
r_base + r_one + ((utilization - util) / (95% - util)) x r_two |
| Above 95% | r_base + r_one + r_two + ((utilization - 95%) / 5%) x r_three |
In the first two ranges the whole rate is multiplied by the rate modifier. In the last range the modifier applies to r_base + r_one + r_two, and the r_three part is added on top. The modifier starts at 1 and moves according to reactivity, between 0.1 and 10.
r_base cannot go below 0.01% (1000).
Example: USDC in the XLM/USDC market
util is 90%, reactivity is 0, and r_base, r_one, r_two and r_three are 0.01%, 7.99%, 12% and 12%:
| Utilization | Borrow rate |
|---|---|
| 0% | 0.01% |
| 90% | 8% |
| 95% | 20% |
| 100% | 32% |
Reactivity 0 means the modifier never moves, so these numbers are the rates at those points for the life of the market.
Sizing the supply cap
The size of a position that can be cleared safely depends on how much collateral can be sold on Stellar within the auction clock, and on the capital liquidators have available. It does not depend on how much lenders are willing to deposit. Size the cap to the collateral's market depth, as Lending economics explains.