Synapse Market is a live AI agent economy dashboard for the Arc + USDC hackathon demo. The frontend runs on Vercel, and the live agent engine runs as a separate Railway websocket service.
- Next.js dashboard with 5 specialized AI agents
- Live reasoning feed with agent debate messages
- Clickable agent cards with deeper reasoning
- Mock x402 payment-required flow for premium thesis unlocks
- Mock USDC nanopayments between agents
- Reputation, wallet, revenue, confidence, and PnL updates
- Consensus trade execution flow
- Local fallback simulation if the websocket is unavailable
- Railway backend with
/healthand websocket broadcasts
Install dependencies:
npm installRun the frontend:
npm run devBuild and run the backend:
npm run backend:build
npm run backend:startIf port 3001 is already busy locally, run the backend on another port:
$env:PORT="3101"
npm run backend:startThen point the frontend at it:
$env:NEXT_PUBLIC_AGENT_ENGINE_WS_URL="ws://localhost:3101"
npm run devUse the default Vercel Next.js settings:
- Build Command:
npm run build - Output Directory: leave default
- Install Command:
npm install
Add this environment variable in Vercel:
NEXT_PUBLIC_AGENT_ENGINE_WS_URL=wss://YOUR-RAILWAY-DOMAIN.up.railway.appRedeploy Vercel after setting the variable.
This repo includes railway.json, so Railway should use:
- Build Command:
npm run backend:build - Start Command:
npm run backend:start - Healthcheck Path:
/health
After Railway deploys, open:
https://YOUR-RAILWAY-DOMAIN.up.railway.app/health
You should see JSON with ok: true.
Set these variables on the Railway backend service:
CIRCLE_API_KEY=...
CIRCLE_ENTITY_SECRET=...
ARC_RPC_URL=...
AGENT_WALLET_ID=...Optional variables:
CIRCLE_WALLET_SET_ID=...
AGENT_WALLET_IDS=1:wallet-id,2:wallet-id,3:wallet-id,4:wallet-id,5:wallet-id
CIRCLE_USDC_TOKEN_ID=...
GEMINI_API_KEY=...How it works:
- The backend initializes Circle Developer-Controlled Wallets when the Circle variables are present.
- It uses
ARC-TESTNETfor agent wallets. - If
CIRCLE_WALLET_SET_IDis not supplied, it creates or reuses a Synapse Market wallet set. - If
AGENT_WALLET_IDSare supplied, those wallets are attached to the agents. - If only
AGENT_WALLET_IDis supplied, that wallet is used as the funded source wallet. - The backend reads wallet balances and finds the Arc testnet USDC token from balances when possible.
- If Circle is ready and a USDC token is found, nanopayments use real Circle transfer transactions.
- If funding or token configuration is missing, the app stays live and reports the Circle issue in the feed.
After setting Railway variables, redeploy Railway and check:
https://YOUR-RAILWAY-DOMAIN.up.railway.app/circle/status
To make the real transfer path fully operational:
- Rotate any secrets that were shared outside Railway/local
.env. - Fund the configured
AGENT_WALLET_IDwith Arc testnet USDC. - If balances do not expose a USDC token id yet, set
CIRCLE_USDC_TOKEN_ID. - Add persistent database storage for wallet ids, receipts, and transaction history.
- Replace the current premium unlock button with a user-owned x402 payment flow.
- Open with the one-liner: Synapse Market is the live financial agora where AI agents debate, trade, and monetize intelligence using USDC on Arc.
- Show the five agents: each has a wallet, thesis, confidence, PnL, reputation, and revenue.
- Point to the live reasoning feed: agents disagree, quote each other, and form consensus.
- Click an agent and unlock the premium thesis: show the x402-style 0.021 USDC payment.
- Trigger a market event: the debate updates and the execution flow moves toward a consensus trade.
- Close with the integration path: replace the mocks with Circle Agent Wallets, x402 nanopayments, and Arc USDC settlement.