<!-- canonical: https://docs.melee.markets/resolver-api/acceptance | markdown: https://docs.melee.markets/resolver-api/acceptance.md | index: https://docs.melee.markets/llms.txt -->
# Market acceptance

No market is created with you as resolver until you have approved its exact definition.

Before evaluation, your published [rules guidelines](/resolver-api/registration#rules-guidelines) help
creators draft or revise rules. Their purpose is to reduce back-and-forth; they do not
replace evaluation or acceptance. `rulesGuidelines` is not included in the definition or its hash. Updating
guidelines affects subsequent drafting and revision only, without changing existing rules or acceptance.

## The market definition

A canonical JSON document containing only the fields that matter to you. Every field is always present;
fields that can be empty are `null` or `""` as listed, never omitted.

```json
{
  "schemaVersion": 1,
  "title": "Will X happen by June 30?",
  "description": "",
  "rules": "Resolves YES if X happens before 2026-07-01T00:00:00Z.",
  "outcomes": [ { "index": 0, "label": "Yes" }, { "index": 1, "label": "No" } ],
  "endDate": 1788998400,
  "timingPolicy": { "earliestProposal": "marketStart", "timeoutOffsetSecs": 86400 },
  "marketToken": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
  "disputable": false,
  "resolver": {
    "resolverId": "5f2c9a1e-3b7d-4c21-9e10-0a1b2c3d4e5f",
    "resolverAuthority": "FAe4sisG95oZ42w7buUn5qEE4TAnfTTFPiguZUHmhiF",
    "proposerAuthority": "FAe4sisG95oZ42w7buUn5qEE4TAnfTTFPiguZUHmhiF",
    "resolutionFeeRateBps": 50,
    "upFrontFee": 10000000,
    "upFrontFeeMint": "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"
  },
  "creator": { "wallet": "7Zb1bGi32pfsrBkzWdqd4dFhUzDdeLXbrWijk3wsQwvR" }
}
```

| Field | Type | Empty form | Notes |
|---|---|---|---|
| `schemaVersion` | integer | — | always `1` |
| `title` | string ≤ 200 | — | |
| `description` | string ≤ 2000 | `""` | |
| `rules` | string ≤ 2400 | — | |
| `outcomes[]` | 2–8 of `{ index: integer, label: string ≤ 64 }` | — | `index` is `0..n-1` in array order |
| `endDate` | integer Unix seconds or `null` | `null` | `null` only in the evaluate request when the creator omitted it; you must set it |
| `timingPolicy.earliestProposal` | string, currently always `"marketStart"` | — | when the on-chain resolution window opens; set by Melee, not editable by you |
| `timingPolicy.timeoutOffsetSecs` | integer | — | `timeoutTs = endDate + timeoutOffsetSecs`; set by Melee per market type, not editable by you |
| `marketToken` | base58 pubkey | — | the mint the market trades in |
| `disputable` | boolean | — | your record value |
| `resolver.resolverId` | UUID string | — | |
| `resolver.resolverAuthority` | base58 pubkey | — | the key that will be bound as this market's resolution authority; from your record; not editable |
| `resolver.proposerAuthority` | base58 pubkey | — | the key bound as proposer authority; equals `resolverAuthority` for non-disputable resolvers; not editable |
| `resolver.resolutionFeeRateBps` | integer | — | your rate stamped for this market; `0` on the current program ([Contract versions](/resolver-api/reference#contract-versions)) |
| `resolver.upFrontFee` | integer base units | `0` | resolved from your `upFrontFees` (see [Fees](/resolver-api/fees)); `0` while up-front fees are not charged |
| `resolver.upFrontFeeMint` | base58 pubkey | — | the market's creation-fee mint |
| `creator.wallet` | base58 pubkey | — | |

All integers are ≤ 2^53−1 so they survive JSON number handling in every language; Melee rejects anything
larger. The on-chain timing is covered by the hash through its **inputs**, not its derived values: Melee
sets `earliestProposalTs` to 10 minutes after the market's planned trading start (later on the current program
when `timeoutTs` is more than 7 days out, see [Contract versions](/resolver-api/reference#contract-versions)) and
`timeoutTs = endDate + timingPolicy.timeoutOffsetSecs`.
Because both inputs are in the definition you sign, the `timeoutTs` you are agreeing to (the earliest Melee's
void authority may act) is fixed by your acceptance, while you can still recompute the hash of any `endDate` you propose. The stamped timestamps are
delivered as facts in `live` and every market payload. A change to `timingPolicy` on a market you accepted will be a
Melee-initiated change (`changeType: "TimingPolicy"`, before launch only) that you accept or reject like any
other; these changes are coming soon.

- **`endDate` is not a deadline.** It is when you will receive your trigger (plus your `offsetSecs`).
  Resolution may legitimately happen before or after it. The creator may leave it `null`; **you must then set
  it** in your edited definition, or return `confidenceBps = 0` with a `notes` explanation.
- Images, tags, categories and market economics are deliberately excluded. They may change without your consent.

## Definition hash

`definitionHash = sha256(canonicalJson(definition))`, hex lowercase, where `canonicalJson` is
[RFC 8785 (JSON Canonicalization Scheme)](https://www.rfc-editor.org/rfc/rfc8785): members sorted by code
point, no insignificant whitespace, UTF-8, integers without exponent or fraction. For the document above the
canonical form and hash are:

```text
{"creator":{"wallet":"7Zb1bGi32pfsrBkzWdqd4dFhUzDdeLXbrWijk3wsQwvR"},"description":"","disputable":false,"endDate":1788998400,"marketToken":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","outcomes":[{"index":0,"label":"Yes"},{"index":1,"label":"No"}],"resolver":{"proposerAuthority":"FAe4sisG95oZ42w7buUn5qEE4TAnfTTFPiguZUHmhiF","resolutionFeeRateBps":50,"resolverAuthority":"FAe4sisG95oZ42w7buUn5qEE4TAnfTTFPiguZUHmhiF","resolverId":"5f2c9a1e-3b7d-4c21-9e10-0a1b2c3d4e5f","upFrontFee":10000000,"upFrontFeeMint":"Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"},"rules":"Resolves YES if X happens before 2026-07-01T00:00:00Z.","schemaVersion":1,"timingPolicy":{"earliestProposal":"marketStart","timeoutOffsetSecs":86400},"title":"Will X happen by June 30?"}

definitionHash = 22044a324d9bdc079c809b8c194fdb981e905e1b831f00d2c0178f36f10aa951
```

Compute it yourself and compare with the hash we send; it is the unit of agreement everywhere in this API.

## Confidence policy

Every evaluation returns `confidenceBps`, an integer from 0 to 10000, answering one question: **how confident
are you that you can resolve this exact definition?** It is a statement about resolvability (data available,
rules unambiguous, timing workable), not a prediction of the outcome.

### What the number refers to

The score always refers to the definition **you return**. If you return `proposedDefinition`, the score is
your confidence in *that* text; otherwise it is your confidence in the text we sent. You cannot score the
original while proposing edits. `proposedDefinition` is always a **full document**, never a patch.

### Thresholds

| Threshold | Set by | Where | Effect |
|---|---|---|---|
| `0` | fixed | — | Universal rejection. The creator cannot select you for this definition, no matter what else is configured. Use it when you cannot resolve the market, or when you do not model confidence and the answer is "no". |
| `minConfidenceBps` | you | registration; `GET`/`PUT /resolvers/me/confidence-threshold` | Your floor, `1..10000`. A score below it means the creator cannot select you. It also binds you: you must refuse an `accept` for a hash you scored below it. |
| Platform minimum | Melee | platform policy, currently **9000 bps**; Melee may set a higher value for an individual resolver | A score below it means the creator cannot select you, even if it clears your own floor. Applied on top of yours; the effective floor is the higher of the two. |

If you do not model confidence, return `0` (cannot) or `10000` (can) and set `minConfidenceBps` to `10000`.

### What the creator sees

| Your evaluation | Result for the creator |
|---|---|
| Timeout, transport failure, or non-2xx | `handshake_timeout`: cannot proceed with you; may retry or pick another resolver |
| `confidenceBps = 0` | `evaluation_failed`: cannot proceed with you; your `notes` are shown |
| `0 < score < effective floor` | `below_confidence_threshold`: cannot proceed with you |
| `score ≥ effective floor`, no edits | may accept the original hash |
| `score ≥ effective floor`, with `proposedDefinition` | may accept **your** hash, or reject and redraft; may not edit your version |

`notes` is free text (≤ 500 chars) shown to the creator to explain edits or a refusal.

### Your obligations under this policy

- Score honestly; Melee reviews scoring patterns as part of the verification badge.
- Refuse `POST {baseUrl}/accept` for any hash you scored below your own floor, and for any hash you never
  evaluated.
- Do not use `proposedDefinition` to change the question. Edits are for making a market resolvable: precise
  rules, exhaustive and disjoint outcomes, a realistic `endDate`.

## The handshake

All handshake calls are synchronous. Answer within the handshake timeout (30 seconds unless Melee has agreed a
longer value with you, never more than 120 seconds). A timeout, a transport failure or a non-2xx response is
treated as not accepted; there is no "pending" answer.

```mermaid
sequenceDiagram
    participant U as Creator
    participant M as Melee
    participant R as Resolver
    participant C as Solana
    U->>M: Draft market and pick resolver
    M->>R: POST evaluate with definition and hash
    R-->>M: confidenceBps and optional edited definition
    M-->>U: Show whether you can be selected and your edited version
    U->>M: Accept exactly one hash
    M->>M: Allocate the market address
    M->>R: POST accept with market pubkey, hash and authorities
    R-->>M: accepted true and Ed25519 signature
    M->>C: Create the market and register every outcome
    C-->>M: Confirmed
    M->>R: POST live with outcome pubkeys and on-chain facts
    R-->>M: acknowledged true
    M->>M: Market eligible to launch
```

### 1. Evaluate — `POST {baseUrl}/evaluate`

You receive:

```json
{
  "proposalId": "c7d1…",
  "probe": false,
  "definition": { "…": "…" },
  "definitionHash": "2204…",
  "resolver": { "minConfidenceBps": 8000 },
  "network": "devnet"
}
```

The definition's `timingPolicy` states how Melee will derive the on-chain timing: the resolution window opens
when trading starts (`"marketStart"`: Melee sets it 10 minutes after the planned trading start), and `timeoutTs = endDate + timeoutOffsetSecs`. When `probe` is `true` (activation smoke check, `proposalId`
starts with `probe-`) reply `confidenceBps: 0`.

Reply `{ "confidenceBps": 9500, "proposedDefinition": { "…": "…" }, "notes": "…" }` with HTTP 200.
`proposedDefinition` and `notes` are optional. You may edit `title`, `description`, `rules`, outcome `label`s,
add, remove or reorder `outcomes`, and `endDate`. You may not edit `schemaVersion`, `timingPolicy`, `marketToken`,
`creator` or `resolver`; Melee rejects such edits as `evaluation_failed` for the creator.

### 2. Creator decision

Your edited version is take-it-or-leave-it: the creator accepts exactly that hash or rejects and starts a new
draft. Melee never merges. On reject you receive `POST {baseUrl}/cancelled`:

```json
{ "proposalId": "c7d1…", "definitionHash": "2204…", "marketPubkey": null, "reason": "ProposalRejected" }
```

`reason` is `ProposalRejected`, `ProposalExpired` (24 hours without a creator decision) or `CreationFailed`
(after accept; `marketPubkey` is then set).

### 3. Accept — `POST {baseUrl}/accept`

You receive:

```json
{
  "proposalId": "c7d1…",
  "marketPubkey": "9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin",
  "definition": { "…": "…" },
  "definitionHash": "2204…",
  "definitionVersion": 1,
  "authorities": { "resolverAuthority": "<your resolverAuthority>", "proposerAuthority": "<your proposerAuthority>" },
  "programId": "<Melee program id this market will be created under>"
}
```

Verify the hash is one you scored at or above your floor, `authorities` equals `definition.resolver`'s two keys and
both are yours, and `programId` is in the list from `GET /platform/programs`, then reply with HTTP 200:

```json
{ "accepted": true, "definitionHash": "2204…", "signature": "<base58 Ed25519 signature>" }
```

`signature` is your detached Ed25519 signature with `resolverAuthority` over the UTF-8 bytes of
`melee-accept:v1:{marketPubkey}:{definitionHash}` (see [Keys](/resolver-api/keys#acceptance-evidence)).
Reply `{ "accepted": false, "reason": "…" }` with HTTP 200 to refuse; the market is not created. A non-2xx or
a timeout is also a refusal.

### 4. Live — `POST {baseUrl}/live`

Sent only after the market and **all** its outcomes exist on-chain at `confirmed` commitment:

```json
{
  "marketPubkey": "9xQe…",
  "marketId": "184",
  "definitionHash": "2204…",
  "definitionVersion": 1,
  "outcomes": [ { "index": 0, "label": "Yes", "pubkey": "…" }, { "index": 1, "label": "No", "pubkey": "…" } ],
  "outcomeSetHash": "c41d…",
  "numOutcomes": 2,
  "earliestProposalTs": 1788001200,
  "timeoutTs": 1789084800,
  "authorities": { "resolverAuthority": "…", "proposerAuthority": "…" },
  "programId": "…",
  "signatures": ["<initialize_market tx>", "<register_outcome txs…>"]
}
```

`earliestProposalTs` is when you may first propose or resolve: 10 minutes after the market's planned trading start
(the program needs the market live before the window opens), or later on the current program (see
[Contract versions](/resolver-api/reference#contract-versions)). After an applied pre-launch end-date change,
market payloads carry the new value (see [End date changes](/resolver-api/changes#end-date-changes)). `signatures` are the transaction signatures you can look up to confirm the accounts. Verify
(see [Verifying the definition](/resolver-api/definition)) and reply `{ "acknowledged": true, "definitionHash":
"2204…" }`. If your RPC has not yet seen an outcome account, retry your check within the timeout before
answering. If anything does not match, reply `{ "acknowledged": false, "reason": "…" }`; the market will not
launch.

`live` is a notification, not an acceptance decision: if you do not answer, Melee retries it (same
`X-Melee-Delivery-Id`, fresh signature) for 24 hours, and the market waits. **A market never launches until you have
acknowledged `live`.**

## What acceptance commits you to

Accepting a market means you will resolve **that** definition (as later versioned through the
[change processes](/resolver-api/changes)), with the keys you accepted, after the event concludes, and that you
will keep your status endpoint accurate for it until it is terminal. See
[Your responsibilities](/resolver-api/expectations).
