Kodiak Integration
Osito Protocol's borrowing limit calculations rely on direct integration with Kodiak liquidity pools for real-time data access. This page explains how this integration works.
Core Integration
Osito integrates with both Kodiak CPMM (Constant Product Market Maker) and CLMM (Concentrated Liquidity Market Maker) programs to access liquidity pool data.
Real-Time Data Access
Pool Data Used in Calculations
The protocol's core formula requires specific data from Kodiak pools:
max_borrow = pool_wBERA - (pool_wBERA * pool_tokens) / (pool_tokens + dumpable_tokens)
Where:
pool_wBERA
is the wBERA locked in the liquidity pool by burned LP tokenspool_tokens
is the quantity of tokens locked in the pool by burned LPdumpable_tokens
is calculated as: total_supply - pool_tokens - total_staked - total_deposited
Just-In-Time Querying
The protocol re-queries Kodiak pool data at each critical operation:
- When depositing collateral
- When withdrawing collateral
- When borrowing wBERA
- When repaying borrowed wBERA
This ensures lending limits always reflect current market conditions without relying on external oracles.
Worst-Case Scenario Calculations
Simulation Logic
The formula simulates a worst-case scenario where all circulating tokens (not in the pool, not staked, not deposited as collateral) are sold into the liquidity pool at once.
It uses the constant product AMM formula (x*y=k) to calculate the resulting price impact, determining how much wBERA would remain in the pool after such an event.
By limiting borrowing to less than this amount, the protocol ensures it can remain solvent even in this extreme scenario.
Qualification Criteria
Token Requirements
For a token to be eligible as collateral in Osito, it must meet two verifiable, objective criteria:
- Verified Deployer: The token must be deployed by one of the trusted launchpads (Panda Factory or Ramen) that ensure tokens have verifiably fixed supply. On-chain verification of fixed supply is impossible with ERC20 unless the deployer is trusted.
- Verifiably Burned LP: A portion of the token's liquidity pool tokens must be permanently destroyed
These criteria are programmatically verified on-chain, requiring no subjective assessment or governance decisions.
Practical Benefits
No Oracle Dependencies
By reading Kodiak pool data directly, Osito eliminates the need for price oracles that can be manipulated or fail.
Real-Time Accuracy
Fresh pool values are fetched at the exact moment they're needed, ensuring borrowing limits always reflect current market conditions.
No Governance Required
The objective qualification criteria eliminate the need for governance votes to approve new collateral types.
Mathematical Risk Management
Risk is managed through pure mathematics rather than subjective assessments, creating a truly permissionless system.