For the complete documentation index, see llms.txt. This page is also available as Markdown.

API Transaction Enhanced - Filtering by Program Instruction

Filter an account's transaction history by specific on-chain instruction using a PROGRAM_ADDRESS + DISCRIMINATOR pair, so you retrieve only the interactions that matter.

Filtering by Program Instruction — Developer Reference

Solscan Pro API · GET /v2.0/account/transactions/enhanced

Full endpoint: https://pro-api.solscan.io/v2.0/account/transactions/enhanced


Overview

/account/transactions/enhanced is the upgraded version of /account/transactions. It returns raw Solana transaction objects (same structure as getTransaction RPC) with full server-side filtering by time, slot, signature range, signer, token, program, and instruction discriminator.

The instruction parameter is the focus of this document — it filters transactions by the leading bytes of instruction data, which uniquely identifies which instruction was called inside a program.



The instruction[] Parameter

What it does

Filters transactions where at least one instruction matches both a specific program and a specific discriminator. Works server-side — only matching transactions are returned.

Multiple values use OR logic: a transaction matching any of the provided values is included.

Format

Every value passed to instruction[] follows a single unified format:

instruction[] = PROGRAM_ADDRESS + DISCRIMINATOR

The PROGRAM_ADDRESS is the base58 program address (44 characters). The DISCRIMINATOR identifies which specific instruction within that program — its format depends on how the program was built (see Three Cases below).

instruction[]=PROGRAM_ADDRESSDISCRIMINATOR

  • Type: array

  • Required: No

  • Max values: 5

  • No program[] prerequisite — the program address is embedded in the value itself

Example from Solscan API

Breaking this down:

bash

Web UI vs API mapping

The Solscan web UI shows a shorter form in the URL (discriminator only):

https://solscan.io/account/jupoNjAxXgZ4rjzxzPMP4oxduvQsQtZzyknqvzYNrNu ?instruction=5f81edf00831df84

The API requires the full combined form (program address + discriminator):

instruction[]=jupoNjAxXgZ4rjzxzPMP4oxduvQsQtZzyknqvzYNrNu5f81edf00831df84


How to Find the Right Hex Value

Hex Dictionary

Check Solscan IDL Dictionary to find the hex and program address you want to filter

Tools

Case 1 — Anchor Programs (8-byte discriminator)

Anchor programs compute their instruction discriminator using SHA-256:

Result: always 8 bytes = 16 hex characters.

Critical: The instruction name must match the IDL exactly — including casing. Jupiter V6 uses camelCase (sharedAccountsRoute). Jupiter Limit Order uses snake_case (cancel_order). One wrong character produces a completely different hash with no error.

How to compute

JavaScript / TypeScript:

Python:

How to find instruction names from IDL

Option A — Anchor CLI:

Option B — Solscan Explorer:

Open solscan.io/account/PROGRAM_ID → "Anchor Program" tab → instruction names listed come directly from the on-chain IDL.

Option C — Program's GitHub:

Look for target/idl/<program_name>.jsoninstructions[].name.


Case 2 — Native Programs (1-byte enum discriminator)

Native Rust programs do not use Anchor. They route instructions using a simpler scheme — typically a single u8 byte at position data[0]. You cannot compute these with sha256.

The hex value must be looked up from the program's source code or from a known on-chain transaction.

How to find the hex value from a transaction

Step 1 — Find a known transaction on Solscan:

Open a transaction that called the instruction you want. In the instruction detail, find the data field (base58-encoded).

Step 2 — Decode to bytes:

Step 3 — Verify across multiple transactions of the same type to confirm the prefix is consistent.

Summary: Three Cases at a Glance

Case

Program type

instruction[] format

Discriminator length

Example

1

Anchor (has IDL)

programAddress + 8-byte SHA256 hex

16 hex chars

JUP6Lk...e517cb977ae3ad2a

2

Shank (native Rust + IDL)

programAddress + 1-byte enum index hex

2 hex chars

metaqb...31

3

Native, no IDL (Solscan-decoded)

programAddress + instruction name string

Variable

Tokenk...initializeImmutableOwner


Discriminator Reference Tables

Anchor Programs

Jupiter V6 Aggregator — JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4

IDL casing: camelCase

Instruction

instruction[] value

Description

route

e517cb977ae3ad2a

Standard multi-hop swap

sharedAccountsRoute

5703feb8e7573909

Swap with shared intermediate accounts

exactOutRoute

7e2c8ea1d9a65bc6

Swap targeting exact output amount

sharedAccountsExactOutRoute

41d8fa8dac726b69

Exact-out with shared accounts

routeWithTokenLedger

34650f14745e8de8

Swap with token ledger tracking

sharedAccountsRouteWithTokenLedger

b4476e37d9cc1af6

Combined


Jupiter Limit Order — jupoNjAxXgZ4rjzxzPMP4oxduvQsQtZzyknqvzYNrNu

IDL casing: snake_case

Instruction

instruction[] value

