DeFi Borrowing

Risk limits for BTC and ETH
DeFi borrowing.

Liquidation-aware exposure governance for DeFi lending positions on Aave V3 and Spark Protocol. Health factor feeds directly into your risk permissions.

Free during beta

The problem

Why defi borrowing needs risk governance.

Health factor exists in isolation

A health factor of 1.5 means different things in a confirmed TREND vs. a PANIC regime with -44% drawdown risk. DeFi dashboards show health factor without market context.

Borrowing and trading risk are managed separately

You borrow DAI against ETH on Aave, then trade spot with that DAI. Two separate risk surfaces — lending liquidation and trade loss — that compound on the same directional move.

No pre-borrow governance for agents

Autonomous agents managing DeFi positions need hard limits. Without a governance layer, an agent can borrow to maximum LTV during a SQUEEZE regime and get liquidated within hours.

How it works

One API call. Full risk governance.

DEFI-AWARE

Health factor as a policy input

Pass your wallet address and RiskState reads your Aave V3 or Spark Protocol position on-chain. Health factor, LTV, collateral composition, and liquidation price all feed into the defi_cap — one of 4 independent risk caps that determine max_size_fraction.

ON-CHAIN

Per-collateral liquidation thresholds

RiskState reads on-chain ReserveConfigurationMap bitmaps for each collateral (WETH, WBTC, wstETH, rETH). Liquidation threshold and bonus are computed per-asset and weighted by collateral value. No hardcoded assumptions.

UNIFIED

Unified DeFi + market risk

The policy engine computes 4 independent caps: rules (market signals), DeFi (health factor), macro (yields, liquidity), and cycle (MVRV, halving). The lowest cap wins. Your DeFi health directly limits how much new exposure you can take.

MULTI-PROTOCOL

Multi-protocol support

Aave V3 and Spark Protocol supported via on-chain reads through Alchemy RPC. Supports BTC, ETH, wstETH, rETH, LINK, UNI, AAVE, GHO as collateral. DAI, USDC, USDT as debt.

API response

Key fields for defi borrowing.

max_size_fraction

Position limit incorporating DeFi health factor as a binding cap

binding_constraint.source

Shows DEFI when health factor is the limiting risk factor

exposure_policy

Combined market + DeFi risk in one policy object

context_risks

DeFi-specific warnings: LIQUIDATION_RISK, LOW_HEALTH_FACTOR

Request

curl -X POST https://riskstate.netlify.app/v1/risk-state \
  -H "Authorization: Bearer $RISKSTATE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"asset": "BTC"}'

Response

{
  "exposure_policy": {
    "max_size_fraction": 0.42,          // ◀
    "leverage_allowed": true,            // ◀
    "allowed_actions": ["DCA", "LONG_SHORT_CONFIRMED"],
    "blocked_actions": ["ALL_IN", "LEVERAGE_GT_2X"]
  },
  "tactical_state": "LEAN BULL",        // ◀
  "market_regime": "TREND",
  "policy_level": 4,
  "binding_constraint": {
    "source": "MACRO",                   // ◀
    "reason_codes": ["MACRO_NEUTRAL", "COUPLING_NORMAL"]
  },
  "risk_flags": {
    "structural_blockers": [],
    "context_risks": ["HIGH_COUPLING", "TREND_NOT_CONFIRMED"]
  }
}

Add risk governance to your defi borrowing workflow.

One POST request. Deterministic policy. No ML to train, no rules to write.

Frequently asked questions.

Pass your wallet address in the API request. RiskState reads your Aave V3 or Spark Protocol position on-chain via Alchemy RPC — health factor, LTV, collateral amounts, and per-asset liquidation thresholds. The data is read in real-time, never stored. Health factor feeds directly into the defi_cap, which limits your max_size_fraction.

Aave V3 and Spark Protocol on Ethereum mainnet. Collaterals: WETH, WBTC, wstETH, rETH, LINK, UNI, AAVE, GHO. Debt: DAI, USDC, USDT. Per-collateral liquidation thresholds are read from on-chain ReserveConfigurationMap. wstETH/ETH exchange rate is fetched dynamically from the Lido contract.

As health factor decreases, defi_cap tightens — reducing max_size_fraction. At low health factors, the policy level drops to BLOCK and most actions are blocked. RiskState provides early warning before liquidation becomes imminent, not after. The goal is to prevent you from adding exposure when your lending position is already stressed.

RiskState governs pre-trade exposure, not post-trade position management. It prevents you from taking new positions that would increase liquidation risk. If you follow the max_size_fraction limit and respect structural_blockers, you’re less likely to add exposure during dangerous conditions. But RiskState doesn’t manage your existing DeFi position — it governs what you can do next.

Before any new trade or borrow action, call the API with your wallet address. Check binding_constraint.source — if it shows DEFI, your lending health is the limiting factor. Respect max_size_fraction for new positions. This way, your spot/perp trading is automatically constrained by your DeFi health, creating unified risk governance across both lending and trading.

Request early access.

Free during beta. API key delivered instantly.

v1.1 live · deterministic · verifiable outputs

Back to Home