OKX DEX v3 IDL

okxv0.1.0DEX Aggregator
Program Address
proVF4pMXVaYqmy4NjniPh4pqKNfMmsihgd4wdkCX3u
On-chain

OKX DEX v3 is the latest on-chain swap program from OKX with optimized account management (create_token_account_with_seed), commission routing, and multi-hop token ledger tracking for Solana swaps.

17
Instructions
1
Accounts
6
Events
12
Types

Instructions

claimcreate_token_accountcreate_token_account_with_seedinit_token_ledgerproxy_swapset_token_ledgerswapswap_tobswap_tob_enhancedswap_tob_v2swap_tob_with_receiverswap_tob_with_receiver_token_ledger+5 more

Account Types

TokenLedger

Events

SwapCpiEvent2SwapEventSwapTobV2CpiEvent2SwapTocV2CpiEvent2SwapWithFeesCpiEvent2SwapWithFeesCpiEventEnhanced2

Integration Examples

Use the OKX DEX v3 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 OKX DEX v3 IDL
import idl from "./okx dex v3.json";

const PROGRAM_ID = new PublicKey("proVF4pMXVaYqmy4NjniPh4pqKNfMmsihgd4wdkCX3u");

// 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.oKX_DEX_v3
  .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

okx dex v3.json
{
  "address": "proVF4pMXVaYqmy4NjniPh4pqKNfMmsihgd4wdkCX3u",
  "metadata": {
    "name": "dex_solana_v3",
    "version": "0.1.0",
    "spec": "0.1.0",
    "description": "Created with Anchor"
  },
  "instructions": [
    {
      "name": "claim",
      "discriminator": [
        62,
        198,
        214,
        193,
        213,
        159,
        108,
        210
      ],
      "accounts": [
        {
          "name": "signer",
          "writable": true,
          "signer": true,
          "address": "CjoV5B96reuCfPh2rRK11G1QptG97jZdyZArTn3EN1Mj"
        },
        {
          "name": "receiver",
...

Frequently Asked Questions

What is the OKX DEX v3 IDL?

The OKX DEX v3 IDL (Interface Definition Language) is a JSON schema that defines the on-chain program interface for the OKX DEX v3 smart contract on Solana. It describes all available instructions, account structures, events, and custom types that developers need to interact with the OKX DEX v3 program. This IDL contains 17 instructions, 1 account types, 6 events, and 12 type definitions.

How do I use the OKX DEX v3 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 OKX DEX v3 program address on Solana?

The OKX DEX v3 program is deployed at address proVF4pMXVaYqmy4NjniPh4pqKNfMmsihgd4wdkCX3u on Solana mainnet. You can verify this on any Solana block explorer.

What version of the OKX DEX v3 IDL is this?

This is version 0.1.0 of the OKX DEX v3 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.