nexxore

A DeFi execution agent that prices risk before every trade and settles only what you approve

nexxore

Created At

ETHGlobal Mumbai

Project Description

RiskPilot is a risk-aware DeFi execution engine that evaluates the economics and downside exposure of a trade before allowing it to execute.

Most DeFi interfaces show users a quoted yield, price discrepancy or trading opportunity. They rarely show the complete picture: execution costs, slippage, fees, portfolio-level exposure and how the position behaves during a market crash. RiskPilot addresses this by combining quantitative pricing, portfolio stress testing and user-authorized execution in one system.

Unlike autonomous trading agents that delegate financial decisions to a language model, RiskPilot uses a deterministic quantitative engine. Every decision has explicit inputs, numerical constraints, a verdict and a reproducible audit trail. Nothing executes without the user's signature.

How it works: Scan → Quantify → Decide → Execute → Settle → Explain

  1. Scan

RiskPilot reads wallet balances, existing positions, pool state, execution quotes and market volatility to identify available opportunities.

  1. Quantify

The engine calculates risk-adjusted net execution edge after accounting for gas, slippage, venue fees, hedging costs and incremental portfolio downside.

E_net = q(P_exit − P_entry) − gas − slippage − fees − hedge − λ × max(0, ΔworstLoss)

The risk penalty λ is configured according to the user's risk profile. The engine also evaluates portfolio losses across a stress grid covering spot-price movements from −40% to +60% and volatility increases of up to 20 percentage points.

  1. Decide

Each opportunity receives one of four verdicts: APPROVE, REJECT, REQUOTE or REQUIRE_REVIEW. Decisions are based on data freshness, quote movement, liquidity, execution costs, risk-budget constraints and minimum acceptable edge. Each decision stores its inputs, block reference, engine version and numerical reasons for the verdict.

  1. Execute

RiskPilot connects quantitative risk evaluation to two execution primitives:

-1inch Aqua: RiskPilot constructs and prices wallet-backed, one-sided liquidity curves. An ETH-only curve above the current market price creates covered-call-like exposure, while a USDC-only curve below the market price creates cash-secured-put-like exposure. The engine maps these curves to option-equivalent parameters, estimates their value and minimum required compensation, and evaluates them against the maker's existing wallet inventory and risk budget. It also accounts for Aqua's virtual quote balances versus actual available token balances.

-Uniswap v4: We built a dynamic-fee hook that estimates realized volatility using an EWMA of tick returns. Updates are limited to once per block, individual tick movements are bounded, and fees are constrained between 0.05% and 1.00%. The execution engine reads the hook's current fee into its cost model, connecting volatility-sensitive fee economics with trade evaluation.

  1. Settle

RiskPilot integrates an Arc testnet USDC escrow contract. Funding, settlement and refunds are associated with the original decision ID. The current MVP uses an operator-mediated settlement process, which is explicitly disclosed in the interface. CCTP-based settlement is planned as a subsequent integration.

The RiskPilot terminal exposes the decision history, pricing parameters, stress-test results, execution costs and transaction references. Users can inspect and replay previous decisions using their stored inputs and engine version to verify that the same conditions produce the same result.

RiskPilot does not simply identify profitable-looking DeFi opportunities or automate transactions. It evaluates the actual economics of providing liquidity, translates nonlinear inventory exposure into option-equivalent risk, accounts for existing wallet holdings and enforces configurable risk constraints before execution.

The result is a quantitative decision and execution layer connecting 1inch Aqua, Uniswap v4 ,Arc and OG with explicit user authorization and reproducible decisions.

How it's Made

Architecture

RiskPilot has four parts, joined by a single decision_id that follows each trade from quote to settlement:

Quant engine ([Python/TypeScript]): a pure, deterministic function. It takes a snapshot of positions, pool state, gas and volatility, and returns a decision (APPROVE / REJECT / REQUOTE / REQUIRE_REVIEW), the numeric reason, and a hash of its inputs. Because there’s no LLM in the decision path, any decision can be replayed and gives the same result. Each cost term in E_net is calculated separately so the terminal can show which one drove the outcome.

Uniswap v4 hook (Solidity, Foundry): a dynamic-fee hook that sets the fee in beforeSwap. 1inch Aqua strategies: options-like positions built from one-sided liquidity ranges. Arc escrow (Solidity): RiskPilotEscrow, with fund, settle and refund functions keyed by decision_id.

On top sits the risk terminal ([Next.js/React + viem/wagmi]). It shows each decision, the formula with real numbers filled in, the user’s signature prompt, and links to the transactions.

How the partners helped

Uniswap v4: hooks let us put risk pricing inside the venue instead of only in the agent. The hook keeps a moving average of tick log returns (β = 0.94), updated once per block, so several swaps in one block can’t push the fee around. Each tick move is capped at 200 to limit manipulation. It annualizes σ and returns fee = clamp(500 + 5000·σ_ann, 500, 10000) pips, using OVERRIDE_FEE_FLAG. The engine reads the same σ and fee from the hook, so the fee the agent quotes is the fee the swap pays: the decision and the venue use one risk model. 1inch Aqua: lets us build options-style exposure without an options protocol. An ETH-only range above spot acts like a covered call; a USDC-only range below spot acts like a cash-secured put. Both are built with XYCConcentrate ranges, use a width factor of w = 1.10, and add a Fee instruction. Collateral is checked per token before placing anything, and calls go through router v1.0.2. Arc: gas and settlement are both in USDC, so the user sees results in dollars. Keying the escrow by decision_id ties every offchain decision to one onchain fund, settle or refund. In this MVP the operator who settles is trusted, and the UI says so.

Hacky / notable

Solo build with parallel coding agents. At most three agents ran at once, each in its own folder and branch, with the quant engine, hook, Aqua, Arc and terminal each written to a separate spec. Nothing merged until its tests passed. I kept the keys and did every deploy myself; no agent ever held a private key. Go/no-go gates with a backup plan. Aqua was the riskiest integration, so I set two hard checkpoints: one-sided ranges working by 13:00, and one curve filled on a fork by 16:00. If either failed, I had a ready spec to swap in a 0G private risk assistant. [Say which way it went: “Both gates passed” or “Gate 2 failed, so we switched to 0G”.] USDC decimals on Arc. Native USDC pays gas with 18 decimals, but the ERC-20 interface at 0x3600…0000 uses 6. The escrow uses only the ERC-20 interface, and amounts are converted at one boundary in the engine. Testing on forks. [Hook / Aqua] behaviour was tested on a mainnet fork with pushed volatility to show the fee rising from 0.05% to [X]% and the engine switching from APPROVE to REQUOTE. [Replace with your real numbers.]

Stack: Solidity, Foundry, Uniswap v4-core/periphery, 1inch Aqua, Arc testnet, [viem, Next.js, Python/TS], [Anvil fork tests].

background image mobile

Join the mailing list

Get the latest news and updates

nexxore | ETHGlobal