Contract e4eca1406cc39d8030033faa78aa8133aa2fda5360759b8515b6a0229e4b2a2d

← Back to Index 📥 Download WASM

Meta

cliver 25.1.0#a048a57a75762458b487052e0021ea704a926bee
rssdkver 25.0.2#59a2e01a26f9330f8d516690911cb2ca87a6f1b3
rsver 1.89.0

Interface

Initialize the pool contract

Arguments

  • admin - Address authorized to trigger settlements
  • seller - Address that receives settlement payouts
  • fee_percent - Fee percentage in basis points (200 = 2%)
  • usdc_token - USDC token contract address
fn initialize(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    seller: soroban_sdk::Address,
    fee_percent: u32,
    usdc_token: soroban_sdk::Address,
)

Set Blend pool addresses (admin only)

fn set_blend_pools(
    env: soroban_sdk::Env,
    blend_pool_usdc: soroban_sdk::Address,
    blend_pool_xlm: soroban_sdk::Address,
)

Deposit funds for an order (buyer calls directly) Transfers tokens from buyer to contract and tracks deposit

fn deposit(
    env: soroban_sdk::Env,
    buyer: soroban_sdk::Address,
    token: soroban_sdk::Address,
    amount: i128,
    order_id: u64,
)

Withdraw collateral from Blend pool back to contract (admin only)

fn withdraw_from_blend(env: soroban_sdk::Env, amount_usdc: i128, amount_xlm: i128)

Settle deposits to seller

fn settle(env: soroban_sdk::Env) -> (i128, i128)

Withdraw accumulated platform yield (admin only)

fn withdraw_yield(
    env: soroban_sdk::Env,
    recipient: soroban_sdk::Address,
) -> (i128, i128)

Update seller address (admin only)

fn set_seller(env: soroban_sdk::Env, new_seller: soroban_sdk::Address)

Update fee percentage (admin only)

fn set_fee_percent(env: soroban_sdk::Env, new_fee_percent: u32)

Update Blend USDC token address (admin only) This is the USDC variant that gets supplied to the Blend pool

fn set_blend_usdc_token(
    env: soroban_sdk::Env,
    new_blend_usdc_token: soroban_sdk::Address,
)

Claim BLND emissions from the Blend pool (admin only)

Calls the Blend pool's claim function to collect accrued BLND emissions for this contract's supply/collateral positions.

Arguments

  • reserve_token_ids - Vec of emission indices to claim (e.g., 6 = USDC supply emissions. Formula: reserve_index * 2 for supply)
fn claim_emissions(
    env: soroban_sdk::Env,
    reserve_token_ids: soroban_sdk::Vec,
) -> i128

Upgrade contract WASM (admin only)

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

Imports

WebAssembly Text (WAT) ▶