---
title: "Analyze a route or account with Risk Sentinel"
method: POST
path: "/v1/agent/risk-sentinel"
tags: ["Risk"]
---

# Analyze a route or account with Risk Sentinel

`POST /v1/agent/risk-sentinel`

## Request

- Base URL: `https://www.farmdash.one/api`
- URL: `https://www.farmdash.one/api/v1/agent/risk-sentinel`
- Auth: one of:
  - HTTP bearer
  - none

Accepts either a full swap-shaped payload or manual health/net-edge inputs.
When swap fields are present, FarmDash auto-selects a route, computes
Execution Alpha diagnostics, and returns a full Risk Sentinel report.

## Headers

- `X-ClawHub-Skill` string

## Request body

- RiskSentinelRequest: Provide either manual health/net-edge inputs or a full swap-shaped request for route-aware analysis.
  - `fromChainId` 1 | 10 | 137 | 8453 | 42161 | 59144
  - `toChainId` 1 | 10 | 137 | 8453 | 42161 | 59144
  - `fromToken` string
  - `toToken` string
  - `fromAmount` string
  - `walletAddress` string
  - `toAddress` string
  - `protocol` 'lifi' | 'relay'
  - `slippage` number
  - `expectedUpsideUsd` number
  - `riskBufferUsd` number
  - `healthFactor` number
  - `liquidationBufferPct` number
  - `protocolFeeUsd` number
  - `gasUsd` number
  - `bridgeFeeUsd` number
  - `enforcePositive` boolean
  - `safetyMode` 'strict' | 'balanced'

## Response `200`

Risk analysis

