Skip to content

Repository files navigation

Trivo β€” Autonomous Agents for Onchain Market on Arc Network

Trivo

Launch your own AI trading agent in minutes. Fund it with USDC. Copy the best traders. Autonomous 24/7.

trivoai.xyz Β· app.trivoai.xyz Β· GitHub

Arc Testnet Tests Contracts Lint License


Submission β€” Agora Agents Hackathon

RFB 06: Social Trading Intelligence Β· Canteen Γ— Circle Γ— Arc Β· May 2026

The three markets that don't know each other

The Agora thesis is that prediction market infrastructure is unbundling into three layers β€” Agent, Identity, and Venue β€” and that the identity layer is where the next primitive gets built.

Look at what happened. Polymarket V2 shipped builder codes β€” a bytes32 field in every signed order that attributes the trade to its originator. Hyperliquid HIP-3 shipped per-fill builder fees. Pump.fun shipped BREAKING_FEE_RECIPIENT. Three venues. Six months. One architectural answer: a bytes32 attribution slot that travels with every trade, can't be stripped, and determines who gets paid.

But these primitives are siloed. An agent that generates winning Polymarket predictions can't prove its track record on Hyperliquid. A trader who copies a strategy on one venue can't port that relationship to another. Every AI trading framework today produces structured trade decisions β€” but those decisions live in a log file, not on a chain. The agent has no portable identity, no verifiable PnL, no way to say "I generated +12% last month β€” here's the on-chain proof."

Builder codes exist. There's just no registry that issues them, no standard that bridges them, no platform that connects the agents who produce alpha with the capital that wants to deploy it.

Trivo is that platform. Every agent gets an ERC-8004 on-chain identity carrying a portable builder code. Track record is verifiable, composable across venues. Copy traders discover alpha through transparent metrics, not wallet tea leaves. Creators earn fees automatically β€” attributed on-chain, settled in USDC on Arc.

Launch an agent in 60 seconds. Fund it with USDC. Copy the best. Get paid.


🧠 What Trivo Does

Launch Agents in 60 Seconds

No infra setup. No code. Pick a model, write your strategy in natural language, set risk parameters β€” deployed with a Circle MPC wallet and an ERC-8004 on-chain identity.

Multi-Venue Trading Engine

One agent trades across perpetual futures, prediction markets, concentrated LP, yield strategies, and spot β€” all through a single identity. Mock execution on Arc Testnet with real CoinGecko market data.

Production-Grade Agent Intelligence

Every agent runs through a deterministic intelligence pipeline:

  • Market Regime Detector β€” classifies trending, volatile, news-driven, low-liquidity conditions
  • Trading Committee β€” 6-role simulation (technical analyst, sentiment analyst, risk analyst, bull/bear researchers, portfolio manager) with consensus voting
  • Confidence Calibrator β€” weighted scoring across technical, sentiment, risk, memory, and committee agreement
  • Risk Constitution β€” deterministic trade approval/block with daily loss limits, max positions, leverage caps, regime-based blocking, cooldown enforcement
  • Decision Memory + Reflection β€” every decision persisted; closed trades generate structured reflections (outcome, miss reasons, next action)
  • Agent Scorecard β€” TrivoScore (0–100) computed from realized PnL, win rate, drawdown, consistency, risk-adjusted return, and explanation quality

Intelligent Copy Trading

Not blind mirroring. Copy traders discover agents through verified on-chain performance, allocate capital based on risk-adjusted returns, and automatically earn fee revenue when others copy their agents. The CopyTrading.sol contract handles on-chain attribution and fee distribution.

On-Chain Identity (ERC-8004)

Every agent mints an identity NFT on Arc. The token ID doubles as a portable builder code β€” same primitive as Polymarket V2 and HIP-3. Track record is verifiable, composable across venues, and can't be faked.


πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                       TRIVO PLATFORM                         β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  trivo-landingβ”‚  trivo-frontend  β”‚     trivo-backend         β”‚
β”‚  (Vite+React) β”‚ (TanStack Start) β”‚    (Hono + TypeScript)     β”‚
β”‚              β”‚                  β”‚           β”‚                β”‚
β”‚  Landing at  β”‚  App at          β”‚  API + Engine at           β”‚
β”‚  trivoai.xyz β”‚  app.trivoai.xyz β”‚  localhost:3000            β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                    Agent Intelligence Engine                  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚ Regime   β”‚Committee β”‚Confidenceβ”‚  Risk    β”‚ Scorecard β”‚  β”‚
β”‚  β”‚ Detector β”‚ (6 roles)β”‚Calibratorβ”‚Constitutionβ”‚ Service  β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                         β”‚
β”‚  β”‚ Decision β”‚Reflectionβ”‚  Skill   β”‚  β†’ AgentRunner (10s)    β”‚
β”‚  β”‚ Memory   β”‚Generator β”‚  Packs   β”‚                         β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                         β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚               Circle Developer Platform                       β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  Agent   β”‚ Gateway  β”‚   App    β”‚   CCTP   β”‚Contracts  β”‚  β”‚
β”‚  β”‚ Wallets  β”‚(Unified) β”‚   Kit    β”‚ (Bridge) β”‚ Platform  β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                   Arc Testnet (5042002)                       β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚SimpleOracleβ”‚MockPerp β”‚MockPoly  β”‚ MockLPV3 β”‚CopyTradingβ”‚  β”‚
β”‚  β”‚(PriceFeed)β”‚(Perps)  β”‚(Predict) β”‚  (LP)    β”‚+FeeManagerβ”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚         6 contracts deployed Β· ~$0.42 USDC deploy cost       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“Š Project Stats

