Program Streams

Program Streams Quickstart

Open a decoded program event stream with Python.

Install tools

python -m pip install grpcio grpcio-tools protobufcurl -O https://nolimitnodes.com/protos/program-streams.proto python -m grpc_tools.protoc \  -I . \  --python_out=. \  --grpc_python_out=. \  program-streams.proto

List topics

import grpcimport program_streams_pb2 as pbimport program_streams_pb2_grpc as rpc channel = grpc.secure_channel(    "events.nln.clr3.org:443",    grpc.ssl_channel_credentials(),)client = rpc.StreamServiceStub(channel)metadata = [("x-api-key", "YOUR_API_KEY")] topics = client.ListTopics(pb.ListTopicsRequest(), metadata=metadata)for topic in topics.topics:    print(topic.name)

Fetch the payload schema

topic = "solana.pump_fun.trade_event" schema = client.GetTopicSchema(    pb.GetTopicSchemaRequest(topic=topic),    metadata=metadata,) print(schema.message_type)print(schema.proto_schema)

Subscribe to JSON

import json request = pb.SubscribeRequest(topic=topic, format=pb.JSON) for message in client.Subscribe(request, metadata=metadata):    event = json.loads(message.payload)    print(message.slot, event)

Store the slot with every event. Use a transaction signature or event identity from the payload for deduplication.