Skip to main content
Glama

# 🛡️ SolAegis DeFAI

Autonomous Multi-Chain AI Agent Risk & Execution Protocol for Solana & DeFi
Targeting the Colosseum Crypto World's Fair 2026 ($840,000 Prize Pool | $15,000 Project Awards)

SolAegis CI License: MIT Protocol Solana


📌 Problem Statement

As autonomous AI agents (AgentKit, autonomous trading loops, DeFAI bots) proliferate across Solana and Web3, they are prone to catastrophic drawdown. Traditional agentic implementations execute naive swap intents without:

  1. Mathematical position sizing (leading to over-allocation and ruin).

  2. Dynamic risk ratchets (failing to lock in profits or trail stop-losses).

  3. Pre-trade stochastic shock modeling (ignoring fat-tailed slippage and liquidity crunches).

  4. Standardized agent interoperability (lacking standardized tools for Claude, Antigravity, and Cursor).

Related MCP server: GearTrade MCP Server

💡 The Solution: SolAegis DeFAI

SolAegis is an autonomous risk management engine and standardized Model Context Protocol (MCP) server that equips any AI agent with institutional quantitative guardrails before and during on-chain execution on Solana and Hyperliquid.

flowchart TD
    User["DeFi User / DAO Treasury"] -->|Configures Risk Policy & Limits| Vault["SolAegis Vault"]
    LLM["AI Agent (Claude / Antigravity / Cursor)"] -->|Queries & Executes| MCP["SolAegis MCP Server (JSON-RPC)"]
    MCP --> Engine["Risk & Simulation Engine"]
    Engine --> MonteCarlo["Monte Carlo VaR & Slippage Simulator"]
    Engine --> Connectors["Multi-Chain Connectors"]
    Connectors -->|Live Feeds & Swaps| Solana["Solana (Jupiter v6 / Raydium)"]
    Connectors -->|Perps & Hedging| Hyperliquid["Hyperliquid Protocol"]
    Dashboard["Live Glassmorphic Web Terminal"] -->|Visualizes Telemetry & Risk| User

🚀 Key Architectural Innovations

1. Institutional Quantitative Math Engine

  • Half-Kelly Capital Allocation: Calculates optimal position size $$f^* = \frac{p(b+1) - 1}{2b}$$ bounded by a strict 25% single-position ruin cap.

  • Parametric Value-at-Risk (VaR 95%) & Conditional VaR (CVaR): Institutional tail-risk modeling calibrated against daily crypto volatility.

  • Dynamic Breakeven Ratchet: Automatically moves stop-loss to entry price + fee buffer as soon as unrealized PnL reaches $+2.0%$, locking in capital preservation.

  • 1:3.0+ Asymmetric Payoff Targeting: Enforces a minimum 1:3 reward-to-risk ratio on all agent executions.

2. Stochastic Monte Carlo Simulator

  • Generates 5,000 Geometric Brownian Motion (GBM) paths with jump diffusion to model black-swan slippage events and oracle lag.

  • Provides 5th percentile (tail-loss), median (50th), and 95th percentile upside outcome curves.

3. Autonomous Circuit Breaker Sentinel

  • Flash Crash Velocity Detection: Halts trading and initiates emergency de-leveraging if asset price falls $>4.5%$ within 15 minutes.

  • Liquidity Spread Guard: Blocks execution if DEX bid-ask spread widens past threshold.

  • Stablecoin Depeg Monitor: Triggers immediate defensive hedge if USDC/USDT deviates $>1.2%$ from $1.00.

4. Model Context Protocol (MCP) Standard Compliance

Exposes 5 standardized tools compatible with Anthropic Claude Desktop, Google Antigravity, Cursor, and custom agent loops:

  • solaegis_analyze_risk: Computes Kelly fraction, VaR, CVaR, and dynamic stops.

  • solaegis_run_monte_carlo: 5,000-path stochastic trajectory analysis.

  • solaegis_inspect_solana_wallet: Live SOL balance and Jupiter v6 routing evaluation.

  • solaegis_check_circuit_breaker: Real-time market health and flash-crash evaluation.

  • solaegis_get_hyperliquid_funding: Hyperliquid funding rate and perpetual market intelligence.


⚡ Quickstart

Prerequisites

  • Node.js >= 20

  • npm >= 10

1. Clone & Install

git clone https://github.com/ashusatyarthi-wq/solaegis-defai.git
cd solaegis-defai
npm install

2. Run Autonomous Diagnostic

npm start

3. Run Test Suite

npm test

4. Launch MCP Server (for Claude / Agent UI)

npm run mcp

To connect to Claude Desktop or Antigravity, add to your claude_desktop_config.json:

{
  "mcpServers": {
    "solaegis": {
      "command": "node",
      "args": ["/path/to/solaegis-defai/dist/mcp/server.js"]
    }
  }
}

🌐 Live Web Terminal

Open web/index.html in any modern browser or visit the live deployment at:
👉 https://ashusatyarthi-wq.github.io/solaegis-defai/


🏆 Colosseum Crypto World's Fair Submission Details

Related MCP Connectors

Related MCP Servers

  • A
    license
    C
    quality
    D
    maintenance
    Provides AI agents with institutional-grade quantitative finance tools including real-time market data, paper trading via Alpaca, risk analysis with Monte Carlo simulations, backtesting, and multi-source news sentiment analysis for portfolio management and trading strategy development.
    31
    5
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables AI assistants to perform cryptocurrency trading analysis and execution with 38+ tools including real-time market data, technical indicators, risk management, and support for both paper trading and live execution on Hyperliquid.
    7
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    An MCP server and Python toolkit that provides AI agents with real-time tools for Polymarket prediction markets, including liquidity scanning, arbitrage detection, and slippage estimation. It also offers advanced wallet intelligence, portfolio risk calculation, and probabilistic reasoning to enhance market analysis and strategy.
    1
    MIT
  • F
    license
    A
    quality
    B
    maintenance
    MCP server providing AI agents with native access to Jupiter's full DeFi stack on Solana. It offers 17 tools covering swaps, tokens, lending, limit orders, DCA, prediction markets, perpetuals, and portfolio management.
    16
    -