- RiskSentinelResponse
  - `ok` boolean
  - `mode` 'manual' | 'quoted'
  - `selectedProtocol` 'lifi' | 'relay': Swap quote provider. Automatic routing compares all healthy compatible providers (LI.FI, Relay; 0x paused until reinstated); force one with ?protocol= (deterministic, never silent fallback).
  - `executionAlpha` ExecutionAlphaReport
    - `selectedProtocol` 'lifi' | 'relay': Swap quote provider. Automatic routing compares all healthy compatible providers (LI.FI, Relay; 0x paused until reinstated); force one with ?protocol= (deterministic, never silent fallback).
    - `routeReason` string
    - `mevProtection` object
      - `safetyMode` 'strict' | 'balanced'
      - `actualSlippageBps` integer
      - `maxRecommendedSlippageBps` integer
    - `candidates` RouteCandidate[]
      - `protocol` 'lifi' | 'relay': Swap quote provider. Automatic routing compares all healthy compatible providers (LI.FI, Relay; 0x paused until reinstated); force one with ?protocol= (deterministic, never silent fallback).
      - `estimatedOutput` string
      - `feeAmountUsd` number
      - `gasEstimateUsd` number, nullable
      - `bridgeFeeUsd` number, nullable
      - `routeRiskScore` number
      - `selected` boolean
    - `quoteDecay` QuoteDecayMetrics
      - `previousObservedAt` integer, nullable
      - `quoteAgeMs` integer, nullable
      - `outputDecayBps` number
      - `gasIncreaseBps` number
      - `severity` 'none' | 'low' | 'medium' | 'high'
    - `netEdge` NetEdgeAnalysis
      - `expectedUpsideUsd` number, nullable
      - `protocolFeeUsd` number
      - `gasUsd` number
      - `bridgeFeeUsd` number
      - `riskBufferUsd` number
      - `totalCostUsd` number
      - `netEdgeUsd` number, nullable
      - `positive` boolean, nullable
      - `enforced` boolean
  - `riskReport` SwapRiskReport
    - `flags` RiskFlag[]
      - `code` string, required
      - `category` 'approval' | 'bridge' | 'contract' | 'token' | 'health' | 'execution', required
      - `severity` 'low' | 'medium' | 'high' | 'critical', required
      - `title` string, required
      - `message` string, required
      - `metadata` object
    - `approval` AllowanceStatus
      - `spender` string, nullable
      - `allowance` string, nullable
      - `requiredAmount` string
      - `approvalNeeded` boolean
      - `overApproved` boolean
      - `source` 'onchain' | 'quote_fallback' | 'unavailable'
    - `pegChecks` PegCheck[]
      - `tokenAddress` string
      - `symbol` string
      - `reference` 'USD' | 'ETH'
      - `priceUsd` number, nullable
      - `referencePriceUsd` number, nullable
      - `deviationPct` number, nullable
      - `alert` boolean
    - `health` HealthCheck
      - `healthFactor` number, nullable
      - `liquidationBufferPct` number, nullable
      - `alertLevel` 'none' | 'warning' | 'critical'
      - `shouldHalt` boolean
    - `shouldHalt` boolean
    - `haltReasons` string[]
  - `quotePreview` SwapResult
    - `protocol` 'lifi' | 'relay', required: Swap quote provider. Automatic routing compares all healthy compatible providers (LI.FI, Relay; 0x paused until reinstated); force one with ?protocol= (deterministic, never silent fallback).
    - `estimatedOutput` string, required
    - `feeBps` integer, required
    - `feeAmountUSD` string, required
    - `feeEventId` string, uuid: Use with /agents/confirm to confirm settlement
    - `gasEstimate` string, required
    - `txData` SwapTxData, required
      - `to` string, required: Protocol contract address (NOT FarmDash)
      - `data` string, required: Encoded calldata
      - `value` string, required: Native token value in wei
      - `chainId` integer, required
    - `expiresAt` integer, required
    - `allowanceTarget` string, nullable
    - `gasEstimateUsd` number, nullable
    - `bridgeFeeUsd` number, nullable
    - `simulation` object
    - `executionAlpha` ExecutionAlphaReport
      - `selectedProtocol` 'lifi' | 'relay': Swap quote provider. Automatic routing compares all healthy compatible providers (LI.FI, Relay; 0x paused until reinstated); force one with ?protocol= (deterministic, never silent fallback).
      - `routeReason` string
      - `mevProtection` object
        - `safetyMode` 'strict' | 'balanced'
        - `actualSlippageBps` integer
        - `maxRecommendedSlippageBps` integer
      - `candidates` RouteCandidate[]
        - `protocol` 'lifi' | 'relay': Swap quote provider. Automatic routing compares all healthy compatible providers (LI.FI, Relay; 0x paused until reinstated); force one with ?protocol= (deterministic, never silent fallback).
        - `estimatedOutput` string
        - `feeAmountUsd` number
        - `gasEstimateUsd` number, nullable
        - `bridgeFeeUsd` number, nullable
        - `routeRiskScore` number
        - `selected` boolean
      - `quoteDecay` QuoteDecayMetrics
        - `previousObservedAt` integer, nullable
        - `quoteAgeMs` integer, nullable
        - `outputDecayBps` number
        - `gasIncreaseBps` number
        - `severity` 'none' | 'low' | 'medium' | 'high'
      - `netEdge` NetEdgeAnalysis
        - `expectedUpsideUsd` number, nullable
        - `protocolFeeUsd` number
        - `gasUsd` number
        - `bridgeFeeUsd` number
        - `riskBufferUsd` number
        - `totalCostUsd` number
        - `netEdgeUsd` number, nullable
        - `positive` boolean, nullable
        - `enforced` boolean
    - `riskReport` SwapRiskReport
      - `flags` RiskFlag[]
        - `code` string, required
        - `category` 'approval' | 'bridge' | 'contract' | 'token' | 'health' | 'execution', required
        - `severity` 'low' | 'medium' | 'high' | 'critical', required
        - `title` string, required
        - `message` string, required
        - `metadata` object
      - `approval` AllowanceStatus
        - `spender` string, nullable
        - `allowance` string, nullable
        - `requiredAmount` string
        - `approvalNeeded` boolean
        - `overApproved` boolean
        - `source` 'onchain' | 'quote_fallback' | 'unavailable'
      - `pegChecks` PegCheck[]
        - `tokenAddress` string
        - `symbol` string
        - `reference` 'USD' | 'ETH'
        - `priceUsd` number, nullable
        - `referencePriceUsd` number, nullable
        - `deviationPct` number, nullable
        - `alert` boolean
      - `health` HealthCheck
        - `healthFactor` number, nullable
        - `liquidationBufferPct` number, nullable
        - `alertLevel` 'none' | 'warning' | 'critical'
        - `shouldHalt` boolean
      - `shouldHalt` boolean
      - `haltReasons` string[]
    - `confirmUrl` string
  - `health` HealthCheck
    - `healthFactor` number, nullable
    - `liquidationBufferPct` number, nullable
    - `alertLevel` 'none' | 'warning' | 'critical'
    - `shouldHalt` boolean
  - `netEdge` NetEdgeAnalysis
    - `expectedUpsideUsd` number, nullable
    - `protocolFeeUsd` number
    - `gasUsd` number
    - `bridgeFeeUsd` number
    - `riskBufferUsd` number
    - `totalCostUsd` number
    - `netEdgeUsd` number, nullable
    - `positive` boolean, nullable
    - `enforced` boolean
  - `flags` RiskFlag[]
    - `code` string, required
    - `category` 'approval' | 'bridge' | 'contract' | 'token' | 'health' | 'execution', required
    - `severity` 'low' | 'medium' | 'high' | 'critical', required
    - `title` string, required
    - `message` string, required
    - `metadata` object
  - `shouldHalt` boolean

## Other responses

- `400`: Invalid parameters
- `402`: Free-tier limit exceeded — x402 payment required
- `429`: Rate limit exceeded

---

[API](https://skmtc.dev/farmdash/apis/farmdash-agent-api.md) · [All operations](https://skmtc.dev/farmdash/apis/farmdash-agent-api/llms.txt) · [OpenAPI document](https://skmtc.dev/farmdash/apis/farmdash-agent-api/revisions/96310281f58c?raw)
