Skip to main content

Crate nyx_txodds_oracle

Crate nyx_txodds_oracle 

Source
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_dispute Assertion account (fields after the 8-byte discriminator).
Market
nyx_settlement Market account (fields after the 8-byte discriminator).

Constants§

DISPUTE_PROGRAM_ID
nyx_dispute program id (devnet).
ORACLE_BRIDGE_PROGRAM_ID
nyx_oracle_bridge program id (devnet).
SETTLEMENT_PROGRAM_ID
nyx_settlement program 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_resolution from your own program.
push_resolution_data
nyx_oracle_bridge::push_resolution().
push_resolution_instruction
Build the nyx_oracle_bridge::push_resolution instruction.
resolve_data
nyx_settlement::resolve(outcome_yes).
settle_undisputed_data
nyx_dispute::settle_undisputed().
vault_pda
Vault PDA: ["vault", market] under settlement.