Skip to main content
Subscribe to executed Pump.fun transactions and decode TradeEvent logs. Each transaction can contain more than one trade event. 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-trades.mts

Interpret trade events

EventParser follows the program invocation stack, so another program’s data logs are not treated as Pump.fun events. Missing or truncated logs can still leave a transaction without a decoded event. Track decode errors and reconcile against transaction history when completeness matters. Keep raw amounts as strings. Apply the decimals of each mint when displaying values. Use signature plus event index for event-level deduplication; one signature can contain several fills. This example observes trades and does not submit swaps.

Pump.fun accounts

Reliability and performance