YT Vault Module

Overview

YT module is responsible for managing the overall logic and lifecycle of "YT (Yield Tranche) products." It uses users' deposited assets as collateral, borrows corresponding amounts of CBRToken through the CBR contract, and converts these borrowed assets into liquidity positions with fixed-rate yields in SLF (automatically recovered at maturity). Each YT product instance is collaboratively managed by an independent wallet instance (WalletInstance) and strategy helper (YTHelper), used for executing strategy logic and fund operations. YTCore undertakes core process control and data management functions, responsible for creating, recording, settling, and liquidating YT positions, while maintaining system permissions and global statistical information.

How YT Positions Work

When users participate in YT positions, the system allocates or extends a shared wallet for that product instance to centrally custody all assets within the position. When users create or join a YT (Yield Tranche) position, the system assigns a unique ID to that instance and deploys a dedicated wallet instance (WalletInstance) for custodying assets and executing strategies. When users join a YT position, user assets are allocated according to the YT's ID. The system follows these steps:

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

  • After users deposit collateral tokens, the contract calculates the borrowable amount based on configuration parameters and price oracles. The system calculates the borrowable amount of CCR (Cleared Collateral Receipt) based on user deposits, and creates or appends a loan through the CBR contract, generating or updating positionId.

3. Register Fixed Interest Lending Position in SLF

  • Convert borrowed CCR to target liquidity tokens according to configuration

  • Call static interest borrowing interface

  • System calculates actual borrowable USDC based on CBRToken quantity

  • Create or extend SLF position (liquidityId) with fixed maturity, determining fixed yield and interest model

  • Save SLF position ID in YT 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 YTHelper to Execute Strategy

  • The wallet calls the YTHelper contract to complete strategy initialization. The wallet instance injects both the user's collateral assets and borrowed liquidity into ytHelper, which executes specific strategy logic (such as market making, staking, reinvestment, etc. to the target protocol) and returns actual output, enabling the position's funds to enter automated operation stage.

6. Risk Control Check & Position Recording

  • Based on this, the system mints or allocates corresponding YT shares to users, records them in userPositions, and accumulates them to the global totalYTs. The entire process results in users successfully joining a yield-linked YT position, with assets uniformly custodied and strategy executed by an independent wallet instance.


Functions and Responsibilities

1. Position Configuration Management

Allow protocol administrators to define and update position configurations:

  • Deposit Token

  • Borrow Token

  • Position logic executor (YTHelper)

  • Price oracle (Oracle)

  • Maximum borrow rate (maxBorrowRate)

  • Liquidation threshold (liquidationRate)

Bind configurations with corresponding deposit tokens for easy user strategy discovery.

2. Position Lifecycle Management

Create Position (createPosition):

  • Initialize wallet instance (WalletInstance)

  • Create loan in CBR, collateralize deposits and borrow CBRToken

  • Convert CBRToken to liquidity, borrow target tokens in SLF

  • Inject deposits and borrowed tokens into WalletInstance, execute initial investment logic through YTHelper

  • Check position borrow rate reasonableness

Refresh Position Status (pokePosition):

  • Call WalletInstance and SLF to update yield and debt data

Position Liquidation (liquidate):

  • If position collateral value is insufficient or LTV exceeds liquidation threshold, the system marks the position as liquidatable.

  • Authorized liquidators can execute liquidation operations, repay debt on behalf and take over position assets.

  • Liquidation transfers YTInstance ownership to liquidator.

Position Maturity (matureYT):

  • preMatureYT: Before maturity or under admin/liquidator conditions, call YTHelper's prepareClose for closure preparation (e.g., converting LP positions back to base tokens). Must be triggered by owner or admin/liquidator (meeting preMatureAt conditions or being owner and liquidator)

  • matureYT: At maturity, or in the forced maturity process triggered by keeper / liquidator, the system will sequentially:

    1. Recover and settle underlying assets through ytHelper;

    2. Call SLF's close process to close the static position;

    3. Repay corresponding loan through CBR;

    4. Release collateral assets and distribute final yields to position holders. Update totalYts (deduct settled debt amount), trigger PositionMatured event.

  • matureWithLiquidation: External parties (e.g., liquidators) first pay debt with borrowing tokens then close (closeStaticEarly), subsequently call helper's close, repay to CBR and update statistics. Suitable for "third-party debt payment and closure triggering" scenarios

3. Risk Control & Access Control

Position Rate Check:

  • Use oracle prices to calculate position debt value / collateral value

  • Exceeds maxBorrowRate → Block creation or operations

  • Exceeds liquidationRate → Allow liquidator takeover

Liquidator Management:

  • Protocol administrators can add/remove liquidators

  • Only liquidators can execute position liquidations


Interactions and Dependencies

CBR Module

  • Used for collateral and lending logic (createLoan, repay)

  • Manage collateral and borrowing token ledgers

SLF Module

  • Responsible for fixed-rate liquidity positions and static borrowing

  • Provide position debt data for maturity calculations

WalletInstance

  • Dedicated wallet contract for each YT instance, used for custodying position assets and executing strategy operations. Responsible for interacting with strategy helper (YTHelper), completing asset injection, investment, position closing, and yield recovery actions, achieving position fund isolation.

YTHelper

  • Dedicated wallet contract for each YT instance, used for custodying position assets and executing strategy operations.

  • Responsible for interacting with strategy helper (YTHelper), completing asset injection, investment, position closing, and yield recovery actions, achieving position fund isolation.

Oracle Interface

  • Provide collateral and borrowing token prices

  • Used to calculate position borrow rates and liquidation thresholds

Last updated

Was this helpful?