Yield - Core Mechanics
1. The Vault Engine
At the core of YieldShade is a secure vault managed by a smart contract. It uses a staking ledger model to track user shares, eliminating the need for secondary receipt tokens.
User Deposit: A user deposits SOL or USDC.
Share Granting: The user is granted "share points" in the vault's internal ledger, representing their proportional ownership of the pool based on the TVL at the time of deposit.
Value Accrual: As the vault earns yield, the overall TVL increases. The value of each share point grows accordingly.
User Withdrawal: Upon withdrawal, the user receives a payout equal to their share of the current TVL, netting them their principal plus accrued yield, minus fees.
2. The Dynamic Allocation Engine
The protocol's deposit() function acts as an intelligent filter, determining the optimal use of assets.
Calculation:
Let
TotalStakedSOL = S,TotalStakedUSDC = U,CurrentSOLPrice = P.The ideal USDC to pair with all SOL is
S * P.Case 1: Excess USDC (
U >= S * P): All SOL is paired withS * PUSDC on Orca. Residual USDC (U - (S * P)) is lent on Jupiter.Case 2: Excess SOL (
U < S * P): All USDC is paired withU / PSOL on Orca. Residual SOL (S - (U / P)) is lent on Jupiter.
Execution:
Orca Integration: The calculated amounts are deployed as concentrated liquidity, earning trading fees.
Jupiter Lend Integration: Residual assets are supplied to the lending market, earning interest.
Example Scenario:
TVL: 100 SOL, 20,000 USDC. Price: $180.
Ideal USDC = 100 * 180 = 18,000 USDC.
Action: Add 100 SOL & 18,000 USDC to Orca. Lend 2,000 USDC on Jupiter.
New Deposit: User deposits 20 SOL.
New TVL: 120 SOL, 20,000 USDC. Ideal USDC = 21,600 USDC.
Action: Withdraw 2,000 USDC from Jupiter. Add 11.11 SOL & 2,000 USDC liquidity on Orca. Lend the remaining 8.89(20 - 11.11) SOL on Jupiter.
Withdraw: User withdraws 10 SOL
Action: Remove 10 SOL + 1,800 USDC liquidity on Orca. Return 10 SOL + reward to user and lend 1,800 USDC on Jupiter.
3. Withdrawal Mechanics
The withdraw() function calculates the user's share of the current TVL, then seamlessly removes the necessary liquidity from Orca and withdraws assets from Jupiter Lend to fulfill the withdrawal request.
Last updated