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

# Environments

> Base URLs, chain configuration, contract addresses, and access procedures for each environment.

## Testnet (open)

Testnet is the default environment for all examples in this documentation.
Access is open — no partner agreement required.

<CodeGroup>
  ```bash Endpoints theme={null}
  CORE_API         = https://core.api.dev.predictstreet.sde.adifoundation.ai
  WS_GATEWAY       = wss://ws-gateway.dev.predictstreet.sde.adifoundation.ai
  ADMIN_API        = https://admin.api.dev.predictstreet.sde.adifoundation.ai
  BLOCKSCOUT       = https://blockscout.ab.testnet.adifoundation.ai
  ```

  ```bash Chain theme={null}
  CHAIN_NAME       = ADI Testnet
  CHAIN_ID         = 99999
  RPC_URL          = https://rpc.ab.testnet.adifoundation.ai/
  NATIVE_CURRENCY  = ADI (18 decimals)
  ```
</CodeGroup>

### Testnet contract addresses

These are the verified deployments on ADI testnet. They are the authoritative
target for every EIP-712 `verifyingContract` field.

| Contract                    | Address                                      |
| --------------------------- | -------------------------------------------- |
| `ConditionalTokens`         | `0x66Ed938E9Dec9A1df6033d66560d5fe6117EE744` |
| `MockCollateral` (mUSDC)    | `0x979696A1B62d4c0F0390124447c065798ee4c70c` |
| `CTFExchange` (binary)      | `0x4074c225b296E1E556c565B0C3Ddba305E63E7c4` |
| `NegRiskAdapter`            | `0x3BE93B8e19b73e1b21B65adFFEF4ef248715D21B` |
| `NegRiskCtfExchange`        | `0x2eB97912c333963a21410Af1eF7E9a0aAB7631bf` |
| `VaultFactory`              | `0x298F4D974a0715a8e9085EE3f48a14A421bCF5B6` |
| `DepositLimitRegistryProxy` | `0x98C8B72d58Ec30b11Ea6Cd7fAeB1B62823D5Ffc1` |
| `Oracle` (proxy)            | `0x346f4065f9aA3CE51F06bAfff3e657bc2FbD209b` |
| `MulticallExecutor`         | `0xD8b812896E4caE5D9b97394e325FcC1998225F25` |

