Reference
Trading deployment configuration
The local deployment script solidity/ts/trading/deploy/deploy-local.mts reads the environment variables below. No public trading deployment manifest is bundled; the client derives and checks 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 trading fee | 30 |
TRADING_FEE_BPS must be a whole number from 0 to 9999. The script stops when the RPC chain ID differs from the core manifest's, when the manifest's SecurityPoolFactory has no code on that chain, or when the RPC exposes no account. Manifests must not contain secrets.
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: the SecurityPoolFactory address, checked to have code on the RPC chain, and the 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 derives
The standalone client reads no environment variables. At startup it uses:
- Networks: the build writes
core-deployments.jsonfrom the Yes and No deployment manifests for mainnet and Sepolia indocs/, with each network's default public RPC URL. Mainnet is listed but disabled in the UI build, and the default network is Sepolia. - RPC override: Settings beside the wallet selects another supported network or accepts an optional HTTPS or loopback HTTP RPC URL.
- URL parameters:
genesis(yesorno) selects the genesis deployment; an absent or invalid choice opens the fork-question picker before startup.network(sepolia) pins the network instead of following the wallet,rpcUrloverrides the saved RPC URL,universeselects a universe within the selected genesis deployment, andsimulate=1with an optionalsimScenarioselects the simulator. - Trading contracts: the factory and router addresses are computed with the fixed 30 basis-point fee through the core deployment's canonical CREATE2 proxy, and each address is checked for code. If either contract is missing, the connected wallet can deploy it.
- Markets: the market lists page through the SecurityPools that
SecurityPoolFactoryregisters in the selected universe and that have a trading pool, 25 at a time, with favorites saved in the browser first; the SecurityPool list shows only favorites. Opening an address reads that SecurityPool and checks it against the canonicalSecurityPoolFactory, Zoltar, and ShareToken; no market address is hard-coded. Mint capacity follows capital health. - Trade settings: slippage tolerance (1 to 500 basis points, default 50) and transaction validity (1 to 1,440 minutes, default 20) are kept in browser local storage under
zoltar.trading.tradeSettings. - Price impact: the trade ticket cautions above 2%, requires an explicit confirmation above 5%, and refuses the trade above 15%.
Quote and simulation behavior is described in the Trading SDK.