{
  "address": "curvevQuSjWHvT6umWRn6yzai2PeuFxnXsbYZqhkLcr",
  "metadata": {
    "name": "abyss_curve",
    "version": "0.1.0",
    "spec": "0.1.0",
    "description": "Abyss launchpad core: config, token launch, bonding-curve buy/sell (Pinocchio). Curve: vSol=26.48, vTok=1.0731B, real 793.1M, graduation at 75 SOL, fee 0.25% flat."
  },
  "instructions": [
    {
      "name": "initialize_config",
      "discriminator": [
        0
      ],
      "accounts": [
        {
          "name": "payer",
          "writable": true,
          "signer": true,
          "docs": [
            "must equal the upgrade authority; becomes config.admin"
          ]
        },
        {
          "name": "config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": "config"
              }
            ]
          }
        },
        {
          "name": "treasury"
        },
        {
          "name": "vesting_program"
        },
        {
          "name": "hook_program",
          "docs": [
            "Zero pubkey = mints without Transfer Hook extension"
          ]
        },
        {
          "name": "pool_program",
          "docs": [
            "abyss-pool program id; migrate validates pool PDAs under it"
          ]
        },
        {
          "name": "program_data",
          "docs": [
            "ProgramData account of this program: PDA [program_id] under BPFLoaderUpgradeab1e11111111111111111111111"
          ]
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "fee_bps",
          "type": "u64"
        },
        {
          "name": "dev_cap_bps",
          "type": "u64"
        },
        {
          "name": "max_wallet_bps",
          "type": "u64"
        },
        {
          "name": "dup_penalty",
          "type": "u64",
          "docs": [
            "lamports, paid to treasury on duplicate ticker within window"
          ]
        },
        {
          "name": "dup_window",
          "type": "i64",
          "docs": [
            "seconds"
          ]
        }
      ],
      "docs": [
        "Only the program's upgrade authority can call it (checked against the ProgramData account). fee_bps <= 1000, bps values <= 10000."
      ]
    },
    {
      "name": "create_launch",
      "discriminator": [
        1
      ],
      "accounts": [
        {
          "name": "payer",
          "writable": true,
          "signer": true,
          "docs": [
            "becomes dev + vesting beneficiary"
          ]
        },
        {
          "name": "config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": "config"
              }
            ]
          }
        },
        {
          "name": "launch",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": "launch"
              },
              {
                "kind": "account",
                "path": "mint"
              }
            ]
          }
        },
        {
          "name": "ticker_acc",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": "ticker"
              },
              {
                "kind": "arg",
                "path": "ticker",
                "trim": "ticker_len"
              }
            ]
          }
        },
        {
          "name": "mint",
          "writable": true,
          "signer": true,
          "docs": [
            "fresh keypair; Token-2022 mint, authority revoked in the same ix"
          ]
        },
        {
          "name": "sol_vault",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": "sol_vault"
              },
              {
                "kind": "account",
                "path": "mint"
              }
            ]
          }
        },
        {
          "name": "token_vault",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": "token_vault"
              },
              {
                "kind": "account",
                "path": "mint"
              }
            ]
          }
        },
        {
          "name": "vesting_state",
          "writable": true,
          "pda": {
            "program": "vesting_program",
            "seeds": [
              {
                "kind": "const",
                "value": "vesting"
              },
              {
                "kind": "account",
                "path": "launch"
              }
            ]
          }
        },
        {
          "name": "vesting_vault",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": "vesting_vault"
              },
              {
                "kind": "account",
                "path": "mint"
              }
            ]
          }
        },
        {
          "name": "treasury",
          "writable": true
        },
        {
          "name": "vesting_program"
        },
        {
          "name": "token_program",
          "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "ticker_len",
          "type": "u8",
          "docs": [
            "1..=10, only [a-z0-9]"
          ]
        },
        {
          "name": "ticker",
          "type": {
            "array": [
              "u8",
              16
            ]
          }
        },
        {
          "name": "dev_buy_sol",
          "type": "u64",
          "docs": [
            "lamports; 0 = no dev allocation, vesting accounts must still be passed. Tokens bought must not exceed dev_cap_bps of supply (107). The dev badge (launch.dev_bps) is computed from the tokens actually bought, rounded up."
          ]
        },
        {
          "name": "cliff_secs",
          "type": "u64",
          "docs": [
            "seconds (wall clock, not slots)"
          ]
        },
        {
          "name": "vest_secs",
          "type": "u64",
          "docs": [
            "seconds of linear unlock after the cliff; must be > 0 when dev_buy_sol > 0"
          ]
        },
        {
          "name": "mint_space",
          "type": "u64",
          "docs": [
            "82 without hook, 234 with hook"
          ]
        }
      ],
      "remaining_accounts": "With config.hook_program set: append [extra_metas (writable, hook PDA ['extra-account-metas', mint]), hook_config (hook PDA ['taint_config']), hook_program]. The mint is registered with the hook in the same instruction."
    },
    {
      "name": "buy",
      "discriminator": [
        2
      ],
      "accounts": [
        {
          "name": "user",
          "writable": true,
          "signer": true
        },
        {
          "name": "config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": "config"
              }
            ]
          }
        },
        {
          "name": "launch",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": "launch"
              },
              {
                "kind": "account",
                "path": "mint"
              }
            ]
          }
        },
        {
          "name": "mint"
        },
        {
          "name": "sol_vault",
          "writable": true
        },
        {
          "name": "token_vault",
          "writable": true
        },
        {
          "name": "user_ata",
          "writable": true,
          "docs": [
            "Must be the user's canonical Token-2022 ATA for mint (ATA program PDA [user, token_program, mint]); anything else fails with 105"
          ]
        },
        {
          "name": "treasury",
          "writable": true
        },
        {
          "name": "wallet",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": "wallet"
              },
              {
                "kind": "account",
                "path": "launch"
              },
              {
                "kind": "account",
                "path": "user"
              }
            ]
          },
          "docs": [
            "Per-wallet state: net curve purchases (cap) + sell throttle bucket. Created on first buy/sell, rent paid by user."
          ]
        },
        {
          "name": "token_program",
          "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "sol_in",
          "type": "u64",
          "docs": [
            "gross lamports; fee_bps taken first; partial fill caps net at 75 SOL graduation, unspent lamports stay with user"
          ]
        },
        {
          "name": "min_tokens_out",
          "type": "u64",
          "docs": [
            "slippage guard"
          ]
        }
      ],
      "remaining_accounts": "Mints with the transfer hook: append 4 remaining accounts [sender_taint (writable), recipient_taint (writable), hook_program, extra_metas]. taint = hook PDA ['taint', token_account] of the source / destination token account; extra_metas = hook PDA ['extra-account-metas', mint]."
    },
    {
      "name": "migrate",
      "discriminator": [
        4
      ],
      "docs": [
        "Permissionless crank. Requires launch.state=TRADING and real_sol >= 75 SOL. Sends all SOL and remaining tokens to pool vaults, sets state=MIGRATED. Same tx as pool.initialize_pool."
      ],
      "accounts": [
        {
          "name": "config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": "config"
              }
            ]
          }
        },
        {
          "name": "launch",
          "writable": true
        },
        {
          "name": "mint"
        },
        {
          "name": "sol_vault",
          "writable": true
        },
        {
          "name": "token_vault",
          "writable": true
        },
        {
          "name": "pool",
          "pda": {
            "program": "config.pool_program",
            "seeds": [
              {
                "kind": "const",
                "value": "pool"
              },
              {
                "kind": "account",
                "path": "mint"
              },
              {
                "kind": "const",
                "value": "<curve_program_id>"
              }
            ]
          }
        },
        {
          "name": "pool_sol_vault",
          "writable": true,
          "pda": {
            "program": "config.pool_program",
            "seeds": [
              {
                "kind": "const",
                "value": "pool_sol_vault"
              },
              {
                "kind": "account",
                "path": "mint"
              },
              {
                "kind": "const",
                "value": "<curve_program_id>"
              }
            ]
          }
        },
        {
          "name": "pool_token_vault",
          "writable": true,
          "pda": {
            "program": "config.pool_program",
            "seeds": [
              {
                "kind": "const",
                "value": "pool_token_vault"
              },
              {
                "kind": "account",
                "path": "mint"
              },
              {
                "kind": "const",
                "value": "<curve_program_id>"
              }
            ]
          }
        },
        {
          "name": "token_program",
          "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
        }
      ],
      "args": [],
      "remaining_accounts": "Mints with the transfer hook: append 4 remaining accounts [sender_taint (writable), recipient_taint (writable), hook_program, extra_metas]. taint = hook PDA ['taint', token_account] of the source / destination token account; extra_metas = hook PDA ['extra-account-metas', mint]."
    },
    {
      "name": "sell",
      "discriminator": [
        3
      ],
      "accounts": [
        {
          "name": "user",
          "writable": true,
          "signer": true
        },
        {
          "name": "config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": "config"
              }
            ]
          }
        },
        {
          "name": "launch",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": "launch"
              },
              {
                "kind": "account",
                "path": "mint"
              }
            ]
          }
        },
        {
          "name": "mint"
        },
        {
          "name": "sol_vault",
          "writable": true
        },
        {
          "name": "token_vault",
          "writable": true
        },
        {
          "name": "user_ata",
          "writable": true,
          "docs": [
            "Must be the user's canonical Token-2022 ATA for mint (ATA program PDA [user, token_program, mint]); anything else fails with 105"
          ]
        },
        {
          "name": "treasury",
          "writable": true
        },
        {
          "name": "wallet",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": "wallet"
              },
              {
                "kind": "account",
                "path": "launch"
              },
              {
                "kind": "account",
                "path": "user"
              }
            ]
          },
          "docs": [
            "Per-wallet state: net curve purchases (cap) + sell throttle bucket. Created on first buy/sell, rent paid by user."
          ]
        },
        {
          "name": "token_program",
          "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "tok_in",
          "type": "u64"
        },
        {
          "name": "min_sol_out",
          "type": "u64",
          "docs": [
            "slippage guard, net of fee"
          ]
        }
      ],
      "docs": [
        "Always allowed, limited only by the progressive throttle. Leaky bucket: sold drains linearly over 24h; stake = ATA balance + sold; stake < 1% supply unrestricted, 1-5% -> 50% of stake, >= 5% or launch dev -> 25% of stake. A seller whose token account is tainted or flagged by the hook is on the 25% tier too."
      ],
      "remaining_accounts": "Mints with the transfer hook: append 4 remaining accounts [sender_taint (writable), recipient_taint (writable), hook_program, extra_metas]. taint = hook PDA ['taint', token_account] of the source / destination token account; extra_metas = hook PDA ['extra-account-metas', mint]."
    }
  ],
  "accounts": [
    {
      "name": "Config"
    },
    {
      "name": "Launch"
    },
    {
      "name": "TickerEntry"
    },
    {
      "name": "WalletState"
    }
  ],
  "types": [
    {
      "name": "Config",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "admin",
            "type": "pubkey"
          },
          {
            "name": "treasury",
            "type": "pubkey"
          },
          {
            "name": "vesting_program",
            "type": "pubkey"
          },
          {
            "name": "hook_program",
            "type": "pubkey"
          },
          {
            "name": "fee_bps",
            "type": "u64"
          },
          {
            "name": "dev_cap_bps",
            "type": "u64"
          },
          {
            "name": "max_wallet_bps",
            "type": "u64"
          },
          {
            "name": "dup_penalty",
            "type": "u64"
          },
          {
            "name": "dup_window",
            "type": "i64"
          },
          {
            "name": "bump",
            "type": "u8"
          },
          {
            "name": "pool_program",
            "type": "pubkey"
          }
        ]
      }
    },
    {
      "name": "Launch",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "dev",
            "type": "pubkey"
          },
          {
            "name": "vesting_state",
            "type": "pubkey"
          },
          {
            "name": "state",
            "type": "u8",
            "docs": [
              "0=TRADING, 1=MIGRATED"
            ]
          },
          {
            "name": "bump",
            "type": "u8"
          },
          {
            "name": "created_slot",
            "type": "u64"
          },
          {
            "name": "real_sol",
            "type": "u64"
          },
          {
            "name": "real_tok",
            "type": "u64"
          },
          {
            "name": "last_activity",
            "type": "i64"
          },
          {
            "name": "dev_bps",
            "type": "u64",
            "docs": [
              "actual dev allocation in bps of supply, rounded up"
            ]
          }
        ]
      }
    },
    {
      "name": "TickerEntry",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "first_created_at",
            "type": "i64"
          },
          {
            "name": "bump",
            "type": "u8"
          }
        ]
      }
    },
    {
      "name": "WalletState",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "sold",
            "type": "u64",
            "docs": [
              "throttle bucket level at last_sell_ts; drains linearly to 0 over 86400 s"
            ]
          },
          {
            "name": "last_sell_ts",
            "type": "i64"
          },
          {
            "name": "bought_net",
            "type": "u64",
            "docs": [
              "tokens bought from the curve minus tokens sold to it (floor 0)"
            ]
          },
          {
            "name": "bump",
            "type": "u8"
          }
        ]
      }
    }
  ],
  "errors": [
    {
      "code": 100,
      "name": "Slippage",
      "msg": "output below the minimum (or zero)"
    },
    {
      "code": 101,
      "name": "Throttled",
      "msg": "sell exceeds the wallet's rolling 24h limit"
    },
    {
      "code": 102,
      "name": "WalletCap",
      "msg": "buy would push the wallet's net curve purchases over max_wallet_bps"
    },
    {
      "code": 103,
      "name": "NotGraduated",
      "msg": "curve has not reached 75 SOL"
    },
    {
      "code": 104,
      "name": "NotTrading",
      "msg": "launch is not in TRADING state"
    },
    {
      "code": 105,
      "name": "BadAta",
      "msg": "user_ata is not the user's canonical Token-2022 ATA"
    },
    {
      "code": 106,
      "name": "Unauthorized",
      "msg": "signer is not the program's upgrade authority"
    },
    {
      "code": 107,
      "name": "DevOverCap",
      "msg": "dev buy exceeds dev_cap_bps of supply"
    }
  ]
}
