> For the complete documentation index, see [llms.txt](https://www.docszh.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.docszh.com/solv-docs/technical-docs/smart-contracts/lst-oracle.md).

# LST 预言机机制

### 整体架构

<figure><img src="https://1161077445-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfjdUISsbS8UDYAUQEGRk%2Fuploads%2FqBpU6i89TKuDp70sEmkb%2F%E6%95%B4%E4%BD%93%E6%9E%B6%E6%9E%84.png?alt=media&amp;token=87f24a3b-6126-4b9c-adf5-ecb53f7dd37e" 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;
```
