Environments
Mainnet and testnet — endpoints, chain ids, contracts and the paper-money token. Reads work on both; build on testnet, ship to mainnet.
Two environments, same API, same contracts, different chain.
| mainnet | testnet | |
|---|---|---|
| Data plane | https://api.prophecyhosting.com |
https://testnet.api.prophecyhosting.com |
| Control plane | https://gateway.prophecyhosting.com |
https://testnet.gateway.prophecyhosting.com |
| Chain | Somnia 5031 |
Somnia Shannon 50312 |
| Collateral | PST 0x3b0E…6D0b |
PST 0x8B4d…455D |
| Prediction core | 0x688e…4e9C |
0x688e…4e9C — same address |
| Conditional tokens | 0x6afA…3952C |
0x6afA…3952C — same address |
The core and conditional-token addresses are identical across chains (deterministic deployment), so only the chain id and the collateral token actually change.
Switching
Point baseUrl at the environment you want:
<ConnectProvider baseUrl="https://testnet.api.prophecyhosting.com">
The stream URL is derived from it, so a single value moves both reads and realtime. For the on-chain side, the SDK ships the constants:
import { NETWORKS, resolveNetwork } from '@prophecy-dev/connect-sdk'
NETWORKS.testnet.chainId // 50312
resolveNetwork('testnet') // { chainId, predictionCore, pstToken, conditionalTokens }
resolveNetwork() defaults to mainnet when called with nothing — an accidental default is a
mainnet default, so be explicit in code that can run in either.
Which to build against
Reads work identically on both, so most integration work can happen wherever you like. The difference is what’s in them: mainnet has the real market catalogue and real traders, testnet has whatever has been created for testing. A market grid on testnet can legitimately be near-empty.
For trading, use testnet until you’re confident: same contracts, same flow, no real stakes. Every trading demo on this site is pinned to mainnet because it needs a live smart wallet, but your own integration doesn’t have to be.
PST, the collateral
Prophecy runs on PST — a paper-money ERC-20, 18 decimals. It’s the default collateral on both chains, and it’s why anyone can try a prediction market without funding an account first.
import { pst, formatPst } from '@prophecy-dev/connect-sdk'
pst(1.5) // 1500000000000000000n
formatPst(wei) // "1.5"
Amounts are bigint wei everywhere in this API. Never Number them on the way through — that’s the
one place a float will silently cost someone money.
Gas
Users don’t need to hold gas. The gateway’s sponsorship gate decides whether an action is paid for, and a paymaster settles it — which is what makes a first prediction one tap rather than a funding exercise. See Login & Session.