<Tip>
  Every testnet contract is verified on Blockscout — paste any address
  above into [blockscout.ab.testnet.adifoundation.ai](https://blockscout.ab.testnet.adifoundation.ai)
  to browse source, ABI, and events.
</Tip>

### Read-at-runtime — `GET /api/platform/contracts`

The address table above is the human-readable form of the canonical
contract registry. **For SDK code** prefer the runtime endpoint:

```http theme={null}
GET /api/platform/contracts
```

```json theme={null}
{
  "chainId": 99999,
  "rpcUrl": "https://rpc.ab.testnet.adifoundation.ai/",
  "vaultFactory":              "0x298F4D974a0715a8e9085EE3f48a14A421bCF5B6",
  "usdc":                      "0x979696A1B62d4c0F0390124447c065798ee4c70c",
  "wrappedCollateral":         null,
  "ctfExchange":               "0x4074c225b296E1E556c565B0C3Ddba305E63E7c4",
  "ctfExchangeNegRisk":        "0x2eB97912c333963a21410Af1eF7E9a0aAB7631bf",
  "negRiskAdapter":            "0x3BE93B8e19b73e1b21B65adFFEF4ef248715D21B",
  "conditionalTokens":         "0x66Ed938E9Dec9A1df6033d66560d5fe6117EE744",
  "depositLimitRegistryProxy": "0x98C8B72d58Ec30b11Ea6Cd7fAeB1B62823D5Ffc1",
  "oracle":                    "0x346f4065f9aA3CE51F06bAfff3e657bc2FbD209b",
  "generatedAt": "2026-05-18T15:40:42.242Z"
}
```

Public, unauthenticated, rate-limited at 60/min/ip. **Source-of-truth
is the platform deploy environment** — CI/CD updates the env in
lockstep with each contract deploy, so the response cannot lag
platform state. Quickstart code samples should `fetch()` this at
boot rather than hardcoding constants — eliminates the entire class
of bugs from a stale prose-page after a redeploy.

`wrappedCollateral` is `null` on both testnet and mainnet — the field
is reserved for future deployments and is not used by today's NegRisk
markets.

### Getting testnet USDC

`MockCollateral` (`0x979696A1B62d4c0F0390124447c065798ee4c70c`) exposes
a public `mint(address to, uint256 amount)` on testnet — anyone can mint
themselves mUSDC. After minting, you still need to deposit into your
vault: see [Vaults](/concepts/contracts/vaults).

```typescript theme={null}
import { Wallet, JsonRpcProvider, Contract, parseUnits } from 'ethers';

const provider = new JsonRpcProvider('https://rpc.ab.testnet.adifoundation.ai/');
const wallet   = new Wallet(privateKey, provider);
const usdc     = new Contract(
  '0x979696A1B62d4c0F0390124447c065798ee4c70c',
  ['function mint(address to, uint256 amount)'],
  wallet,
);

await (await usdc.mint(wallet.address, parseUnits('1000', 6))).wait();
```

### Testnet caveats

<Warning>
  Testnet runs **without** `MOCK_AUTH_ACCEPT_ALL` — every EIP-712 signature
  is verified for real (`ethers.verifyTypedData` against the on-chain
  `CTFExchange` `ORDER_TYPEHASH`). Code that signs a placeholder will be
  rejected with `400 bad_signature`. The schema is identical to staging /
  production — see [EIP-712 signing](/concepts/trading/eip712-signing).
</Warning>

<Note>
  Testnet has compliance guards relaxed for integration testing — KYC,
  geo, and the return-to-source cleared-deposit check are not enforced.
  Practical consequences:

  * Multi-wallet sub-accounts transact without per-wallet KYC.
  * Every depositing EOA is auto-cleared as a **deposit-side** withdrawal
    destination — no `destination_not_cleared` rejection on first
    deposit-then-withdraw round-trip.
  * **Withdrawal-side** EDD enforcement is also suppressed on testnet —
    a never-deposited destination (e.g. `0x...dEaD`) is accepted
    without `destination_not_cleared` reject. Production runs the full
    return-to-source check on every withdrawal address; do not rely on
    testnet behaviour to validate withdrawal-side EDD logic.
  * Sanctions / geo blocks do not fire.

  Production enforces the full compliance chain. Don't rely on testnet
  outcomes to validate your prod compliance flow — sanity-check against
  the staging / production controls before going live.
</Note>

* Matcher state is not persisted across redeploys. After a testnet
  restart, your open orders may disappear (warm-restart of the matcher
  is planned for staging+).
* Oracle on testnet resolves against mock data. Do not use testnet
  resolution for real backtesting.
* Faucet, admin `pause` / `resume` / `cancel`, and platform kill-switch
  can be triggered at any time during partner testing windows — expect
  occasional disruptions.

### Testnet redeploys — what to expect

Testnet contracts get redeployed periodically (chain upgrades, schema
changes, security patches). When that happens **every contract address
on this page changes** — `VaultFactory`, `MockCollateral`,
`ConditionalTokens`, `CTFExchange`, `NegRiskAdapter`, `NegRiskCtfExchange`,
`DepositLimitRegistry`, `Oracle` are re-deployed as a single set.

<Warning>
  **Pre-redeploy assets are stranded.** Vault clones and balances on
  the old `VaultFactory` / `MockCollateral` / `ConditionalTokens`
  remain on-chain but are unusable on the new platform — the new
  exchange does not recognise them. Recovery via the
  `emergency-withdraw` timelock returns the original (now stale)
  tokens; their economic value on the new platform is zero.

  After a redeploy:

  * Mint fresh testnet `MockCollateral` (mUSDC) using the new
    address from the table above.
  * Re-deposit into a fresh vault via the new `VaultFactory`.
  * Re-sign EIP-712 orders against the new `verifyingContract`
    (the new `CTFExchange` / `NegRiskCtfExchange`).

  We post the redeploy notice to integration partners over the
  partner Slack channel and update this page within the same window
  — always re-fetch addresses after a partner-channel ping rather
  than caching them in your config indefinitely.
</Warning>

Mainnet redeploys are not done in-place. Any contract change on
mainnet ships as a new deployment with a coexistence period and
explicit migration instructions delivered via the partner channel.

## Staging (on request)

Production-like environment with real AML provider, real data-source
adapters, real on-chain deployments on a production-ready chain. Used
for the pre-launch dry-run before a new market opens to real users.

Access requires:

1. A signed partner agreement (NDA + API access terms).
2. A whitelisted source IP for the internal network (staging
   surfaces are gated behind VPN).
3. A dedicated partner account provisioned by ops.

Contact [partners@predictstreet.com](mailto:partners@predictstreet.com)
for staging access.

## Mainnet (partner onboarding)

Production environment. Base URL, chain ID, and contract addresses are
delivered to partners at onboarding as part of the live-rollout runbook.
**Do not hardcode mainnet values from this documentation** — always
read them from the onboarding package so configuration remains
auditable.

<CardGroup cols={2}>
  <Card title="Partner onboarding" icon="handshake" href="mailto:partners@predictstreet.com">
    Request mainnet access and onboarding runbook.
  </Card>

  <Card title="Status page" icon="heart-pulse" href="https://status.predictstreet.com">
    Real-time status of all environments.
  </Card>
</CardGroup>

## Environment capability matrix

| Feature                               |      Testnet      |   Staging  |      Mainnet      |
| ------------------------------------- | :---------------: | :--------: | :---------------: |
| HTTP REST (`core-api`)                |         ✅         |      ✅     |         ✅         |
| WebSocket (`ws-gateway`)              |         ✅         |      ✅     |         ✅         |
| `/api/docs` OpenAPI UI                |         ✅         | on request | ❌ (internal only) |
| Faucet                                |         ✅         |      ❌     |         ❌         |
| `MOCK_AUTH_ACCEPT_ALL`                |         ❌         |      ❌     |         ❌         |
| Real AML screening (Global Ledger)    |        mock       |      ✅     |         ✅         |
| Real sports data sources (SDDP, etc.) |        mock       |      ✅     |         ✅         |
| On-chain settlement                   | ✅ (testnet chain) |      ✅     |         ✅         |
| HSM-backed oracle signer              |         ❌         |      ✅     |         ✅         |
| Admin multi-sig on `cancel` / `void`  |         ❌         |      ✅     |         ✅         |
| Platform kill-switch                  |         ✅         |      ✅     |         ✅         |
