Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,32 @@ To become the standard monitoring infrastructure for bridged assets on Stellar,

Continuous tracking of bridged asset supplies across chains with automated verification against official reserve data. This includes monitoring mint and burn events, detecting supply mismatches, and maintaining historical records of bridge performance and uptime.

### On-Chain Bridge Status Aggregation (Soroban)

The Soroban contract maintains **pre-aggregated rollups** for fast reads (no scanning across all assets/bridges at query time). Rollups are normalized into severity tiers:

`StatusTier`: `Ok` | `Low` | `Medium` | `High`

Stored rollup views:

- **Per-asset**: `AssetStatusRollup` (health score + price deviation alerts + paused/active flags)
- **Per-bridge**: `BridgeStatusRollup` (latest supply mismatch severity)
- **Contract-level**: `ContractStatusRollup` (counts by tier across assets and bridges, plus an overall tier)

Read functions (Soroban):

- `get_asset_status_rollup(asset_code)`
- `get_bridge_status_rollup(bridge_id)`
- `get_contract_status_rollup()`

Rollups are updated deterministically when new signals are submitted (for example, `submit_health`, `check_price_deviation`, and `record_supply_mismatch`).

Events:

- `asset_st` — asset tier updated
- `bridge_st` — bridge tier updated
- `ctr_st` — contract-level tier updated

### Liquidity Analytics

Aggregated liquidity depth across StellarX AMM, Phoenix DEX, LumenSwap, SDEX, and Soroswap. The platform provides real-time total value locked per asset pair, best route suggestions for optimal trade execution, and volume-weighted average pricing across all venues.
Expand Down
7 changes: 3 additions & 4 deletions contracts/soroban/src/analytics_aggregator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,7 @@ impl AnalyticsAggregatorContract {
#[cfg(test)]
mod tests {
use super::*;
use soroban_sdk::{
testutils::{Address as _, Ledger as _},
Env,
};
use soroban_sdk::{testutils::Address as _, testutils::Ledger, Env};

#[test]
fn test_analytics_register_metric_and_history() {
Expand All @@ -344,6 +341,8 @@ mod tests {

assert_eq!(history.len(), 3);
assert_eq!(history.get(0).unwrap().value, 1500);
assert_eq!(history.get(1).unwrap().value, 0);
assert_eq!(history.get(2).unwrap().value, 0);
}

#[test]
Expand Down
Loading
Loading