fn asset(env: soroban_sdk::Env) -> Result
fn balance(
env: soroban_sdk::Env,
from: soroban_sdk::Address,
) -> Result
Deposits amount USDC, swaps it to the RWA on Aqua, and mints shares against the
conservatively-valued RWA actually received โ NOT the USDC amount-in โ so the
depositor bears their own swap's execution slippage instead of diluting existing
shareholders. Returns the vault's USDC balance.
fn deposit(
env: soroban_sdk::Env,
amount: i128,
from: soroban_sdk::Address,
) -> Result
No-op telemetry harvest. Keeper-gated (dual check). On a successful price it emits a
HarvestEvent carrying the current price-per-share; on a pricing failure it emits a
SpreadAlertEvent instead of reverting (there is nothing to claim either way).
fn harvest(
env: soroban_sdk::Env,
from: soroban_sdk::Address,
data: Option,
) -> Result<(), StrategyError>
Withdraws amount USDC to to by selling RWA on Aqua, burning the matching shares.
Reverts if the held RWA can't source amount USDC (ยง3.3 revert-on-shortfall).
fn withdraw(
env: soroban_sdk::Env,
amount: i128,
from: soroban_sdk::Address,
to: soroban_sdk::Address,
) -> Result
fn get_keeper(env: soroban_sdk::Env) -> Result
fn get_params(env: soroban_sdk::Env) -> Result
Rotates the keeper. Both parties must sign: the current keeper authorizes handing the role over, and the NEW keeper proves the address is real and under its control โ a typo'd or inaccessible address would otherwise permanently brick every keeper-gated method (this contract is not upgradable).
fn set_keeper(
env: soroban_sdk::Env,
new_keeper: soroban_sdk::Address,
) -> Result<(), StrategyError>
Adjusts the strategy TVL cap. Keeper-gated.
fn set_tvl_cap(env: soroban_sdk::Env, new_cap: i128) -> Result<(), StrategyError>
Whether depositor is currently on the address deposit allowlist.
fn is_depositor(
env: soroban_sdk::Env,
depositor: soroban_sdk::Address,
) -> Result
Initializes the strategy.
asset is the underlying (USDC). init_args (11, in order):
0. rwa_asset: Address
aqua_router: Addressaqua_tokens: Vec<Address> โ the pool's token set, sorted ascending by addressaqua_pool_index: BytesN<32>oracle: Address โ SEP-40 price feed for rwa_assetkeeper: Addressmax_deposit: i128 โ per-tx cap (USDC)max_tvl: i128 โ strategy NAV cap (USDC)max_spread_bps: u32 โ oracle/Aqua disagreement tolerancequote_ttl_seconds: u64 โ oracle staleness windowslippage_bps: u32 โ execution slippage toleranceConstruction-time panics (.expect(...) on a missing/malformed init_args slot,
assert! on an out-of-range value) are deliberate: they abort a bad deploy before any
state is persisted, rather than leaving the strategy live with an invalid Config.
fn __constructor(
env: soroban_sdk::Env,
asset: soroban_sdk::Address,
init_args: soroban_sdk::Vec,
)
Adds depositor to the deposit allowlist. Keeper-gated; idempotent. The allowlist
starts empty at construction, so the keeper must add the DeFindex vault before it
can deposit.
fn add_depositor(
env: soroban_sdk::Env,
depositor: soroban_sdk::Address,
) -> Result<(), StrategyError>
Pauses / unpauses new deposits. Withdrawals are never paused. Keeper-gated.
fn pause_deposits(env: soroban_sdk::Env, paused: bool) -> Result<(), StrategyError>
Whether hash is currently on the wasm-hash deposit allowlist.
fn is_allowed_hash(
env: soroban_sdk::Env,
hash: soroban_sdk::BytesN<32>,
) -> Result
Adjusts the per-tx deposit cap. Keeper-gated.
fn set_deposit_cap(env: soroban_sdk::Env, new_cap: i128) -> Result<(), StrategyError>
Adds a contract hash (wasm code hash) to the deposit allowlist. Keeper-gated;
idempotent. Any contract whose code hash matches may then deposit, regardless of its
address โ bless a vault's wasm once and every instance of it is allowed. Because vault
code hashes are known at build/upload time, the keeper can allowlist a hash before any
such vault is deployed. Note: a vault that upgrades its wasm changes hash and must be
re-blessed.
fn add_allowed_hash(
env: soroban_sdk::Env,
hash: soroban_sdk::BytesN<32>,
) -> Result<(), StrategyError>
Removes depositor from the deposit allowlist. Keeper-gated; idempotent. This blocks
only future deposits from depositor โ it never affects its ability to withdraw
funds it already holds.
fn remove_depositor(
env: soroban_sdk::Env,
depositor: soroban_sdk::Address,
) -> Result<(), StrategyError>
Updates the pricing knobs (spread tolerance, oracle staleness window, execution slippage). Keeper-gated; same validation bounds as construction.
fn set_pricing_params(
env: soroban_sdk::Env,
max_spread_bps: u32,
quote_ttl_seconds: u64,
slippage_bps: u32,
) -> Result<(), StrategyError>
Removes a contract hash from the deposit allowlist. Keeper-gated; idempotent. Blocks
only future deposits from contracts running that code โ never affects withdrawals.
fn remove_allowed_hash(
env: soroban_sdk::Env,
hash: soroban_sdk::BytesN<32>,
) -> Result<(), StrategyError>