fn admin(env: soroban_sdk::Env) -> soroban_sdk::Address
Sweep any tokens stuck in the contract to the vault (admin only).
fn sweep(env: soroban_sdk::Env, asset: soroban_sdk::Address, amount: i128)
fn fee_vault(env: soroban_sdk::Env) -> soroban_sdk::Address
Transfer admin to a new address (only current admin).
fn set_admin(env: soroban_sdk::Env, new_admin: soroban_sdk::Address)
Collect a fee on any token transfer (reusable for Aquarius, etc.).
User sends gross_amount to this contract, which splits it.
Unlike withdraw_with_fee, this doesn't call a pool — the caller
must have already transferred tokens to this contract.
fn split_fee(
env: soroban_sdk::Env,
user: soroban_sdk::Address,
asset: soroban_sdk::Address,
gross_amount: i128,
principal: i128,
) -> (i128, i128)
One-time initialization. Sets admin, vault address, and fee rate. fee_rate_bps: 1500 = 15%, 1000 = 10%, 500 = 5%
fn initialize(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
fee_vault: soroban_sdk::Address,
fee_rate_bps: u32,
)
fn fee_rate_bps(env: soroban_sdk::Env) -> u32
Update the fee rate (only admin).
fn set_fee_rate(env: soroban_sdk::Env, new_rate_bps: u32)
Update the fee vault address (only admin).
fn set_fee_vault(env: soroban_sdk::Env, new_vault: soroban_sdk::Address)
Withdraw from a lending pool, atomically deduct Nestor's fee, and send the net amount to the user.
user — the user's address (must authorize)pool — the lending pool contract address (e.g. Blend)asset — the SAC token contract address (e.g. USDC)amount — total amount to withdraw from the pool (stroops, 7 dec)principal — original deposit amount (stroops, 7 dec)
fee is only charged on (amount − principal), i.e. yieldTuple of (user_receives, fee_collected) both in stroops.
fn withdraw_with_fee(
env: soroban_sdk::Env,
user: soroban_sdk::Address,
pool: soroban_sdk::Address,
asset: soroban_sdk::Address,
amount: i128,
principal: i128,
) -> (i128, i128)