Skip to content

dvansari65/Aegis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Aegis

Real-time stablecoin risk control and circuit breaker infrastructure on Solana.

Rust Solana License MIT


Overview

Aegis detects panic-driven instability in stablecoin markets before liquidity stress spreads across DeFi. During withdrawals, oracle dislocations, and bridge outflows, markets can move faster than human operators can react.

Aegis is built as three cooperating roles:

Role What it does
Risk oracle Ingests live market and on-chain signals, scores stress, and publishes machine-readable risk state.
Stress engine Combines signals into liquidity health, depeg probability, and a normalized stress score.
Circuit breaker Maps severe risk state into defensive controls (fees, throttles, routing) for integrated protocols.

Repository layout

Path Description
layers/risk-oracle/crates/core Deterministic risk math (stress, liquidity health, depeg probability).
layers/risk-oracle/crates/ingestion Data collection and normalization.
layers/risk-oracle/apps/oracle-publisher Off-chain publisher that updates on-chain risk state.
layers/risk-oracle/apps/api HTTP API for off-chain consumers (see that crate’s README for routes).
layers/risk-oracle/programs/risk-oracle Solana program storing canonical risk state (pinocchio).
layers/circuit-breaker/programs/circuit-breaker Solana program for circuit breaker control state.
layers/circuit-breaker/apps/keeper Off-chain automation for policy execution.
docs/ Next.js marketing and documentation site.

Architecture (high level)

Market / oracle / DEX / bridge data
  → Risk oracle (off-chain + ingestion + core)
  → On-chain risk oracle program
  → Circuit breaker program + keeper
  → Integrated protocol actions

Getting started

Prerequisites

Build on-chain programs

Programs use pinocchio and the Solana SBF toolchain:

cargo build-sbf

Run tests

cargo test --workspace

Run the oracle publisher (Layer 1 pipeline)

cargo run -p risk-oracle-publisher

Documentation site (optional)

cd docs
npm install
npm run dev

License

MIT

About

An open Solana-native risk engine that detects stablecoin liquidity stress early, publishes a real-time stress score, and exposes on-chain emergency signals that DeFi protocols can integrate into their own circuit breakers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors