Owner-only: stop future orders. Funds stay escrowed until withdrawn.
fn cancel(env: soroban_sdk::Env, id: u64) -> Result<(), DcaError>
One-time setup. fee_bps is taken once, upfront, at create_strategy
time (not per order — cheaper on gas than Elysium's design needed to
be, and simpler than Stellar's per-order 0.1% treasury payment).
fn initialize(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
keeper: soroban_sdk::Address,
treasury: soroban_sdk::Address,
router: soroban_sdk::Address,
fee_bps: u32,
) -> Result<(), DcaError>
fn set_keeper(
env: soroban_sdk::Env,
new_keeper: soroban_sdk::Address,
) -> Result<(), DcaError>
fn set_fee_bps(env: soroban_sdk::Env, new_fee_bps: u32) -> Result<(), DcaError>
fn get_strategy(env: soroban_sdk::Env, id: u64) -> Option
fn set_treasury(
env: soroban_sdk::Env,
new_treasury: soroban_sdk::Address,
) -> Result<(), DcaError>
Only the keeper can call this, and it can only ever do exactly what's
baked into this function: swap this strategy's fixed amount_per_order
through the router and send the proceeds straight to owner — the
contract never custodies the swap output. min_amount_out is computed
off-chain by the bot (reference price minus a slippage tolerance) and
re-checked here implicitly: the router call reverts if it can't meet it.
fn execute_order(
env: soroban_sdk::Env,
id: u64,
min_amount_out: i128,
) -> Result
fn get_active_ids(env: soroban_sdk::Env) -> soroban_sdk::Vec
fn transfer_admin(
env: soroban_sdk::Env,
new_admin: soroban_sdk::Address,
) -> Result<(), DcaError>
Creates a strategy and pulls amount_per_order * orders_total worth
of sell_asset from owner into the contract's own balance, plus the
upfront fee straight to treasury. These are plain transfers out of
owner, so no prior approve is needed: the owner's single signature
on this call authorizes exactly those two transfers (Soroban auth
entries cover the nested token calls).
fn create_strategy(
env: soroban_sdk::Env,
owner: soroban_sdk::Address,
sell_asset: soroban_sdk::Address,
buy_asset: soroban_sdk::Address,
amount_per_order: i128,
orders_total: u32,
interval_seconds: u64,
) -> Result
Owner-only: pull back whatever budget hasn't been swapped yet. No co-signer dance, no account-merge — this is the Soroban equivalent of the Stellar "Withdraw & close" flow.
fn withdraw_remaining(env: soroban_sdk::Env, id: u64) -> Result