Docs · Reference
Program reference
Instructions, accounts, events and errors of the Holdfast program, generated from the IDL shipped in @holdfast/sdk.
Address
EduEwYBkqWCNbZ95nQVeakY8d4tGKM2qaAk7kuW76AMQ on mainnet. Anchor IDL: packages/sdk/src/idl/moshsol.json.
Instructions
| Instruction | Args | Signer | Writable accounts |
|---|---|---|---|
create_launch | args: CreateLaunchArgs | creator, mint | creator, platform, fee_recipient, launch, mint, curve_tokens, vault_tokens |
deposit | amount: u64, proof: Vec<[u8; 32]> | owner | owner, launch, backer |
cancel_launch | — | creator | launch |
refund | — | owner | owner, launch, backer |
launch | — | cranker | launch, curve_tokens, vault_tokens |
wind_down | — | cranker | launch, curve_tokens, vault_tokens |
buy | sol_in: u64, min_tokens_out: u64 | trader | trader, launch, curve_tokens, trader_tokens |
sell | tokens_in: u64, min_sol_out: u64 | trader | trader, launch, curve_tokens, trader_tokens |
agent_buy | sol_in: u64, min_tokens_out: u64 | agent | launch, curve_tokens, vault_tokens |
agent_sell | tokens_in: u64, min_sol_out: u64 | agent | launch, curve_tokens, vault_tokens |
claim_backer_fees | — | owner | owner, launch, backer |
claim_creator_fees | — | creator | creator, launch |
sweep_platform_fees | — | none | launch, fee_recipient |
admin_withdraw_vault | sol: u64, tokens: u64 | admin | launch, vault_tokens, fee_recipient, recipient_tokens |
initialize_platform | fee_recipient: pubkey, agent_authority: pubkey, params: PlatformParams | admin | admin, platform |
update_platform | params: PlatformParams | admin | platform |
set_fee_recipient | fee_recipient: pubkey | admin | platform |
set_agent_authority | agent_authority: pubkey | admin | platform |
propose_admin | new_admin: pubkey | admin | platform |
accept_admin | — | new_admin | platform |
agent_buy_pump | sol_in: u64, min_tokens_out: u64 | agent | agent, launch, pump_authority, vault_tokens |
agent_sell_pump | tokens_in: u64, min_sol_out: u64 | agent | agent, launch, pump_authority, vault_tokens |
buyback_burn | max_sol: u64, min_tokens_out: u64 | cranker | cranker, launch, pump_authority, buyback_mint, burn_tokens |
collect_pump_fees | — | cranker | cranker, launch, creator_vault |
create_launch_pump | args: CreateLaunchPumpArgs | creator, create_key | creator, platform, fee_recipient, launch |
graduate_pump | — | none | launch |
launch_pump | — | cranker, mint | cranker, launch, pump_authority, mint, bonding_curve, associated_bonding_curve, metadata, vault_tokens, fee_recipient, creator_vault, user_volume_accumulator, buyback_fee_recipient |
migrate_launch | — | admin | admin, launch |
migrate_platform | — | admin | admin, platform |
wind_down_pump | — | cranker | cranker, launch, pump_authority, vault_tokens |
Accounts
Backer
| Field | Type |
|---|---|
launch | pubkey |
owner | pubkey |
deposited | u64 |
fees_claimed | u64 |
bump | u8 |
Launch
| Field | Type |
|---|---|
index | u64 |
creator | pubkey |
mint | pubkey |
status | LaunchStatus |
bump | u8 |
curve_bump | u8 |
vault_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 |
virtual_sol | u64 |
real_sol | u64 |
token_reserve | u64 |
vault_sol | u64 |
vault_tokens | u64 |
bundle_sol | u64 |
bundle_tokens | u64 |
vault_cost_sol | u64 |
acc_fee_per_share | u128 |
backer_fees_accrued | u64 |
backer_fees_claimed | u64 |
creator_fees_unclaimed | u64 |
creator_fees_claimed | u64 |
platform_fees_unclaimed | u64 |
window_start | i64 |
window_buy_cap | u64 |
window_sol_spent | u64 |
window_sell_cap | u64 |
window_tokens_sold | u64 |
ema_price | u128 |
last_trade_ts | i64 |
agent_buys | u32 |
agent_sells | u32 |
agent_sol_spent | u64 |
agent_sol_received | u64 |
agent_tokens_sold | u64 |
buyback_sol | u64 |
volume_sol | u64 |
trade_count | u64 |
last_public_trade_slot | u64 |
last_agent_trade_slot | u64 |
venue | Venue |
create_key | pubkey |
pump | PumpState |
buyback_pool_sol | u64 |
creator_fees_collected | u64 |
burned_sol | u64 |
burned_tokens | u64 |
last_buyback_ts | i64 |
name | string |
symbol | string |
uri | string |
Platform
| Field | Type |
|---|---|
admin | pubkey |
pending_admin | pubkey |
fee_recipient | pubkey |
agent_authority | pubkey |
params | PlatformParams |
launch_count | u64 |
bump | u8 |
Events
| Event | Fields |
|---|---|
BackerFeesClaimed | launch, backer, amount, timestamp |
BuybackBurned | launch, buyback_mint, sol, tokens, buyback_pool_sol, timestamp |
CreatorFeesClaimed | launch, creator, amount, timestamp |
CreatorFeesCollected | launch, mint, amount, to_buyback_pool, to_vault, to_backers, timestamp |
Deposited | launch, backer, amount, total_deposited, raised, timestamp |
LaunchCancelled | launch, timestamp |
LaunchCreated | launch, mint, creator, index, name, symbol, uri, raise_min, raise_max, raise_deadline, bundle_supply_bps, reserve_bps, whitelisted, timestamp |
LaunchMigrated | launch, mint, timestamp |
Launched | launch, mint, raised, launch_fee, bundle_sol, bundle_tokens, vault_sol, price_q64, timestamp |
PlatformFeesSwept | launch, amount, timestamp |
PumpGraduated | launch, mint, pool, timestamp |
Refunded | launch, backer, amount, timestamp |
Trade | launch, mint, trader, is_buy, is_agent, sol_amount, token_amount, fee, price_q64, ema_q64, real_sol, token_reserve, vault_sol, vault_tokens, timestamp |
VaultProfitShared | launch, mint, amount, to_buyback_pool, timestamp |
VaultWithdrawn | launch, mint, sol, tokens, recipient, recipient_tokens, timestamp |
WoundDown | launch, mint, sol_to_backers, tokens_returned, 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 unavailable |
| 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 curve 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 | An agent trade and a public trade can't share a 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 | Launch traded in the last 24 hours; it can't wind down yet |
| 6034 | OutsideHolders | Tokens are held outside the curve and vault; the launch can't wind down |
| 6035 | WrongVenue | This instruction is for the other venue (Holdfast curve vs pump.fun) |
| 6036 | HoldfastCurveDisabled | Launches on the Holdfast curve are closed; create a pump.fun launch |
| 6037 | InvalidVenueAccount | A venue account is missing, has the wrong owner or the wrong layout |
| 6038 | CurveComplete | The pump.fun curve is complete; migrate it and run graduate_pump |
| 6039 | NotGraduated | The launch has not graduated to PumpSwap (or already has) |
| 6040 | BuybackMintUnset | The platform has no buyback mint yet |
| 6041 | BuybackThrottled | Buyback below the minimum size or too soon after the last one |
| 6042 | AlreadyMigrated | Account already uses the current layout |