Staking / Revenue Vault
Time-locked $VYLO staking. Rewards scale with how much you lock and for how long.
Overview#
Stakers lock $VYLO for a period they choose, from 7 to 365 days. Each lock is its own position, so one wallet can hold several locks with different end dates.
Revenue is shared by weight: weight = amount x boost, where the boost rises linearly from 1x at 7 days to 2x at 365 days. Locking 1,000 $VYLO for a year earns as much as 2,000 locked for a week.
Rewards are paid in the tokens revenue arrives in (for example USDC, wSOL and $VYLO itself, up to 4 reward tokens) with a reward-per-weight accumulator (precision 1e12). There are no emissions.
Principal is locked until the lock ends, then withdrawable at any time. A finished lock keeps earning, but anyone can call expire to drop its weight back to 1x, so expired locks never keep a boost they no longer back. Owners can extend a lock to raise its boost.
$VYLO revenue shares the stake vault. Only the surplus above staked principal is treated as reward, so principal is never paid out as yield.
Instructions#
| Instruction | Who | What it does |
|---|---|---|
| init_pool | Admin (once) | Sets the stake mint ($VYLO) and creates the stake vault. |
| add_reward | Admin | Registers a reward token (max 4). |
| stake | Anyone | Opens a new lock: amount and lock period (7 to 365 days). |
| unstake | Position owner | Withdraws the full principal once the lock has ended. Earned rewards stay claimable. |
| claim | Position owner | Pays the pending amount of one reward token. |
| extend | Position owner | Relocks from now for a new period that ends no earlier, raising the boost. |
| expire | Anyone | Drops a finished lock back to 1x weight. |
| close | Position owner | Closes an empty position and returns its rent. |
| sync | Anyone | Distributes newly arrived revenue without staking or claiming. |
Accounts#
| Account | Seeds | Notes |
|---|---|---|
| Pool | ["stake_pool"] | 640 bytes: stake mint, vault, total staked, total weight, up to 4 reward slots. |
| Lock position | ["stake", owner, id (u64 LE)] | 177 bytes: amount, weight, lock end, reward debts, claimable per reward token. |
Guarantees#
- Locked principal cannot be withdrawn before the lock ends, by anyone.
- Only the owner can withdraw, claim, extend or close a position.
- The stake vault always covers total principal.
- Seed a small treasury lock right after init so revenue from before launch is not captured by the first outside staker.
Events#
Events are emitted as program data logs and can be indexed from transaction logs.
- Stake: owner, amount, weight, lock end, kind (lock / unstake / extend)
- Claim: owner, mint, amount
Source and client#
Source: programs/vylo-staking. TypeScript builders and decoders: @vylo/solana/programs. See the SDK.