VYLO
Launch App
Developers

Program reference

Instruction encoding, error codes and events for integrators.

Instruction encoding#

Pool Factory, Staking, Buyback and Agent Vault use a one byte instruction tag followed by little-endian arguments. The Fee Router uses Anchor-compatible 8 byte discriminators (sha256("global:name")[0..8]).

ProgramTags
Pool Factory0 create_pool(fee u16, a u64, b u64) · 1 deposit(lp u64, max_a u64, max_b u64) · 2 withdraw(lp u64, min_a u64, min_b u64) · 3 swap(in u64, min_out u64) · 4 collect
Staking0 init_pool · 1 add_reward · 2 stake(id u64, amount u64, lock_secs u64) · 3 unstake · 4 claim(index u8) · 5 sync · 6 close · 7 expire · 8 extend(lock_secs u64)
VYLO Lock0 create_stream · 1 withdraw · 2 cancel · 3 transfer_recipient · 4 close_stream · 5 create_drop · 6 add_recipients · 7 claim · 8 clawback · 9 close_claim · 10 sweep_tokens · 11 sweep_sol
Buyback0 init(executor, router) · 1 set_executor · 2 set_vylo_mint · 3 set_router · 4 buyback(in u64, min_out u64, route data) · 5 set_burn(u8) · 6 burn(u64)
Agent Vault0 create(id u64, policy) · 1 update_policy · 2 set_agent · 3 set_paused · 4 deposit(u64) · 5 withdraw(u64) · 6 add_liquidity · 7 remove_liquidity · 8 swap

Error codes#

CodeNameMeaning
7000UnauthorizedSigner is not allowed to do this
7001InvalidAccountAn account does not match what the program expects
7002InvalidMintWrong mint or wrong mint order
7003InvalidTokenProgramToken program does not match the mint
7004MathOverflowArithmetic overflow or invariant check failed
7005SlippagePrice moved past your limit
7006ZeroAmountAmount must be above zero
7007PausedPaused by the owner or the Fee Router
7008PolicyViolationOutside the agent mandate or a failed post-check
7009ExpiredAgent mandate has expired
7010InsufficientLiquidityPool cannot fill this trade
7011UnsupportedMintExtensionToken-2022 extension not supported
7012NotInitializedRequired setup has not been done yet
7013LimitExceededPer-transaction, daily or capacity limit reached

Fee Router errors: 6000 Paused, 6001 ZeroAmount, 6002 InsufficientSource, 6003 Overflow, 6004 NothingPending, 6005 TimelockActive, 6006 Unauthorized, 6007 InvalidAccount, 6008 InvalidTokenProgram, 6009 WrongDestination.

Events#

Events are written with sol_log_data and start with an 8 byte tag: evswap__, evliq___, evcollct (Pool Factory), evstake_, evclaim_ (Staking), evbuybck (Buyback), evagent_ (Agent Vault). Fields are fixed-width little-endian; see the program sources for exact layouts.