Metric Value
Backend tests 153 passed (20 files)
Frontend lint 0 errors, 0 warnings
Backend lint 0 errors, 0 warnings
TypeScript errors 0
Smart contracts 6 deployed + verified
API endpoints 41
Database tables 18 (10 original + 8 intelligence)
Intelligence modules 10 engine modules
Valid access codes TRIVO2026 Β· ARC-BETA Β· AGENT-01

πŸ“ Project Structure

trivo/
β”œβ”€β”€ trivo-landing/              # Landing page (Vite + React 19 + Tailwind v4)
β”‚   β”œβ”€β”€ src/App.tsx             #   β†’ trivoai.xyz
β”‚   └── src/components/         # Magic UI components, AccessCodeDialog
β”‚
β”œβ”€β”€ trivo-frontend/             # App (TanStack Start + React 19 + shadcn/ui)
β”‚   β”œβ”€β”€ src/routes/             #   6 app routes
β”‚   β”œβ”€β”€ src/hooks/              #   12 TanStack Query hooks
β”‚   β”œβ”€β”€ src/components/         #   shadcn/ui + custom components
β”‚   └── src/lib/                #   API client, types, utils
β”‚
β”œβ”€β”€ trivo-backend/              # API + Engine (Hono + TypeScript)
β”‚   β”œβ”€β”€ src/engine/             #   Agent intelligence pipeline
β”‚   β”‚   β”œβ”€β”€ regime/             #     Market regime detection
β”‚   β”‚   β”œβ”€β”€ committee/          #     Trading committee (6 roles)
β”‚   β”‚   β”œβ”€β”€ confidence/         #     Confidence calibration
β”‚   β”‚   β”œβ”€β”€ risk/               #     Risk constitution + policy
β”‚   β”‚   β”œβ”€β”€ skills/             #     Skill pack registry
β”‚   β”‚   β”œβ”€β”€ scoring/            #     Score formula + scorecard
β”‚   β”‚   β”œβ”€β”€ memory/             #     Decision memory + reflection
β”‚   β”‚   β”œβ”€β”€ tools/              #     get_price, open_trade, close_trade
β”‚   β”‚   └── providers/          #     AI model routing
β”‚   β”œβ”€β”€ src/routes/             #   14 route files (41 endpoints)
β”‚   β”œβ”€β”€ src/services/           #   12 services (Circle SDK, market data, etc.)
β”‚   └── src/lib/                #   Schema (18 tables), OpenAPI, DB client
β”‚
β”œβ”€β”€ trivo-contracts/            # Smart Contracts (Foundry + Solidity)
β”‚   β”œβ”€β”€ src/                    #   6 contracts + interfaces
β”‚   β”œβ”€β”€ test/                   #   Foundry tests
β”‚   └── script/                 #   Deploy scripts
β”‚
β”œβ”€β”€ docs/                       # Architecture docs, plans, specs
β”‚   └── superpowers/            #   Session plans + tickets
β”‚
β”œβ”€β”€ PRD.md                      # Product Requirements Document
β”œβ”€β”€ AGENTS.md                   # Agent context reference
└── README.md                   # This file

πŸ”— Live URLs

Layer URL Description
Landing trivoai.xyz Marketing page, access code gate
App app.trivoai.xyz Full application (feed, launch, agents)
API localhost:3000 Backend API server
API Docs localhost:3000/api/docs Scalar UI OpenAPI docs

⛓️ Smart Contracts (Arc Testnet)

Contract Address Purpose
SimpleOracle 0xd5c2...f1c1 Price feed (BTC/ETH/SOL)
MockPerp 0x5dcc...12c8 Perpetual futures mock
MockPolymarket 0x066f...ac10 Prediction market mock
MockLPV3 0x7749...fc38 Concentrated LP mock
CopyTrading 0x42a2...ed77 Copy trading + attribution
FeeManager 0x226b...2415 Fee distribution

All contracts verified on Arcscan. No require β€” custom errors only. Deploy cost: ~0.42 USDC.


πŸ› οΈ Tech Stack

Layer Technology
Smart Contracts Solidity 0.8.28 + Foundry
Backend Hono + TypeScript + tsx
Database PostgreSQL + Drizzle ORM (18 tables)
Auth Privy (wallet connect)
AI SDK OpenAI-compatible (openai npm)
Wallets Circle Developer-Controlled Wallets + MPC
Chain Arc Testnet (Chain ID: 5042002) + viem
Frontend App TanStack Start + React 19 + shadcn/ui + Tailwind CSS v4
Landing Vite + React 19 + Tailwind CSS v4 + Framer Motion
State TanStack Query + Axios
Charts lightweight-charts v5
WebSocket ws + @hono/node-server
Deployment Cloudflare Workers (app) + Cloudflare Pages (landing)

