Contract 8fe8af0476ec2f270bb65bb88b4cebdaa336904a7fff93b3d1551958d742baa0

← Back to Index 📥 Download WASM

Meta

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

Instances

  • CBZCO4W656T3XOGNDLVKYBVXUTESLE67653I536G4BKFOTQEMVQREJHS
  • CDISU2PPKHTYPBBC6BJOLZLOCJB6PXVYU4LV6CUS4VOEUQ4Q5WTEJ2Z4
  • CDSD4WT5ZCND3PSZ7A3EXU2FO4O3TCWR7IAJJHMWA2HYHEMQ62AEX5DD

Interface

fn admin(env: soroban_sdk::Env) -> soroban_sdk::Address
fn owner(env: soroban_sdk::Env) -> soroban_sdk::Address

Pause invest/rebalance (withdraw stays open). Auth: admin.

fn pause(env: soroban_sdk::Env)

Pull asset, deposit across allocations by weight, record positions. Auth: owner. T1: USDC-only, every swap == None.

fn invest(
    env: soroban_sdk::Env,
    asset: soroban_sdk::Address,
    total: i128,
    allocations: soroban_sdk::Vec,
) -> Result<(), soroban_sdk::Error>

Emergency: pull a vault's funds to the Owner if its protocol bricks redeem. Auth: admin. No fee; callable even when Paused.

fn rescue(
    env: soroban_sdk::Env,
    vault: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>

Lift the pause. Auth: admin.

fn unpause(env: soroban_sdk::Env)

Replace the contract Wasm. Auth: admin (checked BEFORE the swap).

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

Withdraw amount (underlying; i128::MAX = whole position) from one vault back to the owner. Auth: owner. Allowed even when Paused. T1: Raw only.

fn withdraw(
    env: soroban_sdk::Env,
    vault: soroban_sdk::Address,
    amount: i128,
    out: WithdrawOut,
) -> Result<(), soroban_sdk::Error>
fn is_paused(env: soroban_sdk::Env) -> bool

Ledger state + raw shares_held per open vault. Display value is computed off-chain (no on-chain value read — docs/02 §4.3).

fn positions(env: soroban_sdk::Env) -> soroban_sdk::Vec

Withdraw every position in full + drain caller-named idle assets. Skips a vault whose redeem reverts (exit-liveness). Auth: owner.

fn withdraw_all(
    env: soroban_sdk::Env,
    out: WithdrawOut,
    extra_idle: soroban_sdk::Vec,
) -> Result<(), soroban_sdk::Error>

Deploy-time init (Protocol-22 __constructor, atomic with deploy). Writes Owner/Admin/Registry + AutoRebalance=false/Paused=false; Nonce/ RebalanceOn/ActiveDeltaBps follow the read-default rule (UPG-1).

fn __constructor(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    admin: soroban_sdk::Address,
    registry: soroban_sdk::Address,
)
fn auto_rebalance(env: soroban_sdk::Env) -> bool

Convert idle asset_inasset_out via the whitelisted router (measured output ≥ amount_out_min). Auth: owner or keeper. Nonce-guarded.

fn rebalance_swap(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    nonce: u64,
    asset_in: soroban_sdk::Address,
    asset_out: soroban_sdk::Address,
    amount_in: i128,
    swap: SwapLeg,
) -> Result<(), soroban_sdk::Error>

Emit a RebalanceNoOp receipt (target breached, no feasible move). Auth: owner or keeper. No state change; consumes no nonce.

fn note_no_rebalance(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    reason: soroban_sdk::Symbol,
    observed_bps: u32,
    target_bps: u32,
) -> Result<(), soroban_sdk::Error>

Deposit idle asset into a whitelisted active vault (debt-free). Auth: owner or keeper. Nonce-guarded.

fn rebalance_deposit(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    nonce: u64,
    vault: soroban_sdk::Address,
    asset: soroban_sdk::Address,
    amount: i128,
) -> Result<(), soroban_sdk::Error>

Redeem from a vault → fee → keep proceeds idle. Auth: owner or Registry keeper (gated by AutoRebalance + keeper_enabled). Nonce-guarded.

fn rebalance_withdraw(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    nonce: u64,
    vault: soroban_sdk::Address,
    amount: i128,
) -> Result<(), soroban_sdk::Error>

Opt in to keeper-driven rebalance (settle OFF→ON, snapshot the surcharge). Auth: owner. Idempotent.

fn enable_auto_rebalance(env: soroban_sdk::Env)

Opt out (settle ON→OFF) — the owner's instant kill-switch. Auth: owner.

fn disable_auto_rebalance(env: soroban_sdk::Env)

Imports

WebAssembly Text (WAT) ▶