Term Integration

This section explores the foundational components and data structures enabling Term Strategy Vault integration with the Term Finance Protocol.

Strategy State

The StrategyState struct encapsulates critical parameters and integration points required for integration within the Term Protocol. These parameters ensure secure and efficient operation of the strategy by validating smart contract interactions to protect against fraudulent transactions, enforcing robust risk management controls, and integrating an ERC-4626-compliant vault for holding idle assets.

StrategyState Structure

Type
Name
Description

address

assetVault

ERC-4626-compliant vault for holding idle assets.

ITermController

currTermController

Reference to the current Term Protocol controller.

IDiscountRateAdapter

discountRateAdapter

Oracle for discount rate and repo token pricing.

uint256

timeToMaturityThreshold

Upper limit for portfolio duration.

uint256

requiredReserveRatio

Minimum reserve ratio to mitigate liquidity risks.

uint256

repoTokenConcentrationLimit

Upper limit for repo token concentration in the portfolio.

Purpose and Features

  • Protocol Compliance: Ensures all interactions with external smart contracts are validated against termController to protect against fraudulent transactions.

  • Risk Management: Implements controls for duration, liquidity, and position concentration.

  • AssetVault Integration: Provides a compliant vault for parking idle assets.

RepoTokenList Architecture

The RepoTokenListData struct provides a framework for managing a sorted linked list of repo token positions within Term Strategy Vaults. This master repo token list identifies the repo tokens the vault recognizes as part of its portfolio. It is a critical component used downstream for portfolio valuation and calculating risk parameters such as concentration ratios, weighted average maturity, reserve ratios, and more.

struct RepoTokenListData {
    address head;                               // Head of the linked list
    mapping(address => RepoTokenListNode) nodes; // Nodes of the linked list
    mapping(address => uint256) discountRates;   // Discount rates for repo tokens
    mapping(address => uint256) collateralTokenParams; // Collateral-specific parameters
}
  • Note:.

    • collateralTokenParams is a mapping of collateral token addresses to minimum collateral ratios and is used to enforce collateral quality of loans held by the vault. This ideally belongs in the StrategyState struct, but remains here due to historical design decisions.

TermAuctionList

The TermAuctionListData struct, despite its name, functions more as a "TermOfferList." It serves as a master list tracking all pending auction offers to lend into auctions that have yet to be processed. This information is essential for portfolio valuation and calculating key risk parameters, such as exposure limits and liquidity requirements. Additionally, it facilitates participation in Term auctions by enabling the tracking and management of open offers throughout the auction lifecycle.

struct TermAuctionListData {
    bytes32 head;                             // Head of the linked list
    mapping(bytes32 => TermAuctionListNode) nodes; // Nodes representing auction offers
    mapping(bytes32 => PendingOffer) offers; // Mapping to track active offers
}
struct PendingOffer {
    address repoToken;              // Token being offered on
    uint256 offerAmount;           // Amount of purchase tokens in the offer
    ITermAuction termAuction;      // Reference to the auction contract
    ITermAuctionOfferLocker offerLocker;  // Contract tracking the offer state
}

Last updated