VYLO
Launch App
Smart contracts

Fee Router

Keeps 95% with the LP and splits VYLO's 5% revenue 40 / 40 / 20 in integer token units.

Overview#

Every eligible LP fee collected through VYLO passes through the Fee Router. The user keeps 95%. VYLO's 5% is split 40% to the Buyback Vault, 40% to $VYLO stakers and 20% to the team treasury.

The split is computed in basis points of the gross amount with integer math, so the four parts always add up to exactly the gross amount. Works with SPL Token and Token-2022.

Destinations are token-account owners stored in the config. They are the Buyback Vault authority PDA, the Staking pool PDA and the team treasury, and can only be changed through a 48 hour timelock.

Instructions#

InstructionWhoWhat it does
initializeAdmin (once)Creates the config with the three destinations and an emergency pause key.
route_feesAnyone holding feesTransfers a gross fee amount from the source account: 95% stays with the user, the 5% goes 40/40/20 to the destinations. Emits a FeeRouted event with pool, position and pool type.
propose_destinationsAuthorityQueues new destinations. They can be applied after 48 hours.
apply_destinationsAuthorityApplies queued destinations once the timelock has passed.
cancel_destinationsAuthorityDrops a queued change.
set_pausedAuthority or emergency keyPauses or resumes routing. Pool fee collection also stops while paused.

Accounts#

AccountSeedsNotes
Config["config"]283 bytes: authority, emergency key, destinations, pending change, paused flag, total routed.

Guarantees#

  • Only the hardcoded admin wallet can initialize.
  • Destination token accounts are checked against the stored owners and the mint. Fees cannot be redirected by the caller.
  • No admin path can move user funds. The router only moves the amount the source authority signs for.

Events#

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

  • FeeRouted: mint, gross, user share, buyback, stakers, team, pool, position, pool type

Source and client#

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