- This document uses
$Solto refer to the native token,$DAIto refer to the sale token, and$bbSolto refer to the payment token. - This document uses
committo mean subscription, andclaimto mean redemption.
| Step | Description |
|---|---|
| (1) Prep | The project provides event parameters and creates a fundraising account. See init_auction() |
| (2) Commit | Users use $bbSol to subscribe to a specified tier. See commit() |
| (3) Claim | Users redeem tokens of the selected tier $DAI, and receive back unallocated $bbSol (in case of over-subscription). See claim() |
| (4) Withdraw | Admin withdraws unsold $DAI, raised $bbSol, and fees in $Sol received by the contract. See withdraw_funds() and withdraw_fees() |
Each fundraising event sets up several tiers, each with its own token price and supply cap;
Users choose a target tier and subscribe using $bbSol;
After the commit phase ends, the amount of $DAI a user can claim and the unallocated $bbSol (to be refunded) are calculated as follows:
Tier supply cap = sale_token_cap (denominated in $DAI)
Actual committed $bbSol = SUM of all user commitments in $bbSol
Total $DAI demanded = Actual committed $bbSol / sale price
IF total $DAI demanded <= tier supply cap THEN // Not oversubscribed
User claimable $DAI = User committed $bbSol / sale price
User unallocated $bbSol = 0
ELSE // Oversubscribed
Allocation ratio = tier supply cap / total $DAI demanded
User claimable $DAI = (User committed $bbSol / sale price) * allocation ratio
User effective $bbSol = User claimable $DAI * sale price
User unallocated $bbSol = User committed $bbSol - User effective $bbSol
END
| Token | Description |
|---|---|
| NativeToken | Native token used to pay for transaction and claim fees, i.e., $Sol |
| SaleToken | Token being issued, e.g., $DAI |
| PaymentToken | Token used for payment during subscription, e.g., $bbSol |
| Account | Description |
|---|---|
| Launchpad | Platform account (executable program). The program hardcodes the admin public key LaunchpadAdmin. There is only one. Use get_launchpad_admin() to query the admin's public key. |
| Auction | Fundraising event account for each campaign. A PDA account instance stores fundraising data, including amount committed in each tier and vault bump info. authority points to the hardcoded LaunchpadAdmin. |
| Custody | Proxy account controlled by a private key, representing Bybit. This account can subscribe on behalf of users and bypasses whitelist and cap restrictions. There is currently only one and no instruction to change it. |
| VaultSaleTokenAccount | Vault account for $DAI, a PDA created at event setup for holding sale tokens. |
| VaultPaymentTokenAccount | Vault account for $bbSol, a PDA created at event setup for holding payment tokens. |
| UserSaleTokenAccount | User's $DAI account. Created at claim to receive tokens. authority = signer.key() |
| UserPaymentTokenAccount | User's $bbSol account. Used at commit to pay. authority = signer.key() |
| Committed | User commitment account (PDA) storing subscription info for all tiers: committed, claimed amounts, etc. authority = signer.key() |
| Ext. whitelist_authority | Whitelist authorization account, controlled via private key, provides offline signature for user authorization. |
init_auction: Initialize a new fundraising event, create Auction account and vault PDAs, transfer initial tokens.emergency_control: (Admin) Pause/resume specific operations of the auction with fine-grained control.commit: User subscribes by selecting tier and amount. Automatically creates a Committed account if needed.decrease_commit: User reduces their subscription for a specific tier.claim: User flexibly redeems a specific amount of$DAIand refunds of$bbSol. Partial claim supported.withdraw_funds: (Admin) Withdraw all committed$bbSoland unsold$DAIfor all tiers of this event.withdraw_fees: (Admin) Withdraw collected fees.set_price: (Admin) Change price of a specific tier.get_launchpad_admin: Query hardcodedLaunchpadAdminpublic key.
Contains fundraising info and state, derived from sale token mint.
authority is the hardcoded admin.
Configuration for optional features:
whitelist_authority: Whitelist authority accountcommit_cap_per_user: Max cap per userclaim_fee_rate: Claim fee rate (in basis points, e.g., 100 = 1%)
Emergency control flags to pause/resume operations:
PAUSE_AUCTION_COMMIT: Pause commit operationPAUSE_AUCTION_CLAIM: Pause claim operationPAUSE_AUCTION_WITHDRAW_FEES: Pause fee withdrawalPAUSE_AUCTION_WITHDRAW_FUNDS: Pause funds withdrawalPAUSE_AUCTION_UPDATION: Pause update operations like price change
Stores a user's commitments in all tiers, derived from user and auction PDAs.
Each CommittedBin contains:
- Tier index
- Amount committed
- Amount claimed
- Refunded payment tokens
Vaults are PDA accounts automatically managed by the program.
If whitelist_authority is configured, only users authorized via whitelist can participate; Custody is exempt.
Offline Signature Mechanism:
- Uses Ed25519 offline signature verification
- Payload includes:
user,auction,bin_id,payment_token_committed,nonce,expiry - Uses Anchor's binary format
- Client must first send Ed25519 verification instruction before commit
If commit_cap_per_user is configured, it limits the total amount a regular user can commit across all tiers; Custody is exempt.
If set, a fee (in Sale Token) is charged during claim, calculated as:
fee = sale_token_to_claim * claim_fee_rate / 10_000
The fee is added to auction.total_fees_collected.
Current allocation logic is based on sale_token_cap:
- If not oversubscribed, user gets all desired tokens.
- If oversubscribed, allocation is proportional to total demand.
- Excess payments are refunded.