# System Architecture

#### Looper Architecture

When users open a Looper position, the system first assigns a new position ID and deploys a dedicated wallet instance to custody assets. Subsequently, the system creates a loan in the CBR contract based on position configuration, with user collateral deposited and borrowed CCR transferred to the SLF contract through authorization to generate corresponding liquidity positions. Meanwhile, the contract transfers both collateralized tokens and borrowed liquidity to the wallet instance, which calls the LoopHelper contract for initialization, implementing the "borrow—invest—borrow again" cyclic leverage logic. After completing all checks and confirming position safety ratios, the system binds the position to the user.

#### YT Architecture

When users open a YT position, the system first assigns a new position ID and deploys a dedicated wallet instance to custody assets. Based on configuration parameters, it calculates the borrowing capacity supported by the collateral, then initiates a loan through the CBR contract, exchanging collateralized tokens for corresponding amounts of CCR. The contract then converts these borrowed CCR into usable liquidity and creates a fixed-rate borrowing position (aka static price-locked position) in SLF, determining future interest payment methods. Finally, the wallet calls a preset strategy helper contract to complete initialization logic, putting the position into operational status. The end result is that users successfully open a YT position linked to yields, managed and executed by an independent wallet instance.

#### SLF Deposit Architecture

When users choose to deposit assets into SLF, they are essentially providing funds to liquidity pools. Users transfer liquidity tokens to the SLF contract, which checks whether the pool's capacity limit has reached its maximum, then generates a price-locked record for users to track their deposit principal and corresponding interest accumulation. Simultaneously, SLF updates the liquidity pool's dynamic interest index based on current interest rate parameters and includes the user's deposit amount in the pool's utilized capacity. Over time, SLF continuously calls interest rate provider contracts to refresh rate indices and distributes newly earned interest to each depositor's record. Ultimately, user deposits both provide the liquidity needed for pool lending and generate continuous interest income for themselves.

#### JR (Junior Token / Principal Token) Architecture

JR is a tokenized representation of the principal value of Looper positions. When a user holds a Looper position, the PrincipalConverterSplit contract can convert it into a tradeable JR (ERC20) token representing the principal portion. The system calculates JR token price based on the underlying collateral and debt values (collateral\_per\_share × collateral\_price + debt\_per\_share × debt\_price). Users call `mintWithLooper` to deposit a Looper position and receive JR tokens, while the underlying position remains custodied in the converter's wallet. Position leverage adjustments are handled through the IJrAdjustHelper interface to maintain target LTV ratios. This allows users to extract liquidity from their principal holdings while the underlying strategy continues running.

#### GYT (General Yield Token) Architecture

GYT is an order type within the ConvertTradeRouterGYT contract for trading already-minted Interest Tokens (GYT). The InterestConverter contract first creates GYT tokens by tokenizing yield from Looper positions or YT shares into tradeable ERC20 tokens. The router then supports three order types: Looper orders (auto-convert position to GYT), YT orders (auto-convert YT shares to GYT), and GYT orders (direct GYT spot trading without conversion). For GYT orders, users sign EIP-712 messages specifying their GYT sell amount and minimum price, and buyers can fill these orders through `takeOrder`. This provides a unified marketplace where yield tokens can be traded regardless of their source strategy.

***

#### Key Features

**Diversified Yield Strategies**: Users can access multiple yield optimization approaches - YT strategies for leveraged yield exposure with fixed costs, or Looper strategies for ongoing leveraged positions, allowing different risk and return profiles to match individual preferences.

**Position Tokenization**: Through JR (Principal Token) and GYT (Interest Token), users can split Looper positions into separately tradeable components — extracting liquidity from principal holdings via JR while continuing to earn yield, or tokenizing future yield into GYT for immediate trading on the GYT marketplace.

**Secure Lending and Liquidity System**: The CBR and SLF modules work together to manage all lending activities with strict safety ratios and risk controls, while simultaneously allowing users to earn continuous returns by providing liquidity that powers the entire ecosystem's borrowing and leverage strategies.

**Asset Independence and Transparency**: Each position generates an independent wallet instance with asset isolation and transparent strategies, allowing users to clearly track fund flows and yield situations.

**Dynamic Risk Management and Optimization**: The system continuously adjusts interest rates, monitors capital utilization across all strategies, and dynamically rebalances allocation between assets and strategies to maximize risk-adjusted returns while maintaining position safety through real-time risk controls.

**Unified Yield Marketplace**: The ConvertTradeRouterGYT provides a single trading venue supporting multiple order types (Looper, YT, GYT), enabling seamless conversion and trading of yield tokens regardless of their source strategy, with EIP-712 signed orders for security.

**Scalable Architecture**: Bondify's modular design enables rapid integration of new strategies, asset types, and interest rate models, maintaining long-term innovation capacity and market adaptability.

***

#### Operational Flow

**Creating Positions**

**1. Deploy Position Wallet (Wallet Instance)**

* Deploy a lightweight wallet contract specifically for this position to custody collateral and borrowed assets

**2. Create Position in CBR**

* Collateralize RWA assets
* Borrow CCR
* Create position and save CBR position ID in position information

**3. Register Interest Lending Position in SLF**

* **For Looper**: Call dynamic interest borrowing interface
* **For YT**: Call fixed interest borrowing interface (static price-locked position)
* System calculates actual borrowable USDC based on CCR quantity
* Create SLF position and save SLF position ID in position information

**4. Transfer Assets to Wallet Instance**

* User's RWA assets transfer to wallet
* Borrowed USDC (converted in SLF) transfers to wallet

**5. Call Helper to Convert USDC Liquidity to RWA Assets**

* LoopHelper (for Looper) or YTHelper (for YT) executes the conversion logic

**6. Risk Control Check**

* Verify position meets safety requirements and leverage ratios

**7. Position Recording**

* Record position in user's portfolio

**Tokenizing Positions (JR / GYT)**

**1. Minting JR Tokens (Principal Tokenization)**

* User selects a Looper position to tokenize
* PrincipalConverterSplit takes custody of the position
* JR (ERC20) tokens are minted to the user representing principal value
* Position leverage is adjusted to match the target LTV via IJrAdjustHelper

**2. Minting GYT Tokens (Yield Tokenization)**

* InterestConverter creates GYT tokens from Looper positions or YT shares
* The tokenized yield is represented as a tradeable ERC20 with an expiry date

**3. Trading via GYT Orders**

* Users create signed EIP-712 orders specifying GYT amount, minimum price, and deadline
* Buyers fill orders through ConvertTradeRouterGYT
* Three order types supported: Looper orders (auto-convert), YT orders (auto-convert), GYT orders (direct GYT spot)
