PoX-5

Every print from the pox-5 boot contract (SIP-045, live since Bitcoin block 960,230), decoded and filterable by staker, signer or bond, plus per-cycle totals.

for await (const event of sl.index.pox5.events.walk({ topic: "stake", signer: "SP…" })) {
console.log(event.block_height, event.staker, event.amount_ustx);
}
const { events } = await sl.index.pox5.events.list({
topic: "register-for-bond",
fields: ["bond_index", "amount_sats"],
});

Current totals and every signer's stacked STX, free with no key: PoX-5 staking data.

ReadRouteSDK
All 19 print topics/v1/index/pox5/eventspox5.events.list / walk / consume
Reward cycles of the current PoX/v1/index/pox/cycles · /{reward_cycle}pox.cycles.list / walk / get

fields narrows each row to the columns you ask for. pox5.events.consume() is the checkpointed sweep: Checkpoints.

FilterNarrows to
topicOne print topic
stakerOne staker
signerOne signer; alone it returns a pool's full activity, claims and key grants included
signerManagerOne signer manager
bondIndexOne bond
rewardCycleOne reward cycle
fromHeight, toHeightA block-height range
confirmedtrue holds a read to rows past the reorg margin

register-for-bond rows add bond_index, amount_sats, is_l1_lock and data.btc-lockup.

This is the print log, not a position scoreboard: positions and payouts are a subgraph you deploy. Cycles are exact to the node and follow the chain again at the next PoX fork. PoX-4 cycle history is final and not served; read pox-4 calls from contract calls. To be pushed instead: Webhooks.

$curl "$SECONDLAYER_API_URL/v1/index/contract-calls?contract_id=SP000000000000000000002Q6VF78.pox-4" \
-H "Authorization: Bearer $SECONDLAYER_API_KEY"

2

Edit on GitHub

Quick Start

Copy this prompt into your agent.

Set up Secondlayer Index in this project. It reads Stacks chain data, decoded, from block 1.

1. Install `@secondlayer/sdk` with the project's package manager. If a release-age policy blocks the install, stop and ask me instead of changing it.
2. Ask me for a Secondlayer API key (`sk-sl_...`, from https://www.secondlayer.tools/signin) and put it in `.env` as `SECONDLAYER_API_KEY`. Never commit it. If I self-host, use `INSTANCE_TOKEN` and my instance URL instead. Until I give you one, read with a free trial key: `curl -X POST https://api.secondlayer.tools/api/public/trial-key` returns `{ key }`, read-only for Streams and Index, good for 24 hours and 100,000 rows. Keep it out of git too.
3. Add a note to `AGENTS.md`, creating it if needed: before using Secondlayer, follow the secondlayer skill if it's installed, and read https://www.secondlayer.tools/llms.txt. Before writing code, read https://www.secondlayer.tools/docs/index.md. Any docs page opens as Markdown when you add `.md` to its URL.
4. If you support skills, run: `bunx skills add ryanwaits/secondlayer --skill secondlayer -y`