Skip to content

Checks and troubleshooting ​

Run the commands from the repository root. Use Node.js 22.12 or later, pnpm 11, and Foundry. Keep keys in the root .env file. Keep the public browser settings in web/.env.local.

Choose the test ​

TestNecessary processes and accounts
UI layout previewWeb server only. No funded account.
MetaMask connectionWeb server and the installed extension. No gas for the connection.
Live market displayWeb server, API, configured RPC, and a deployment file
Browser tradingWeb, API, operator loop, funded relayer, two funded makers, and a funded browser wallet
Oracle shock only, testnetDeployment file and funded deployer. The shock command does not need a maker key or a relayer key.
Hedging demoThe full local exchange. See Hedging demo.

An oracle price alone does not create a funded trader position or valid book depth. A useful trading demonstration needs the two.

UI preview ​

sh
pnpm install
pnpm dev:web

Open http://localhost:3000. Without API data, the panels show labeled samples and trading is disabled. Connect MetaMask separately to test the extension prompt.

Automated checks ​

sh
pnpm contracts:test
pnpm typecheck
pnpm test
pnpm test:abi
pnpm build
CommandScope
pnpm contracts:buildforge build --root contracts
pnpm contracts:testThe Foundry suite: accounting, matching, ladders, the queue, sessions, risk, and gas measurements
pnpm typecheckTypeScript in the workspace packages, integration/, and scripts/
pnpm testUnit tests of the workspace packages and the LP model test in integration/ui-math.test.ts
pnpm test:abiCompares the shared ABIs with the compiled Solidity. Build the contracts first.
pnpm test:budgetCost records and pending transaction recovery of the fast testnet loop
pnpm test:smokeAn Anvil integration check through the relayer. Do not point it at the public testnet.
pnpm test:uiPlaywright layout checks. They need a running web server and an installed Chromium.
pnpm buildBuilds all workspace packages that have a build script, the documentation site included

For the browser layout check:

sh
pnpm exec playwright install chromium
pnpm test:ui

This check covers the offline preview and the narrow screen layout. It does not cover wallet transactions.

Python reference ​

The Python research checks are separate:

sh
uv run --project simulation python -m unittest discover -s simulation -p 'test_*.py' -v
python3 integration/reference.py

The reference script uses the standard Python library and the market model in simulation/. The Solidity test testPythonReferenceFortyOneContracts checks the same trade and funding path to within 0.000001 USDC.

What a passing check proves

A successful build does not prove that wallet transactions work on testnet. Passing accounting tests do not establish economic safety. See the verification record in Decisions and open work.

Failure diagnosis ​

SymptomCheck
The terminal shows sample dataThe API process, the API URL in web/.env.local, the deployment file, and RPC access
MetaMask cannot connectThe extension is available and the selected network matches NEXT_PUBLIC_CHAIN_ID
The wallet shows a nonce error on the local chainReset the account activity in the wallet after each restart of Anvil
Orders cannot be relayedA funded relayer, an active session, GET /health, and the gas cap RELAYER_MAX_GAS
The banner says that the relayer has no gas accountRELAYER_PRIVATE_KEY is not set for the API
An order confirms with zero fillsRead OrderResult. The price limit did not cross, or an observation was due.
Mark frozenTwo-owner depth, the spread, and the quote age on the two sides. Is the operator loop running?
Observation overdueThe operator loop. Stop it before an explicit recovery.
Oracle haltedThe gap limit passed. Run the recover command for that deployment.
Position closed but margin keptThe funding position stays until the next accepted observation
A withdrawal fails with free collateral above zeroThe mark is frozen, an observation is due, or the oracle is halted
The shock bar does not showGET /health must report shockEnabled: true. This needs the test oracle and either chain 31337 or SHOCK_ENABLED=true for the API.
The API stops with a chain ID errorRPC_URL and DEPLOYMENT_FILE select different chains
Old history after a new local deploymentDelete .local/local-indexer.json and start the API again
The RPC host does not resolveNetwork and DNS access. No deployment can continue without it.

The API binds to 127.0.0.1. A testnet contract deployment does not publish the web application. Shared public access needs a separate hosting setup.

Local scripts and testnet scripts ​

LocalTestnet
Chain ID3133710143
Commandspnpm local:deploy, pnpm demo ...pnpm testnet ...
KeysPublic Anvil accountsPrivate accounts in .env
Deployment filedeployments/local.jsondeployments/monad-testnet.json by default

Each script checks the chain ID before it sends a transaction. Do not interchange them.

Deployed on Monad testnet.