# LST 预言机机制

### 整体架构

<figure><img src="/files/UKuGIYz67snAGLEg9Vp4" alt=""><figcaption></figcaption></figure>

### SolvBTC LST与预言机相关函数

{% embed url="<https://github.com/solv-finance/SolvBTC/blob/main/contracts/SolvBTCYieldToken.sol>" %}

#### 基于份额的资产值

```
/**
 * @notice Get amount of underlying asset for a given amount of shares.
 */
    function getValueByShares(uint256 shares) external view returns (uint256 value);
```

#### 资产值的小数位数

```
/**
 * @notice Get the decimals of the values.
 */
function getOracleDecimals() external view returns (uint8);
```

#### LST预言机合约地址

```
/**
 * @notice Get the address of LST Oracle.
 */
function getOracle() public view returns (address);
```

### LST预言机合约

{% embed url="<https://github.com/solv-finance/SolvBTC/blob/main/contracts/oracle/SolvBTCYieldTokenOracleForSFT.sol>" %}

#### 获取净资产值 (NAV: Net Asset Value)

```
function getNav(address erc20) external view returns (uint256);
```

#### 净资产值的小数位数

```
function navDecimals(address erc20) external view returns (uint8);
```

### 流动性池净资产值预言机

{% embed url="<https://github.com/solv-finance-dev/solv-contracts-v3/blob/main/markets/open-fund-market/contracts/oracle/NavOracle.sol>" %}

#### 获取净资产值

```
function getSubscribeNav(bytes32 poolId_, uint256 time_) 
    external view returns (uint256 nav_, uint256 navTime_);
```

#### 设置净资产值

```
function setSubscribeNavOnlyMarket(bytes32 poolId_, uint256 time_, uint256 nav_) external;
```


---

# 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://www.docszh.com/solv-docs/technical-docs/smart-contracts/lst-oracle.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.
