Mathematical Security Model
Osito Protocol's mathematical security model calculates safe lending limits without relying on oracles or price feeds. This model addresses the question: "how much BERA could be extracted in the worst-case scenario?" to ensure protocol solvency.
The Core Borrow Limit Formula
The central formula that enables Osito's oracle-free lending approach is:
max_borrow = pool_BERA - extractable_BERA
Where:
pool_BERA
is the BERA locked in the liquidity poolextractable_BERA
is the maximum BERA that could be extracted by selling all circulating tokens into the pool
This formula ensures that the protocol remains solvent even in worst-case scenarios.
Extraction Calculations
The calculation for extractable_BERA
depends on the AMM pool type:
For CPMM Pools (Constant Product Market Maker)
extractable_BERA = (pool_BERA * pool_tokens) / (pool_tokens + dumpable_tokens)
Where:
pool_BERA
is the BERA in the poolpool_tokens
is the tokens in the pooldumpable_tokens
= total_supply - pool_tokens - total_staked - total_deposited
This applies the constant product formula (x*y=k) to determine the result of selling all dumpable tokens into the pool.
For CLMM Pools (Concentrated Liquidity Market Maker)
extractable_BERA = (dumpable_tokens * pool_BERA/pool_tokens / 2)
This accounts for the price impact in CLMM pools.
Numerical Example
Here's how these calculations work in practice:
Initial Conditions:
pool_BERA
= 1,000 BERApool_tokens
= 10,000 TOKENtotal_supply
= 20,000 TOKENtotal_staked
= 2,000 TOKENtotal_deposited
= 3,000 TOKEN
Calculation:
dumpable_tokens
= 20,000 - 10,000 - 2,000 - 3,000 = 5,000 TOKENextractable_BERA
= (1,000 * 10,000) / (10,000 + 5,000) = 10,000,000 / 15,000 = 666.67 BERAmax_borrow
= 1,000 - 666.67 = 333.33 BERA
In this example, the protocol can safely lend 333.33 BERA against this token.
Position-Level Borrow Limits
For individual positions, the borrow limit is calculated as:
position_max_borrow = (tokens_in_position / total_tokens_deposited) * max_borrow
This formula ensures that each position's borrowing limit is proportional to its share of the total deposited tokens.
Non-Monotonic Borrowing Power
The lending formula creates an interesting economic dynamic where:
- Depositing tokens reduces dumpable supply, potentially increasing the global borrowing limit
- But also dilutes individual borrowing power as total deposits increase
This creates the rationale for staking as a separate activity from borrowing, providing a way to reduce dumpable supply without diluting borrowing power.
Key Protocol Requirements
This mathematical model necessitates several protocol features:
1. Fixed Supply Requirement
Tokens must have fixed supply because:
- The
dumpable_tokens
calculation requires a known total supply - Variable supply would make it impossible to calculate safe lending limits
2. Real-Time Risk Assessment
Since extraction depends on current pool states, the protocol:
- Re-queries pool data at each significant interaction
- Recalculates borrowing limits
- Adjusts lending parameters in real-time
3. Liquidation Mechanism
The liquidation system follows from the model:
- Positions become liquidatable when borrowed BERA exceeds recalculated max borrow
- Liquidators ensure protocol solvency by closing underwater positions
Benefits of the Mathematical Approach
This mathematical approach provides several advantages:
- No Oracle Dependence: No price feeds that can be manipulated or fail
- Minimal Governance Requirements: Few subjective decisions about token quality or parameters
- Permissionless Integration: Any token meeting objective criteria can be used
- Verifiable Security: Lending limits based on observable on-chain data
The Revolutionary Implications
This mathematical approach provides several revolutionary advantages:
- Zero Oracle Dependence: No price feeds that can be manipulated or fail
- No Governance Risk: No subjective decisions about token quality or parameters
- Permissionless Integration: Any token meeting objective criteria can be used immediately
- Mathematical Certainty: Security guarantees based on pure mathematics
By deriving everything from a single adversarial design principle, Osito creates a lending system that's fundamentally different from and more resilient than traditional DeFi lending protocols.