Contract e24384106303a32c2298af875978e649c4f948a8d9ad3fba7ced8d7fc9c2c72f

← Back to Index 📥 Download WASM

Meta

cliver 25.2.0#28484880988199233a7e8e87c97cb12dac323cb3
rssdkver 22.0.11#34f7f53ae31e0fd02aab436a9872e79fa671ca02
rsver 1.93.0

Instances

  • CDF37Z2B5JDF5UB3I3Y3COFTH3I3JF3ECKKIXDZBOUAVEO7LN5LH2SXN
  • CDITBCJV22JTYF7CXO443HJYOSXQCMJ45Z3MDWDVNPKLTO2MXWMYAUUJ

Interface

fn asset(env: soroban_sdk::Env) -> soroban_sdk::Address

Returns the underlying asset value of from's shares.

fn balance(env: soroban_sdk::Env, from: soroban_sdk::Address) -> i128

Deposit amount of underlying into Blend. Returns shares minted to from.

Share math:

  • First depositor (total_shares == 0): shares = amount (1:1 bootstrap).
  • Subsequent: shares = delta_value * total_shares / value_before_deposit. Rounding DOWN — protects existing depositors from dilution due to rounding.
fn deposit(env: soroban_sdk::Env, amount: i128, from: soroban_sdk::Address) -> i128

Claim BLND emissions, swap via Soroswap → asset, then redeposit into Blend. Share price rises for all holders; no per-user distribution.

No-op if total_shares == 0 (prevents a 1-wei first-depositor from harvesting pre-accrued emissions for free).

fn harvest(env: soroban_sdk::Env, from: soroban_sdk::Address) -> i128
fn registry(env: soroban_sdk::Env) -> soroban_sdk::Address

Burn shares_to_burn shares held by from, pay out proportional underlying to to.

amount parameter is REUSED as shares_to_burn under the v4 share model. Do not pass underlying amount.

Reverts if shares_to_burn > Shares(from) — fixes the C2 drain.

fn withdraw(
    env: soroban_sdk::Env,
    amount: i128,
    from: soroban_sdk::Address,
    to: soroban_sdk::Address,
) -> i128

One-time initializer.

  • registry — strategy-registry contract; gates authorized callers.
  • asset — base asset handled by this strategy (e.g. USDC SAC).
  • blend_pool — Blend V2 pool contract this strategy supplies to.
  • reserve_index — index of asset within the pool's reserve list.
  • reward_token — BLND emission token contract.
  • soroswap_router — Soroswap router contract (reward compound).
  • soroswap_first_pair — pair contract of (swap_path[0], swap_path[1]).
  • swap_path — must start with reward_token, end with asset, length ≥ 2.
fn initialize(
    env: soroban_sdk::Env,
    registry: soroban_sdk::Address,
    asset: soroban_sdk::Address,
    blend_pool: soroban_sdk::Address,
    reserve_index: u32,
    reward_token: soroban_sdk::Address,
    soroswap_router: soroban_sdk::Address,
    soroswap_first_pair: soroban_sdk::Address,
    swap_path: soroban_sdk::Vec,
)

Convenience: share price scaled by 10^7 (1.0 = 10_000_000).

fn share_price(env: soroban_sdk::Env) -> i128

Total shares outstanding across all depositors.

fn total_shares(env: soroban_sdk::Env) -> i128

Share balance for a specific keeper.

fn share_balance(env: soroban_sdk::Env, from: soroban_sdk::Address) -> i128

Imports

WebAssembly Text (WAT) ▶