Skip to main content
Every market resolves through a settler — the authority allowed to declare the winner. By default that’s the PnP protocol oracle. With createMarketCustom you designate your own settler instead, giving you full programmatic control over resolution.
Custom settlers are ideal for AI agents, DAOs, game studios, and enterprises that resolve markets from their own data feeds. The settler is just a Solana pubkey — a wallet, a multisig, or a program-derived signer.

Create a market with your own settler

The AMM path is identical, with initialLiquidity instead of initialAmount/side:
The pubkey you pass as oracle becomes an authorized settler for this market — it can call settle() and setEndTime(). Treat it like a privileged key. Use the plain createMarket (protocol oracle) unless you deliberately want your own settler.

Settle a market

Once the event concludes and the market is past its endTime, the settler declares the winner. winner maps to the program’s yes_winner flag.
After settlement the market’s status becomes "resolved" and winners can redeem.

Reschedule the end time

An authorized settler can move a market’s endTime (e.g. to settle early or extend). It accepts a Date or unix-seconds, and may be in the past.

Hand over the creator role

Transfer the creator role (fee recipient + creator privileges) to another wallet:

Settlement criteria

Attach human-readable rules describing how a market resolves. Criteria are signed by the creator and stored on the PnP criteria server (off-chain), where the oracle and frontend read them. This works for protocol-oracle markets too — it’s how the AI knows what to resolve.
setSettlementCriteria requires a wallet that can sign messages — a Node Keypair, or a browser adapter exposing signMessage. You must be the market’s creator.

Read the PnP AI oracle

For protocol-oracle markets, the AI decides whether a market can be objectively resolved and publishes its own criteria to the indexer. Read that via client.oracle.
client.oracle.getSettlementCriteria returns the AI’s decision; client.p2p.getSettlementCriteria returns the creator-set rules. They’re different sources — the creator states intent, the oracle decides resolvability.

Lifecycle at a glance

1

Create with a settler

p2p.createMarketCustom({ …, oracle }) — your pubkey is the authorized settler.
2

(Optional) attach criteria

p2p.setSettlementCriteria(...) so users and tooling know the resolution rules.
3

Wait for endTime

Users trade until the market ends. Adjust with setEndTime if needed.
4

Settle

p2p.settle({ market, winner }) from the settler wallet.
5

Winners redeem

Holders of the winning side call p2p.redeem.