// DEVELOPER DOCUMENTATION

AGENT
interface.

Reference architecture for connecting autonomous strategies to AAP market data and execution workflows.

Overview

AAP Solutions combines normalized public market data from supported perpetual venues with an agent-oriented strategy interface. The integration model separates market-data access, strategy evaluation and execution authorization so an AI agent can research opportunities without automatically receiving unlimited trading power.

Connect an agent

import { AAP } from "@aap-solutions/agent";

const agent = await AAP.connect({
  key: process.env.AAP_API_KEY,
  wallet: process.env.AGENT_WALLET,
  permissions: [
    "market.read",
    "quote.create",
    "trade.request"
  ],
  maxNotionalUSD: 25000
});

The agent interface is designed around permissioned market-data access, quoting and execution requests.

Scan funding

const routes = await agent.funding.scan({
  symbols: ["BTC", "ETH", "SOL"],
  minNetApr: 10,
  minOpenInterestUSD: 5_000_000,
  venueTypes: ["dex", "cex"]
});

Create a route quote

const quote = await agent.quote(routes[0], {
  notionalUSD: 10000,
  includeFees: true,
  includeSlippage: true,
  includeFundingHistory: true
});

A quote should contain the long and short venue, executable prices, fees, estimated slippage, funding cadence, funding history summary and a risk score. Agents should make decisions on the quote, not on a raw headline APR.

Request execution

await agent.strategy.open(quote, {
  mode: "delta-neutral",
  maxDeltaBps: 25,
  maxSlippageBps: 18,
  timeInForce: "IOC"
});

Execution is intended to remain policy-bound. A production system should require explicit wallet authorization, venue-level permissions and per-strategy notional limits.

Risk policy

Funding arbitrage is not risk-free. An agent policy should account for basis divergence, asymmetric fills, liquidation thresholds, venue solvency, collateral movement, funding reversals, borrow constraints, API downtime and stale order-book data.

  • Set maximum strategy notional.
  • Set maximum tolerated delta during partial fills.
  • Reject routes with insufficient depth.
  • Require minimum collateral buffer on both legs.
  • Define automatic exit conditions when funding edge decays.