Expand description
§nyx-txodds-oracle (unofficial)
Rust building blocks for the Nyx trust-minimized settlement stack on
Solana: program IDs, Anchor discriminators, PDA derivation, borsh account
decoders, instruction-data builders, and an on-chain CPI helper to push a
dispute-finalized outcome into settlement. No Anchor dependency — just
solana-program + borsh.
Unofficial / community project. Not affiliated with or endorsed by TxODDS or Tether. “TxODDS”, “TxLINE” and “USD₮” are trademarks of their respective owners; used here only to describe compatibility.
§Why this exists
TxLINE proves a feed is internally consistent (a Merkle root), not that an
outcome is true, and gives no on-chain way to challenge a bad signer. Built
naively, every market keeps an admin key that can call resolve(). This crate
is the Rust side of removing that key: a market’s oracle is a program PDA, and
an outcome reaches settlement only after propose -> dispute -> arbitrate via
push_resolution, which forwards exactly the finalized result.
Structs§
- Assertion
nyx_disputeAssertion account (fields after the 8-byte discriminator).- Market
nyx_settlementMarket account (fields after the 8-byte discriminator).
Constants§
- DISPUTE_
PROGRAM_ ID nyx_disputeprogram id (devnet).- ORACLE_
BRIDGE_ PROGRAM_ ID nyx_oracle_bridgeprogram id (devnet).- SETTLEMENT_
PROGRAM_ ID nyx_settlementprogram id (devnet).- STATE_
DISPUTED - STATE_
PROPOSED - Assertion lifecycle states (mirrors
nyx_dispute). - STATE_
RESOLVED - TOKEN_
PROGRAM_ ID - SPL Token program id.
Functions§
- account_
disc - Anchor account discriminator = sha256(“account:
”)[..8]. - arbitrate_
data nyx_dispute::arbitrate(final_outcome_yes).- assertion_
pda - Assertion PDA:
["assertion", fixture_id_le, market_key]under dispute. - claim_
data nyx_settlement::claim().- create_
bound_ market_ data nyx_oracle_bridge::create_bound_market(fixture_id, market_key, close_ts).- create_
market_ data nyx_settlement::create_market(fixture_id, market_key, close_ts).- decode_
assertion - Decode an Assertion account, skipping its 8-byte discriminator.
- decode_
market - Decode a Market account, skipping its 8-byte discriminator.
- dispute_
data nyx_dispute::dispute().- dispute_
vault_ pda - Dispute vault PDA:
["dispute_vault", assertion]under dispute. - ix_disc
- Anchor instruction discriminator = sha256(“global:
”)[..8]. - market_
pda - Market PDA:
["market", fixture_id_le, market_key]under settlement. - oracle_
pda - Oracle PDA:
["oracle"]under the bridge (the market’s non-human oracle). - place_
bet_ data nyx_settlement::place_bet(side_yes, amount).- position_
pda - Position PDA:
["pos", market, owner]under settlement. - propose_
data nyx_dispute::propose(fixture_id, market_key, outcome_yes, bond, liveness).- push_
resolution_ cpi - CPI into
nyx_oracle_bridge::push_resolutionfrom your own program. - push_
resolution_ data nyx_oracle_bridge::push_resolution().- push_
resolution_ instruction - Build the
nyx_oracle_bridge::push_resolutioninstruction. - resolve_
data nyx_settlement::resolve(outcome_yes).- settle_
undisputed_ data nyx_dispute::settle_undisputed().- vault_
pda - Vault PDA:
["vault", market]under settlement.