Execution & Simulation
Chainlink CRE, CCIP, Confidential Compute, and Tenderly simulation infrastructure.
Aquarius builds on three Chainlink infrastructure components:
CRE provides the execution substrate for Aquarius workflows. The CRE Workflow orchestrator (run-cre-workflow.ts) is a shared domain function that:
const result = await runCREWorkflow({
protocol: "aave",
chain: "ethereum",
mode: "production",
});
// result.protocolStatus → "stable" | "watch" | "high-risk"
// result.agentDecision.decision → "OK" | "ESCALATE" | "OBSERVE_ONLY"
// result.latencies → { riskEngine: 12, agentDecision: 8, ... }Shared Domain Function
The CRE workflow is framework-agnostic — no UI imports, no API dependencies. It runs identically from CLI scripts, API handlers, and test suites.
CCIP enables cross-chain risk propagation through the CCIPCoordinator.sol contract:
Current implementation supports observe-only mode. Cross-chain mitigation execution is planned for future releases.
Confidential Compute provides trusted execution for sensitive operations:
Tenderly is Aquarius's simulation backbone. Every mitigation action is validated in simulation before production deployment.
| Capability | Usage |
|---|---|
| Virtual testnet deployment | Fork mainnet state for deterministic testing |
| Simulation before broadcasting | Verify transaction outcomes before submitting |
| Gas estimation | Accurate gas costs for mitigation actions |
| State change validation | Confirm expected state transitions |
| Mitigation dry-runs | Execute the full pipeline without real assets |
| Failure scenario testing | Simulate edge cases and extreme conditions |
Aquarius maintains four Tenderly infrastructure modules:
TenderlyRpcClient — Low-level JSON-RPC wrapper:
class TenderlyRpcClient {
setBalance(address: string, balanceWei: string): Promise<void>;
setErc20Balance(token: string, address: string, value: string): Promise<void>;
setStorageAt(contract: string, slot: string, value: string): Promise<void>;
snapshot(): Promise<string>;
revert(snapshotId: string): Promise<void>;
}ForkController — High-level state manipulation:
class ForkController {
setEthBalance(address: string, amountEth: number): Promise<void>;
simulateBorrow(user: string, asset: string, amount: number): Promise<void>;
simulateSupply(user: string, asset: string, amount: number): Promise<void>;
forceHealthFactor(user: string, targetHF: number): Promise<void>;
snapshot(): Promise<string>;
revert(snapshotId: string): Promise<void>;
}ContractDeployer — Deploys all five Aquarius smart contracts to the testnet.
UserFactory — Creates test users with configurable Aave V3 positions.
Before integrating any new protocol, Aquarius follows a mandatory simulation pipeline:
CI/CD Integration
Tenderly simulation will be integrated into the CI/CD pipeline, making it a mandatory gate for all production deployments.
The Scheduler service provides continuous health monitoring for the Aquarius system itself:
Checks for:
Implements a three-state machine:
CLOSED → OPEN → HALF_OPEN → CLOSED
Phase-based recovery when the circuit breaker opens: