Skip to main content
Subscribe to Pump.fun bonding curve account writes and decode their reserves and completion flag. Save the quickstart helper as stream.mts in the same directory. These examples use the same environment variables and dependencies.

Install the decoder and IDL

Use the bundled Pump.fun IDL with this example. It supplies the program address, discriminators, and field names; check compatibility when updating it.

Decode updates

pump-accounts.mts

Read reserves without rounding

The example prints raw reserve integers as strings. Derive display amounts with the token and quote mint decimals. A raw reserve ratio is not a price in SOL per token, and quote_mint is not always SOL. Check the current mint data before formatting a price.

Handle layout changes

The discriminator filter identifies the account type without assuming a fixed total size. Decode errors remain visible rather than silently dropping updates. A completed curve does not provide the full migrated pool state; use the PumpSwap reference or Data API for the new pool.

Pump.fun trades

Reliability and performance