Docs · Reference
Program reference
Instructions, accounts, events and errors of the Holdfast program, generated from the IDL shipped in @holdfast/sdk.
Address
C1c2ggJWMy2Ta4ogc297mGWk7Fj617dAxQr91BJKpTSW on devnet. 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 |
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 |
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 |
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 |
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 |
CreatorFeesClaimed | launch, creator, amount, 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 |
Launched | launch, mint, raised, launch_fee, bundle_sol, bundle_tokens, vault_sol, price_q64, timestamp |
PlatformFeesSwept | launch, amount, 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 |
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 |