Agent Guides

Open playbooks for building autonomous agents. Hard-won lessons from building in public.

🗂️

Start Here — Architecture

New to building production agents? The 4-Layer Autonomous Agent Stack — Identity, Payment, Execution, Accountability — maps the complete infrastructure on Base.

read →
ProtocolIntermediate9/17

Uniswap Agent Skills + CustosNetwork: Agentic Finance with Accountability

Uniswap launched 7 Agent Skills giving AI agents direct access to swaps, LP, and routing on Base. This guide shows how to pair Uniswap Skills with CustosNetwork inscriptions for the first auditable agentic finance stack.

UniswapAgentic FinanceBaseDeFiCustosNetworkAccountabilityAgent Skills

The Problem: Financial Agents Without Audit Trails

On February 20, 2026, Uniswap Labs released 7 Agent Skills — structured actions that give AI agents direct access to core Uniswap protocol functions: swaps, LP positions, routing, and more.

This is a major milestone for onchain agentic finance. For the first time, AI agents can execute real DeFi operations programmatically, without human hand-holding.

But there's a gap: financial agents acting onchain with no neutral audit trail.

When an agent makes a trade, the blockchain records the transaction. But it doesn't record:

  • *Why* the agent made the decision
  • *What reasoning* led to it
  • *Whether the decision was formed before execution* or retrofitted after
  • For institutional use, regulatory compliance, or DAO treasury management, this gap matters.


    The Stack: Uniswap Skills + CustosNetwork

    Combine Uniswap Agent Skills with CustosNetwork inscriptions to get a complete agentic finance + accountability stack:

    LayerWhat it gives youProtocol
    **Execution**Swap, LP, route on UniswapUniswap Agent Skills
    **Accountability**Tamper-proof decision trailCustosNetwork
    **Identity**Who the agent isERC-8004 / ENS

    The pattern: Inscribe *before* executing. Hash your decision rationale, write it onchain, then call the Uniswap Skill. The inscription timestamp proves the reasoning preceded the trade.


    Integration Pattern

    ### Step 1 — Inscribe the decision (before the trade)

    typescript
    import { createWalletClient, createPublicClient, http, keccak256, toBytes } from "viem";
    import { base } from "viem/chains";
    
    const PROXY = "0x9B5FD0B02355E954F159F33D7886e4198ee777b9";
    const USDC  = "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
    
    // Build your decision payload before trading
    const decision = {
      action: "swap",
      tokenIn: "USDC",
      tokenOut: "ETH",
      amountIn: "1000",
      rationale: "ETH/USDC at 30d low; rebalancing per allocation policy",
      timestamp: Date.now(),
    };
    
    const content   = JSON.stringify(decision);
    const proofHash = keccak256(toBytes(content));
    
    // Approve + inscribe BEFORE calling the Uniswap Skill
    await walletClient.writeContract({
      address: USDC, abi: erc20Abi, functionName: "approve",
      args: [PROXY, 100_000n], // 0.1 USDC inscription fee
    });
    
    await walletClient.writeContract({
      address: PROXY, abi: proxyAbi, functionName: "inscribe",
      args: [proofHash, prevHash, "market", "swap USDC→ETH: rebalancing per allocation policy"],
    });
    
    // THEN execute via Uniswap Agent Skill
    const swapResult = await uniswapSkill.swap({ ... });

    ### Step 2 — Inscribe the outcome (after execution)

    typescript
    const outcome = {
      action: "swap_complete",
      txHash: swapResult.txHash,
      amountIn: swapResult.amountIn,
      amountOut: swapResult.amountOut,
      slippage: swapResult.slippage,
      decisionHash: proofHash, // links back to pre-trade inscription
    };
    
    await walletClient.writeContract({
      address: PROXY, abi: proxyAbi, functionName: "inscribe",
      args: [keccak256(toBytes(JSON.stringify(outcome))), proofHash, "market", "swap complete: got X ETH for Y USDC"],
    });

    Why "Inscribe Before" Matters

    The inscription timestamp on Base is immutable. If you inscribe the rationale *before* the swap executes, you've proven the decision was formed before the trade. This matters for:

  • Regulatory compliance: Demonstrates non-manipulative intent
  • DAO accountability: Governance can audit what the agent was "thinking" before each trade
  • Trust building: Counterparties can verify the agent isn't retrofitting justifications
  • If you inscribe *after*, the timestamp can't prove the reasoning preceded the action.


    The Audit Gap: Uniswap Skills Alone

    Uniswap Agent Skills record execution onchain — the swap transaction is permanently on Base. But execution records only show *what happened*, not *why*.

    An auditor looking at a sequence of agent trades can verify amounts and prices. They cannot verify:

  • Whether the agent followed its stated strategy
  • Whether decisions were consistent with its mandate
  • Whether reasoning gaps exist between trades
  • CustosNetwork fills this gap. The prevHash chain-link means auditors can walk the entire decision history, verify continuity, and detect missing cycles.


    Uniswap Agent Skills Available (Feb 2026)

    SkillWhat it does
    SwapExecute token swaps on Uniswap v3/v4
    Add LiquidityProvide LP to a pool
    Remove LiquidityExit LP position
    RouteFind optimal swap path
    PriceFetch pool price data
    Pool InfoQuery pool state
    Position InfoRead LP position details

    Each Skill maps to a structured onchain action. Each action is a candidate for a CustosNetwork inscription.


    Production Notes

  • Inscription fee: **0.1 USDC per call** — factor into agent operating costs
  • Approve exact amount before each inscribe (or use a slightly higher approval and track remaining)
  • Use `blockType: "market"` for all trading decisions
  • Store `proofHash` as part of your trade record — you'll want it for outcome linking
  • Chain-link: pass the previous inscription's `proofHash` as `prevHash` to maintain the audit chain
  • *Based on Uniswap Agent Skills release Feb 20, 2026 and CustosNetwork V5 proxy. Both live on Base mainnet.*

    All guides documented from real production use · Machine-readable API