Description

initialize_order

856e4aaf709ff59f

Place a new limit order

cancel_order

5f81edf00831df84

Cancel an active limit order

cancel_expired_order

d87840eb9b13e563

Cancel an expired order

fill_order

e87a7319c78f88a2

Fill (execute) a limit order

update_order

3608d0cf2286efa8

Update order parameters


PumpFun — 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P

IDL casing: single word / camelCase

Instruction

instruction[] value

Description

buy

66063d1201daebea

Buy tokens from bonding curve

sell

33e685a4017f83ad

Sell tokens to bonding curve

create

181ec828051c0777

Create new token + bonding curve

withdraw

b712469c946da122

Withdraw after graduation

setParams

a51f8635bdb482ff

Set program parameters


PumpSwap AMM — pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA

Instruction

instruction[] value

Description

buy

66063d1201daebea

Buy tokens from AMM pool

sell

33e685a4017f83ad

Sell tokens to AMM pool

createPool

f4ec750412003e58

Create a new liquidity pool

deposit

f223c68952e1f2b6

Add liquidity

withdraw

b712469c946da122

Remove liquidity


Meteora DLMM — LBUZKhRxPF3XUpBCjp4YzTKgLLjeyegsnkragzgX3e1

Instruction

instruction[] value

Description

swap

f8c69e91e17587c8

Swap tokens

addLiquidity

af5dbe403d45f72f

Add liquidity to bin range

addLiquidityByWeight

2864ba22a03abda5

Add liquidity by weight

addLiquidityByStrategy

3fce7c3284c7f5c7

Add liquidity by strategy

removeLiquidity

42462be955ca6569

Remove liquidity

initializeLbPair

d4ef121058d49273

Create new DLMM pool

claimFee

60de60a26da84b50

Claim accumulated fees

claimReward

4e2e56036289e445

Claim pending rewards


OpenBook V2 — opnb2LAfJYbRMAHHvqjCwQxanZn7ReEHp1k81EohpZb

Instruction

instruction[] value

Description

placeOrder

c00587a4401d171f

Place a new limit order

placeOrderPegged

e725358372f26354

Place a pegged order

cancelOrder

1b5e0e66de5a0c81

Cancel a specific order

cancelAllOrders

1a89748f328b8970

Cancel all open orders

cancelAllAndPlaceOrders

f49de4be55bd8eef

Atomic cancel-all + place

settleFunds

90cad55fcdcf1ffd

Settle filled order funds


Marinade Finance — MarBmsSgKXdrN1egZf5sqe1TMai9K1rChYNDJgjq7aD

Instruction

instruction[] value

Description

depositSol

ea2547ee8871ffc4

Deposit native SOL

liquidUnstake

5c5668e7895eb4c6

Instant unstake

orderUnstake

c1c8fa8c0007dfdf

Delayed unstake

claim

3ec6d6c1d59f6cd2

Claim matured ticket


Kamino Lending — KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD

Instruction

instruction[] value

Description

depositReserveLiquidity

c4673dc58e51b79f

Deposit to reserve

borrowObligationLiquidity

44808469a09add91

Borrow against collateral

repayObligationLiquidity

02fa22eeb7c3175b

Repay borrow

withdrawReserveLiquidity

41ce6575a9d0f7c4

Withdraw from reserve

liquidateObligation

427ece3917fdad5e

Liquidate position


Native Programs (1-byte enum)

SPL Token — TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA

Values from official SPL Token source — stable since genesis.

Instruction

instruction[] value

Description

InitializeMint

00

Initialize a new mint

InitializeAccount

01

Initialize a token account

Transfer

03

Transfer tokens

Approve

04

Approve delegate

MintTo

07

Mint new tokens

Burn

08

Burn tokens

CloseAccount

09

Close token account

TransferChecked

0c

Transfer with mint verification

MintToChecked

0e

Mint with verification

BurnChecked

0f

Burn with verification


Raydium AMM V4 — 675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8

No public IDL. Values from on-chain data analysis.

Instruction

instruction[] value

Description

swapBaseIn

09

Swap with fixed input amount

swapBaseOut

0b

Swap with fixed output amount

addLiquidity

03

Add liquidity

removeLiquidity

04

Remove liquidity


Full Request Examples — Combined Filters

USDC swaps on Jupiter V6 within a time window

New token launches on PumpFun (program as address)

Market maker order activity on OpenBook V2 with slot range

Paginating through results with cursor



Choosing the Right Encoding

The encoding parameter controls the format of transaction data in the response.

Value

instruction.data format

Use when

jsonParsed (default)

Human-readable parsed object (where IDL available)

Exploring data, debugging

json

Base58 string

Standard RPC-compatible format

base64

Base64 string

Compact binary transfer

base58

Base58 string

Legacy compatibility

For instruction filtering and data analysis, jsonParsed gives the most context. For raw byte inspection (to find discriminators manually), json or base64 and then decoding client-side.

Last updated

Was this helpful?