πŸš€ Quick Start

Prerequisites

  • Node.js β‰₯ 22 + pnpm + bun
  • PostgreSQL (for backend DB)
  • Arc Testnet RPC URL (from Canteen)
  • Circle API credentials (for wallet operations)

Backend

cd trivo-backend
cp .env.example .env   # fill in DATABASE_URL, PRIVY_*, ARC_RPC_URL, etc.
pnpm install
pnpm run dev           # starts on :3000
pnpm run check         # typecheck + lint + test (153 tests)

Frontend App

cd trivo-frontend
bun install
bun run dev            # starts on :5173
bun run build          # production build

Landing Page

cd trivo-landing
bun install
bun run dev            # starts on :5174
bun run build          # static build β†’ dist/

Smart Contracts

cd trivo-contracts
forge install
forge test             # Foundry tests
forge build

🎯 Hackathon Alignment β€” RFB 06: Social Trading Intelligence

This submission directly addresses RFB 06 β€” moving beyond blind copy trading toward AI-driven selection, weighting, monitoring, and risk management of trading strategies with on-chain verifiable identity.

Judging Criteria Performance

30% Agentic Sophistication
Trivo agents exercise substantial autonomy. They interpret natural language objectives, maintain persistent memory, reason through a 6-role committee, calibrate confidence across 5 weighted dimensions, evaluate real-time market data, detect regime shifts, and generate structured trade decisions with deterministic risk approval. The 10-second THINK β†’ DECIDE β†’ EXECUTE loop runs fully autonomous, 24/7.

30% Traction
The platform is built for rapid user adoption. Real-time feed with one-click copy trading enables immediate participation. Access code gated launch creates exclusivity. Live deployment at trivoai.xyz + app.trivoai.xyz.

20% Circle Tool Usage
Extensive Circle integration across the stack:

  • Developer-Controlled Wallets β€” MPC wallet per agent with spending policies
  • Gateway + Unified Balance β€” Cross-chain USDC management
  • App Kit β€” Bridge, swap, send, and unified balance flows
  • CCTP β€” Cross-chain collateral movement
  • Smart Contract Platform β€” Position management and fee settlement
  • USDC as native gas β€” Every tx, fee, and incentive denominated in USDC

20% Innovation
Trivo introduces a unified on-chain identity primitive (ERC-8004 + portable builder codes) bridging siloed attribution systems across venues. The deterministic intelligence pipeline (committee β†’ confidence β†’ risk constitution β†’ scorecard β†’ reflection) is an architecture pattern that makes AI trading agents auditable and composable β€” not just automated, but accountable.


πŸ“ Key Design Decisions

  • Deterministic intelligence β€” All engine modules are pure functions, no external API calls in the approval path. Makes agents auditable and reproducible.
  • Event-style records β€” Every decision, committee report, reflection, and scorecard persisted as immutable DB records.
  • Custom errors only β€” All Solidity contracts use custom errors via revert, no require.
  • ERC-8004 identity β€” Agent NFTs on Arc with embedded builder codes for cross-venue attribution.
  • Separate landing page β€” Extracted to trivo-landing/ for independent deployment (Cloudflare Pages static vs Workers SSR).
  • Access code gate β€” TRIVO2026, ARC-BETA, AGENT-01 β€” early access control before public launch.

πŸ”Œ API Endpoints (41 total)

Intelligence (9 new)

Method Path Description
GET /api/intelligence/skill-packs Built-in skill packs
GET /api/intelligence/agents/:id/decisions Agent decision history
GET /api/intelligence/agents/:id/committee-reports Committee role reports
GET /api/intelligence/agents/:id/reflections Trade reflections
GET /api/intelligence/agents/:id/scorecard Agent TrivoScore
GET /api/intelligence/scorecards All scorecards
GET /api/intelligence/agents/:id/skill-packs Agent skill config
GET /api/intelligence/market-regimes Market regime history
GET /api/intelligence/agents/:id/risk-policy Risk constitution policy

Core (32 existing)

Agents (CRUD) Β· Feed Β· Positions Β· Copy Trading Β· Wallets Β· Memory Β· Thinking Traces Β· Strategy Compiler Β· Backtest Β· Market Data Β· PnL Β· Bridge Β· Transfers Β· Unified Balance Β· Auth Β· Health


πŸ§ͺ Testing

# Backend (153 tests in 20 files)
cd trivo-backend && pnpm run test

# Specific test suites
pnpm exec vitest run src/engine/regime/regime-detector.test.ts
pnpm exec vitest run src/engine/committee/trading-committee.test.ts
pnpm exec vitest run src/__tests__/intelligence.test.ts

# Full check (typecheck + lint + test)
pnpm run check

# Contracts
cd trivo-contracts && forge test

Built for the Agora Agents Hackathon β€” Canteen Γ— Circle Γ— Arc.


About

Launch programmable agents that trade and earn with guardrails for onchain markets.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages