Reference > On-chain program
On-chain program reference
Document Quovra accounts, instructions, events, and errors.
On-chain program reference
Program ID:
text
2dTzj5v1nhzkS87e5umJkpNWNc7UschvyHwRVkkK4FZVNetwork:
text
Solana devnetAccounts
Market
Stores the terms and state for a binary market.
| Field | Type | Description |
|---|---|---|
authority | Pubkey | Market creator |
market_id | u64 | Stable market id |
fixture_id | i64 | TxLINE fixture id |
stat_key | u32 | TxLINE stat key |
threshold | i32 | Stored predicate threshold |
close_ts | i64 | Deposit cutoff |
mint | Pubkey | SPL token mint |
vault | Pubkey | Vault token account |
total_yes | u64 | YES total in token base units |
total_no | u64 | NO total in token base units |
resolved | bool | Settlement status |
yes_won | bool | Winning outcome after settlement |
settle_tx_recorded | bool | Settlement marker |
question | String | Public question, max 140 chars |
PDA seeds:
text
["market", authority, market_id_le_bytes]Position
Stores one wallet position per market.
| Field | Type | Description |
|---|---|---|
market | Pubkey | Market account |
owner | Pubkey | Wallet owner |
amount | u64 | Deposited amount |
outcome | u8 | 0 NO, 1 YES |
claimed | bool | Claim status |
PDA seeds:
text
["position", market, owner]Instructions
create_market
Creates a market and token vault.
Parameters:
| Parameter | Type | Description |
|---|---|---|
market_id | u64 | Unique market id |
fixture_id | i64 | TxLINE fixture id |
stat_key | u32 | TxLINE stat key |
threshold | i32 | Predicate threshold |
close_ts | i64 | Deposit cutoff timestamp |
question | String | Public question, max 140 chars |
Errors:
QuestionTooLongInvalidCloseTime
deposit
Escrows user tokens in the vault.
Parameters:
| Parameter | Type | Description |
|---|---|---|
outcome | u8 | 0 NO or 1 YES |
amount | u64 | Token base units |
Errors:
MarketResolvedMarketClosedInvalidOutcomeBelowMinimumOutcomeLockedOverflowInvalidVaultInvalidMintInvalidOwner
settle
Validates a TxLINE proof by CPI into txoracle and resolves the market.
Parameters:
| Parameter | Type | Description |
|---|---|---|
args.ts | i64 | TxLINE proof timestamp |
args.fixture_summary | ScoresBatchSummary | Fixture summary |
args.fixture_proof | Vec<ProofNode> | Fixture Merkle path |
args.main_tree_proof | Vec<ProofNode> | Main tree Merkle path |
args.stat_a | StatTerm | Stat term to prove |
Errors:
MarketResolvedStatMismatchFixtureMismatchNoValidationReturnUnexpectedReturnProgramInvalidOracleProgram- Txoracle validation errors from CPI
claim
Transfers payout to a winning position.
Errors:
NotResolvedAlreadyClaimedNotAWinnerNoWinnersOverflowInvalidVaultInvalidMintInvalidOwner
Events
MarketSettled
Emitted after successful settlement.
| Field | Type |
|---|---|
market | Pubkey |
fixture_id | i64 |
stat_key | u32 |
yes_won | bool |
total_yes | u64 |
total_no | u64 |
Related pages
Search keywords
Anchor, accounts, instructions, Market, Position, settle, claim
Last updated: [YYYY-MM-DD]