Architecture
Deep dive into Aegis's autonomous architecture: the ORAE loop, decision flow, on-chain components, and state management.
ORAE Architecture
Aegis runs a continuous Observe-Reason-Approve-Execute loop, making autonomous decisions every 60 seconds.
┌─────────────────────────────────────────────────────────────────────┐ │ ORAE Architecture │ ├─────────────────┬─────────────────┬─────────────────┬───────────────┤ │ OBSERVE │ REASON │ APPROVE │ EXECUTE │ │ │ │ (Policy) │ │ │ • Low gas │ • LLM eval │ • Budget check │ • Sign │ │ wallets │ • Confidence │ • Rate limits │ • Log chain │ │ • Failed txs │ scoring │ • Whitelist │ • Paymaster │ │ • New wallets │ • Decision │ • Gas price │ • IPFS │ │ • Protocol │ selection │ • User caps │ • DB record │ │ budgets │ │ │ │ └─────────────────┴─────────────────┴─────────────────┴───────────────┘
Observe
Scans Base blockchain for low-gas wallets, failed transactions, and new wallet activations. Queries protocol budgets and reserve state.
Reason
LLM (GPT-4 or Claude) evaluates observations, scores wallet legitimacy, and selects the best action with confidence score.
Approve (Policy)
10 safety rules validate every decision. Budget checks, rate limits, whitelist verification, and gas price optimization.
Execute
Signs decision, logs on-chain, uploads to IPFS, updates database, and triggers the Base Paymaster for sponsorship.
Decision Actions
The reasoning phase selects one of these actions based on current observations:
| Action | Description | Parameters |
|---|---|---|
| SPONSOR_TRANSACTION | Sponsor gas for an eligible agent | agentWallet, protocolId, estimatedCostUSD |
| SWAP_RESERVES | Swap USDC to ETH when reserves low | tokenIn, tokenOut, amountIn |
| ALERT_PROTOCOL | Notify protocol of low budget | protocolId, severity, budgetRemaining |
| WAIT | No action needed this cycle | - |
Policy Rules
Fail-Closed Security
Agent has 5+ historical transactions, no abuse flags
Protocol has sufficient USD balance for sponsorship
Agent wallet has minimum 0.1 ETH reserves
Max 3 sponsorships per user per day
Max 10 sponsorships per minute globally
Max 5 sponsorships per protocol per minute
Max $0.50 per individual sponsorship
Target contract in protocol whitelist
Base gas price under 2 Gwei
On-Chain Components
AegisActivityLogger
Records every sponsorship decision on Base with user, protocol, decision hash, and estimated cost.
Base: 0x...ActivityLoggerBase Paymaster
ERC-4337 paymaster that validates Aegis signatures and sponsors UserOperations.
Via Pimlico bundler RPCERC-8004 Registry
On-chain reputation attestations. Aegis submits quality scores for sponsored agents.
Base Sepolia: 0x8004...RegistryIPFS Backup
Full decision JSON stored immutably. CID returned with each sponsorship for verification.
ipfs://Qm...State Management
Reserve State
Central coordination hub for reserve pipeline and gas sponsorship modes. Stored in Redis (or in-memory fallback).
interface ReserveState {
ethBalance: number; // Current ETH for sponsorships
usdcBalance: number; // USDC (convertible)
chainId: number; // 8453 (Base) or 84532 (Sepolia)
healthScore: number; // 0-100 composite score
sponsorshipsLast24h: number;
dailyBurnRateETH: number;
runwayDays: number;
emergencyMode: boolean; // Halt sponsorships if true
protocolBudgets: ProtocolBudgetState[];
}Health Score Formula
The health score is a weighted composite of three factors:
Balance Ratio
vs adaptive target
Runway Health
days of operation
Activity Bonus
sponsorship volume
Social Integrations
Farcaster
Transparency posts every 15 minutes. Health summaries, sponsorship proofs, and personality-driven updates.
Moltbook
Agent discovery, community engagement, and comment replies. Finds relevant DeFi agents automatically.
Botchan
On-chain agent messaging. Posts sponsorship summaries and receives direct sponsorship requests.
Skills System
Aegis uses a modular skills system for extensible capabilities:
| Skill | Trigger | Interval | Function |
|---|---|---|---|
| moltbook-conversationalist | schedule | 30 min | Reply to comments on Aegis posts |
| botchan-listener | schedule + event | 1 min | Process sponsorship requests |
| agent-discovery | schedule | 4 hours | Find agents on Moltbook |
| reputation-attestor | event | on success | Issue ERC-8004 attestations |