> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chance.cc/llms.txt
> Use this file to discover all available pages before exploring further.

# Myriad Markets

> Venue-aware verification for Myriad Markets — pass the exact trade quote or signed order-book order, get a verdict on the real market and outcome, bound to those bytes.

Chance understands Myriad Markets natively. Submit the **exact trade payload** your agent is about to send — an AMM trade quote or a signed order-book order — and the harness will classify it deterministically, **resolve the market id to the live market** (title, outcome, current price, state), and judge it against your mandate with Myriad's own documentation in the loop — returning a signed verdict whose `requestHash` binds to those exact bytes.

## What gets recognized

| Family  | Payloads                                                                                                                                                   |
| ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `order` | AMM trade quotes (buy/sell by value or shares, with slippage), signed order-book orders (GTC, GTD, FOK/FAK, post-only), batch placement, signed cancel-all |

Myriad runs two trading models — an AMM and a hybrid on-chain order book — and the classifier knows both payload shapes. For order-book orders it decodes the venue's 1e18-scaled prices into cents, computes shares and collateral notional, checks the 1-cent tick grid and time-in-force rules, and resolves the numeric market id against the live market registry. The judge reasons over:

> *BUY 1,000 shares of outcome 0 (Yes) in market #1264 @ 6.0¢ ≈ 60 USD1 max cost (FOK) — resolved: this is the "Yes" outcome of "Bitcoin ATH before December 31 2026?" (order-book market, state: open). Market currently prices this outcome at 5.5¢.*

That resolution step is what catches the classic prediction-market failure: an agent whose thesis says *"back the near-certain favorite"* while its order quietly buys the cheap opposite outcome. The judge sees the real outcome and the live price gap — the side-inversion has nowhere to hide. It also catches the venue-specific tells: an FOK "market order" from a bot that promised maker-only flow, or a frontend fee quietly routed to the agent's own wallet. If a market can't be resolved, the verdict leans ESCALATE rather than trusting the agent's own description: fail closed, never allow on assumption.

## Use it from your bot

Wrap the order you were already going to place:

```ts theme={null}
const submission = {
  order: {
    trader: "0x8Ba1f109551bD432803012645Ac136ddd64DBA72",
    marketId: "1264",
    outcomeId: 0,                  // 0 = Yes, 1 = No
    side: 0,                       // 0 = buy, 1 = sell
    amount: "1000000000000000000000", // 1,000 shares (wei)
    price: "60000000000000000",    // 0.06 — 1e18-scaled
    minFillAmount: "0",
    nonce: "1",
    expiration: "0",
  },
  signature: "0x...",              // your EIP-712 signature
  network_id: 56,
  time_in_force: "GTC",
};

const res = await fetch("https://harness.chance.cc/api/v1/intent", {
  method: "POST",
  headers: { "x-api-key": process.env.CHANCE_API_KEY!, "Content-Type": "application/json" },
  body: JSON.stringify({
    intent: "Passive market-making only: rest GTC limit orders, never take liquidity. Max 100 USD1 notional per order.",
    venue: "myriad",
    action: submission, // the exact payload — the verdict binds to these bytes
  }),
});

const { verdict, reasoning, mode } = await res.json();
if (verdict !== "ALLOW") throw new Error(`Blocked: ${reasoning}`);
// only now POST the submission to Myriad's /orders endpoint
```

`venue` is optional — Myriad's quote and signed-order shapes are auto-detected — and freeform `action` descriptions still work (`mode: "semantic"`). AMM trades are verified the same way: pass the `/markets/quote` body (`market_id`, `outcome_id`, `action`, `value`) before requesting calldata.

## Use it from Claude or ChatGPT

Add the hosted connector (`https://harness.chance.cc/api/mcp`, see [Connectors](/connectors)) and give your agent one standing instruction:

> Before placing any Myriad Markets trade, call `verify_intent` with my rules as the intent and the exact API payload (the quote body or the signed order submission) as the action, with `venue: "myriad"`. Only proceed on ALLOW; on BLOCK or ESCALATE, stop and tell me why.

Agents with Myriad execution tools — including Myriad's own CLI and MCP server — then get gated automatically; agents without them still give you provable pre-trade checks in chat.

## How the harness knows Myriad Markets

The judge works from a **versioned snapshot of Myriad's own docs** — the Protocol API reference, order-book order placement and EIP-712 signing, price scale and tick rules, time-in-force semantics, AMM quoting, positions and NegRisk events, market lifecycle and resolution, contract addresses — plus a curated brief of the venue's footguns (1e18 price scale, Yes/No outcome semantics, FOK/FAK taker behavior, frontend-fee siphoning, centralized resolution, perpetual markets that never resolve). Static knowledge is never fetched at verdict time; the only live call is the market-registry lookup that resolves the payload's market id to its title, outcome, and current price, and what it resolves is recorded in the verdict's hash-chained transcript. Every documentation page the judge consults is chained with its content hash — the receipt proves exactly which knowledge, at which version, informed the decision. See [Architecture](/concepts/architecture).

## What the receipt adds for Myriad Markets

On top of the standard proof bundle (transcript root, judge signature, onchain anchor), venue-aware verdicts carry `venue: "myriad"`, the `actionFamily`, the venue `actionType`, `mode: "structured"`, the knowledge-snapshot version — and the resolved market identity (title, outcome, live price and market state at verdict time), all inside the hash-chained transcript.

<Note>
  **Roadmap:** escrowed execution — the same contract, but an ALLOW triggers order placement by a Chance-held signer and a BLOCK physically never reaches one. The payload-first contract above is forward-compatible with it.
</Note>
