All Agent Setups
Smart-money aware executionMedium complexityAdvanced onchain

ElizaOS + Nansen + RiskState + CoW

Wallet-tracking agent powered by the largest crypto-native framework (17K+ stars, 25+ DeFi plugins). Nansen identifies smart-money flows and sector rotations, RiskState decides how much capital is allowed, CoW executes the trade.

How it works

1

Nansen provides market intelligence

Your agent queries Nansen for real-time market data — smart-money wallet flows, sector rotations, and token accumulation signals. Professional tier with smart-money data.

2

RiskState gates the decision

Before any execution, your agent calls POST /v1/risk-state. The response contains max_size_fraction (position ceiling), allowed_actions (what’s permitted), and structural_blockers (hard stops). If blockers exist, the agent halts. Otherwise, it sizes the trade within the policy limit. 30+ signals scored in real-time, 60-second cache, SHA-256 audit hash.

3

CoW Swap executes within limits

The trade is submitted to CoW Swap with MEV protection via batch auctions. Surplus goes to the trader, not the MEV bot. Position size never exceeds what RiskState permitted.

Integration code

Copy this into your project. Replace the API keys with your own.

elizaos_riskstate_cow.ts
import { ElizaAgent } from "@elizaos/core";

// 1. Nansen smart-money signal (simplified)
const smartMoneyFlow = await fetch(
  "https://api.nansen.ai/v1/smart-money/token-flows",
  { headers: { "x-api-key": NANSEN_KEY } }
).then(r => r.json());

// 2. Get risk policy from RiskState
const policy = await fetch(
  "https://riskstate.netlify.app/v1/risk-state",
  {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${RISKSTATE_KEY}`,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({ asset: "BTC", include_details: true })
  }
).then(r => r.json());

const { max_size_fraction, leverage_allowed, allowed_actions }
  = policy.exposure_policy;
const blockers = policy.risk_flags.structural_blockers;

// 3. Enforce governance in ElizaOS action
if (blockers.length > 0) {
  agent.log(`Blocked by: ${blockers.join(", ")}`);
  return;
}

// 4. Size the trade within policy limits
const tradeSize = portfolioValue * max_size_fraction;
// Execute via CoW Swap with MEV protection

What your agent receives from RiskState

Every call to /v1/risk-state returns these three blocks. Your agent reads them in order.

Exposure Policy

Binding
  • max_size_fraction — hard ceiling
  • leverage_allowed — boolean
  • allowed_actions — enum list
  • blocked_actions — enum list

Market Intelligence

Context
  • tactical_state — LEAN BULL, etc.
  • market_regime — TREND, RANGE...
  • binding_constraint — source + why
  • risk_flags — blockers + risks

Auditability

Trust
  • policy_hash — SHA-256
  • confidence_score — 0-100
  • data_sources — per-signal
  • ttl_seconds — cache hint

Start building

Get an API key in under a minute. Free during beta.