# Term Integration

### Strategy State&#x20;

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**

<table><thead><tr><th width="220">Type</th><th width="282">Name</th><th>Description</th></tr></thead><tbody><tr><td>address</td><td><code>assetVault</code></td><td>ERC-4626-compliant vault for holding idle assets.</td></tr><tr><td>ITermController</td><td><code>currTermController</code></td><td>Reference to the current Term Protocol controller.</td></tr><tr><td>IDiscountRateAdapter</td><td><code>discountRateAdapter</code></td><td>Oracle for discount rate and repo token pricing.</td></tr><tr><td>uint256</td><td><code>timeToMaturityThreshold</code></td><td>Upper limit for portfolio duration.</td></tr><tr><td>uint256</td><td><code>requiredReserveRatio</code></td><td>Minimum reserve ratio to mitigate liquidity risks.</td></tr><tr><td>uint256</td><td><code>repoTokenConcentrationLimit</code></td><td>Upper limit for repo token concentration in the portfolio.</td></tr></tbody></table>

**Purpose and Features**

* **Protocol Compliance**: Ensures all interactions with external smart contracts are validated against  [`termController`](/latest/protocol-class/termcontroller.md) 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.

```solidity
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.

```solidity
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
}
```

```solidity
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
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.term.finance/periphery-contracts/curated-vaults/core-architecture/term-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
