Agent workflow

Agent API docs

AI agents can call ExitIQ before recommending a yield opportunity. The exit-check returns deterministic, auditable signals; the agent-decision endpoint turns those signals into an allow/warn/reject call the agent can act on.

Endpoint 1 · evidence

POST /api/exit-check

Submit an asset, amount, risk profile, time horizon, and mode. Live requests use GeckoTerminal Mantle pool data where available and fall back to seeded liquidity data when live data is unavailable. The response is the deterministic, auditable evidence the agent reasons over.

Example request

POST /api/exit-check
Content-Type: application/json

{
  "assetId": "usdy",
  "amountUsd": 100000,
  "riskProfile": "balanced",
  "timeHorizonDays": 7,
  "mode": "demo"
}

Example response

{
  "asset": {
    "id": "usdy",
    "name": "Ondo U.S. Dollar Yield",
    "symbol": "USDY",
    "address": "0x5be26527e817998a7206475496fde1e68957c5a6",
    "liquidityUsd": 3400,
    "dailyVolumeUsd": 60,
    "routes": 1,
    "apy": 3.55
  },
  "amountUsd": 100000,
  "exitScore": "F",
  "verdict": "avoid",
  "estimatedSlippagePct": 96.71,
  "maxSafeSizeUsd": 87,
  "bestRoute": "Ondo redemption (KYC-gated, multi-day settlement)",
  "routeDiversity": "low",
  "liquidityDepthUsd": 3400,
  "volumeSupport": "weak",
  "stress": {
    "liquidityDown20": { "exitScore": "F" },
    "liquidityDown50": { "exitScore": "F" },
    "bestRouteUnavailable": { "exitScore": "F" }
  },
  "complianceStatus": {
    "level": "unknown",
    "label": "Eligibility review required",
    "summary": "USDY exit is KYC-gated Ondo redemption that restricts U.S. persons. Verify access rules before allocation."
  },
  "alternative": {
    "asset": "Ethena USDe",
    "reason": "Better route depth and lower exit slippage at the same size",
    "exitScore": "B",
    "maxSafeSizeUsd": 164102
  }
}

Endpoint 2 · decision

POST /api/agent-decision

Pass an exit-check result and the AI agent returns the governing allow/warn/reject call with confidence, grounded reasons, and a required action. It may confirm or override the model baseline, and every decision stays backed by the auditable signals. If the model is unavailable, it falls back to the deterministic baseline (source: "deterministic").

Decision request

POST /api/agent-decision
Content-Type: application/json

{
  "result": { /* the /api/exit-check response */ }
}

Decision response

{
  "decision": {
    "action": "reject",
    "confidence": 95,
    "headline": "Exit of $100,000 THIN rejected due to extreme slippage.",
    "reasons": [
      "Estimated slippage of 45.45% far exceeds safe thresholds.",
      "Max safe size is only $3,076 for a $100,000 exit."
    ],
    "requiredAction": "Do not execute exit. Consider Ethena USDe (B grade).",
    "monitoringTrigger": "Re-evaluate if liquidity depth falls 20%.",
    "modelBaselineAction": "reject",
    "agreesWithBaseline": true,
    "source": "llm"
  }
}