> For the complete documentation index, see [llms.txt](https://ripe-finance.gitbook.io/ripe-developers/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ripe-finance.gitbook.io/ripe-developers/readme.md).

# Technical Documentation

> **Looking for user documentation?** Visit the [User Documentation](https://docs.ripe.finance/) to learn about how the protocol works, mechanism design, tokenomics, and conceptual guides (non-technical).

For deployed contract addresses on Base Mainnet, see [Deployments](/ripe-developers/deployments.md). To see our full source code, check out our [GitHub](https://github.com/Ripe-Foundation/ripe-protocol).

## Overview

Ripe Protocol is an onchain credit layer that turns **any tokenized asset—crypto‑native&#x20;*****or*****&#x20;real‑world**—into both a yield source *and* instant liquidity.

Users deposit assets that keep earning through external strategies **plus** Ripe's Endaoment, then draw a **single GREEN loan** against their diversified portfolio—no order books, no counterparties, predictable rates. Governance, driven by RIPE tokens and dynamic committee voting, steers risk, monetary policy and treasury allocations, giving the community full ownership of the protocol's economics.

### Key Features

| Feature                                        | Why it matters                                                                                                                                                |
| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Earn Yield on Anything**                     | The Endaoment reinvests all protocol revenues and Bonding proceeds, distributing sustainable yield (and RIPE incentives) even to idle NFTs or tokenized RWAs. |
| **One‑Loan‑for‑All Collateral**                | Aggregate every deposit—stablecoins, LP tokens, NFTs, houses—to back a *single* GREEN debt position, slashing liquidation risk and UX friction.               |
| **GREEN Stablecoin & Multi‑Layer Peg Defense** | Dynamic interest, Stability Pool absorption, Endaoment redemptions and protocol‑owned liquidity keep GREEN fully‑backed and on‑peg.                           |
| **Compliance‑Ready RWA Support**               | Whitelists and transfer‑restricted liquidation paths let regulated or permissioned assets participate safely.                                                 |
| **Counterparty‑Free, Predictable Borrowing**   | Smart contracts mint GREEN directly—no lenders, no funding gaps, transparent terms.                                                                           |
| **Resilient Liquidations**                     | Cascade of Stability Pool swaps + fungible/NFT auctions minimizes bad debt while rewarding backstops.                                                         |
| **Dynamic, Onchain Governance**                | Continuous "Dynamic Voting," elected committees and **Juice Score** incentives align risk, rewards and protocol evolution with token‑holder skin‑in‑the‑game. |

### Protocol Components

The protocol consists of several interconnected systems:

* **Core**: Lending engine, user interface, liquidations, and stability pool
* **Treasury**: Treasury management, bonding, rewards distribution, and contributor compensation
* **Governance**: Access control, configuration management, and time-locked operations
* **Tokens**: GREEN (stablecoin), RIPE (governance), and sGREEN (yield-bearing GREEN)
* **Vaults**: Asset management strategies from simple storage to yield optimization
* **Pricing**: Multi-oracle integration for accurate and resilient asset valuations
* **Core Modules**: Central coordination points, address resolution, and shared functionality

## Core

Essential contracts for lending operations, liquidations, and user interactions.

| Contract                                                   | Description                                                                                              |
| ---------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| [CreditEngine.vy](/ripe-developers/core/creditengine.md)   | Lending powerhouse managing collateralized borrowing, interest accrual, and debt repayment               |
| [Teller.vy](/ripe-developers/core/teller.md)               | Primary user interface for deposits, withdrawals, borrowing, and account management                      |
| [TellerUtils.vy](/ripe-developers/core/tellerutils.md)     | Utility library for complex Teller operations including batch processing and delegation                  |
| [Ledger.vy](/ripe-developers/core/ledger.md)               | Comprehensive data storage for user positions, debt, and protocol metrics                                |
| [AuctionHouse.vy](/ripe-developers/core/auctionhouse.md)   | Liquidation engine executing multi-phase strategies to recover value from under-collateralized positions |
| [StabilityPool.vy](/ripe-developers/core/stabilitypool.md) | Insurance fund where stablecoin deposits earn discounted liquidated collateral                           |
| [CreditRedeem.vy](/ripe-developers/core/creditredeem.md)   | Collateral redemption mechanism allowing GREEN holders to redeem against unhealthy positions             |
| [Deleverage.vy](/ripe-developers/core/deleverage.md)       | Automated deleveraging system for reducing user debt through collateral liquidation                      |

## Treasury

Treasury management, bonding mechanisms, and reward distribution systems.

| Contract                                                         | Description                                                                                          |
| ---------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| [Endaoment.vy](/ripe-developers/treasury/endaoment.md)           | Treasury and liquidity hub deploying funds across DeFi strategies while maintaining GREEN stability  |
| [EndaomentFunds.vy](/ripe-developers/treasury/endaomentfunds.md) | Fund management module handling yield distribution and treasury accounting for Endaoment             |
| [EndaomentPSM.vy](/ripe-developers/treasury/endaomentpsm.md)     | Peg Stability Module enabling 1:1 stablecoin swaps to maintain GREEN peg                             |
| [BondRoom.vy](/ripe-developers/treasury/bondroom.md)             | Decentralized bond marketplace for GREEN/RIPE exchanges with dynamic pricing based on treasury needs |
| [Lootbox.vy](/ripe-developers/treasury/lootbox.md)               | Rewards distribution engine calculating time-weighted points for RIPE token allocation               |
| [HumanResources.vy](/ripe-developers/treasury/humanresources.md) | On-chain payroll system managing contributor vesting schedules and token compensation                |
| [Contributor.vy](/ripe-developers/treasury/contributor.md)       | Individual vesting contracts for contributor token compensation                                      |
| [BondBooster.vy](/ripe-developers/treasury/bondbooster.md)       | Dynamic discount mechanism for GREEN-to-RIPE bond conversions                                        |

## Governance

Access control, configuration management, and protocol governance systems.

| Contract                                                           | Description                                                              |
| ------------------------------------------------------------------ | ------------------------------------------------------------------------ |
| [RipeHq.vy](/ripe-developers/governance/ripehq.md)                 | Master registry and governance hub controlling token minting permissions |
| [Switchboard.vy](/ripe-developers/governance/switchboard.md)       | Authorization gateway for all protocol configuration changes             |
| [MissionControl.vy](/ripe-developers/governance/missioncontrol.md) | Central configuration hub storing all operational parameters             |
| [LocalGov.vy](/ripe-developers/governance/localgov.md)             | Two-tier governance system for contract-specific operations              |
| [TimeLock.vy](/ripe-developers/governance/timelock.md)             | Time-delay mechanism for critical configuration changes                  |

### Configuration Contracts

| Contract                                                                                 | Description                                                           |
| ---------------------------------------------------------------------------------------- | --------------------------------------------------------------------- |
| [SwitchboardAlpha.vy](/ripe-developers/governance/configuration/switchboardalpha.md)     | Asset and vault configuration including collateral parameters         |
| [SwitchboardBravo.vy](/ripe-developers/governance/configuration/switchboardbravo.md)     | Reward distribution and points system configuration                   |
| [SwitchboardCharlie.vy](/ripe-developers/governance/configuration/switchboardcharlie.md) | Protocol operations including deposits, withdrawals, and liquidations |
| [SwitchboardDelta.vy](/ripe-developers/governance/configuration/switchboarddelta.md)     | HR, contributor management, and auxiliary feature configuration       |
| [SwitchboardEcho.vy](/ripe-developers/governance/configuration/switchboardecho.md)       | Endaoment and PSM operations with time-locked treasury management     |
| [TrainingWheels.vy](/ripe-developers/governance/trainingwheels.md)                       | User allowlist for restricted protocol access during early deployment |

## Tokens

Protocol tokens for value transfer and governance.

| Contract                                                   | Description                                                       |
| ---------------------------------------------------------- | ----------------------------------------------------------------- |
| [GreenToken.vy](/ripe-developers/tokens/greentoken.md)     | USD-pegged stablecoin minted through overcollateralized positions |
| [RipeToken.vy](/ripe-developers/tokens/ripetoken.md)       | Governance token for voting on protocol parameters and treasury   |
| [SavingsGreen.vy](/ripe-developers/tokens/savingsgreen.md) | Yield-bearing GREEN vault implementing ERC4626 standard           |

### Token Modules

| Module                                                                   | Description                                                               |
| ------------------------------------------------------------------------ | ------------------------------------------------------------------------- |
| [Erc20Token.vy](/ripe-developers/tokens/token-modules/erc20token.md)     | Enhanced ERC20 with blacklisting, pausability, and governance integration |
| [Erc4626Token.vy](/ripe-developers/tokens/token-modules/erc4626token.md) | Tokenized vault standard for yield-bearing tokens                         |

## Vaults

Modular vault implementations for different asset management strategies.

| Contract                                                 | Description                                                                            |
| -------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| [SimpleErc20.vy](/ripe-developers/vaults/simpleerc20.md) | Basic vault with direct 1:1 balance tracking for standard ERC20 collateral             |
| [RebaseErc20.vy](/ripe-developers/vaults/rebaseerc20.md) | Yield-optimized vault for rebase tokens like stETH with automatic compounding          |
| [RipeGov.vy](/ripe-developers/vaults/ripegov.md)         | Governance vault where users lock RIPE tokens for voting power with time-based bonuses |

### Vault Modules

Reusable components that power vault functionality.

| Module                                                                 | Description                                                                 |
| ---------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| [BasicVault.vy](/ripe-developers/vaults/vault-modules/basicvault.md)   | Foundational vault operations for deposits, withdrawals, and transfers      |
| [SharesVault.vy](/ripe-developers/vaults/vault-modules/sharesvault.md) | Share-based accounting for yield distribution and proportional ownership    |
| [StabVault.vy](/ripe-developers/vaults/vault-modules/stabvault.md)     | Stability pool mechanics for liquidation absorption and reward distribution |
| [VaultData.vy](/ripe-developers/vaults/vault-modules/vaultdata.md)     | Universal database layer for balance tracking and state management          |

## Pricing

Oracle integrations and price aggregation for reliable asset valuations.

| Contract                                                                  | Description                                                             |
| ------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| [PriceDesk.vy](/ripe-developers/pricing/pricedesk.md)                     | Oracle aggregator routing price requests through prioritized sources    |
| [ChainlinkPrices.vy](/ripe-developers/pricing/chainlinkprices.md)         | Integration with Chainlink's decentralized oracle network               |
| [PythPrices.vy](/ripe-developers/pricing/pythprices.md)                   | High-frequency pricing with Pyth Network's pull-based oracles           |
| [RedStone.vy](/ripe-developers/pricing/redstone.md)                       | RedStone oracle integration with Chainlink-compatible interface         |
| [StorkPrices.vy](/ripe-developers/pricing/storkprices.md)                 | Stork Network integration with nanosecond-precision timestamps          |
| [CurvePrices.vy](/ripe-developers/pricing/curveprices.md)                 | Curve LP token pricing and GREEN stabilizer monitoring                  |
| [BlueChipYieldPrices.vy](/ripe-developers/pricing/bluechipyieldprices.md) | Specialized pricing for yield-bearing vault tokens with snapshot system |
| [AeroRipePrices.vy](/ripe-developers/pricing/aeroripeprices.md)           | RIPE token pricing from Aerodrome pools with TWAP protection            |
| [wsuperOETHbPrices.vy](/ripe-developers/pricing/wsuperoethbprices.md)     | Wrapped superOETHb pricing using ERC4626 share conversion               |
| [UndyVaultPrices.vy](/ripe-developers/pricing/undyvaultprices.md)         | Underscore Protocol vault token pricing with snapshot-based TWAP        |

### Pricing Modules

| Module                                                                            | Description                                                   |
| --------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| [PriceSourceData.vy](/ripe-developers/pricing/pricing-modules/pricesourcedata.md) | Base module defining standard interface for all price sources |

## Core Modules

Central coordination points and reusable components providing common functionality across the protocol.

| Module                                                                 | Description                                                                         |
| ---------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| [VaultBook.vy](/ripe-developers/core-modules/vaultbook.md)             | Central registry of approved vaults with safety checks and RIPE reward distribution |
| [AddressRegistry.vy](/ripe-developers/core-modules/addressregistry.md) | Flexible registry for managing protocol addresses with time-locks                   |
| [Addys.vy](/ripe-developers/core-modules/addys.md)                     | Centralized address resolution providing validated protocol addresses               |
| [DeptBasics.vy](/ripe-developers/core-modules/deptbasics.md)           | Base functionality for protocol departments including pause controls                |

***

## Getting Started

1. **New Users**: Start with [Teller.vy](/ripe-developers/core/teller.md) to understand user interactions
2. **Developers**: Review [RipeHq.vy](/ripe-developers/governance/ripehq.md) for protocol architecture
3. **Governance**: Explore [RipeToken.vy](/ripe-developers/tokens/ripetoken.md) and [RipeGov.vy](/ripe-developers/vaults/ripegov.md)
4. **Integrators**: Check [PriceDesk.vy](/ripe-developers/pricing/pricedesk.md) and vault interfaces

## Architecture Principles

* **Modular Design**: Reusable modules reduce code duplication and audit surface
* **Registry Pattern**: Central registries coordinate decentralized components
* **Time-Locked Changes**: Critical updates require delays to prevent rushed decisions
* **Multi-Oracle Support**: No single point of failure for price feeds
* **Layered Security**: Multiple validation layers from modules to registries to core contracts
