Initialize the pool contract
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)
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)
Get current pool status
fn get_status(env: soroban_sdk::Env) -> (i128, i128, bool)
Get yield information
fn get_yield_info(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.
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>)