Skip to main content
The SDK ships three built-in environments, all on Arbitrum One. You pick one when constructing Rain:
choose-environment.ts

Environment table

The dispute timer (dispute_initial_timer) is the initial oracle resolution duration baked into every market this environment creates — 5 minutes on dev/stage for fast iteration, 2 hours in production. It is not the dispute window, which is a separate on-chain constant per market — read that one with getDisputeWindow().

Tokens

Each environment configures two trading tokens. Note that development uses a mock USDT at a different address: The oracle fee actually charged when creating a market is read on-chain from the market factory — on development it currently reads 0n. Each token config also carries an oracle_fixed_fee_per_option constant of 1peroptioninthetoken′sbaseunits(seebelow),butnoSDKcodepathreadsit—itreflectstheprotocol′sintended1 per option in the token's base units (see below), but no SDK code path reads it — it reflects the protocol's intended 1 design, not the number in effect. See Market fees. getTokenPrice only serves whitelisted tokens — for anything else it throws a 404 with {"msg":"Token not found in whitelist"}. The dev mock USDT (USDTm) is not whitelisted.

Reading the config at runtime

getEnvironmentConfig() returns the active environment’s full configuration. The config for a development instance:
get-environment-config.ts
getTokenConfig(tokenAddress) looks a single token up by address in the active environment, returning a TokenConfig ({ address, symbol, decimals, oracle_fixed_fee_per_option }) or null if the address isn’t one of the environment’s tokens:
get-token-config.ts

RPC selection

If you don’t pass rpcUrl, the constructor picks a random public Arbitrum RPC for that instance. Public RPCs rate-limit and vary in reliability — pass your own endpoint (Alchemy, Infura, a self-hosted node, …) in production.
custom-rpc.ts
The rpcUrl is used by all on-chain reads and by transaction builders that read chain state while building.

Overriding the API URL

RainCoreConfig also accepts an apiUrl override, which replaces the environment’s REST base URL (useful for local backends or proxies):
RainCoreConfig (types.d.ts)
The factory address, dispute timer, and token config still come from the selected environment — only the REST base URL changes. Point RainSocket at the same host you use for REST (e.g. new RainSocket('https://dev2-api.rain.one')).