VYLO Lock
Token vesting, token locks and airdrops for any Solana token.
Overview#
Vesting: a creator escrows tokens for a recipient. Nothing unlocks before the cliff; at the cliff a chosen amount unlocks, then the rest unlocks linearly every period (second, day, week or month) until the end. Optionally cancelable: unvested tokens return to the creator, vested ones go to the recipient.
Token locks: tokens are escrowed until a single unlock time, then fully withdrawable. Used for team tokens, LP tokens and treasury commitments that should be provably locked.
Airdrops: the creator escrows a total and registers recipients (20 per transaction). Each recipient claims inside the claim window. After the window the creator claws back what is left. Recipient records cost about 0.0015 SOL rent each, paid by the creator and refunded as people claim.
Fees are low and flat: 0.08 SOL plus 0.10% of tokens per vesting, 0.08 SOL plus 0.25% per lock, 0.005 SOL per airdrop claim (paid by the claimer) and 1% of clawed-back airdrop tokens. Fees collect in the fees PDA and are swept permissionlessly 40/40/20 to buyback, stakers and team.
Instructions#
| Instruction | Who | What it does |
|---|---|---|
| create_stream | Creator | Escrows a vesting or lock for a recipient and pays the fee. |
| withdraw | Recipient | Withdraws everything unlocked so far. |
| cancel | Creator | Cancels a cancelable vesting: vested to the recipient, the rest back. |
| transfer_recipient | Recipient | Hands the stream to another wallet. |
| close_stream | Creator | Closes a fully paid stream and returns its rent. |
| create_drop | Creator | Escrows the airdrop total with a claim window. |
| add_recipients | Creator | Registers up to 20 recipients per transaction, one allocation per wallet. |
| claim | Recipient | Claims an allocation inside the window (0.005 SOL fee). |
| clawback | Creator | After the window: returns what is left, minus 1%. |
| close_claim | Creator | After clawback: recovers rent of unclaimed records. |
| sweep_tokens / sweep_sol | Anyone | Pays collected fees 40/40/20 to the Fee Router destinations (SOL as wSOL). |
Accounts#
| Account | Seeds | Notes |
|---|---|---|
| Stream | ["stream", creator, id (u64 LE)] | 208 bytes: parties, mint, amounts, cliff, end, period, flags. Escrow is its associated token account. |
| Airdrop | ["drop", creator, id (u64 LE)] | 168 bytes: mint, total, allocated, claimed, window, counts. |
| Claim record | ["claim", airdrop, recipient] | 80 bytes: one allocation per wallet; closed on claim. |
| Fees | ["fees"] | Collects SOL fees and owns one token account per fee mint. |
Guarantees#
- Escrowed tokens can only leave to the recipient (unlocked part), back to the creator on cancel or clawback, or as the published fee.
- Locks cannot be cancelled. Vesting is cancelable only if the creator chose so at creation.
- Fee destinations are read from the Fee Router config onchain, so sweeps cannot be redirected.
- Token-2022 extensions that could move or freeze escrowed funds are rejected.
Events#
Events are emitted as program data logs and can be indexed from transaction logs.
- Stream created: stream, recipient, amount, kind
- Withdrawal: stream, amount
- Airdrop claim: airdrop, recipient, amount
Source and client#
Source: programs/vylo-lock. TypeScript builders and decoders: @vylo/solana/programs. See the SDK.