Reference
Trading deployment configuration
The local deployment script and the standalone client read the inputs below. No public trading deployment manifest is bundled; the client derives and verifies its contracts at startup.
Environment variables
| Name | Meaning | Default |
|---|---|---|
TRADING_RPC_URL |
JSON-RPC endpoint | http://127.0.0.1:8545 |
TRADING_DEPLOYER |
Unlocked RPC account | First eth_accounts entry |
ZOLTAR_DEPLOYMENT_MANIFEST |
Existing matching core manifest | Required |
TRADING_FEE_BPS |
Immutable AMM fee | 30 |
Secrets do not belong in manifests or .env.example.
Deployment manifest
bun run trading:deploy:local writes solidity/deployments/trading/local.json for scripts and integration environments. The file is git-ignored because local addresses are ephemeral. A generated manifest contains:
network: decimal and hexadecimal chain IDs plus the deployment RPC;core: verified SecurityPoolFactory and source manifest path;trading: factory, router, and immutablefeeBps;transactions:factoryandrouterobjects shaped as{ hash, blockNumber: "<base-10 integer string>" }.blockNumberis a JSON string, not a JavaScript number, so large receipt block numbers remain exact;compilerProfiles: exact versions and settings from the main Solidity artifact;bytecodeHashes: creation-bytecode commitments;deployeranddeployedAt.
Pairs never appear as static deployment inputs. Discover them dynamically with getPair(pool), verify with isPair, or derive the deterministic address with predictPair. Review a manifest before publishing it, and never copy local ephemeral addresses into a public-network file.
What the client uses
The live client discovers pools from the canonical SecurityPoolFactory in bounded pages, isolates individual market-read failures, never hard-codes market addresses, and refreshes market data and wallet balances in the background. The pool details view shows total and fee-eligible capacity ownership in REP; neither is an ETH deposit limit. The ETH minting-capacity ceiling is computed from the current REP price, and available capacity is that ceiling minus checkpointed settlement collateral, floored at zero. Entry, exit, liquidity, settlement, and fork-migration calls are simulated through the actual contracts, and every read in one simulation is pinned to the same canonical block hash. A quote does not expire when a new block arrives: immediately before submission the client simulates the call again at the latest block and submits with the minimum or maximum amounts and the deadline approved in the quote, where the call accepts them. Submission stops if that simulation fails or its result falls outside the approved bounds.
The build writes core-deployments.json from the root mainnet and Sepolia deployment manifests and adds each network's default public RPC URL. The live client defaults to the first supported network, computes the trading contracts with the fixed 0.30% trading fee through the core deployment's canonical CREATE2 proxy, and checks each address directly. If either contract is missing, it lets the connected wallet deploy and verify it. Settings beside the wallet selects another supported network or accepts an optional HTTPS or loopback HTTP RPC override. The router handles entry and liquidity operations as well as approval-free receive-based share exits and complete-set redemptions; the canonical pair supports ERC-2612 permits and deadline-bound direct liquidity removal.