π§βπ»Technical Details
This section provides a deeper technical understanding of how Oasis works. While not necessary for using the platform, these details offer insights into the mathematical foundations and mechanisms that ensure the protocol's security and efficiency.
Core Mathematical Framework
Position Value Calculations
When you provide liquidity, several key values are calculated:
Initial Position Setup
For a deposit amount D_token:
HTR_matched = D_token / P_htr_iWhere:
D_token: Initial token deposit amountP_htr_i: Initial HTR priceHTR_matched: Amount of HTR matched by Oasis
Bonus Calculation
HTR_bonus = (D_token Γ Bonus_rate) / P_htr_iWhere:
Bonus_rate: Set by lock duration (10%, 15%, or 20%)HTR_bonus: Amount of bonus HTR tokens received
Protection Mathematics
Value Preservation Model
The protocol maintains constant product AMM mathematics:
x Γ y = KWhere:
x: Token amount in pool
y: HTR amount in pool
K: Constant product
Price Ratio Calculations
R = P_htr_f / P_token_fWhere:
P_htr_f: Final HTR priceP_token_f: Final token priceR: Price ratio
Protection Calculations
Value Deficit Calculation
Token_deficit = max(0, D_token - x_f)Where:
x_f: Final token balanceToken_deficit: Amount requiring protection
Protection Payment
When protection applies:
HTR_protection = Token_deficit / P_htr_fLiquidity Pool Mechanics
Pool Balance Adjustments
For any new price ratio R, new pool balances are calculated as:
y/x = R
x Γ y = KTherefore:
x = sqrt(K/R)
y = x Γ RPool Value Protection
Protection ensures that for any price movement within 4x:
withdrawal_value β₯ initial_deposit_valueWhere withdrawal_value includes:
Original token amount (or equivalent)
Protection compensation in HTR
Accumulated trading fees
Return Calculations
Total Position Value
For positions with held bonus:
V_total_hold = LP_value + (B_htr Γ P_htr_f)For positions with sold bonus:
V_total_sell = LP_value + (B_htr Γ P_htr_i)Where:
LP_value: Liquidity position valueB_htr: Bonus HTR amountP_htr_f: Final HTR priceP_htr_i: Initial HTR price
Return Metrics
Percentage return calculation:
Return_% = ((V_total / D_token) - 1) Γ 100Risk Management
Protection Boundaries
Full Protection Range:
Up to 4x price divergence
Complete value preservation
Automatic calculation
Reserve Management
The protocol maintains:
HTR reserve for each pool
Automated matching system
Protection reserve allocation
Dynamic capacity management (new HTR deposits can be made to increase the reserve available)
Market Simulation Model
Return Scenario Calculations
The simulation tool models returns using:
Price movement inputs:
HTR price change
Token price change (for hBTC)
Strategy comparisons:
Hold bonus path
Immediate sell path
Protection impacts
Fee accumulation
Performance Characteristics
Operational Parameters
Transaction Processing:
Instant matching
Automatic protection
Real-time calculations
Value Tracking:
Continuous monitoring
Price feed integration
Protection threshold checks
Additional Resources
Last updated
Was this helpful?