# open-defi-notification-protocol/projects architecture

> Architecture diagram of the GitHub repository open-defi-notification-protocol/projects, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-02-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/open-defi-notification-protocol/projects
- Repository: https://github.com/open-defi-notification-protocol/projects

## Overview

##### Main Components

a) Input Layer:
- Blockchain Networks (Ethereum, BSC, Polygon, Arbitrum, etc.)
- Web3 Providers (Infura/Alchemy)
- Smart Contract Interfaces (represented by the various ABI files)

b) Core Processing Layer:
- Alert Nodes (running on Orbs Network)
- Project Monitors (individual project implementations)
- Block Processing Engine

c) Notification Layer:
- Mobile App Interface
- Alert Distribution System
- Phone Call System

##### Specific Components Detail

**[Blockchain Networks]**
- ↓
**[Web3 Providers] → [Alert Nodes (Orbs Network)]**
- ↓                     ↓
**[Project Monitors] → [Processing Engine]**
- ↓                     ↓
**[Smart Contracts] → [Notification System]**
- ↓
- [End User Devices]

##### Important Details to Highlight

a) Project Integration Pattern:
- How each project folder (aave, compound, etc.) connects to the core system
- Standardized interface pattern (onInit, onBlocks)

b) Multi-Chain Support:
- Demonstrate parallel processing for different networks
- Network-specific components (wallet-balance-* files)

c) Alert Node Distribution:
- Decentralized nature of alert nodes
- Redundancy and fault tolerance

##### Technical Implementation Details

- JavaScript class implementation pattern
- ABI integration flow
- Web3 interaction pattern
- Block processing pipeline

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Blockchain Layer"
        ETH["Ethereum"]:::blockchain
        BSC["BSC"]:::blockchain
        POLY["Polygon"]:::blockchain
        ARB["Arbitrum"]:::blockchain
        FTM["Fantom"]:::blockchain
    end

    subgraph "Web3 Provider Layer"
        W3P["Web3 Providers<br/>(Infura/Alchemy)"]:::provider
    end

    subgraph "Smart Contract Interface Layer"
        ABI["Smart Contract Interfaces"]:::interface
    end

    subgraph "Monitoring Layer"
        subgraph "Network Monitors"
            WBE["Ethereum Balance"]:::monitor
            WBP["Polygon Balance"]:::monitor
            WBA["Arbitrum Balance"]:::monitor
            WBB["BSC Balance"]:::monitor
            WBF["Fantom Balance"]:::monitor
        end

        subgraph "Project Monitors"
            AAVE["Aave Monitor"]:::project
            COMP["Compound Monitor"]:::project
            UNI["Uniswap Monitor"]:::project
            VEN["Venus Monitor"]:::project
        end

        subgraph "Specialized Monitors"
            GAS["Gas Price"]:::monitor
            FLOOR["NFT Floor Price"]:::monitor
            HEALTH["Position Health"]:::monitor
            REWARD["Reward Monitor"]:::monitor
        end
    end

    subgraph "Processing Layer"
        AN["Alert Nodes<br/>(Orbs Network)"]:::processing
        BPE["Block Processing<br/>Engine"]:::processing
    end

    subgraph "Notification Layer"
        NS["Notification System"]:::notification
        END["End User Devices"]:::endpoint
    end

    %% Connections
    ETH & BSC & POLY & ARB & FTM --> W3P
    W3P --> AN
    ABI --> AN
    WBE & WBP & WBA & WBB & WBF --> AN
    AAVE & COMP & UNI & VEN --> AN
    GAS & FLOOR & HEALTH & REWARD --> AN
    AN --> BPE
    BPE --> NS
    NS --> END

    %% Click Events
    click ABI "https://github.com/open-defi-notification-protocol/projects/blob/master/interfaces.ts"
    click WBE "https://github.com/open-defi-notification-protocol/projects/blob/master/common/wallet-balance-ethereum.js"
    click WBP "https://github.com/open-defi-notification-protocol/projects/blob/master/common/wallet-balance-polygon.js"
    click WBA "https://github.com/open-defi-notification-protocol/projects/blob/master/common/wallet-balance-arbitrum.js"
    click WBB "https://github.com/open-defi-notification-protocol/projects/blob/master/common/wallet-balance-bsc.js"
    click WBF "https://github.com/open-defi-notification-protocol/projects/blob/master/common/wallet-balance-fantom.js"
    click BPE "https://github.com/open-defi-notification-protocol/projects/blob/master/ethereum/block-height.js"
    click AAVE "https://github.com/open-defi-notification-protocol/projects/blob/master/aave/position-health.js"
    click COMP "https://github.com/open-defi-notification-protocol/projects/blob/master/compound/low-liquidity.js"
    click UNI "https://github.com/open-defi-notification-protocol/projects/blob/master/uniswap/position-worth.js"
    click VEN "https://github.com/open-defi-notification-protocol/projects/blob/master/venus/low-liquidity.js"
    click GAS "https://github.com/open-defi-notification-protocol/projects/blob/master/ethereum/gas-price.js"
    click FLOOR "https://github.com/open-defi-notification-protocol/projects/blob/master/opensea/floor-price.js"
    click HEALTH "https://github.com/open-defi-notification-protocol/projects/blob/master/aave/position-health.js"
    click REWARD "https://github.com/open-defi-notification-protocol/projects/blob/master/balancer/pending-reward.js"

    %% Styles
    classDef blockchain fill:#2196F3,stroke:#1565C0,color:white
    classDef provider fill:#42A5F5,stroke:#1E88E5,color:white
    classDef interface fill:#90CAF9,stroke:#64B5F6,color:black
    classDef monitor fill:#4CAF50,stroke:#388E3C,color:white
    classDef project fill:#FF9800,stroke:#F57C00,color:white
    classDef processing fill:#81C784,stroke:#66BB6A,color:black
    classDef notification fill:#9C27B0,stroke:#7B1FA2,color:white
    classDef endpoint fill:#757575,stroke:#616161,color:white
```
