Agentic Trading Lab
Talk to agents, and test trading ideas. Try AI trading agents on real market data with no code required.
AI translation
Execute and reconcile a long/short perp pair (ETH, BTC, SOL, HYPE) on dreamDEX testnet.
Translation pending
FinanceTypeScript · HTMLGitHub @zkzoraOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
No updates detected yet. GitHub releases will appear here.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
One ticket for a two-leg perp trade on dreamDEX (Somnia Tokyo testnet): bounded IOC legs, fill read-back, reviewed recovery. ETH, BTC, SOL, HYPE.
Translation pending
Taken from the repository README
Loading the full README.
Read the full README ↗PairPilot helps traders understand and resolve long/short pairs whose execution did not finish as planned. One ticket for a two-leg perp trade on dreamDEX, Somnia Tokyo testnet (chain 50383): long one asset, short another (ETH, BTC, SOL, HYPE). When only one leg fills, PairPilot shows what actually filled and what is still open, says what to do next, and unwinds the rest through a reviewed close. The headline proof is a live recovery: run 5 below.
Live app: https://pairpilot-delta.vercel.app. Pick the path that fits your time. Paths A and B need no wallet, no install and no funds.
npm ci first), re-check any pair from chain data. Neither command needs a key or sends anything; verify saves its report to evidence/pair-proof-<id>.json:
npm run verify -- evidence/testnet-pair-8ab9e2fb-8185-4d1c-9bfe-59081193117a.json checks receipts, signer, owner, fills and price bounds, and that the owner's position was zero right after the pair's last order (exit code 0 when everything passes);npm run summary -- evidence/testnet-pair-8ab9e2fb-8185-4d1c-9bfe-59081193117a.json prints realized PnL, fees and funding.There is no shared test account: a published key would let anyone trade it. You use your own wallet; the funds are free testnet paper money.
More detail on each check: docs/BROWSER-WALKTHROUGH.md. The in-app Setup tab checks gas, margin and permissions for your connected wallet.
Demo video (49 s): evidence/demo/pairpilot-demo.webm. Part 1 is labeled SIMULATION: a HYPE/SOL pair whose second signature is rejected, then the close review and recovery to flat. Part 2 is TESTNET, read-only: live HYPE/SOL books and setup. Live signed trades are listed below with explorer links.
A relative-value trader opens a long/short pair as two separate orders. If one fills and the other fails, partially fills or times out, the trader is left with unhedged exposure, an unclear state and manual recovery work. Retrying blindly can double a position.
It runs in two ways, both against the same engine: a browser dashboard (keys stay in your wallet extension; the server has no signing endpoint) and a local CLI. Either one trades its own account or a dreamDEX app wallet that linked it through Link a Bot (operator placeOrderFor).
Every row below was independently re-verified from chain data: receipt success, sender = signer, placeOrderFor owner = app wallet, decoded fills = journal fills, fills inside the price bound, explorer page present, and the owner's position zero right after the pair's last order in each market it traded, decoded from MarginBank PositionUpdated events in the pair's own receipts. That check gives the same answer whenever it runs. The app wallet has traded again since, so today's positions are printed for information only.
| # | Path | Pair | What happened | Proof |
|---|---|---|---|---|
| 1 | CLI, linked app wallet | ETH/BTC | Opened paired (0.0103 ETH / 0.0003 BTC), reconciled, closed, flat | cli-operator-proof-cd37d484.json |
| 2 | Browser, user-signed, linked | ETH/BTC | Opened paired (0.0207 ETH / 0.00061 BTC), closed, flat | browser-operator-proof-bda58fa7.json |
| 3 | Browser, user-signed, linked | SOL/BTC | Opened paired (0.23 SOL / 0.0003 BTC), closed, flat | browser-operator-proof-43dc36bf.json |
| 4 | CLI, linked app wallet | HYPE/SOL | Opened paired (0.31 HYPE / 0.23 SOL), reconciled, closed, flat | hype-sol-operator-proof.json |
| 5 | CLI, linked, injected fault | HYPE/ETH | HYPE long filled; ETH short deliberately withheld (--inject=withhold-second-leg, labeled in the journal) → incomplete → reconcile (no orders) → close review unwound HYPE only → flat | recovery-injected-hype-eth-proof.json |
Transactions (explorer https://explorer.testnet.somnia.network/tokyo/tx/…):
Read-only, from the pairs' own receipts and the dreamDEX indexer: evidence/pair-summaries.json (npm run summary -- <journal>). USDso; funding paid is positive, received is negative. Net = realized − fees − funding paid. This is each pair's result, not the account's equity change.
| # | Pair | Realized price PnL | Fees | Funding paid | Funding attribution | Net |
|---|---|---|---|---|---|---|
| 1 | ETH/BTC CLI | −0.009178 | 0 | 0 | pair-exclusive | −0.009178 |
| 2 | ETH/BTC browser | +0.056405 | 0 | −0.007416 | pair-exclusive | +0.063821 |
| 3 | SOL/BTC browser | +0.005972 | 0 | 0 | pair-exclusive | +0.005972 |
| 4 | HYPE/SOL CLI | −0.0194 | 0 | 0 | pair-exclusive | −0.0194 |
| 5 | HYPE/ETH recovery | +0.0144 | 0 | 0 | pair-exclusive (ETH: no position) | +0.0144 |
crossCheck in the file).Accounts: app wallet (owner, margin and positions) 0x436dAE2EF8e8eECE9960b3C3a9DA6731a2D6c1F5; CLI signer 0x39f4aebEff78aB72c2FDA3b34c7993608AA79C50; browser signer 0xd41C88eE843dcCBe6E8AD3D62e4c33Ccb6C9787b. How the owner was identified without guessing: operator-link.json. Re-verify any journal yourself: npm run verify -- <journal.json> (read-only).
Node.js 24+ and npm.
npm ci
npm run dev # http://127.0.0.1:3000 (dashboard) /home (overview) /setup (guide)
Start in Simulation: pick a pair, a failure scenario, preview and execute. Prices and fills there are fixed and labeled. Testnet reads live books and signs with your wallet; see docs/BROWSER-WALKTHROUGH.md. After you connect, PairPilot looks up which app wallets linked your wallet and offers to trade one.
CLI (signs with a local key in ignored .env.local):
npm run wallet:init && npm run wallet:status # create a dedicated key, then fund it with Tokyo STT
npm run trade -- check --owner=0x<app wallet> --pair=HYPE/SOL # read-only readiness
npm run trade -- preview --owner=0x<app wallet> --pair=HYPE/SOL
npm run trade -- simulate --owner=0x<app wallet> # eth_call of both legs; nothing signed
npm run trade -- open --owner=0x<app wallet> # within 40 s of preview; signs two orders
npm run trade -- reconcile --owner=0x<app wallet> # sends nothing
npm run trade -- close --owner=0x<app wallet> # unwinds the JOURNAL's markets
Omit --owner to trade the key's own account. npm run summary -- <journal.json> prints a closed-pair summary from receipts and the indexer (read-only, no key). Runbooks: docs/TESTNET.md, docs/HYPE-SOL-WALKTHROUGH.md.
Checks: npm test (116 unit tests), npm run test:browser (41 Playwright tests at 375/768/1280 px, using mock wallets and injected offline reads, never real keys), npm run typecheck, npm run build, npm run doctor (read-only network check).
.pairpilot/. A send interrupted before its hash is saved needs a manual nonce check; PairPilot never guesses or retries.Live proofs are listed above. Supporting material:
evidence/operator-preflight-*.json, evidence/operator-simulation-*.json.0x3e31dcc2) and one simulation that sent nothing.src/core/ engine, planner, pairs, journals · src/adapters/ dreamDEX venue, operator (placeOrderFor, permissions, owner discovery), simulator, voucher · app/ dashboard, overview, setup · scripts/ CLI, verifier, demo recorder · tests/ Playwright · evidence/ proofs · docs/ runbooks and design notes · feedback/ integration findings (drafts, not submitted).
Sources and their limits: docs/SOURCES.md.