本文档包含用于计算 Pendle 市场 APY 的公式。
以主网市场 0x107a2e3cd2bb9a32b9ee2e4d51143149f8367eba 为示例。
变量说明
| 变量名 | 说明 |
|---|
| market | 0x107a2e3cd2bb9a32b9ee2e4d51143149f8367eba |
| sy | 0xC4ed348c56223C5953939e932E315F9d72Cd83fF |
| lpPriceUsd | LP 代币的 USD 价格 |
| syPriceUsd | SY 代币的 USD 价格 |
| pendlePriceUSD | PENDLE 代币的 USD 价格 |
| duration | 用于计算 APY 的时间间隔。例如 duration=7 表示基于过去 7 天的数据计算 APY。系统默认使用 7 天。 |
| syIndex | SY 代币的当前指数,可从 SY 合约的 exchangeRate 函数读取 |
| prevSyIndex | duration 天前的 syIndex |
| yearsToExpiry | 市场到期的年数 |
底层 APY
underlyingApy=underlyingInterestApy+underlyingRewardApr
underlyingApy 由两部分组成,各自计算方法如下:
底层利息 APY(UnderlyingInterestApy)
interestMultiple=prevSyIndexsyIndex
underlyingInterestApy=interestMultipledays365−1
- 说明:
- underlyingInterestApy 估算 SY 代币底层协议利息的当前 APY。利息 = 以底层资产计价的收益,默认自动复利。
- 此公式取过去 7 天的历史 APY,并外推为年化收益率。
底层奖励 APR(UnderlyingRewardApr)
隐含 APY(impliedAPY)
apy=elnImpliedYield−1
- lnImpliedYield 可从市场合约的 readState 函数读取,请注意需除以 1e18 进行缩放。
兑换手续费 APY(SwapFeeApy)
SwapFeeApy
swapFeeApy 是 LP 持有者从池子兑换手续费中获得的 APY。
poolValue=lpPriceUsd∗totalSupply
swapFeeForLpHolder=explicitSwapFee∗20%+implicitSwapFee
swapFeeRateForLpHolder=poolValueswapFeeForLpHolder∗syPriceUsd
swapFeeApy=(1+swapFeeRateForLpHolder)durations365−1
- 说明:
- LP 持有者获得显式兑换手续费的 20% 和全部隐式兑换手续费
- swapFeeRateForLpHolder 是 LP 持有者以 USD 计算获得的手续费比率,再外推得到 swapFeeApy
做多收益 APY(longYieldApy):