VERDICT
Initializing Protocol...
0%

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

Someone has to decide, once a question's deadline passes, whether the answer was YES or NO. That's usually a single admin account, which means they could get it wrong, get bribed, or disappear. Verdict replaces that one person with rules written down in advance, enforced by the program, not trusted to a key.
MethodDescription
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

Devnet only
Point everything at https://api.devnet.solana.com. The on-chain program is unaudited; don't use mainnet.
A funded devnet wallet
For whichever account signs each call. Airdrop with solana airdrop 1 <pubkey> -u devnet.
pm-AMM's devnet mock USDC
As collateral, MOCK_USDC_MINT_DEVNET, exported by the SDK, unless you use your own 6-decimal mint.
Nothing to deploy
You call the already-deployed Verdict program over CPI to the already-deployed pm-AMM. No Rust, no Anchor, no build.

No sign-in, no API key, no account

Unlike RPC infra (Helius, Alchemy) that gates usage behind an API key, Verdict has no centralized service to authenticate against, just a program deployed on-chain that anyone can call directly. Connecting your wallet is the only authentication Verdict has: the signature on each transaction is both your identity and your authorization, in one step.

Installation

Published and public on npm: one command, nothing to build:

bash
npm install @verdict-protocol/sdk

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.

ts
import { Connection } from "@solana/web3.js";
import { Verdict } from "@verdict-protocol/sdk";
const verdict = new Verdict(
new Connection("https://api.devnet.solana.com", "confirmed"),
wallet, // { publicKey, signTransaction }
);

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:

ts
import { rulesHash } from "@verdict-protocol/sdk";

const rules = {
question: "Will SOL be above $200 tomorrow?",
comparator: "gt", threshold: "20000", ...
};

const hash = rulesHash(rules);
ts
const { marketId } = await verdict.createPriceMarket({
creator: wallet.publicKey, collateralMint: MOCK_USDC_MINT_DEVNET,
feedId: SOL_USD_FEED_ID, comparator: "gt", threshold: 20000n,
rulesHash: hash, ...
});

Or, for a question nothing can price

Use 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:

ts
await verdict.submitPriceEvidence(submitter, marketId, priceUpdateAccount);
# after the challenge window, permissionless:
await verdict.finalizePrice(marketId);
await verdict.settle(marketId);

Optimistic path: proposal, then a dispute if someone disagrees:

ts
await verdict.proposeOutcome(proposer, marketId, "yes", bondMint);
# nobody disagreed? permissionless:
await verdict.finalizeUndisputed(marketId, proposer, bondMint);
# somebody did instead:
await verdict.dispute(disputer, marketId, bondMint);
// ...jurors commitVote/revealVote, then anyone calls:
await verdict.tally(marketId, proposer, disputer, bondMint);

Keeping things moving

If a price market's deadline passes and nobody ever posts a price, anyone can call 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:

ts
const receipt = await verdict.getReceipt(marketId);

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.

ts
await verdict.registerJuror(authority, stakeAmount, bondMint);
# admin approves you, this MVP uses an allowlist

const salt = generateSalt(); // save this!
const commitment = computeCommitment(marketId, "yes", salt, authority);
await verdict.commitVote(authority, marketId, commitment);

await verdict.revealVote(authority, marketId, "yes", salt);
await verdict.settleVote(authority, marketId, bondMint);
If you lose the salt, you can't reveal your vote.
Write it down somewhere safe the moment you generate it.

Troubleshooting

Unfunded signer
solana airdrop 1 <pubkey> -u devnet
Check cluster
solana config set --url devnet
Check market status
await verdict.getMarket(marketId)
Jury allowlist
setJurorApproval() required first

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.