Reference > On-chain program

On-chain program reference

Document Quovra accounts, instructions, events, and errors.

On-chain program reference

Program ID:

text
2dTzj5v1nhzkS87e5umJkpNWNc7UschvyHwRVkkK4FZV

Network:

text
Solana devnet

Accounts

Market

Stores the terms and state for a binary market.

FieldTypeDescription
authorityPubkeyMarket creator
market_idu64Stable market id
fixture_idi64TxLINE fixture id
stat_keyu32TxLINE stat key
thresholdi32Stored predicate threshold
close_tsi64Deposit cutoff
mintPubkeySPL token mint
vaultPubkeyVault token account
total_yesu64YES total in token base units
total_nou64NO total in token base units
resolvedboolSettlement status
yes_wonboolWinning outcome after settlement
settle_tx_recordedboolSettlement marker
questionStringPublic question, max 140 chars

PDA seeds:

text
["market", authority, market_id_le_bytes]

Position

Stores one wallet position per market.

FieldTypeDescription
marketPubkeyMarket account
ownerPubkeyWallet owner
amountu64Deposited amount
outcomeu80 NO, 1 YES
claimedboolClaim status

PDA seeds:

text
["position", market, owner]

Instructions

create_market

Creates a market and token vault.

Parameters:

ParameterTypeDescription
market_idu64Unique market id
fixture_idi64TxLINE fixture id
stat_keyu32TxLINE stat key
thresholdi32Predicate threshold
close_tsi64Deposit cutoff timestamp
questionStringPublic question, max 140 chars

Errors:

  • QuestionTooLong
  • InvalidCloseTime

deposit

Escrows user tokens in the vault.

Parameters:

ParameterTypeDescription
outcomeu80 NO or 1 YES
amountu64Token base units

Errors:

  • MarketResolved
  • MarketClosed
  • InvalidOutcome
  • BelowMinimum
  • OutcomeLocked
  • Overflow
  • InvalidVault
  • InvalidMint
  • InvalidOwner

settle

Validates a TxLINE proof by CPI into txoracle and resolves the market.

Parameters:

ParameterTypeDescription
args.tsi64TxLINE proof timestamp
args.fixture_summaryScoresBatchSummaryFixture summary
args.fixture_proofVec<ProofNode>Fixture Merkle path
args.main_tree_proofVec<ProofNode>Main tree Merkle path
args.stat_aStatTermStat term to prove

Errors:

  • MarketResolved
  • StatMismatch
  • FixtureMismatch
  • NoValidationReturn
  • UnexpectedReturnProgram
  • InvalidOracleProgram
  • Txoracle validation errors from CPI

claim

Transfers payout to a winning position.

Errors:

  • NotResolved
  • AlreadyClaimed
  • NotAWinner
  • NoWinners
  • Overflow
  • InvalidVault
  • InvalidMint
  • InvalidOwner

Events

MarketSettled

Emitted after successful settlement.

FieldType
marketPubkey
fixture_idi64
stat_keyu32
yes_wonbool
total_yesu64
total_nou64

Related pages

Search keywords

Anchor, accounts, instructions, Market, Position, settle, claim

Last updated: [YYYY-MM-DD]