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

Dynamic Pool & Token Data

Fetch the live pool and token config from Flash's CDN instead of the snapshot bundled with the SDK, and pick up new pools, token listings, custody changes, and oracle updates without an SDK upgrade or a redeploy.

Why the bundled snapshot goes stale

PoolConfig.fromIdsByName('Crypto.1', 'mainnet-beta') reads pool and token data compiled into the npm package — a snapshot frozen at the version you installed. When Flash adds a pool, lists a token, changes a custody, or updates an oracle, that snapshot is out of date until the next SDK release ships and you upgrade.

The live config is published to a CDN as a single JSON manifest — the same data the Flash UI and Flash's own bots run on. Read it at runtime and your integration stays current the moment protocol config changes.

Fetch the manifest

https://dxjms0h859jb3.cloudfront.net/pool-config/flash-trade-v2/prod.json

The shape, trimmed to the fields you'll reach for first:

{
  "configMeta": {
    "version": "<commit SHA the config was published from>",
    "env": "prod",
    "publishedAt": "2026-07-08T11:55:39Z",
    "promotedAt": "2026-07-08T11:56:24Z"
  },
  "pools": [
    {
      "poolName": "Crypto.1",
      "cluster": "mainnet-beta",
      "poolAddress": "HfF7GCcEc76…",
      "tokens": [],
      "custodies": [],
      "markets": [],
      "addressLookupTableAddresses": []
    }
  ],
  "otherTokens": []
}

Three top-level keys:

Key
What it holds

configMeta

Publish metadata. version is the commit the config was published from — log it so a stale-config bug is one grep away.

pools[]

Full config for every pool: addresses, custodies, markets, tokens, and lookup tables — every field PoolConfig needs.

otherTokens[]

The protocol-wide token directory (symbols, mints, decimals, price ids, icons) for tokens not currently in a pool — useful for search and display without a pool round-trip.

One file carries both clusters' pools. Every pools[] entry has a cluster field (mainnet-beta or devnet), so you filter by cluster after fetching — not by URL.

Don't hardcode pool names. The manifest is the source of truth and grows as pools launch — treat any static pool list in older docs or examples as illustrative. listDynamicPools.ts (below) prints exactly what is live right now.

Use it in your app

Copy fetchPoolConfigManifest.ts into your project. It is self-contained — its only dependency is the SDK's public PoolConfig.buildPoolconfigFromJson — and it returns real PoolConfig instances you hand to FlashPerpetualsClient exactly like the bundled one:

Omit poolNames to build every pool for the cluster.

Hot-reload in bots and backends

Long-running processes — bots, keepers, backends — shouldn't restart just because a token was listed. Poll the manifest and swap config when it changes. Pass the previous fetch's lastModified back in: when nothing changed, the CDN answers 304 Not Modified with no body, so steady-state polling every 30–60 seconds is nearly free. Deduplicate on configMeta.version — a republish with no real change keeps the same commit, so skip the swap when the version hasn't moved:

Keep your current config when a fetch fails or a payload looks malformed — an empty pools array is almost always a transient fetch problem, not a mass delisting. The helper also isolates bad entries per pool (one malformed pools[] entry is skipped instead of failing the whole load). watchPoolConfig.ts is the full production pattern: conditional refetch, version dedupe, last-known-good on errors, and a change log on every reload.

Run the examples

All three examples run with no wallet and no RPC endpoint, from a clone of flash-sdk-v2:

File
What it does

fetchPoolConfigManifest.ts

The helper. Copy it into your project as-is; conditional (304) refetch built in.

listDynamicPools.ts

Prints the live pools and token directory for a cluster.

watchPoolConfig.ts

Polls and hot-reloads on config change — the pattern for long-running bots and backends.

Was this helpful?