Contract 40b76bc2136e3d31aee9c4208d09e2612786d6c0d3853ca3ef387db89e0a189c

← Back to Index 📥 Download WASM

Meta

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

Interface

fn debt(env: soroban_sdk::Env) -> i128
fn owner(env: soroban_sdk::Env) -> soroban_sdk::Address
fn repay(env: soroban_sdk::Env, amount: i128, refund_to: soroban_sdk::Address) -> i128
fn venue(env: soroban_sdk::Env) -> soroban_sdk::Address
fn health(env: soroban_sdk::Env) -> Wad
fn upgrade(env: soroban_sdk::Env, new_wasm_hash: soroban_sdk::BytesN<32>)
fn snapshot(env: soroban_sdk::Env) -> VenueSnapshot
fn collateral(env: soroban_sdk::Env) -> i128
fn debt_asset(env: soroban_sdk::Env) -> soroban_sdk::Address
fn flash_open(
    env: soroban_sdk::Env,
    receiver: soroban_sdk::Address,
    borrow_amount: i128,
    expected_collateral: i128,
    min_health: Wad,
) -> VenueSnapshot

owner is the broker (lock-borrow); venue the Blend pool; the asset pair is fixed for the account's lifetime (one hedge triple).

fn __constructor(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    venue: soroban_sdk::Address,
    collateral_asset: soroban_sdk::Address,
    debt_asset: soroban_sdk::Address,
)
fn collateral_asset(env: soroban_sdk::Env) -> soroban_sdk::Address
fn supply_and_borrow(
    env: soroban_sdk::Env,
    collateral_amount: i128,
    borrow_amount: i128,
    to: soroban_sdk::Address,
    min_health: Wad,
) -> VenueSnapshot

Blend caps an over-ask at the position's balance and says so nowhere in its return — the funds simply arrive short. So the withdrawal is routed to this account rather than straight to to, the balance delta is measured, and that is what gets forwarded and reported. One extra transfer buys a number the caller can trust; taking amount on faith made every consumer of it wrong the moment a position was over-asked.

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

Imports

WebAssembly Text (WAT) ▶