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

Flash SDK

Introduction

Flash.trade SDK written in TypeScript provides the easiest way for developers, partners, and others to integrate with flash.trade. This page will walk you through setting up the Flash client, creating transactions, and executing them.

v15.16+ migration notes

  • Prices now come from the Pyth Lazer HTTP proxy. The old @pythnetwork/client dependency is no longer needed.

  • Privilege accounts (Referral / Stake) are resolved automatically per-trade — see Trader Interactions → Privilege accounts.

  • A single POOL_CONFIGS array replaces hardcoded Crypto.1 selection.

Install the Flash SDK

npm install flash-sdk

yarn add flash-sdk

Setting up the Flash SDK

Mainnet pools (load every pool you might trade against — the SDK auto-routes to the right one per trade):

Pool name
a.k.a.
Notable markets

Crypto.1

flp.1

BTC, ETH, SOL, ZEC, JitoSOL

Virtual.1

flp.2

Virtuals

Governance.1

flp.3

HYPE, JUP, JTO

Community.1

flp.4

BONK, PENGU, PUMP

Community.2

flp.5

WIF

Trump.1

flp.7

FARTCOIN

Ore.1

flp.8

ORE

Remora.1

flp.r

Remora

Equity.1

flp.x

SPY and other equities

Devnet pools: devnet.1 through devnet.5.

Pool definitions live at node_modules/flash-sdk/dist/PoolConfig.json.

Load every pool up front

All mainnet pools share the same programId, perpComposibilityProgramId, fbNftRewardProgramId, and rewardDistributionProgram.programId. One PerpetualsClient instance therefore serves every pool — the per-trade poolConfig argument is what scopes each instruction.

Picking the right pool per trade

Don't hardcode a single pool — use these two helpers to look up the right one from a token + side, or from a position's market account.

SOL/BTC routes to Crypto.1, SPY to Equity.1, FARTCOIN to Trump.1, ORE to Ore.1, and so on. getPoolConfigForMarket also checks marketsDeprecated, so positions on retired markets still resolve cleanly.

Required environment variables

ANCHOR_WALLET points at a keypair JSON consumed by AnchorProvider.local. The wallet doesn't need to sign anything for read-only queries (its pubkey is used for view-function simulations), but it must hold some SOL to pay rent and fees if you intend to send transactions.

Detailed Example

Checkout the public repo here.

Last updated

Was this helpful?