fn asset(env: soroban_sdk::Env) -> Result
fn balance(
env: soroban_sdk::Env,
from: soroban_sdk::Address,
) -> Result
Deposits amount of the underlying, supplies it to Kinetic, and mints shares.
Returns the vault's underlying-denominated balance after the deposit.
fn deposit(
env: soroban_sdk::Env,
amount: i128,
from: soroban_sdk::Address,
) -> Result
Claims one reward asset (named in data) and reinvests it. Keeper-gated.
Reward selection is supplied per call via data โ an XDR-encoded
[HarvestInstruction] โ instead of being fixed at construction, so the immutable
contract can compound reward assets Kinetic adds to the market over time. One reward
per call: the keeper enumerates the market's reward list off-chain and calls harvest
once per active token (see design doc ยง12).
None / empty data => no-op (nothing to claim this call).data => InvalidArgument (a keeper encoding mistake; we
refuse rather than proceed).fn harvest(
env: soroban_sdk::Env,
from: soroban_sdk::Address,
data: Option,
) -> Result<(), StrategyError>
Withdraws amount of underlying from Kinetic to to, burning the matching shares.
Returns the vault's remaining underlying-denominated balance.
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
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>
Whether depositor is currently on the address deposit allowlist.
fn is_depositor(
env: soroban_sdk::Env,
depositor: soroban_sdk::Address,
) -> Result
Initializes the strategy.
init_args (4, in order):
kinetic_router: Addressincentives: Addressswap_router: Address โ AMM router for reward -> asset swaps (Soroswap today)keeper: Address โ the only address allowed to harvestThe reward token is NOT fixed here: it is chosen per-harvest via the data
payload (see harvest and design doc ยง12), so the immutable contract can reach
reward assets Kinetic adds to the market after deployment.
The aToken address is resolved from the router for asset and cached in Config.
Construction is the only place this contract panics on bad input: a malformed
or short init_args aborts deployment via .expect(...) (each names the missing
arg). This is deployment-time and one-shot โ there is no post-deploy code path
that can reach these panics โ so returning a Result here buys nothing.
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>
Whether hash is currently on the wasm-hash deposit allowlist.
fn is_allowed_hash(
env: soroban_sdk::Env,
hash: soroban_sdk::BytesN<32>,
) -> Result
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>
Harvested profit still locked out of the share price at the current ledger time.
fn get_locked_profit(env: soroban_sdk::Env) -> Result
Current harvest-profit vesting window in seconds.
fn get_vesting_window(env: soroban_sdk::Env) -> Result
Retunes the harvest-profit vesting window. Keeper-gated; bounded to
[MIN_VESTING_SECONDS, MAX_VESTING_SECONDS]. Keep the window at least as long as
the harvest cadence โ shorter, and a sniper can wait a window out between harvests
and still capture the full vested amount right before the next one.
fn set_vesting_window(env: soroban_sdk::Env, seconds: u64) -> 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>