Contract f26f973ccd217325c752c974c14d223cf3b72e757bbf628c0588bafd7c5da9d3

← Back to Index 📥 Download WASM

Meta

cliver 27.0.0#5a7c5fe76530bf4248477ac812fc757146b98cc4
rssdkver 26.1.0#175aa41306f383057a8cdfc84b68d931664fc34e
rsver 1.96.0

Instances

  • CCCRYAU6VVEUW55RHV7GG36XYUSIDQO5PHWAG4Z4AETUZTW6IHMV5A5P

Interface

fn vamm(env: soroban_sdk::Env) -> soroban_sdk::Address
fn admin(env: soroban_sdk::Env) -> soroban_sdk::Address
fn pause(env: soroban_sdk::Env)
fn engine(env: soroban_sdk::Env) -> soroban_sdk::Address
fn unpause(env: soroban_sdk::Env)

Replace the contract's wasm (admin-gated). Address and storage are kept.

fn upgrade(env: soroban_sdk::Env, new_wasm_hash: soroban_sdk::BytesN<32>)
fn is_paused(env: soroban_sdk::Env) -> bool

Transfer the admin role to new_admin (current admin only). The deploy hands LockYield over to the governance timelock this way once its owner-driven setup has run.

fn set_admin(env: soroban_sdk::Env, new_admin: soroban_sdk::Address)

Set the pause flag (admin only). The bool shape is what the governance guardian's guardian_pause(target, paused) invokes, so LockYield is reachable by the same emergency brake as the engine; pause / unpause are the no-arg sugar over it.

Once enable_emergency has run, the pause can no longer be lifted through either shape — emergency is irreversible and implies pause.

fn set_paused(env: soroban_sdk::Env, paused: bool)

Storage/schema version, bumped by a post-upgrade migration when the layout changes.

fn get_version(env: soroban_sdk::Env) -> u32
fn revoke_pool(env: soroban_sdk::Env, pool_id: PoolId)
fn approve_pool(env: soroban_sdk::Env, pool_id: PoolId)
fn get_position(env: soroban_sdk::Env, position_id: u32) -> Option
fn positions_of(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
) -> soroban_sdk::Vec

Global config: admin (whitelist / pause / wrapper config), the shared collateral_engine, and the vamm manager.

fn __constructor(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    collateral_engine: soroban_sdk::Address,
    vamm: soroban_sdk::Address,
)

Fee buffer for principal in pool_id at the current time (0 once matured).

fn calculate_fee(
    env: soroban_sdk::Env,
    pool_id: PoolId,
    principal: i128,
) -> Result
fn reapprove_pool(env: soroban_sdk::Env, pool_id: PoolId)

Open a locked-yield position. Returns (position_id, locked_fixed_rate, fee, price_after).

fn open_lock_yield(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    pool_id: PoolId,
    principal: i128,
    sqrt_price_limit: SqrtPriceX96,
) -> Result<(u32, Wad, i128, SqrtPriceX96), soroban_sdk::Error>

Enable emergency mode (irreversible) and pause new positions.

fn enable_emergency(env: soroban_sdk::Env)
fn is_pool_approved(env: soroban_sdk::Env, pool_id: PoolId) -> bool
fn next_position_id(env: soroban_sdk::Env) -> u32

Settle a matured position and pay out the owner. Requires the engine to have settled the position first (two-step: engine settle_position, then this).

fn settle_lock_yield(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    position_id: u32,
) -> Result

Sweep stuck tokens; only while emergency mode is on.

fn emergency_withdraw(
    env: soroban_sdk::Env,
    token: soroban_sdk::Address,
    amount: i128,
    recipient: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>

Position plus live (fixed_token_balance, variable_token_balance) from the engine.

Both are the engine's stored balances, so the variable one is in the pool's term-start-anchored tokens — smaller than the notional the position was opened for by the accrued factor. It is not a notional and must not be quoted or traded as one.

fn get_position_stats(
    env: soroban_sdk::Env,
    position_id: u32,
) -> Result<(Position, i128, i128), soroban_sdk::Error>
fn is_emergency_enabled(env: soroban_sdk::Env) -> bool

Settle up to MAX_BATCH_SIZE positions, returning the total payout.

fn batch_settle_lock_yield(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    position_ids: soroban_sdk::Vec,
) -> Result

Imports

WebAssembly Text (WAT) ▶