AegisAEGIS
Uniblock API

Uniblock Integration

Unified EVM token balance aggregation across Ethereum, Base, Polygon, and Arbitrum — one API for all chains.

Why Uniblock for Agents?

🔗

Single API, All EVM Chains

One endpoint for Ethereum, Base, Polygon, Arbitrum

🪙

Token Balance Aggregation

Native + ERC-20 tokens across all supported chains

💵

USD Valuations

Real-time price data included in balance responses

Fast Response Times

Optimized for real-time monitoring workflows


What Aegis Uses Uniblock For

EVM Token Balance Queries

Fetch native + ERC-20 token balances across 4 EVM chains in a single call via getEvmBalances().

Multi-Source Deduplication

Uniblock data is combined with Zerion and Allium. Aegis deduplicates by chain:token, keeping the highest USD value.

Dashboard Display

Powers the wallet balance component in the Aegis dashboard (Nexus).


Use Cases

\uD83D\uDCCA

Multi-Chain Balance Monitoring

Track agent EVM holdings across Ethereum, Base, Polygon, and Arbitrum from a single query.

getEvmBalances(addr) → 4 chains

\uD83C\uDF10

Cross-Chain Agent Operations

Agents operating on multiple L2s need a unified view of their balances for decision-making.

balances across Base + Arbitrum + Polygon

\uD83D\uDEE1\uFE0F

Budget Enforcement

Verify agent balances against spending policies before authorizing transactions.

budget.check(totalUsdValue)

\uD83C\uDFED

Fleet Treasury View

Aggregate balances across all agent wallets for a complete fleet treasury overview.

agents.map(a => getEvmBalances(a.addr))


EVM Balance Query

Query EVM token balances
import { getEvmBalances } from "@aegis-ows/integrations";

// Query across all default chains (Ethereum, Base, Polygon, Arbitrum)
const balances = await getEvmBalances("0x1234...");

// Or specify specific chains
const l2Only = await getEvmBalances("0x1234...", ["base", "arbitrum"]);

// Returns:
// [
//   { chain: "Base", chainId: "eip155:8453", token: "ETH",
//     balance: "0.500000", usdValue: "1500.00", source: "uniblock" },
//   { chain: "Base", chainId: "eip155:8453", token: "USDC",
//     balance: "100.000000", usdValue: "100.00", source: "uniblock" },
//   { chain: "Arbitrum", chainId: "eip155:42161", token: "ETH",
//     balance: "0.250000", usdValue: "750.00", source: "uniblock" }
// ]

How it works

  1. Iterates each target chain (default: ethereum, base, polygon, arbitrum)
  2. Calls /token/balances?address=...&chain=...
  3. Filters dust balances (<0.0001)
  4. Maps chain names and CAIP-2 chain IDs

Supported Chains

ChainCAIP-2 Chain IDUniblock Key
Ethereumeip155:1ethereum
Baseeip155:8453base
Polygoneip155:137polygon
Arbitrumeip155:42161arbitrum

Multi-Source Aggregation

Uniblock is one of three EVM data sources Aegis queries in parallel. Results are deduplicated automatically.

Unified balance query across all chains + sources
import { getAllBalances } from "@aegis-ows/integrations";

const balances = await getAllBalances({
  evm: "0x1234...",         // → Zerion + Uniblock + Allium (parallel)
  solana: "2G55...",        // → Solana RPC
  xrp: "rHb9...",           // → XRPL WebSocket
  stellar: "GBZX..."        // → Stellar Horizon
});

// Deduplication: same chain:token from multiple sources
// → keeps the entry with the highest USD value

Setup Guide

.env
# Required — get from uniblock.dev
UNIBLOCK_API_KEY=your_api_key_here
ConfigValue
Authx-api-key header
Base URLhttps://api.uniblock.dev/v1
Env VarUNIBLOCK_API_KEY

Hackathon Ideas

Infrastructure Track

Universal balance API for AI agent fleets across all EVM chains

Multi-Chain Track

Agents that optimize operations across L2s based on gas costs and balances

DeFi Track

Portfolio-aware trading agents with cross-chain position tracking

Analytics

Cross-chain agent wealth tracking and treasury management dashboard


API Reference

FunctionParametersReturns
getEvmBalanceswalletAddress, chains?ChainBalance[]