Files
assetxContracts/contracts/ytLending/LendingConfiguration.sol
2025-12-18 13:07:35 +08:00

44 lines
2.0 KiB
Solidity
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @title LendingConfiguration
* @notice 借贷池配置结构体定义
*/
contract LendingConfiguration {
struct AssetConfig {
address asset; // 资产地址
address priceFeed; // 价格预言机地址
uint8 decimals; // 小数位数
uint64 borrowCollateralFactor; // 借款抵押率 (例: 0.8e18 = 80%)
uint64 liquidateCollateralFactor; // 清算抵押率 (例: 0.85e18 = 85%)
uint64 liquidationFactor; // 清算激励 (例: 1.05e18 = 5%折扣)
uint128 supplyCap; // 供应上限
}
struct Configuration {
address baseToken; // 基础资产(借出的资产,如 USDC
address baseTokenPriceFeed; // 基础资产价格预言机
// 利率模型参数
uint64 supplyKink; // 供应拐点利用率
uint64 supplyPerYearInterestRateSlopeLow; // 供应拐点前斜率
uint64 supplyPerYearInterestRateSlopeHigh; // 供应拐点后斜率
uint64 supplyPerYearInterestRateBase; // 供应基础利率
uint64 borrowKink; // 借款拐点利用率
uint64 borrowPerYearInterestRateSlopeLow; // 借款拐点前斜率
uint64 borrowPerYearInterestRateSlopeHigh; // 借款拐点后斜率
uint64 borrowPerYearInterestRateBase; // 借款基础利率
// 其他核心参数
uint64 storeFrontPriceFactor; // 清算价格折扣
uint64 trackingIndexScale; // 追踪索引比例
uint104 baseBorrowMin; // 最小借款额
uint104 targetReserves; // 目标储备金
AssetConfig[] assetConfigs; // 抵押资产配置数组
}
}