# Sandbox

Sandbox is a **separate deployed environment** with its own base URL, its own API keys, its own database, and its own vault contract pulling against fake USDC. It runs on Polygon mainnet, so every transaction behaves exactly like it will in production — signatures, gas, confirmations, events — but the tokens it settles are worthless outside of Multiply. Use it to drive the full position lifecycle end-to-end before touching real money.

For the point-by-point comparison with production, see [Environments](/for-developers/environments.md). For the canonical contract addresses, see [Contract Addresses](/for-developers/contract-addresses.md).

***

## Getting access

Sandbox API keys are issued by the Dimes team. To request one:

1. Go to [dimes.fi](https://dimes.fi) and use the Telegram link in the site footer to contact us.
2. Tell us you want sandbox access and share the wallet address(es) you intend to test with, plus the partner name you want the key issued under.
3. We will reply with:

* A `dm_sbx_skey_...` API key scoped to sandbox.
* A starting balance of fake USDC minted directly to the wallet addresses you gave us.

Sandbox contract addresses are published on [Contract Addresses](/for-developers/contract-addresses.md) — wire them into your allowlist ahead of time.

If you burn through your fake USDC mid-test, ping us again and we will top you up.

***

## Pointing your integration at sandbox

Swap `api.dimes.fi` for `api-sandbox.dimes.fi` everywhere — REST calls, WebSocket connections, any base URL you have pinned in config. Everything else is identical to production.

| Property           | Value                                                                     |
| ------------------ | ------------------------------------------------------------------------- |
| **REST base URL**  | `https://api-sandbox.dimes.fi/v1`                                         |
| **WebSocket URL**  | `wss://api-sandbox.dimes.fi/v1/ws/prediction-markets/positions`           |
| **Swagger UI**     | `https://api-sandbox.dimes.fi/v1/customer-docs`                           |
| **API key prefix** | `dm_sbx_skey_...`                                                         |
| **Resource IDs**   | contain `sdx` (e.g. `dm_pos_sdx_...`) so sandbox data is obvious on sight |

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X POST https://api-sandbox.dimes.fi/v1/prediction-markets/tokens \
  -H "Authorization: Api-Key dm_sbx_skey_your_sandbox_key" \
  -H "Content-Type: application/json" \
  -d '{ "wallet_address": "0x1234...abcd" }'
```

{% endtab %}

{% tab title="SDK" %}

```typescript
const client = new DimesClient({
  baseUrl: "https://api-sandbox.dimes.fi",
  auth: new ApiKeyAuth({
    apiKey: "dm_sbx_skey_...",
    walletAddress: "0x...",
  }),
});
```

{% endtab %}
{% endtabs %}

From there, follow the [Quickstart](/for-developers/quickstart.md) — every step works in sandbox by substituting the base URL and key.

> **Working reference frontend:** [`dimes-fi/dimes-demo-ui`](https://github.com/dimes-fi/dimes-demo-ui) is a React + Vite app that exercises the entire integration path against sandbox — auth, markets, quotes, USDC approval, `createPosition`, signature verification, and position monitoring. Fork it, run `npm run dev`, and trace the calls.

***

## Sandbox vs production

| Aspect             | Production              | Sandbox                                          |
| ------------------ | ----------------------- | ------------------------------------------------ |
| **USDC**           | Real USDC.e on Polygon  | Fake USDC minted on request                      |
| **Outcome tokens** | Real Polymarket CTF     | Fake CTF deployed by Dimes                       |
| **Vault**          | Production deployment   | Separate deployment (different address)          |
| **Market data**    | Live Polymarket markets | Live Polymarket markets (read-only)              |
| **Funds at risk**  | Yes                     | No                                               |
| **SLA**            | Production-grade        | Best-effort — may reset or pause for maintenance |

Sandbox runs the same `LeveragedPredictionVaultV1` contract as production. Every REST endpoint, WebSocket event, response shape, and error code is identical — if it works in sandbox, it works in production. The only things that change between environments are the contract addresses (listed in [Contract Addresses](/for-developers/contract-addresses.md)) and the API key.

For the full matrix, see [Environments](/for-developers/environments.md).

***

## What sandbox is not

* **Not a staging mirror of production data.** Sandbox has its own database. Positions, partners, and API keys from production are not visible in sandbox and vice versa. Sandbox and production API keys are not interchangeable — the wrong key against the wrong base URL is rejected.
* **Not production.** No SLA. Do not build customer-facing demos or production workloads on top of sandbox. We may reset or redeploy on short notice.
* **Not a faucet.** Sandbox USDC is minted by the Dimes team on request and has no off-ramp. It cannot be converted to real USDC.
* **Not shared.** Your sandbox API key only sees positions opened with itself. Other customers' sandbox data is invisible to you.

***

## Need help?

Find us on the Telegram link at [dimes.fi](https://dimes.fi). Tell us you are working against sandbox and include your partner name and the wallet addresses you need funded.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.dimes.fi/for-developers/sandbox.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
