npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

nyx-txodds-settlement

v0.1.0

Published

Trust-minimized sports settlement on Solana for TxLINE/TxODDS feeds: instruction builders, PDA derivation and account decoders for the Nyx optimistic-oracle settlement, dispute and oracle-bridge programs.

Readme

nyx-txodds-settlement

Trust-minimized settlement for TxODDS / TxLINE sports data on Solana. Client-side instruction builders, PDA derivation and account decoders for the three on-chain programs behind the Nyx settlement stack. No IDL, no framework — just @solana/web3.js.

npm i nyx-txodds-settlement @solana/web3.js

Why this exists

TxLINE gives you fast, signed sports data, and it proves the data is the data it committed to (a Merkle root). What it does not prove is that the outcome is true, and there is no on-chain way to challenge a bad signer. So in practice every prediction market built on a feed ends up with an admin key that can call resolve() — which means the whole "decentralized" market is one leaked key away from being drained or rigged.

That is the gap this package closes. An outcome only becomes final after surviving an optimistic dispute game, and the market's oracle is a program PDA, not a person:

propose (bond) -> dispute (matching bond) -> arbitrate -> slash the wrong side
                                     |
                                     v
        oracle-bridge PDA --CPI--> settlement.resolve   (no human key, ever)
  • Honest asserters get their bond back. Wrong asserters get slashed to the challenger.
  • Undisputed outcomes finalize automatically after a liveness window.
  • The only path an outcome can reach settlement is push_resolution, which forwards the exact result the dispute layer already finalized. It reverts otherwise.

What you get

  • settlement — build create_market, place_bet, claim, resolve
  • dispute — build propose, dispute, settle_undisputed, arbitrate
  • bridge — build create_bound_market, push_resolution
  • pda — derive every PDA (market, vault, position, assertion, dispute vault, oracle)
  • decodeMarket, decodeAssertion — read on-chain account state
  • disc, u64le, i64le, PROGRAM_IDS, STATE, TOKEN_PROGRAM_ID

Programs (Solana devnet)

| Program | ID | | --- | --- | | nyx_settlement | AmMSLCCtJPCU3EJHEyxwAUTXQuzcAHVEVkCFJv6JrrW3 | | nyx_dispute | 7bSmAPPAypVtWsRMvMhmT6bUrJyvmc76VKXinAgwc8vN | | nyx_oracle_bridge | BiJaXJ7kEXy8cohxf7NxfyqS2sLbxZSa3Fx4JjEZS9bk |

Quick start — the full trustless loop

import { Connection, Keypair, Transaction, sendAndConfirmTransaction } from "@solana/web3.js";
import { settlement, dispute, bridge, pda, decodeMarket } from "nyx-txodds-settlement";

const conn = new Connection("https://api.devnet.solana.com", "confirmed");
const fixtureId = 2001, marketKey = [3, 0, 0, 0, 0, 0, 0, 0];
const send = (ix, signers) => {
  const tx = new Transaction().add(ix);
  tx.feePayer = signers[0].publicKey;
  return sendAndConfirmTransaction(conn, tx, signers);
};

// 1. Create a market whose oracle is the bridge PDA (no human can resolve it).
await send(bridge.createBoundMarket({ fixtureId, marketKey, closeTs, mint }), [payer]);

// 2. Bettors stake opposite sides.
await send(settlement.placeBet({ fixtureId, marketKey, bettor: alice.publicKey, bettorAta, sideYes: true, amount: 10_000000 }), [alice]);

// 3. The dispute layer decides the real outcome.
await send(dispute.propose({ fixtureId, marketKey, proposer: p.publicKey, proposerAta, mint, arbiter, outcomeYes: false, bond: 10_000000, liveness: 3600 }), [p]);
await send(dispute.dispute({ fixtureId, marketKey, disputer: d.publicKey, disputerAta }), [d]);
await send(dispute.arbitrate({ fixtureId, marketKey, arbiter, winnerAta, finalOutcomeYes: true }), [arbiterKp]);

// 4. Anyone can push the finalized outcome into settlement — but only that outcome.
await send(bridge.pushResolution({ fixtureId, marketKey }), [payer]);

// 5. Winner claims; loser is rejected by the program.
await send(settlement.claim({ fixtureId, marketKey, bettor: alice.publicKey, bettorAta }), [alice]);

const market = decodeMarket((await conn.getAccountInfo(pda.market(fixtureId, marketKey))).data);
console.log(market.resolved, market.outcomeYes); // true true

Account layouts

Offsets are given after the 8-byte Anchor discriminator.

Marketauthority@8, oracle@40, vault@72, mint@104, fixture_id u64@136, market_key[8]@144, close_ts i64@152, pool_yes u64@160, pool_no u64@168, resolved@176, outcome_yes@177, bump@178.

Assertionarbiter@8, mint@40, vault@72, proposer@104, disputer@136, fixture_id u64@168, market_key[8]@176, proposed_outcome_yes@184, final_outcome_yes@185, bond u64@186, challenge_end_ts i64@194, state@202, bump@203.

Proven on devnet

Not a mock — this is the exact stack these builders target, run end-to-end on devnet:

License

MIT.

Unofficial community project. Not affiliated with, sponsored by, or endorsed by TxODDS or Tether. "TxODDS", "TxLINE" and "USD₮" are trademarks of their respective owners; used only to describe compatibility.