This repository contains IDO with vesting Smart Contracts, implemented using both Anchor and native Rust on Solana.
- Token launches with controlled unlock schedules
- Investor vesting plans
- DAO treasury distribution
- Any scenario requiring scheduled, partial token unlocks
Component | Status |
---|---|
Anchor Implementation | ✅ MVP completed |
Native Rust | ✅ Production-ready |
This monorepo contains two submodules:
anchor
- Anchor-based implementationnative_rust
- Native Rust implementation
Both share a common instruction layer and business logic
-
Modular Vesting Logic
ConfigurableLinearVestingStrategy
with optional cliff and periodic unlocks.MAX_UNLOCKS
must be >= 100 -
Flexible Recipient Design
During the claim phase, any recipient and ATA can be specified - not limited to the original buyer. -
Initialize, Buy, Claim Instructions
Core functionality of this program. See Program Instructions for more details. -
SPL Token 2022 & ATA Support
Fully compatible with Token-2022 standard, including ATA derivation and mint logic. -
No Anchor Dependency (in Native version)
Native Rust implementation is entirely free of Anchor dependencies, resulting in:- Lower CU usage (check benchmark section)
- Faster execution
- Initializes the IDO's
Treasury ATA
,Config
. - Accepts a customizable
LinearVestingStrategy
and other arguments such aslamports_per_token
andtransfer_amount
.
transfer_amount
- amount of SPL tokens to be transferred from thesigners ATA
to theTreasury ATA
- Creates a
VestingAccount
(if needed). - Transfers lamports from the buyer to the
Treasury ATA
.
- Checks eligibility based on vesting schedule,
- Initializes
recipient ATA
(if needed). - Transfers SPL tokens according to the unlocked portion to the
recipient ATA
.
This section compares two implementations of the same Smart Contract.
You can verify the data here.
Component | Initialize IDO | Buy Tokens | Claim Tokens (1st) | Claim Tokens (2nd) |
---|---|---|---|---|
Anchor | 38,374 CU | 20,574 CU | 22,083 CU | 21,864 CU |
Native Rust | 18,068 CU | 9,662 CU | 10,947 CU | 11,041 CU |
As you can see, the native Rust implementation consumes ~2x fewer compute units across all instructions!