A comprehensive oracle system for aggregating Assets Under Management (AUM) data from multiple sources including Binance and Jupiter/Solana. The system employs a consensus mechanism to ensure data reliability and accuracy.
The AUM Oracle consists of multiple components working together to collect, validate, and provide AUM data:
- Off-chain messengers that collect data from external sources
- CosmWasm contracts that receive and process the data through consensus
- Consensus packages that implement robust data validation mechanisms
- Integration tests to ensure system reliability
aum-oracle/
├── aum_messenger/ # Go daemon for data collection
├── recorder/ # GO daemon for periodic TWAER records creation in the TWAER contract
├── pkg/ # Set of usefule packages that are being used by the daemons
├── packages/
│ ├── consensus/ # Rust consensus mechanism library
│ └── jupiter-aum-common/ # Common utilities for Jupiter AUM data
├── contracts/
│ ├── binance-aum-receiver/ # CosmWasm contract for Binance data
│ └── jupiter-aum-receiver/ # CosmWasm contract for Jupiter data
│ └── twaer/ # CosmWasm contract for time weighted exchange rate calculations
├── integration_tests/ # End-to-end system tests
├── scripts/ # Deployment and utility scripts
├── Makefile # Build and test automation
└── README.md # This file
A Go daemon that serves as the data collection layer of the Oracle system.
Responsibilities:
- Retrieve data from Binance (off-chain)
- Collect Jupiter/Solana data (other-chain)
- Submit data to on-chain Oracle Receiver contracts
How to run:
cd aum_messenger/
cp config.yaml.default config.yaml
# Edit config.yaml with your values
docker compose upA Go daemon for periodic TWAER records creation in the TWAER contract
Responsibilities:
- periodically execute '{"record_er": {}}' method in the TWAER contract.
How to run:
cd recorder/
cp config.yaml.default config.yaml
# Edit config.yaml with your values
docker compose up recorder -f ../docker-compose.ymlA robust Rust library providing consensus mechanisms for CosmWasm smart contracts.
Features:
- Configurable consensus parameters
- Round-based consensus with automatic progression
- Generic data support with specialized numerical consensus
- Comprehensive error handling
Key Components:
Config: Defines consensus parameters (messengers, threshold, data delta, round length)Round: Manages consensus rounds and timingConsensusDatatrait: Generic interface for consensus data typesState: Persistent state managementpublish_data: Main entry point for data submission
Testing:
cargo test -p consensusCommon utilities and types for Jupiter AUM data processing.
Testing:
cargo test -p jupiter-aum-commonA CosmWasm contract for processing Binance AUM data through consensus.
Functionality:
- Data Collection: Receives BinanceData from authorized messengers
- Consensus Mechanism: Aggregates submissions and determines consensus values
- AUM Calculation: Calculates total AUM in BTC using external price oracles
- Configuration Management: Owner can update messengers, thresholds, and parameters
Key Data Types:
- Unrealized Initial Margin Maintenance Ratio (unimmr)
- Binance positions and PnL
- USDⓈ-M Futures account balance
- Spot balances across multiple assets
- Portfolio Margin account equity
Testing:
cargo test -p binance-aum-receiverA CosmWasm contract for consensus-based aggregation of Jupiter AUM data.
Functionality:
- Receives structured AUM snapshots from authorized messengers
- Implements consensus mechanism for data validation
- Computes final AUM in wBTC
- Provides query interface for AUM data
Execute Messages:
UpdateConfig: Update configuration (owner only)PublishData: Submit Jupiter AUM data (messengers)
Query Messages:
Config: Get current configurationGetData: Get latest finalized dataGetAum: Get latest AUM in wBTCGetRoundInfo: Get consensus round information
Testing:
cargo test -p jupiter-aum-receiverEnd-to-end tests for the entire AUM Oracle system.
See more info in the corresponding folder
Utility scripts for deployment and contract interaction:
deploy_contracts.sh: Deploy contracts to blockchainquery_contract.sh: Query contract state and data
Common helpers, structures and methods that are being used by the daemons.