Docs · Reference
Program reference
Addresses, instructions, accounts, events and errors of the Backstock program, generated from the IDL shipped in @backstock/sdk.
Address
69H4mKjPcR3Ncsk8orfSDAx6UDWz98szmFm3L4qU8Yzq on mainnet. Anchor IDL: packages/sdk/src/idl/backstock.json.
Program addresses
| Account | Seeds | Holds |
|---|---|---|
| Platform | ["platform"] | Admin, fee recipient, agent and dev authorities, the LaunchLab platform config, default params |
| Quote | ["quote", quote_mint] | An enabled quote asset: token program, decimals, LaunchLab global config, raise bounds, vault floor |
| Launch | ["launch", create_key] | One launch: quote, raise, frozen terms, venue, vault accounting, agent state, payback |
| Authority | ["authority", launch] | Data-less; LaunchLab payer and creator, signer of venue trades, owner of the quote and token vaults |
| Backer | ["backer", launch, owner] | A backer's deposit (raw quote) and claimed fees |
| Mint | ["mint", launch] | The coin, created by LaunchLab at launch (Token-2022, 6 decimals) |
Instructions
| Instruction | Args | Signer | Writable accounts |
|---|---|---|---|
create_ | args: CreateLaunchArgs | creator, create_key | creator, platform, fee_recipient, launch, authority, quote_vault |
deposit | amount: u64, proof: Vec<[u8; 32]> | owner | owner, launch, backer, owner_quote, quote_vault |
cancel_ | — | creator | launch |
refund | — | owner | owner, launch, backer, owner_quote, quote_vault |
launch | — | cranker | launch, authority, mint, quote_vault, fee_recipient_quote, token_vault, pool_state, pool_base_vault, pool_quote_vault, platform_fee_vault, creator_fee_vault |
graduate | — | none | launch |
agent_ | quote_in: u64, min_tokens_out: u64 | agent | launch, authority, quote_vault, token_vault |
agent_ | tokens_in: u64, min_quote_out: u64 | agent | launch, authority, quote_vault, token_vault |
payout_ | — | agent | launch |
collect_ | — | cranker | launch, authority, quote_vault, token_vault, fee_recipient_quote, creator_fee_vault |
claim_ | — | owner | launch, backer, owner_quote, quote_vault |
admin_ | quote: u64, tokens: u64 | admin | launch, quote_vault, token_vault, recipient_quote, recipient_tokens |
dev_ | quote: u64, tokens: u64 | dev | launch, quote_vault, token_vault, recipient_quote, recipient_tokens |
initialize_ | fee_recipient: pubkey, agent_authority: pubkey, params: PlatformParams | admin | admin, platform |
update_ | params: PlatformParams | admin | platform |
set_ | fee_recipient: pubkey | admin | platform |
set_ | agent_authority: pubkey | admin | platform |
set_ | dev_authority: pubkey | admin | platform |
set_ | — | admin | platform |
add_ | params: QuoteParams | admin | admin, quote_config |
update_ | params: QuoteParams | admin | quote_config |
propose_ | new_admin: pubkey | admin | platform |
accept_ | — | new_admin | platform |
begin_ | — | cranker | launch, authority, quote_vault, token_vault |
finish_ | — | cranker | launch, authority, quote_vault, token_vault |
Accounts
Backer
| Field | Type |
|---|---|
launch | pubkey |
owner | pubkey |
deposited | u64 |
fees_claimed | u64 |
bump | u8 |
Launch
| Field | Type |
|---|---|
index | u64 |
creator | pubkey |
create_key | pubkey |
quote_mint | pubkey |
quote_token_program | pubkey |
quote_decimals | u8 |
mint | pubkey |
status | LaunchStatus |
bump | u8 |
authority_bump | u8 |
mint_bump | u8 |
created_at | i64 |
launched_at | i64 |
terms | LaunchTerms |
raise_min | u64 |
raise_max | u64 |
max_per_wallet | u64 |
raise_deadline | i64 |
raised | u64 |
refunded | u64 |
backer_count | u32 |
whitelist_root | [u8; 32] |
bundle_supply_bps | u16 |
reserve_bps | u16 |
global_config | pubkey |
launchlab_platform | pubkey |
supply | u64 |
total_sell | u64 |
fund_raising | u64 |
platform_fee_rate | u64 |
creator_fee_rate | u64 |
pool | pubkey |
cpmm_pool | pubkey |
graduated | bool |
wind_down_started_at | i64 |
vault_quote | u64 |
vault_tokens | u64 |
bundle_quote | u64 |
bundle_tokens | u64 |
vault_cost_quote | u64 |
initial_vault_quote | u64 |
acc_fee_per_share | u128 |
backer_fees_accrued | u64 |
backer_fees_claimed | u64 |
creator_fees_collected | u64 |
window_start | i64 |
window_buy_cap | u64 |
window_quote_spent | u64 |
window_sell_cap | u64 |
window_tokens_sold | u64 |
ema_price | u128 |
last_trade_ts | i64 |
agent_buys | u32 |
agent_sells | u32 |
agent_quote_spent | u64 |
agent_quote_received | u64 |
agent_tokens_sold | u64 |
last_agent_trade_slot | u64 |
volume_quote | u64 |
trade_count | u64 |
name | string |
symbol | string |
uri | string |
backers_repaid | u64 |
backer_payouts | u64 |
last_payout_ts | i64 |
Platform
| Field | Type |
|---|---|
admin | pubkey |
pending_admin | pubkey |
fee_recipient | pubkey |
agent_authority | pubkey |
dev_authority | pubkey |
launchlab_platform | pubkey |
params | PlatformParams |
launch_count | u64 |
bump | u8 |
QuoteConfig
Admin-curated allowlist entry of a quote asset, PDA `[QUOTE_SEED, quote_mint]`. Validated against the mint and its LaunchLab GlobalConfig by `add_quote` / `update_quote`; amounts are raw units of the quote mint.
| Field | Type |
|---|---|
quote_mint | pubkey |
token_program | pubkey |
decimals | u8 |
global_config | pubkey |
enabled | bool |
fund_raising | u64 |
min_raise | u64 |
max_raise | u64 |
max_wallet_deposit | u64 |
min_vault | u64 |
bump | u8 |
Events
Amounts are raw quote units unless the field names tokens.
| Event | Fields |
|---|---|
BackerFeesClaimed | launch, backer, amount, timestamp |
BackersPaid | launch, mint, kind, amount, vault_quote_after, timestamp |
CreatorFeesCollected | launch, mint, quote_mint, amount, to_vault, to_platform, to_backers, tokens, timestamp |
Deposited | launch, backer, amount, total_deposited, raised, timestamp |
Graduated | launch, mint, cpmm_pool, timestamp |
LaunchCancelled | launch, timestamp |
LaunchCreated | launch, mint, quote_mint, creator, index, name, symbol, uri, raise_min, raise_max, raise_deadline, bundle_supply_bps, reserve_bps, fund_raising, whitelisted, timestamp |
Launched | launch, mint, quote_mint, pool, raised, launch_fee, bundle_quote, bundle_tokens, vault_quote, price_q64, timestamp |
QuoteConfigured | quote_mint, token_program, decimals, global_config, enabled, fund_raising, min_raise, max_raise, max_wallet_deposit, min_vault, timestamp |
Refunded | launch, backer, amount, timestamp |
Trade | launch, mint, quote_mint, side, quote, tokens, price_q64, ema_q64, venue, vault_quote, vault_tokens, timestamp |
VaultWithdrawn | launch, mint, quote, tokens, recipient, recipient_quote, recipient_tokens, timestamp |
VaultWithdrawnByDev | launch, mint, quote, tokens, by, recipient_quote, recipient_tokens, timestamp |
WindDownAborted | launch, mint, outside, timestamp |
WindDownStarted | launch, mint, outside, finish_after, timestamp |
WoundDown | launch, mint, quote_to_backers, timestamp |
Errors
| Code | Name | Message |
|---|---|---|
| 6000 | Unauthorized | Signer is not authorized for this action |
| 6001 | InvalidParam | Parameter out of allowed bounds |
| 6002 | InvalidMetadata | Name, symbol or URI too long or empty |
| 6003 | Paused | Platform is paused |
| 6004 | AgentsPaused | Agents are paused |
| 6005 | NotRaising | Launch is not raising |
| 6006 | NotLive | Launch is not live |
| 6007 | NotRefunding | Launch is not refunding |
| 6008 | RaiseClosed | Raise deadline has passed |
| 6009 | RaiseStillOpen | Raise is still open |
| 6010 | RaiseFull | Raise is full |
| 6011 | WalletCapReached | Wallet deposit cap reached |
| 6012 | MinimumNotReached | Raise minimum not reached |
| 6013 | MinimumReached | Raise minimum was reached; refunds open only if it is not launched within the grace period |
| 6014 | NotWhitelisted | Wallet is not on the whitelist |
| 6015 | ZeroAmount | Amount must be greater than zero |
| 6016 | Slippage | Output below minimum (slippage) |
| 6017 | InsufficientLiquidity | Insufficient venue liquidity |
| 6018 | MathOverflow | Arithmetic overflow |
| 6019 | AgentWindowLimit | Agent window limit exceeded |
| 6020 | AgentPriceImpact | Agent trade exceeds max price impact |
| 6021 | AgentBuyNotDip | Agents may only buy below the EMA band |
| 6022 | AgentSellNotRally | Agents may only sell above the EMA band |
| 6023 | InsufficientVault | Insufficient vault balance |
| 6024 | NothingToClaim | Nothing to claim |
| 6025 | AlreadyRefunded | Already refunded |
| 6026 | NoPendingAdmin | No pending admin or signer mismatch |
| 6027 | AgentAboveCostBasis | Agents may only buy below the vault's average cost, or buy back with sell proceeds below the average sell price |
| 6028 | AgentBelowCostBasis | Agents may only sell above the vault's average cost plus band |
| 6029 | NotUpgradeAuthority | Only the program upgrade authority can initialize the platform |
| 6030 | SameSlotTrade | One agent trade per slot; retry in the next slot |
| 6031 | TermsChanged | Platform terms changed since this launch was prepared; review them and retry |
| 6032 | LaunchTooYoung | Launch must be live for 3 days before it can wind down |
| 6033 | RecentTrade | The vault traded in the last 24 hours; the launch can't wind down yet |
| 6034 | OutsideHolders | More tokens are held outside the venue and vault than a dead launch allows; it can't wind down |
| 6035 | InvalidVenueAccount | A venue account is missing, has the wrong owner or the wrong layout |
| 6036 | VenueMigrating | The LaunchLab curve is complete and waiting for migration to CPMM; retry after graduate |
| 6037 | NotGraduated | The LaunchLab pool has not migrated to CPMM (or the launch already graduated) |
| 6038 | PayoutNotDue | No backer payout is due: vault quote under the payback target or the last payout is too recent |
| 6039 | VaultFloor | Vault quote may not drop below the launch's minimum vault reserve |
| 6040 | DevKeyDisabled | No dev key is set on the platform (set_dev_authority) |
| 6041 | LaunchWindowClosed | The raise was not launched within the grace period after its deadline; backers can refund |
| 6042 | LaunchLabPlatformUnset | The platform has no LaunchLab platform config yet (set_launchlab_platform) |
| 6043 | QuoteDisabled | This quote asset is not enabled for new launches |
| 6044 | InvalidQuoteMint | The quote mint is not an SPL Token or Token-2022 mint, or its decimals don't match |
| 6045 | QuoteTransferFee | The quote mint charges a transfer fee, or its transfer-fee config can still be changed |
| 6046 | QuoteHookActive | The quote mint has an active transfer hook |
| 6047 | QuoteNotTransferable | The quote mint freezes new accounts by default or is non-transferable |
| 6048 | InvalidGlobalConfig | The LaunchLab global config does not match the quote or rejects the launch curve |
| 6049 | NotWindingDown | The launch is not winding down |
| 6050 | WindDownNotReady | The wind-down delay has not passed since begin_wind_down |
| 6051 | LaunchLabPlatformInvalid | The LaunchLab platform config overrides the CPMM pool creator or restricts launches |