# resupplyfi/resupply architecture

> Architecture diagram of the GitHub repository resupplyfi/resupply, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/resupplyfi/resupply
- Repository: https://github.com/resupplyfi/resupply

## Overview

Resupply is a CDP-based stablecoin protocol intended to help users earn yield on stablecoin lending positions. The tree shows distinct lending, oracle, liquidation, redemption, governance, emissions, staking, and sreUSD components, but no Solidity source excerpts were provided. Accordingly, the map identifies these product areas without asserting runtime calls or data flows between them; such connections need source evidence.

Main entry points: [`src/protocol/ResupplyPair.sol`](https://github.com/resupplyfi/resupply/blob/main/src/protocol/ResupplyPair.sol) (Lending pair), [`src/protocol/Stablecoin.sol`](https://github.com/resupplyfi/resupply/blob/main/src/protocol/Stablecoin.sol) (Stablecoin), [`src/protocol/sreusd/sreUSD.sol`](https://github.com/resupplyfi/resupply/blob/main/src/protocol/sreusd/sreUSD.sol) (sreUSD vault)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_lending["Lending protocol"]
  node_pair["Lending pair<br/>[ResupplyPair.sol]"]
  node_paircore["Pair core"]
  node_registry["Pair registry"]
  node_stablecoin["Stablecoin<br/>[Stablecoin.sol]"]
  node_redemption["Redemption handler"]
end

subgraph group_risk["Risk and pricing"]
  node_oracle["Underlying oracle"]
  node_reusd_oracle["reUSD oracle<br/>[ReusdOracle.sol]"]
  node_rates["Interest rates"]
  node_liquidation["Liquidation handler"]
end

subgraph group_dao["Governance and DAO"]
  node_core["DAO core<br/>[Core.sol]"]
  node_voter["Voter<br/>[Voter.sol]"]
  node_emissions["Emissions controller"]
  node_retention["Retention incentives"]
  node_staker["Governance staking<br/>[GovStaker.sol]"]
  node_treasury["Treasury<br/>[Treasury.sol]"]
end

subgraph group_yield["Yield products"]
  node_sreusd["sreUSD vault<br/>[sreUSD.sol]"]
  node_linear_rewards["Vault rewards"]
  node_fee_deposit["Fee deposit<br/>[FeeDeposit.sol]"]
end

node_user(("Stablecoin user"))

node_user -.->|"lends through"| node_pair
node_pair -.->|"uses stablecoin"| node_stablecoin
node_user -.->|"seeks yield"| node_sreusd

click node_pair "https://github.com/resupplyfi/resupply/blob/main/src/protocol/ResupplyPair.sol"
click node_paircore "https://github.com/resupplyfi/resupply/blob/main/src/protocol/pair/ResupplyPairCore.sol"
click node_registry "https://github.com/resupplyfi/resupply/blob/main/src/protocol/ResupplyRegistry.sol"
click node_stablecoin "https://github.com/resupplyfi/resupply/blob/main/src/protocol/Stablecoin.sol"
click node_redemption "https://github.com/resupplyfi/resupply/blob/main/src/protocol/RedemptionHandler.sol"
click node_oracle "https://github.com/resupplyfi/resupply/blob/main/src/protocol/UnderlyingOracle.sol"
click node_reusd_oracle "https://github.com/resupplyfi/resupply/blob/main/src/protocol/ReusdOracle.sol"
click node_rates "https://github.com/resupplyfi/resupply/blob/main/src/protocol/InterestRateCalculatorV2.sol"
click node_liquidation "https://github.com/resupplyfi/resupply/blob/main/src/protocol/LiquidationHandler.sol"
click node_core "https://github.com/resupplyfi/resupply/blob/main/src/dao/Core.sol"
click node_voter "https://github.com/resupplyfi/resupply/blob/main/src/dao/Voter.sol"
click node_emissions "https://github.com/resupplyfi/resupply/blob/main/src/dao/emissions/EmissionsController.sol"
click node_retention "https://github.com/resupplyfi/resupply/blob/main/src/dao/RetentionIncentives.sol"
click node_staker "https://github.com/resupplyfi/resupply/blob/main/src/dao/staking/GovStaker.sol"
click node_treasury "https://github.com/resupplyfi/resupply/blob/main/src/dao/Treasury.sol"
click node_sreusd "https://github.com/resupplyfi/resupply/blob/main/src/protocol/sreusd/sreUSD.sol"
click node_linear_rewards "https://github.com/resupplyfi/resupply/blob/main/src/protocol/sreusd/LinearRewardsErc4626.sol"
click node_fee_deposit "https://github.com/resupplyfi/resupply/blob/main/src/protocol/FeeDeposit.sol"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_pair,node_paircore,node_registry,node_stablecoin,node_redemption,node_user toneBlue
class node_oracle,node_reusd_oracle,node_rates,node_liquidation toneAmber
class node_core,node_voter,node_emissions,node_retention,node_staker,node_treasury toneMint
class node_sreusd,node_linear_rewards,node_fee_deposit toneRose
```

## Components

### Lending protocol

- [Lending pair](https://github.com/resupplyfi/resupply/blob/main/src/protocol/ResupplyPair.sol): `src/protocol/ResupplyPair.sol`
- [Pair core](https://github.com/resupplyfi/resupply/blob/main/src/protocol/pair/ResupplyPairCore.sol): `src/protocol/pair/ResupplyPairCore.sol`
- [Pair registry](https://github.com/resupplyfi/resupply/blob/main/src/protocol/ResupplyRegistry.sol): `src/protocol/ResupplyRegistry.sol`
- [Stablecoin](https://github.com/resupplyfi/resupply/blob/main/src/protocol/Stablecoin.sol): `src/protocol/Stablecoin.sol`
- [Redemption handler](https://github.com/resupplyfi/resupply/blob/main/src/protocol/RedemptionHandler.sol): `src/protocol/RedemptionHandler.sol`

### Risk and pricing

- [Underlying oracle](https://github.com/resupplyfi/resupply/blob/main/src/protocol/UnderlyingOracle.sol): `src/protocol/UnderlyingOracle.sol`
- [reUSD oracle](https://github.com/resupplyfi/resupply/blob/main/src/protocol/ReusdOracle.sol): `src/protocol/ReusdOracle.sol`
- [Interest rates](https://github.com/resupplyfi/resupply/blob/main/src/protocol/InterestRateCalculatorV2.sol): `src/protocol/InterestRateCalculatorV2.sol`
- [Liquidation handler](https://github.com/resupplyfi/resupply/blob/main/src/protocol/LiquidationHandler.sol): `src/protocol/LiquidationHandler.sol`

### Governance and DAO

- [DAO core](https://github.com/resupplyfi/resupply/blob/main/src/dao/Core.sol): `src/dao/Core.sol`
- [Voter](https://github.com/resupplyfi/resupply/blob/main/src/dao/Voter.sol): `src/dao/Voter.sol`
- [Emissions controller](https://github.com/resupplyfi/resupply/blob/main/src/dao/emissions/EmissionsController.sol): `src/dao/emissions/EmissionsController.sol`
- [Retention incentives](https://github.com/resupplyfi/resupply/blob/main/src/dao/RetentionIncentives.sol): `src/dao/RetentionIncentives.sol`
- [Governance staking](https://github.com/resupplyfi/resupply/blob/main/src/dao/staking/GovStaker.sol): `src/dao/staking/GovStaker.sol`
- [Treasury](https://github.com/resupplyfi/resupply/blob/main/src/dao/Treasury.sol): `src/dao/Treasury.sol`

### Yield products

- [sreUSD vault](https://github.com/resupplyfi/resupply/blob/main/src/protocol/sreusd/sreUSD.sol): `src/protocol/sreusd/sreUSD.sol`
- [Vault rewards](https://github.com/resupplyfi/resupply/blob/main/src/protocol/sreusd/LinearRewardsErc4626.sol): `src/protocol/sreusd/LinearRewardsErc4626.sol`
- [Fee deposit](https://github.com/resupplyfi/resupply/blob/main/src/protocol/FeeDeposit.sol): `src/protocol/FeeDeposit.sol`

### Other components

- **Stablecoin user**

## Connections

- Stablecoin user → Lending pair: lends through
- Lending pair → Stablecoin: uses stablecoin
- Stablecoin user → sreUSD vault: seeks yield
