二、动态质押奖励算法
质押奖励分配采用 动态 APY 调整模型,基于协议收入与代币供需平衡:
数学模型:
质押奖励公式:
RewardPerBlock=ProtocolRevenue×0.5TotalStaked×InflationRateBlocksPerYearRewardPerBlock=TotalStakedProtocolRevenue×0.5×BlocksPerYearInflationRate
通胀率调整:若 LSP 价格低于目标阈值(如 $1.0),DAO 可投票降低通胀率上限。
代码实现:
// 动态奖励分配合约 contract DynamicRewards { uint256 public inflationRate; // 当前年通胀率(初始 2%) uint256 public targetPrice; // LSP 目标价格(如 $1.0) uint256 public blocksPerYear = 2102400; // Arbitrum 区块数/年(~1.3秒/区块) // 计算每区块奖励 function calculateReward(uint256 totalStaked, uint256 protocolRevenue) public view returns (uint256) { uint256 revenueShare = protocolRevenue * 50 / 100; // 50% 收入用于奖励 uint256 annualReward = revenueShare + (totalStaked * inflationRate) / 100; return annualReward / blocksPerYear; } // DAO 调整通胀率(需治理投票) function adjustInflation(uint256 newRate) external onlyDAO { require(newRate <= 2, "Max inflation 2%"); inflationRate = newRate; } }
最后更新于