VYLO
Launch App
Smart contracts

Agent Vault

Lets an agent manage liquidity under a mandate enforced onchain.

Overview#

A user deposits into a PDA vault and grants an agent key a mandate. The agent can only move funds between the vault and pools (up to 4 picked pools, or 1 to 3 pools it chooses for Autopilot), never to a wallet. It can add liquidity, remove liquidity, collect fees and swap, only within the mandate.

The mandate covers allowed tokens with a per-transaction and a rolling 24 hour limit, a reserve (the share of deposits the agent may never deploy), allowed pools (up to 4), an expiry, pause and instant revocation.

Every token the agent receives (LP tokens, swap output) must land in an account owned by the vault. Only the owner can withdraw, at any time, including while paused.

Instructions#

InstructionWhoWhat it does
createOwnerCreates vault number id with its mandate.
update_policyOwnerReplaces the mandate; accounting for kept tokens is preserved.
set_agentOwnerSets or revokes (all zeros) the agent key.
set_pausedOwnerPauses or resumes the agent.
depositOwnerDeposits an allowed token into the vault.
withdrawOwnerWithdraws any token the vault holds. Always allowed.
agent_add_liquidityAgentDeposits into an allowed VYLO pool within limits and reserve.
agent_remove_liquidityAgentWithdraws from an allowed pool back into the vault.
agent_swapAgentSwaps between allowed tokens in an allowed pool within limits.
agent_bin_poolAgentBin pool: open, add, remove, collect fees (5% routed), close, swap, all owned by the vault.

Accounts#

AccountSeedsNotes
Vault["vault", owner, id (u64 LE)]528 bytes: owner, agent, mandate, per-token deposited / deployed / spent today, allowed pools.

Guarantees#

  • The agent can never withdraw or transfer to an outside account.
  • Pausing, revoking and expiry take effect immediately for the next agent action.
  • The agent can only call VYLO classic pools, bin pools and swaps whose output stays in the vault, never a transfer to a wallet.

Events#

Events are emitted as program data logs and can be indexed from transaction logs.

  • Agent: vault, action, pool, amounts

Source and client#

Source: programs/vylo-agent-vault. TypeScript builders and decoders: @vylo/solana/programs. See the SDK.