BonkSwap IDL

bonkswapv0.1.1DEX / AMM
Program Address
BSwp6bEBihVLdqJRKGgzjcGLHkcTuzmSo1TQkHepzH8p
On-chain

BonkSwap is a Solana AMM DEX built for the BONK memecoin ecosystem. Features pool creation, liquidity provision, token swapping with multi-tier fees (LP, buyback, project, Mercanti), and built-in farming rewards for LPs.

19
Instructions
5
Accounts
0
Events
4
Types

Instructions

createPoolcreateProvidercreateStateaddTokenswithdrawBuybackswapwithdrawShareswithdrawLpFeewithdrawProjectFeecreateFarmcreateDualFarmcreateTripleFarm+7 more

Account Types

FarmPoolV2PoolProviderState

Integration Examples

Use the BonkSwap IDL in your application with these code examples for TypeScript, Rust, and Python.

import { Connection, PublicKey } from "@solana/web3.js";
import { Program, AnchorProvider, Idl } from "@coral-xyz/anchor";

// Load the BonkSwap IDL
import idl from "./bonkswap.json";

const PROGRAM_ID = new PublicKey("BSwp6bEBihVLdqJRKGgzjcGLHkcTuzmSo1TQkHepzH8p");

// Set up the provider and program
const connection = new Connection("https://api.mainnet-beta.solana.com");
const provider = new AnchorProvider(connection, wallet, {
  commitment: "confirmed",
});
const program = new Program(idl as Idl, provider);

// Fetch and decode an account
const accountData = await program.account.bonkSwap
  .fetch(accountPublicKey);
console.log("Account data:", accountData);

// Build and send an instruction
const tx = await program.methods
  .initialize(/* ...args */)
  .accounts({
    /* ...required accounts */
  })
  .rpc();
console.log("Transaction signature:", tx);

IDL JSON Preview

bonkswap.json
{
  "version": "0.1.1",
  "name": "bonkswap",
  "instructions": [
    {
      "name": "createPool",
      "accounts": [
        {
          "name": "state",
          "isMut": false,
          "isSigner": false,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "type": "string",
                "value": "bonkswapstatev1"
              }
            ]
          }
        },
        {
          "name": "pool",
          "isMut": true,
          "isSigner": false,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "type": "string",
...

Frequently Asked Questions

What is the BonkSwap IDL?

The BonkSwap IDL (Interface Definition Language) is a JSON schema that defines the on-chain program interface for the BonkSwap smart contract on Solana. It describes all available instructions, account structures, events, and custom types that developers need to interact with the BonkSwap program. This IDL contains 19 instructions, 5 account types, 0 events, and 4 type definitions.

How do I use the BonkSwap IDL in my project?

Download the JSON file and import it in your project. With TypeScript, use the @coral-xyz/anchor package to create a Program instance. In Rust, use anchor-client. For Python, use anchorpy. See the integration examples above for complete code snippets in all three languages.

What is the BonkSwap program address on Solana?

The BonkSwap program is deployed at address BSwp6bEBihVLdqJRKGgzjcGLHkcTuzmSo1TQkHepzH8p on Solana mainnet. You can verify this on any Solana block explorer.

What version of the BonkSwap IDL is this?

This is version 0.1.1 of the BonkSwap IDL. IDL versions correspond to specific program deployments and may be updated as the protocol evolves. Always verify compatibility with the on-chain program version before integrating.