# Technical architecture

The Ledgity Yield protocol is composed of modular smart contracts that manage deposits, yield accrual, token utility, governance, and cross-chain interoperability.\
This section provides a clear overview of **how the contracts are organized and interact**.

> **Note:** Contract addresses will be added after the final V2 mainnet deployments and chain synchronizations.\
> Addresses are already defined in internal deployment manifests and will be published once audits and verification are finalized.

***

| Contract / Module             | Description                                                                 | Notes                                              |
| ----------------------------- | --------------------------------------------------------------------------- | -------------------------------------------------- |
| **GlobalOwner**               | Controls upgrades and role assignments via multisig governance.             | Core security gate.                                |
| **GlobalPause**               | Can temporarily halt deposits/withdrawals in emergencies.                   | User funds remain safe & redeemable.               |
| **GlobalBlacklist**           | Ability to restrict malicious or sanctioned wallets.                        | Used only when necessary (AML / exploit response). |
| **LToken (lyUSDC / lyEURC)**  | Core vault contract. Manages deposits, withdrawals, and PPS-based yield.    | Users hold L-Tokens instead of idle stables.       |
| **WrappedLToken (ERC-4626)**  | DeFi-compatible wrapper for L-Tokens, enabling LP and lending integrations. | Used for DEX & money market composability.         |
| **FeeCollector**              | Gathers performance fees generated from real yield.                         | Feeds BuybackManager.                              |
| **BuybackManager**            | Executes LDY buybacks and redistributes tokens to veLDY stakers.            | Drives value capture flywheel.                     |
| **LDY Token**                 | Governance & utility token of the Ledgity Protocol.                         | Fixed supply, no inflation.                        |
| **LDYStaking (veNFT)**        | Lock-based staking system providing rewards, boosts, and governance power.  | Lock longer → more power & yield share.            |
| **Chainlink CCIP Router**     | Ensures secure cross-chain messaging without relying on custom bridges.     | Forms the backbone of multi-chain L-Tokens.        |
| **LTokenSignaler / Subgraph** | Indexing & data transparency layer.                                         | Powers dashboards, reporting & analytics.          |

### **System Overview**

The protocol is structured into **four layers**:

| Layer                            | Purpose                                                    |
| -------------------------------- | ---------------------------------------------------------- |
| **Admin & Safety Layer**         | Ownership, pause control, compliance & incident response   |
| **Vault & Yield Layer**          | Deposit / withdrawal logic, L-Tokens, PPS-based real yield |
| **Value Capture & Governance**   | LDY token, staking, revenue distribution, voting power     |
| **Cross-Chain & Indexing Layer** | Multi-chain deployments, bridging, analytics & reporting   |

***

### **Contract Structure Diagram**

```
                           ┌──────────────────────┐
                           │    GlobalOwner       │
                           │  (Multisig Control)  │
                           └─────────┬────────────┘
                                     │
         ┌───────────────────────────┴────────────────────────────┐
         │                     Admin Layer                         │
         │                                                         │
         │   GlobalPause         GlobalBlacklist                   │
         │   (Emergency)         (Compliance / Threat Response)    │
         └───────────────────────────┬────────────────────────────┘
                                     │
                                     ▼
         ┌────────────────────────────────────────────────────────┐
         │                   Vault & Yield Layer                   │
         │                                                        │
         │   LToken (lyUSDC / lyEURC) → Deposit / Withdraw        │
         │   Liquidity Buffer & Withdrawal Queue Logic            │
         │   WrappedLToken (ERC-4626) for DeFi integrations       │
         │                                                        │
         └───────────────────────────┬────────────────────────────┘
                                     │
                                     ▼
         ┌────────────────────────────────────────────────────────┐
         │         Value Capture & Governance Layer                │
         │                                                        │
         │   FeeCollector → BuybackManager → LDYStaking (veNFT)   │
         │   LDY Governance Token                                 │
         │   veLDY Voting Power + Boosts                          │
         │                                                        │
         └───────────────────────────┬────────────────────────────┘
                                     │
                                     ▼
         ┌────────────────────────────────────────────────────────┐
         │         Cross-Chain & Indexing Layer                    │
         │                                                        │
         │   Chainlink CCIP Router                                │
         │   LTokenSignaler → Subgraph (Data / Dashboard)         │
         │   Multi-chain deployments (Base / Arbitrum / …)        │
         │                                                        │
         └────────────────────────────────────────────────────────┘
```
