Dashboard
Backend Offline

Technical Documentation

UniAgent v1.0 — Cross-Chain Universal Trading

Overview

UniAgent is a cross-chain trading infrastructure powered by Universal Accounts from Particle Network. It enables seamless token swaps across 21+ chains without manual bridging, chain switching, or gas token management.

How Users Interact

Users talk naturally: "Buy $50 of ARB on Arbitrum" or "Send 10 USDC to 0x..."
The AI agent interprets this, executes the trade via the backend, and confirms the result.
No CLI, no commands, no technical knowledge required.

Chain Abstraction

Trade on any chain using a unified balance. No bridging, no wrapped tokens, no friction.

Universal Balance

USDC, USDT, ETH, SOL, BNB, BTC aggregated across all chains into one spendable balance.

Atomic Execution

Single-signature transactions that execute complex multi-chain operations atomically.

Self-Custody

Your private key never leaves your machine. All transactions are signed locally.

System Architecture

UniAgent consists of three core layers:

1

Dashboard (Next.js + wagmi)

  • React 19 with App Router for server/client components
  • wagmi + RainbowKit for wallet connection (17 EVM chains)
  • Real-time portfolio, terminal, and activity views
  • Framer Motion animations, Tailwind CSS v4 styling
2

Backend API (Express.js)

  • RESTful endpoints for balance, trading, and history
  • Particle Network Universal Account SDK integration
  • Transaction building with automatic gas and route optimization
  • UserOperation construction for ERC-4337 execution
3

Particle Network (Universal Accounts)

  • Chain abstraction layer across 21+ networks
  • Smart account derivation from EOA signature
  • Cross-chain liquidity aggregation and routing
  • Bundled transaction execution via ERC-4337

Universal Accounts

A Universal Account is a smart contract account derived deterministically from your EOA wallet. It provides:

  • EVM Address — Single deposit address for all EVM chains (Ethereum, Base, Arbitrum, etc.)
  • Solana Address — Native Solana deposit address
  • Unified Balance — Assets across all chains aggregated into one view
  • Cross-Chain Spend — Use ETH on Arbitrum to buy tokens on Base, automatically

Account Derivation

// 1. User connects EOA wallet (MetaMask, Rainbow, etc.)
const eoaAddress = "0xYourWalletAddress";

// 2. Sign a deterministic message
const signature = await wallet.signMessage("particle-ua-derivation");

// 3. Universal Account is derived
const ua = await particleSDK.deriveUniversalAccount(eoaAddress, signature);

// 4. Returns EVM + Solana deposit addresses
console.log(ua.evmAddress);    // 0x...
console.log(ua.solanaAddress); // Base58...

Backend Architecture

Note: Users don't need to install any SDK. Just install the skill on your agent and use the CLI commands. The backend handles all Particle Network integration automatically.

For developers who want to understand or contribute, here's how the backend works:

Backend Flow

// 1. User connects wallet in dashboard or runs CLI
// 2. Frontend sends EOA address to backend

POST /init { ownerAddress: "0x..." }

// 3. Backend (server.mjs) uses Particle SDK internally
// All SDK credentials are on the server - users never see them

// 4. Backend returns derived UA addresses
{ evmAddress: "0x...", solanaAddress: "...", balance: "1234.56" }

// 5. User funds their UA, trades via CLI/dashboard
// All signing happens locally, backend only sees signed transactions

What Users Actually Do

# Install the skill on your agent
# Then just use natural language or CLI:

node cli.mjs init          # Creates wallet, derives UA
node cli.mjs balance       # Check balance
node cli.mjs buy ...       # Trade

# That's it. No SDK, no API keys, no configuration.
# Your private key stays local. Backend handles the rest.

API Reference

The backend exposes RESTful endpoints on port 3069:

POST/init

Initialize Universal Account from EOA address

Request Body:
{
  "ownerAddress": "0x..."
}
Response:
{
  "evmAddress": "0x...",
  "solanaAddress": "...",
  "balance": "1234.56"
}
POST/balance

Get current balance and asset breakdown

Request Body:
{
  "ownerAddress": "0x..."
}
Response:
{
  "total": "1234.56",
  "assets": [],
  "chains": []
}
POST/buy

Buy a token using unified balance

Request Body:
{
  "ownerAddress": "0x...",
  "chain": "base",
  "token": "0x...",
  "amount": 10
}
Response:
{
  "txHash": "0x...",
  "status": "pending"
}
POST/sell

Sell a token back to primary assets

Request Body:
{
  "ownerAddress": "0x...",
  "chain": "arbitrum",
  "token": "0x...",
  "amount": 100
}
Response:
{
  "txHash": "0x...",
  "status": "pending"
}
POST/convert

Convert between primary assets

Request Body:
{
  "ownerAddress": "0x...",
  "chain": "ethereum",
  "asset": "ETH",
  "amount": 0.1
}
Response:
{
  "txHash": "0x...",
  "status": "pending"
}
POST/transfer

Transfer tokens to another address

Request Body:
{
  "ownerAddress": "0x...",
  "chain": "polygon",
  "token": "0x...",
  "amount": 50,
  "to": "0x..."
}
Response:
{
  "txHash": "0x...",
  "status": "pending"
}
GET/chains

List all supported chains

Response:
[
  {
    "id": 1,
    "name": "Ethereum",
    "symbol": "ETH"
  }
]
GET/health

Health check endpoint

Response:
{
  "status": "ok",
  "chains": 21
}

Transaction Flow

When a user initiates a trade (e.g., "Buy $10 of ARB on Arbitrum"):

1

Request Parsing

Dashboard sends request to backend with ownerAddress, chain, token, amount

2

Route Calculation

SDK analyzes unified balance, finds optimal source assets (may span multiple chains)

3

UserOperation Building

Constructs ERC-4337 UserOperation with all necessary cross-chain calls

4

Local Signing

UserOp is returned to client, signed with user's private key (never sent to server)

5

Submission

Signed UserOp sent back to backend, submitted to Particle's bundler network

6

Execution

Bundlers execute the transaction atomically across all required chains

7

Confirmation

Transaction hash returned, balance updates reflected in real-time

Security Model

UniAgent follows a self-custody security model:

Local Key Storage

Private keys are stored in local .env file and never transmitted. All signing happens client-side.

Message Signing Only

Server only receives signed transactions, never raw private keys. Zero knowledge of user secrets.

Deterministic Derivation

Universal Account is derived from EOA signature, recoverable with same wallet on any device.

Smart Contract Security

Universal Account contracts are audited, battle-tested, and non-upgradeable.

Important: Never share your .env file or UA_PRIVATE_KEY. Anyone with access to your private key controls your Universal Account and all assets within.

Supported Chains

UniAgent supports 21 chains for trading, with more being added:

ChainCLI NameChain IDStatus
Ethereumethereum1Active
BNB Chainbnb56Active
Basebase8453Active
Arbitrumarbitrum42161Active
Avalancheavalanche43114Active
Optimismoptimism10Active
Polygonpolygon137Active
Solanasolana101Active
Linealinea59144Active
Sonicsonic146Active
Berachainberachain80094Active
Mantlemantle5000Active
Monadmonad143Active
Merlinmerlin4200Active
HyperEVMhyperevm999Active
Blastblast81457Active
Mantamanta169Active
Modemode34443Active
Plasmaplasma9745Active
X Layerxlayer196Active
Confluxconflux1030Active