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

| Method & path | Purpose |
|---|---|
| `GET /proposals?status=&cursor=&limit=` · `GET /proposals/{id}` | Market drafts sent to you for evaluation and their outcome. |
| `GET /markets?status=&cursor=&limit=` | Markets you are the resolver of. `status` filters on `DisplayStatus`. |
| `GET /markets/{market}/status` | The [trigger payload](/resolver-api/your-endpoints#trigger-callback) with `triggerType: null`. `404 market_not_bound` if you are not this market's resolver. |
| `GET /markets/{market}/definition` | Current definition, full version history with acceptance evidence, and on-chain facts. See [Verifying the definition](/resolver-api/definition). |
| `POST /markets/{market}/changes` | Your rules edits while the market is live or in arbitration. See [Changes to a market](/resolver-api/changes). |
| `POST /markets/{market}/changes/{changeId}/decision` | Your answer to a creator's rules request: `Accepted` or `Declined`. See [Answering a rules request](/resolver-api/changes#answering-a-rules-request). |
| `GET /markets/{market}/changes` | Changes on this market: your rules updates, the creator's pre-launch changes, and the creator's rules requests with your answers. |

Pagination: `cursor` is an opaque string; pass the response's `nextCursor` to continue; `limit` defaults to 25
and is capped at 100.

The poll endpoints are how a resolver with `trigger.type = None` self-monitors. They are rate-limited more
tightly than the rest of the API (see [conventions](/resolver-api/api#conventions)); use the trigger callback
where you can.

## `GET /proposals` — item

```json
{
  "proposalId": "c7d1…",
  "status": "Accepted",
  "definitionHash": "21e5…",
  "resolverHash": "…",
  "confidenceBps": 9500,
  "marketPubkey": "9xQe…",
  "createdAt": 1787990000,
  "evaluatedAt": 1787990012,
  "acceptedAt": 1787990400,
  "expiresAt": 1788076400
}
```

`status` is one of `Evaluating`, `Evaluated`, `BelowThreshold`, `Accepted`, `Rejected`, `Cancelled`,
`Expired`, `Created`. `resolverHash` is the hash of your `proposedDefinition` when you returned one.

## `GET /markets` — item

```json
{
  "marketPubkey": "9xQe…",
  "marketId": "184",
  "title": "Will X happen by June 30?",
  "displayStatus": "Pending",
  "onChainState": "Live",
  "definitionVersion": 1,
  "definitionHash": "9f2a…",
  "programId": "…",
  "endDate": 1788998400,
  "earliestProposalTs": 1788000000,
  "timeoutTs": 1789084800
}
```

## `POST /markets/{market}/changes` — rules edit

```json
{
  "changeType": "RulesEdit",
  "definition": { "…": "…" },
  "definitionHash": "b7e1…",
  "rationale": "Clarified how a postponed game is handled.",
  "changeId": "…"
}
```

Only `rules` may differ from the current version (`422 invalid_change` otherwise). Melee recomputes the hash,
applies the change as the next version, adds it to the market's public rules history, and returns
`{ definitionVersion, definitionHash, appliedAt }`. `changeId` is optional: it names a creator's rules request on
this market that you have not answered yet, which becomes `Accepted` with this update. Allowed only while the
market is live or has a standing proposal; otherwise `409 change_window_closed`.

## `POST /markets/{market}/changes/{changeId}/decision` — answer a rules request

```json
{ "decision": "Declined", "reason": "The rules already cover a postponed game." }
```

`decision` is `Accepted` or `Declined`; `reason` (≤ 500 characters) is required when declining. Returns `200` with
the request as listed below. The same answer again returns it unchanged; a different one is
`409 change_already_decided`. An unknown `changeId` is `404 change_not_found`; one that names a change other than a
rules request is `422 invalid_change`.

## `GET /markets/{market}/changes` — item

```json
{
  "changeId": "…",
  "changeType": "RulesRequest",
  "proposedBy": "Creator",
  "status": "Declined",
  "fromVersion": 3,
  "toVersion": null,
  "rationale": "The league moved the game to Thursday.",
  "requestedRules": "…",
  "createdAt": 1788600000,
  "decidedAt": 1788603600,
  "reason": "The rules already cover a postponed game."
}
```

Items are listed oldest first.

| `changeType` | What it is | `status` |
|---|---|---|
| `RulesEdit` (`proposedBy: "Resolver"`) | Your rules update | `Applied` |
| `RulesRequest` | The creator's rules request | `Received` (not answered), `Accepted` or `Declined` |
| `TitleDescription`, `OutcomeLabel`, `RulesEdit`, `EndDate` (`proposedBy: "Creator"`) | The creator's [pre-launch change](/resolver-api/changes#pre-launch-changes-creator-initiated) | `Proposed` (waiting for your answer), `Accepted` (an `EndDate` change you accepted, being written on-chain), `Applied`, `Rejected` or `Failed` |

`decidedAt` is when the change applied, or when the request was answered. `reason` is the reason given with an
answer or a failure, when there is one. `appliedVersion` is the version of the rules update that accepted a
request, when one did. `requestedRules` is present on a rules request only.
