# code-423n4/2024-11-concrete architecture

> Architecture diagram of the GitHub repository code-423n4/2024-11-concrete, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/code-423n4/2024-11-concrete
- Repository: https://github.com/code-423n4/2024-11-concrete

## Overview

##### Core System Components

a) Vault System
- ConcreteMultiStrategyVault (core component)
- VaultFactory
- VaultRegistry
- VaultManager

b) Strategy Layer
- StrategyBase (abstract base)
- Implementation Strategies:
- AaveV3Strategy
- CompoundV3Strategy
- RadiantV2Strategy
- SiloV1Strategy
- ProtectStrategy
- MorphoVaultStrategy

c) Management Layer
- DeploymentManager
- RewardManager
- TokenRegistry
- ImplementationRegistry

d) Supporting Infrastructure
- WithdrawalQueue
- ClaimRouter
- Swapper
- OraclePlug

##### Component Relationships

a) Primary Flow:
**User -> ConcreteMultiStrategyVault -> StrategyBase implementations -> External Protocols**

b) Management Flow:
**DeploymentManager -> VaultFactory -> ConcreteMultiStrategyVault**
**TokenRegistry <-> VaultManager <-> ConcreteMultiStrategyVault**

##### Key Elements to Highlight

a) Security Boundaries:
- Owner (multisig) controlled components
- Strategy isolation
- External protocol interfaces

b) Data Flow:
- Asset deposits/withdrawals
- Strategy allocation
- Reward distribution
- Claims routing

##### Specific Implementation Details

Protocol-specific elements:

- ERC4626 compliance for vault and strategies
- Multi-strategy management capabilities
- Withdrawal queue mechanism
- Reward distribution system
- Oracle price feed integration

##### Notes Section

Important protocol characteristics:
- Supported tokens (ERC20)
- Chain deployment targets (Ethereum, BSC, Arbitrum, Berachain)
- Strategy shareholder restrictions
- Fee handling mechanisms

Remember to highlight the critical paths for:
- Asset flow
- Strategy management
- Risk controls
- Access permissions

This will create a comprehensive yet understandable representation of the Concrete protocol's architecture.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Core["Core Vault System"]
        CV[ConcreteMultiStrategyVault]
        VF[VaultFactory]
        VR[VaultRegistry]
        VM[VaultManager]
    end

    subgraph Strategies["Strategy Layer"]
        SB[StrategyBase]
        AV3[AaveV3Strategy]
        CV3[CompoundV3Strategy]
        RV2[RadiantV2Strategy]
        SV1[SiloV1Strategy]
        PS[ProtectStrategy]
        MV[MorphoVaultStrategy]
    end

    subgraph Management["Management Layer"]
        DM[DeploymentManager]
        RM[RewardManager]
        TR[TokenRegistry]
        IR[ImplementationRegistry]
    end

    subgraph Infrastructure["Supporting Infrastructure"]
        WQ[WithdrawalQueue]
        CR[ClaimRouter]
        SW[Swapper]
        OP[OraclePlug]
    end

    subgraph External["External Protocols"]
        AAVE[Aave]
        COMP[Compound]
        RAD[Radiant]
        SILO[Silo]
        PROT[Protect]
        MORP[Morpho]
    end

    %% Core relationships
    User --> CV
    CV --> SB
    SB --> AV3 & CV3 & RV2 & SV1 & PS & MV
    
    %% Strategy to Protocol connections
    AV3 --> AAVE
    CV3 --> COMP
    RV2 --> RAD
    SV1 --> SILO
    PS --> PROT
    MV --> MORP

    %% Management connections
    DM --> VF
    VF --> CV
    TR <--> VM
    VM <--> CV
    IR --> CV

    %% Infrastructure connections
    CV --> WQ
    CV --> CR
    CV --> SW
    CV --> OP

    %% Styling
    classDef core fill:#a8d1ff,stroke:#333,stroke-width:2px
    classDef strategy fill:#90EE90,stroke:#333,stroke-width:2px
    classDef management fill:#FFE5B4,stroke:#333,stroke-width:2px
    classDef infrastructure fill:#E6E6FA,stroke:#333,stroke-width:2px
    classDef external fill:#FFB6C1,stroke:#333,stroke-width:2px
    classDef user fill:#fff,stroke:#333,stroke-width:2px

    class CV,VF,VR,VM core
    class SB,AV3,CV3,RV2,SV1,PS,MV strategy
    class DM,RM,TR,IR management
    class WQ,CR,SW,OP infrastructure
    class AAVE,COMP,RAD,SILO,PROT,MORP external
    class User user

    %% Click events
    click CV "https://github.com/code-423n4/2024-11-concrete/tree/main/src/vault"
    click AV3 "https://github.com/code-423n4/2024-11-concrete/tree/main/src/strategies/Aave"
    click CV3 "https://github.com/code-423n4/2024-11-concrete/tree/main/src/strategies/compoundV3"
    click RV2 "https://github.com/code-423n4/2024-11-concrete/tree/main/src/strategies/Radiant"
    click SV1 "https://github.com/code-423n4/2024-11-concrete/tree/main/src/strategies/Silo"
    click PS "https://github.com/code-423n4/2024-11-concrete/tree/main/src/strategies/ProtectStrategy"
    click MV "https://github.com/code-423n4/2024-11-concrete/tree/main/src/strategies/Morpho"
    click DM "https://github.com/code-423n4/2024-11-concrete/tree/main/src/managers"
    click TR "https://github.com/code-423n4/2024-11-concrete/tree/main/src/registries"
    click IR "https://github.com/code-423n4/2024-11-concrete/tree/main/src/registries"
    click WQ "https://github.com/code-423n4/2024-11-concrete/tree/main/src/queue"
    click CR "https://github.com/code-423n4/2024-11-concrete/tree/main/src/claimRouter"
    click SW "https://github.com/code-423n4/2024-11-concrete/tree/main/src/swapper"
    click VF "https://github.com/code-423n4/2024-11-concrete/tree/main/src/factories"
```
