<!-- canonical: https://docs.melee.markets/resolver-api/environments | markdown: https://docs.melee.markets/resolver-api/environments.md | index: https://docs.melee.markets/llms.txt -->
# Environments & testing

| | Devnet | Mainnet (coming soon) |
|---|---|---|
| API base URL | `https://api.dev.melee.markets/api/resolver/v1/` | `https://api.melee.markets/api/resolver/v1/` |
| Solana cluster | `devnet` | announced at launch |
| API key prefix | `mk_test_` | `mk_live_` |
| Registration | separate record, credentials and on-chain accounts | separate |

Integrate on devnet first. Nothing carries over between environments except your code.

## Program ids

Melee's programs are identified by their on-chain program ids. **These ids change during development and
will change over time.** Melee may also run partial upgrades in which an old and a new program are live at the
same time on the same network, with different markets bound to each. Your integration must therefore:

- Treat `programId` as a **per-market fact**. Every market payload (`accept`, `live`, `trigger`, `status`,
  `definition`) names the program id the market lives under; use that id for that market.
- Validate every `programId` you act on against `GET /platform/programs`, which lists the ids currently in
  use on the network with `status: "Active"` or `"Deprecated"` (still live for existing markets, not used for
  new ones). Refresh the list at least daily and on any validation failure.
- Never hard-code a single id. Keep an allowlist and derive outcome addresses with the market's own id.

When a new program version is deployed, Melee registers your resolver on it; you do nothing. See
[Contract versions](/resolver-api/reference#contract-versions).

Ids at the time of writing, for orientation only:

| Network | Program | Id |
|---|---|---|
| devnet | Melee markets | `5xZenqSrpGjmCYzCrcKYK3if4U2fPr9q4mVNmGWApZou` |
| mainnet | Melee markets | coming soon |

## Funding

Your payer key needs SOL for transaction fees and, at activation, for the rent of the Melee user account of your
`resolverAuthority` (and of a distinct `proposerAuthority`). Every envelope states `estimatedLamports`. On devnet, fund the payer with `solana airdrop 1 <payer> --url devnet`.
Melee does not fund partner keys.

## Testing your integration

`POST /resolvers/me/smoke-check` re-runs the activation probes and returns the `checks` report. Use it after
registration and after any change to your endpoint or keys.

To exercise the market flows, test with a real market, the same way you will run in production:

1. Register and activate on devnet, then call `POST /resolvers/me/smoke-check` until every check passes.
2. Ask your Melee integration lead to create a test market bound to your resolver.
3. Confirm you receive `evaluate`, `accept` and `live` in order and that the `live` payload verifies (hash,
   outcome set).
4. Once the market is live, confirm the `Live` lifecycle event and the start of status polls.
5. When your trigger fires, resolve with `definitionHash` and confirm `Resolved`.

## Clocks and commitment

- Use NTP. Signatures are rejected beyond 5 minutes of skew.
- Melee reports `Confirmed` at Solana `confirmed` commitment and sends `live`/`applied` at that level. Read
  with `confirmed` and allow a few seconds of RPC lag.

## Support

Your Melee integration lead is the channel for: handshake timeouts beyond 30 s, verification review,
`resolution_blocked`, and drift you detect. Include the `traceId` of a `500 internal_error`, the request you sent
and its time, and the `X-Melee-Delivery-Id` of any callback you are asking about.
