VYLO
Launch App
Smart contracts

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#

InstructionWhoWhat it does
create_streamCreatorEscrows a vesting or lock for a recipient and pays the fee.
withdrawRecipientWithdraws everything unlocked so far.
cancelCreatorCancels a cancelable vesting: vested to the recipient, the rest back.
transfer_recipientRecipientHands the stream to another wallet.
close_streamCreatorCloses a fully paid stream and returns its rent.
create_dropCreatorEscrows the airdrop total with a claim window.
add_recipientsCreatorRegisters up to 20 recipients per transaction, one allocation per wallet.
claimRecipientClaims an allocation inside the window (0.005 SOL fee).
clawbackCreatorAfter the window: returns what is left, minus 1%.
close_claimCreatorAfter clawback: recovers rent of unclaimed records.
sweep_tokens / sweep_solAnyonePays collected fees 40/40/20 to the Fee Router destinations (SOL as wSOL).

Accounts#

AccountSeedsNotes
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.