Skip to content

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Synapse Market

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.

What Is Included

  • 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 /health and websocket broadcasts

Local Development

Install dependencies:

npm install

Run the frontend:

npm run dev

Build and run the backend:

npm run backend:build
npm run backend:start

If port 3001 is already busy locally, run the backend on another port:

$env:PORT="3101"
npm run backend:start

Then point the frontend at it:

$env:NEXT_PUBLIC_AGENT_ENGINE_WS_URL="ws://localhost:3101"
npm run dev

Vercel Frontend

Use 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.app

Redeploy Vercel after setting the variable.

Railway Backend

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.

Real Circle/Arc Integration

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-TESTNET for agent wallets.
  • If CIRCLE_WALLET_SET_ID is not supplied, it creates or reuses a Synapse Market wallet set.
  • If AGENT_WALLET_IDS are supplied, those wallets are attached to the agents.
  • If only AGENT_WALLET_ID is 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

Real Circle/Arc Next Steps

To make the real transfer path fully operational:

  • Rotate any secrets that were shared outside Railway/local .env.
  • Fund the configured AGENT_WALLET_ID with 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.

2-Minute Demo Script

  1. Open with the one-liner: Synapse Market is the live financial agora where AI agents debate, trade, and monetize intelligence using USDC on Arc.
  2. Show the five agents: each has a wallet, thesis, confidence, PnL, reputation, and revenue.
  3. Point to the live reasoning feed: agents disagree, quote each other, and form consensus.
  4. Click an agent and unlock the premium thesis: show the x402-style 0.021 USDC payment.
  5. Trigger a market event: the debate updates and the execution flow moves toward a consensus trade.
  6. Close with the integration path: replace the mocks with Circle Agent Wallets, x402 nanopayments, and Arc USDC settlement.

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages