Integrate Verdict
Any Solana program with an authority-based resolve function can plug in the same way pm-AMM does. This page is everything you need to create, watch, and settle a market from @verdict-protocol/sdk, no Anchor IDL client, just a thin wrapper over real transactions.
What Verdict solves
| Method | Description |
|---|---|
| createPriceMarket() | Create a market that settles itself from Pyth |
| createOptimisticMarket() | Create a market that settles from a bonded proposal |
| submitPriceEvidence() | Post a Pyth price update toward settlement |
| escalateStale() | Send a stale price market down the dispute path |
| proposeOutcome() / dispute() | The optimistic propose → challenge flow |
| registerJuror() / commitVote() / revealVote() | Jury commit-reveal voting |
| settle() | CPIs pm_amm::resolve_market once Finalized |
| getMarket() / getReceipt() | Read-only, no wallet required |
Before You Start
https://api.devnet.solana.com. The on-chain program is unaudited; don't use mainnet.solana airdrop 1 <pubkey> -u devnet.MOCK_USDC_MINT_DEVNET, exported by the SDK, unless you use your own 6-decimal mint.No sign-in, no API key, no account
Installation
Published and public on npm: one command, nothing to build:
Works the same in a Node script and in a bundled browser app (Next.js, Vite, whatever); it uses @noble/hashes and Web Crypto instead of node:crypto, so nothing needs polyfilling.
Connect
Verdict wraps a Connection and anything that can sign a transaction: a wallet-adapter wallet, a Keypair-backed signer, whatever you already have.
Create a Market
Two kinds. A price market settles itself from Pyth once it expires. An optimistic market settles from a bonded proposal, with a dispute path to a jury.
First, lock in the rules: a hash of whatever you're committing to being unable to change later:
Or, for a question nothing can price
createOptimisticMarket({ creator, collateralMint, endTs, name, rulesHash, resolverRentLamports }) instead, same return shape, different settlement path below.Drive to Settlement
Price path: usually nobody needs to call anything:
Optimistic path: proposal, then a dispute if someone disagrees:
Keeping things moving
verdict.escalateStale(marketId) to send it down the dispute path instead, so it still resolves.Receipt
Anyone can check how and why a market settled, with no wallet and no transaction required:
It carries the rules hash, the evidence (price, or vote tally), and the final answer, everything needed to independently check the market was resolved correctly.
Being a Juror
Jurors stake tokens for the right to vote on disputed markets, and vote in two steps: commit, then reveal, so nobody can copy the leading answer at the last second.
Write it down somewhere safe the moment you generate it.
Troubleshooting
Revealed vote doesn't match the commit
revealVote recomputes computeCommitment(marketId, choice, salt, juror) and checks it against what you committed. Save the exact salt generateSalt() returned; losing it means you can't reveal.