{
  "address": "8AzK5ZoKFNALWq7Hx29e3UTsfxfXzDAaHbbg7sdTB8X6",
  "metadata": {
    "name": "claw_shark_curve",
    "version": "0.1.0",
    "spec": "0.1.0",
    "description": "SharkTank Bonding Curve — Solana Program"
  },
  "instructions": [
    {
      "name": "buy_tokens",
      "docs": [
        "Agent or user buys tokens on the bonding curve"
      ],
      "discriminator": [
        189,
        21,
        230,
        133,
        247,
        2,
        110,
        42
      ],
      "accounts": [
        {
          "name": "launch",
          "writable": true
        },
        {
          "name": "purchase",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112,
                  117,
                  114,
                  99,
                  104,
                  97,
                  115,
                  101
                ]
              },
              {
                "kind": "account",
                "path": "launch"
              },
              {
                "kind": "account",
                "path": "buyer"
              },
              {
                "kind": "account",
                "path": "launch.total_buyers",
                "account": "Launch"
              }
            ]
          }
        },
        {
          "name": "agent_record",
          "docs": [
            "Optional: if buyer is a registered agent"
          ],
          "optional": true
        },
        {
          "name": "buyer",
          "writable": true,
          "signer": true
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "usdc_amount",
          "type": "u64"
        }
      ]
    },
    {
      "name": "create_launch",
      "docs": [
        "Founder creates a new token launch with bonding curve"
      ],
      "discriminator": [
        239,
        223,
        255,
        134,
        39,
        121,
        127,
        62
      ],
      "accounts": [
        {
          "name": "launch",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  108,
                  97,
                  117,
                  110,
                  99,
                  104
                ]
              },
              {
                "kind": "account",
                "path": "founder"
              },
              {
                "kind": "arg",
                "path": "name"
              }
            ]
          }
        },
        {
          "name": "founder",
          "writable": true,
          "signer": true
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "name",
          "type": "string"
        },
        {
          "name": "symbol",
          "type": "string"
        },
        {
          "name": "total_supply",
          "type": "u64"
        },
        {
          "name": "initial_price_lamports",
          "type": "u64"
        },
        {
          "name": "curve_slope",
          "type": "u64"
        },
        {
          "name": "migration_threshold",
          "type": "u64"
        }
      ]
    },
    {
      "name": "create_vault",
      "docs": [
        "Register agent vault with spending rules"
      ],
      "discriminator": [
        29,
        237,
        247,
        208,
        193,
        82,
        54,
        135
      ],
      "accounts": [
        {
          "name": "vault",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  97,
                  117,
                  108,
                  116
                ]
              },
              {
                "kind": "account",
                "path": "owner"
              }
            ]
          }
        },
        {
          "name": "owner",
          "writable": true,
          "signer": true
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "max_per_project",
          "type": "u64"
        },
        {
          "name": "daily_limit",
          "type": "u64"
        },
        {
          "name": "min_score",
          "type": "u8"
        },
        {
          "name": "require_consensus",
          "type": "bool"
        }
      ]
    },
    {
      "name": "deposit_vault",
      "docs": [
        "Deposit USDC into agent vault"
      ],
      "discriminator": [
        126,
        224,
        21,
        255,
        228,
        53,
        117,
        33
      ],
      "accounts": [
        {
          "name": "vault",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  97,
                  117,
                  108,
                  116
                ]
              },
              {
                "kind": "account",
                "path": "owner"
              }
            ]
          }
        },
        {
          "name": "owner",
          "signer": true
        }
      ],
      "args": [
        {
          "name": "amount",
          "type": "u64"
        }
      ]
    },
    {
      "name": "get_price",
      "docs": [
        "Get current price on bonding curve"
      ],
      "discriminator": [
        238,
        38,
        193,
        106,
        228,
        32,
        210,
        33
      ],
      "accounts": [
        {
          "name": "launch"
        }
      ],
      "args": []
    },
    {
      "name": "sell_tokens",
      "docs": [
        "Sell tokens back to the bonding curve"
      ],
      "discriminator": [
        114,
        242,
        25,
        12,
        62,
        126,
        92,
        2
      ],
      "accounts": [
        {
          "name": "launch",
          "writable": true
        },
        {
          "name": "seller",
          "writable": true,
          "signer": true
        }
      ],
      "args": [
        {
          "name": "token_amount",
          "type": "u64"
        }
      ]
    },
    {
      "name": "withdraw_vault",
      "docs": [
        "Withdraw from vault back to wallet"
      ],
      "discriminator": [
        135,
        7,
        237,
        120,
        149,
        94,
        95,
        7
      ],
      "accounts": [
        {
          "name": "vault",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  97,
                  117,
                  108,
                  116
                ]
              },
              {
                "kind": "account",
                "path": "owner"
              }
            ]
          }
        },
        {
          "name": "owner",
          "signer": true
        }
      ],
      "args": [
        {
          "name": "amount",
          "type": "u64"
        }
      ]
    }
  ],
  "accounts": [
    {
      "name": "AgentVault",
      "discriminator": [
        232,
        220,
        237,
        164,
        157,
        9,
        215,
        194
      ]
    },
    {
      "name": "Launch",
      "discriminator": [
        144,
        51,
        51,
        163,
        206,
        85,
        213,
        38
      ]
    },
    {
      "name": "Purchase",
      "discriminator": [
        33,
        203,
        1,
        252,
        231,
        228,
        8,
        67
      ]
    }
  ],
  "events": [
    {
      "name": "MigrationTriggered",
      "discriminator": [
        95,
        32,
        44,
        77,
        244,
        159,
        125,
        57
      ]
    },
    {
      "name": "PriceQuery",
      "discriminator": [
        90,
        25,
        53,
        129,
        14,
        253,
        42,
        87
      ]
    },
    {
      "name": "TokensPurchased",
      "discriminator": [
        214,
        119,
        105,
        186,
        114,
        205,
        228,
        181
      ]
    },
    {
      "name": "TokensSold",
      "discriminator": [
        217,
        83,
        68,
        137,
        134,
        225,
        94,
        45
      ]
    }
  ],
  "errors": [
    {
      "code": 6000,
      "name": "AlreadyMigrated",
      "msg": "Launch already migrated to DEX"
    },
    {
      "code": 6001,
      "name": "ZeroAmount",
      "msg": "Amount must be greater than zero"
    },
    {
      "code": 6002,
      "name": "SoldOut",
      "msg": "All tokens have been sold"
    },
    {
      "code": 6003,
      "name": "Unauthorized",
      "msg": "Not authorized"
    },
    {
      "code": 6004,
      "name": "InsufficientBalance",
      "msg": "Insufficient vault balance"
    },
    {
      "code": 6005,
      "name": "Overflow",
      "msg": "Arithmetic overflow"
    },
    {
      "code": 6006,
      "name": "Underflow",
      "msg": "Arithmetic underflow"
    }
  ],
  "types": [
    {
      "name": "AgentVault",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "owner",
            "type": "pubkey"
          },
          {
            "name": "balance",
            "type": "u64"
          },
          {
            "name": "max_per_project",
            "type": "u64"
          },
          {
            "name": "daily_limit",
            "type": "u64"
          },
          {
            "name": "daily_spent",
            "type": "u64"
          },
          {
            "name": "last_reset",
            "type": "i64"
          },
          {
            "name": "min_score",
            "type": "u8"
          },
          {
            "name": "require_consensus",
            "type": "bool"
          },
          {
            "name": "is_active",
            "type": "bool"
          },
          {
            "name": "total_invested",
            "type": "u64"
          },
          {
            "name": "total_returns",
            "type": "u64"
          },
          {
            "name": "bump",
            "type": "u8"
          }
        ]
      }
    },
    {
      "name": "Launch",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "authority",
            "type": "pubkey"
          },
          {
            "name": "name",
            "type": "string"
          },
          {
            "name": "symbol",
            "type": "string"
          },
          {
            "name": "total_supply",
            "type": "u64"
          },
          {
            "name": "tokens_sold",
            "type": "u64"
          },
          {
            "name": "usdc_collected",
            "type": "u64"
          },
          {
            "name": "initial_price",
            "type": "u64"
          },
          {
            "name": "curve_slope",
            "type": "u64"
          },
          {
            "name": "migration_threshold",
            "type": "u64"
          },
          {
            "name": "migrated",
            "type": "bool"
          },
          {
            "name": "created_at",
            "type": "i64"
          },
          {
            "name": "agent_buys",
            "type": "u64"
          },
          {
            "name": "total_buyers",
            "type": "u64"
          },
          {
            "name": "bump",
            "type": "u8"
          }
        ]
      }
    },
    {
      "name": "MigrationTriggered",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "launch",
            "type": "pubkey"
          },
          {
            "name": "market_cap",
            "type": "u64"
          },
          {
            "name": "total_buyers",
            "type": "u64"
          },
          {
            "name": "agent_buys",
            "type": "u64"
          }
        ]
      }
    },
    {
      "name": "PriceQuery",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "launch",
            "type": "pubkey"
          },
          {
            "name": "current_price",
            "type": "u64"
          },
          {
            "name": "tokens_sold",
            "type": "u64"
          },
          {
            "name": "market_cap",
            "type": "u64"
          }
        ]
      }
    },
    {
      "name": "Purchase",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "buyer",
            "type": "pubkey"
          },
          {
            "name": "launch",
            "type": "pubkey"
          },
          {
            "name": "usdc_paid",
            "type": "u64"
          },
          {
            "name": "tokens_received",
            "type": "u64"
          },
          {
            "name": "price_at_buy",
            "type": "u64"
          },
          {
            "name": "is_agent",
            "type": "bool"
          },
          {
            "name": "timestamp",
            "type": "i64"
          },
          {
            "name": "bump",
            "type": "u8"
          }
        ]
      }
    },
    {
      "name": "TokensPurchased",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "launch",
            "type": "pubkey"
          },
          {
            "name": "buyer",
            "type": "pubkey"
          },
          {
            "name": "usdc_paid",
            "type": "u64"
          },
          {
            "name": "tokens_received",
            "type": "u64"
          },
          {
            "name": "new_price",
            "type": "u64"
          },
          {
            "name": "is_agent",
            "type": "bool"
          }
        ]
      }
    },
    {
      "name": "TokensSold",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "launch",
            "type": "pubkey"
          },
          {
            "name": "seller",
            "type": "pubkey"
          },
          {
            "name": "tokens_sold",
            "type": "u64"
          },
          {
            "name": "usdc_received",
            "type": "u64"
          },
          {
            "name": "fee",
            "type": "u64"
          }
        ]
      }
    }
  ]
}