@stake-dao/reader 0.2.6 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/abis/MulticallAngleVaults.json +83 -0
- package/dist/esm/bytecodes/index.js +1 -0
- package/dist/esm/bytecodes/index.js.map +1 -1
- package/dist/esm/bytecodes/strategies/batches/batchAngleStrats.js +24 -0
- package/dist/esm/bytecodes/strategies/batches/batchAngleStrats.js.map +1 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lockers/fetch/index.js +1 -2
- package/dist/esm/lockers/fetch/index.js.map +1 -1
- package/dist/esm/{strategies/utils/sdt.js → sdt.js} +37 -33
- package/dist/esm/sdt.js.map +1 -0
- package/dist/esm/strategies/angle/endpoints.js +3 -0
- package/dist/esm/strategies/angle/endpoints.js.map +1 -0
- package/dist/esm/strategies/angle/fetch.js +212 -0
- package/dist/esm/strategies/angle/fetch.js.map +1 -0
- package/dist/esm/strategies/curve/fetch/index.js +1 -1
- package/dist/esm/strategies/curve/fetch/index.js.map +1 -1
- package/dist/esm/strategies/pancakeswap/fetch/getPancakeV3Vaults.js +2 -1
- package/dist/esm/strategies/pancakeswap/fetch/getPancakeV3Vaults.js.map +1 -1
- package/dist/esm/strategies/utils/index.js +0 -1
- package/dist/esm/strategies/utils/index.js.map +1 -1
- package/dist/esm/strategies/yearn/fetch/index.js +7 -3
- package/dist/esm/strategies/yearn/fetch/index.js.map +1 -1
- package/dist/esm/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/bytecodes/index.d.ts +1 -0
- package/dist/types/bytecodes/index.d.ts.map +1 -1
- package/dist/types/bytecodes/strategies/batches/batchAngleStrats.d.ts +4 -0
- package/dist/types/bytecodes/strategies/batches/batchAngleStrats.d.ts.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/lockers/fetch/index.d.ts.map +1 -1
- package/dist/types/{strategies/utils/sdt.d.ts → sdt.d.ts} +4 -2
- package/dist/types/sdt.d.ts.map +1 -0
- package/dist/types/strategies/angle/endpoints.d.ts +3 -0
- package/dist/types/strategies/angle/endpoints.d.ts.map +1 -0
- package/dist/types/strategies/angle/fetch.d.ts +22 -0
- package/dist/types/strategies/angle/fetch.d.ts.map +1 -0
- package/dist/types/strategies/curve/fetch/index.d.ts +1 -1
- package/dist/types/strategies/curve/fetch/index.d.ts.map +1 -1
- package/dist/types/strategies/pancakeswap/fetch/getPancakeV3Vaults.d.ts.map +1 -1
- package/dist/types/strategies/utils/index.d.ts +0 -1
- package/dist/types/strategies/utils/index.d.ts.map +1 -1
- package/dist/types/strategies/yearn/fetch/index.d.ts +1 -1
- package/dist/types/strategies/yearn/fetch/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/bytecodes/index.ts +1 -0
- package/src/bytecodes/strategies/batches/batchAngleStrats.ts +26 -0
- package/src/index.ts +4 -0
- package/src/lockers/fetch/index.ts +1 -2
- package/src/{strategies/utils/sdt.ts → sdt.ts} +43 -38
- package/src/strategies/angle/endpoints.ts +2 -0
- package/src/strategies/angle/fetch.ts +252 -0
- package/src/strategies/curve/fetch/index.ts +1 -1
- package/src/strategies/pancakeswap/fetch/getPancakeV3Vaults.ts +2 -1
- package/src/strategies/utils/index.ts +0 -1
- package/src/strategies/yearn/fetch/index.ts +9 -3
- package/dist/esm/lockers/utils/getSdtInflationData.js +0 -38
- package/dist/esm/lockers/utils/getSdtInflationData.js.map +0 -1
- package/dist/esm/strategies/utils/sdt.js.map +0 -1
- package/dist/types/lockers/utils/getSdtInflationData.d.ts +0 -8
- package/dist/types/lockers/utils/getSdtInflationData.d.ts.map +0 -1
- package/dist/types/strategies/utils/sdt.d.ts.map +0 -1
- package/src/lockers/utils/getSdtInflationData.ts +0 -54
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { STRAT_FEES, angleStrats, contracts } from '@stake-dao/constants'
|
|
2
|
+
import { chunk, uniq } from 'lodash-es'
|
|
3
|
+
import { encodeAbiParameters, formatUnits, parseAbiParameters } from 'viem'
|
|
4
|
+
import { mainnet } from 'viem/chains'
|
|
5
|
+
import multicallAngleVaultsAbi from '../../abis/MulticallAngleVaults.json'
|
|
6
|
+
import { batchAngleStrats } from '../../bytecodes/index.js'
|
|
7
|
+
import { type Price, getPricesFromLlama } from '../../prices.js'
|
|
8
|
+
import { batchJsonRpc, equalTlc, multicall } from '../../utils.js'
|
|
9
|
+
import type { RewardsData, SdtApr } from '../types.js'
|
|
10
|
+
import { getAprBreakdown } from '../utils/getAprBreakdown.js'
|
|
11
|
+
import { Zero } from '../utils/index.js'
|
|
12
|
+
import { ANGLE_APR_URL, ANGLE_PRICE_URL } from './endpoints.js'
|
|
13
|
+
|
|
14
|
+
interface TFetchAngle {
|
|
15
|
+
prices: Price[]
|
|
16
|
+
provider: any
|
|
17
|
+
rpc: string
|
|
18
|
+
chainId: number
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const fetchAngle = async ({ prices, provider, rpc, chainId }: TFetchAngle) => {
|
|
22
|
+
const stratsDataCalls: { vault: string; token: string; sdtLiquidityGauge: string }[] = []
|
|
23
|
+
const balancesCalls: { address: string; name: string }[] = []
|
|
24
|
+
const dataCalls: { address: string; name: string }[] = []
|
|
25
|
+
|
|
26
|
+
const strats = angleStrats.strats[chainId].filter((s) => s.chainId === chainId)
|
|
27
|
+
|
|
28
|
+
const tokensToFetch: any = []
|
|
29
|
+
|
|
30
|
+
for (const s of strats) {
|
|
31
|
+
tokensToFetch.push(...s.underlyingCoins)
|
|
32
|
+
if (s.lpToken.symbol !== 'SLP') {
|
|
33
|
+
balancesCalls.push(
|
|
34
|
+
...[
|
|
35
|
+
{
|
|
36
|
+
address: s.lpToken.address,
|
|
37
|
+
name: s.key.includes('gamma') ? 'getTotalAmounts' : 'getUnderlyingBalances',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
address: s.lpToken.address,
|
|
41
|
+
name: 'totalSupply',
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
dataCalls.push(
|
|
47
|
+
...[
|
|
48
|
+
{ address: s.vault, name: 'totalSupply' },
|
|
49
|
+
{ address: s.rewards[0].gauge, name: 'totalSupply' },
|
|
50
|
+
{ address: s.rewards[0].gauge, name: 'working_supply' },
|
|
51
|
+
],
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const httpCalls = [
|
|
56
|
+
// Angle APR
|
|
57
|
+
(await fetch(ANGLE_APR_URL)).json(),
|
|
58
|
+
// Angle Prices
|
|
59
|
+
(await fetch(ANGLE_PRICE_URL)).json(),
|
|
60
|
+
// Defillama prices
|
|
61
|
+
await getPricesFromLlama(uniq(tokensToFetch), chainId),
|
|
62
|
+
]
|
|
63
|
+
|
|
64
|
+
const httpResponses = await Promise.all(httpCalls)
|
|
65
|
+
|
|
66
|
+
const rawBalances: any = await multicall(provider, balancesCalls, multicallAngleVaultsAbi)
|
|
67
|
+
const rawData: any = await multicall(provider, dataCalls, multicallAngleVaultsAbi)
|
|
68
|
+
|
|
69
|
+
const angleAprData = httpResponses[0]
|
|
70
|
+
const anglePriceData = httpResponses[1]
|
|
71
|
+
const defillamaPrices = httpResponses[2]
|
|
72
|
+
|
|
73
|
+
let rawPriceIndex = 0
|
|
74
|
+
const stratsWithApy = strats.map((s) => {
|
|
75
|
+
const aprData = angleAprData[s.aprApiKey]
|
|
76
|
+
let priceData = anglePriceData.find((d) => d.token === s.aprApiKey)
|
|
77
|
+
|
|
78
|
+
if (!priceData) {
|
|
79
|
+
const token0 = s.underlyingCoins[0]
|
|
80
|
+
const token1 = s.underlyingCoins[1]
|
|
81
|
+
const token0Price = defillamaPrices.find((p) => p.symbol === token0.symbol)
|
|
82
|
+
const token1Price = defillamaPrices.find((p) => p.symbol === token1.symbol)
|
|
83
|
+
const token0AmountUsd =
|
|
84
|
+
Number(formatUnits(rawBalances[rawPriceIndex].result[0], token0.decimals)) * token0Price.usdPrice
|
|
85
|
+
const token1AmountUsd =
|
|
86
|
+
Number(formatUnits(rawBalances[rawPriceIndex].result[1], token1.decimals)) * token1Price.usdPrice
|
|
87
|
+
const totalLp = Number(formatUnits(rawBalances[rawPriceIndex + 1].result, 18))
|
|
88
|
+
const lpPriceInUsd = (token0AmountUsd + token1AmountUsd) / totalLp
|
|
89
|
+
|
|
90
|
+
priceData = { rate: lpPriceInUsd }
|
|
91
|
+
|
|
92
|
+
rawPriceIndex += 2
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
let maxApr = 0
|
|
96
|
+
let tradingApy = 0
|
|
97
|
+
|
|
98
|
+
if (aprData?.details && aprData.value && aprData.address) {
|
|
99
|
+
tradingApy = aprData.details.fees ? aprData.details.fees : 0
|
|
100
|
+
const aprDetailsKeys = Object.keys(aprData.details)
|
|
101
|
+
const indexOfApy = aprDetailsKeys.map((k) => k.includes(s.lpToken.address.toLowerCase())).indexOf(true)
|
|
102
|
+
maxApr =
|
|
103
|
+
indexOfApy > 0
|
|
104
|
+
? aprData.details[aprDetailsKeys[indexOfApy]!]
|
|
105
|
+
: aprData.details.max
|
|
106
|
+
? aprData.details.max
|
|
107
|
+
: aprData.value - tradingApy
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if (s.key === 'angle-sushi-eura-angle') {
|
|
111
|
+
stratsDataCalls.push({
|
|
112
|
+
vault: s.vault,
|
|
113
|
+
token: s.lpToken.address,
|
|
114
|
+
sdtLiquidityGauge: s.gaugeAddress,
|
|
115
|
+
})
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return {
|
|
119
|
+
...s,
|
|
120
|
+
tradingApy,
|
|
121
|
+
minApr: (maxApr * ((100 - STRAT_FEES) / 100)) / 2.5,
|
|
122
|
+
maxApr: maxApr * ((100 - STRAT_FEES) / 100),
|
|
123
|
+
lpPriceInUsd: priceData ? priceData.rate : 1,
|
|
124
|
+
}
|
|
125
|
+
})
|
|
126
|
+
|
|
127
|
+
const inputArgsChunks = chunk(stratsDataCalls, 20)
|
|
128
|
+
const angleCalls = inputArgsChunks.map((inputArgs) => {
|
|
129
|
+
const inputData = encodeAbiParameters(parseAbiParameters(batchAngleStrats.inputType[chainId]!) as any, [
|
|
130
|
+
contracts.sdGaugeController![chainId],
|
|
131
|
+
inputArgs,
|
|
132
|
+
])
|
|
133
|
+
return batchAngleStrats.bytecode[chainId]!.concat(inputData.slice(2))
|
|
134
|
+
})
|
|
135
|
+
|
|
136
|
+
const rawAngleData = await batchJsonRpc({
|
|
137
|
+
rpc,
|
|
138
|
+
calls: angleCalls,
|
|
139
|
+
outputTypeAbi: batchAngleStrats.outputTypeHr[chainId],
|
|
140
|
+
callsKey: `strategies/angle/fetch.ts: rawAngleData - chainId ${chainId} - rpc ${rpc}`,
|
|
141
|
+
})
|
|
142
|
+
|
|
143
|
+
let offchainDataIndex = 0
|
|
144
|
+
const parsedStrats = stratsWithApy.map((s) => {
|
|
145
|
+
let fetchedData: any
|
|
146
|
+
|
|
147
|
+
if (s.offchain) {
|
|
148
|
+
fetchedData = {
|
|
149
|
+
totalSupply: rawData[offchainDataIndex].result,
|
|
150
|
+
sdGaugeTotalSupply: rawData[offchainDataIndex + 1].result,
|
|
151
|
+
sdWorkingSupply: chainId === mainnet.id ? rawData[offchainDataIndex + 2].result : Zero,
|
|
152
|
+
accumulatedFees: Zero,
|
|
153
|
+
keeperFee: Zero,
|
|
154
|
+
}
|
|
155
|
+
} else {
|
|
156
|
+
fetchedData = rawAngleData.shift()
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
offchainDataIndex += 3
|
|
160
|
+
|
|
161
|
+
const rewardsData: RewardsData[] = s.rewards.map((r: any) => {
|
|
162
|
+
const rewardToken = {
|
|
163
|
+
symbol: r.symbol,
|
|
164
|
+
name: r.name,
|
|
165
|
+
decimals: r.decimals,
|
|
166
|
+
address: r.address,
|
|
167
|
+
}
|
|
168
|
+
const rewardPrice = prices.find((p: any) => equalTlc(p.address, rewardToken.address))
|
|
169
|
+
|
|
170
|
+
return {
|
|
171
|
+
token: rewardToken,
|
|
172
|
+
price: rewardPrice ? rewardPrice.usdPrice : 0,
|
|
173
|
+
apr: 0,
|
|
174
|
+
streaming: false,
|
|
175
|
+
periodFinish: 0,
|
|
176
|
+
rate: '0',
|
|
177
|
+
lastUpdate: '0',
|
|
178
|
+
claimablePendingRewards: '0',
|
|
179
|
+
}
|
|
180
|
+
})
|
|
181
|
+
|
|
182
|
+
const boost = 2.5
|
|
183
|
+
const sdtApr: SdtApr = {
|
|
184
|
+
sdtUserApr: 0,
|
|
185
|
+
sdtFuturUserApr: 0,
|
|
186
|
+
sdtMinApr: 0,
|
|
187
|
+
sdtFuturMinApr: 0,
|
|
188
|
+
sdtMaxApr: 0,
|
|
189
|
+
sdtFuturMaxApr: 0,
|
|
190
|
+
sdtBoost: 1,
|
|
191
|
+
}
|
|
192
|
+
const apr = getAprBreakdown(s, rewardsData, boost, sdtApr)
|
|
193
|
+
|
|
194
|
+
const totalSupply = formatUnits(fetchedData.totalSupply, 0)
|
|
195
|
+
const lpPriceInUsd = s.lpPriceInUsd
|
|
196
|
+
const tvl = lpPriceInUsd * Number(formatUnits(BigInt(fetchedData.totalSupply), 18))
|
|
197
|
+
|
|
198
|
+
const sdGauge = {
|
|
199
|
+
address: s.gaugeAddress,
|
|
200
|
+
totalSupply: formatUnits(fetchedData.sdGaugeTotalSupply, 0),
|
|
201
|
+
relativeWeight: '0',
|
|
202
|
+
weight: '0',
|
|
203
|
+
futureWeight: '0',
|
|
204
|
+
workingSupply: '0',
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
return {
|
|
208
|
+
key: s.key,
|
|
209
|
+
name: s.name,
|
|
210
|
+
protocol: s.protocol,
|
|
211
|
+
chainId: s.chainId,
|
|
212
|
+
vault: s.vault,
|
|
213
|
+
lpToken: s.lpToken,
|
|
214
|
+
gaugeAddress: s.gaugeAddress,
|
|
215
|
+
coins: s.coins,
|
|
216
|
+
sdGauge,
|
|
217
|
+
lpPriceInUsd,
|
|
218
|
+
streaming: rewardsData.every((r) => Math.floor(Date.now() / 1000) > Number(r.periodFinish)),
|
|
219
|
+
tvl,
|
|
220
|
+
apr: {
|
|
221
|
+
boost,
|
|
222
|
+
...apr,
|
|
223
|
+
},
|
|
224
|
+
rewards: rewardsData,
|
|
225
|
+
// Base APR data
|
|
226
|
+
tradingApy: s.tradingApy,
|
|
227
|
+
minApr: s.minApr,
|
|
228
|
+
maxApr: s.maxApr,
|
|
229
|
+
// Raw data
|
|
230
|
+
totalSupply,
|
|
231
|
+
// Gas optimised
|
|
232
|
+
vaultFees: {
|
|
233
|
+
keeper: Number(fetchedData.keeperFee) / 100,
|
|
234
|
+
accumulated: formatUnits(fetchedData.accumulatedFees, 0),
|
|
235
|
+
},
|
|
236
|
+
}
|
|
237
|
+
})
|
|
238
|
+
|
|
239
|
+
return {
|
|
240
|
+
global: {
|
|
241
|
+
fees: {
|
|
242
|
+
veSdt: 0,
|
|
243
|
+
perf: 0,
|
|
244
|
+
accumulator: 0,
|
|
245
|
+
claimer: 0,
|
|
246
|
+
},
|
|
247
|
+
},
|
|
248
|
+
deployed: parsedStrats,
|
|
249
|
+
notDeployed: [],
|
|
250
|
+
fetched: true,
|
|
251
|
+
}
|
|
252
|
+
}
|
|
@@ -2,6 +2,7 @@ import { formatUnits } from 'viem'
|
|
|
2
2
|
|
|
3
3
|
import { ONE_YEAR, curveStrats, mainnet, tokenWithId } from '@stake-dao/constants'
|
|
4
4
|
import type { Price } from '../../../prices.js'
|
|
5
|
+
import { type SdtEmissionData, getSdtApr } from '../../../sdt.js'
|
|
5
6
|
import { equalTlc } from '../../../utils.js'
|
|
6
7
|
import type {
|
|
7
8
|
CurveGlobalData,
|
|
@@ -15,7 +16,6 @@ import { getBoost } from '../../utils/boost.js'
|
|
|
15
16
|
import decodeEtherscanFactoryEvent, { decodeNewFactoryEvent } from '../../utils/decodeEtherscanFactoryEvent.js'
|
|
16
17
|
import { getAprBreakdown } from '../../utils/getAprBreakdown.js'
|
|
17
18
|
import { OneEther, Zero } from '../../utils/index.js'
|
|
18
|
-
import { type SdtEmissionData, getSdtApr } from '../../utils/sdt.js'
|
|
19
19
|
import { buildCurveStrategies } from '../build.js'
|
|
20
20
|
import { getCurveHttpCalls } from '../httpCalls.js'
|
|
21
21
|
import { getOnChainSdCurveData } from '../onChainCalls.js'
|
|
@@ -186,6 +186,7 @@ export const getPancakeV3Vaults = async (
|
|
|
186
186
|
minApr: farmApr,
|
|
187
187
|
maxApr: farmApr * 2,
|
|
188
188
|
// Raw data
|
|
189
|
+
fees24H,
|
|
189
190
|
allocPoint: stratParsedData.allocPoint,
|
|
190
191
|
tick: stratParsedData.tick,
|
|
191
192
|
sqrtPriceX96: stratParsedData.sqrtPriceX96,
|
|
@@ -200,5 +201,5 @@ export const getPancakeV3Vaults = async (
|
|
|
200
201
|
}
|
|
201
202
|
})
|
|
202
203
|
|
|
203
|
-
return { global, stratsData }
|
|
204
|
+
return { global, stratsData: stratsData.filter((s) => s.allocPoint > 0) }
|
|
204
205
|
}
|
|
@@ -11,9 +11,10 @@ import { computeYearnApr } from './computeYearnApr.js'
|
|
|
11
11
|
|
|
12
12
|
import { contracts } from '@stake-dao/constants'
|
|
13
13
|
import type { Price } from '../../../prices.js'
|
|
14
|
+
import { type SdtEmissionData, getSdtApr } from '../../../sdt.js'
|
|
14
15
|
import type { RewardsData, StrategyData, ValidChainId, ValidExplorer } from '../../types.js'
|
|
15
16
|
import { getAprBreakdown } from '../../utils/getAprBreakdown.js'
|
|
16
|
-
import {
|
|
17
|
+
import { OneEther, Zero, decodeNewFactoryEvent } from '../../utils/index.js'
|
|
17
18
|
import { fetchAllYearnGauges } from './fetchAllYearnGauges.js'
|
|
18
19
|
|
|
19
20
|
const globalCalls = [
|
|
@@ -183,12 +184,17 @@ export const fetchYearn = async ({
|
|
|
183
184
|
}
|
|
184
185
|
})
|
|
185
186
|
|
|
187
|
+
const gaugeWeight: bigint = chunkedRawData[index][8].result
|
|
188
|
+
|
|
186
189
|
const sdGauge = {
|
|
187
190
|
address: s.sdGauge,
|
|
188
191
|
totalSupply: formatUnits(sdGaugeTotalSupply, 0),
|
|
189
192
|
relativeWeight: formatUnits(chunkedRawData[index][7].result, 0),
|
|
190
|
-
weight: formatUnits(
|
|
191
|
-
futureWeight:
|
|
193
|
+
weight: formatUnits(gaugeWeight, 0),
|
|
194
|
+
futureWeight:
|
|
195
|
+
sdtEmissionData.stratGcTotalWeight > Zero
|
|
196
|
+
? formatUnits((gaugeWeight * OneEther * OneEther) / sdtEmissionData.stratGcTotalWeight, 0)
|
|
197
|
+
: '0',
|
|
192
198
|
workingSupply: formatUnits(chunkedRawData[index][9].result, 0),
|
|
193
199
|
}
|
|
194
200
|
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { mainnet } from 'viem/chains';
|
|
2
|
-
import { ETH_SECONDS_PER_BLOCK, LOCKERS_MASTERCHEF_PID, STRATEGIES_MASTERCHEF_PID, contracts, } from '@stake-dao/constants';
|
|
3
|
-
import { parseAbi } from 'viem';
|
|
4
|
-
import { multicall } from '../../utils.js';
|
|
5
|
-
const getSdtInflationData = async (provider) => {
|
|
6
|
-
const chainId = await provider.getChainId();
|
|
7
|
-
if (chainId === mainnet.id) {
|
|
8
|
-
const rawSdtMasterchefData = await multicall(provider, [
|
|
9
|
-
{ address: contracts.sdtMasterchef[1], name: 'sdtPerBlock' },
|
|
10
|
-
{ address: contracts.sdtMasterchef[1], name: 'totalAllocPoint' },
|
|
11
|
-
{ address: contracts.sdtMasterchef[1], name: 'poolInfo', params: [LOCKERS_MASTERCHEF_PID] },
|
|
12
|
-
{ address: contracts.sdtMasterchef[1], name: 'poolInfo', params: [STRATEGIES_MASTERCHEF_PID] },
|
|
13
|
-
], parseAbi([
|
|
14
|
-
'function sdtPerBlock() external view returns (uint256)',
|
|
15
|
-
'function totalAllocPoint() external view returns (uint256)',
|
|
16
|
-
'function poolInfo(uint256) external view returns (address,uint256,uint256)',
|
|
17
|
-
]));
|
|
18
|
-
const sdtPerBlock = rawSdtMasterchefData[0].result;
|
|
19
|
-
const totalAllocPoint = rawSdtMasterchefData[1].result;
|
|
20
|
-
const lockerPoolInfo = rawSdtMasterchefData[2].result;
|
|
21
|
-
const stratPoolInfo = rawSdtMasterchefData[3].result;
|
|
22
|
-
const lockersAllocPoint = lockerPoolInfo[1];
|
|
23
|
-
const stratsAllocPoint = stratPoolInfo[1];
|
|
24
|
-
const lockersSdtPerBlock = (lockersAllocPoint * sdtPerBlock) / totalAllocPoint;
|
|
25
|
-
const lockersSdtPerSecond = BigInt(lockersSdtPerBlock) / BigInt(ETH_SECONDS_PER_BLOCK);
|
|
26
|
-
const stratsSdtPerBlock = (stratsAllocPoint * sdtPerBlock) / totalAllocPoint;
|
|
27
|
-
const stratsSdtPerSecond = BigInt(stratsSdtPerBlock) / BigInt(ETH_SECONDS_PER_BLOCK);
|
|
28
|
-
return {
|
|
29
|
-
lockersSdtPerBlock,
|
|
30
|
-
lockersSdtPerSecond,
|
|
31
|
-
stratsSdtPerBlock,
|
|
32
|
-
stratsSdtPerSecond,
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
return undefined;
|
|
36
|
-
};
|
|
37
|
-
export default getSdtInflationData;
|
|
38
|
-
//# sourceMappingURL=getSdtInflationData.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getSdtInflationData.js","sourceRoot":"","sources":["../../../../src/lockers/utils/getSdtInflationData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAErC,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,SAAS,GACV,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAA;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,MAAM,mBAAmB,GAAG,KAAK,E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A;IACD,MAAM,UAAU,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,CAAA;IACpE,IAAI,UAAU,EAAE,CAAC;QACf,MAAM,GAAG,aAAa,CAAC,eAAe,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,CAAC,CAAA;IACtF,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
declare const getSdtInflationData: (provider: any) => Promise<{
|
|
2
|
-
lockersSdtPerBlock: bigint;
|
|
3
|
-
lockersSdtPerSecond: bigint;
|
|
4
|
-
stratsSdtPerBlock: bigint;
|
|
5
|
-
stratsSdtPerSecond: bigint;
|
|
6
|
-
} | undefined>;
|
|
7
|
-
export default getSdtInflationData;
|
|
8
|
-
//# sourceMappingURL=getSdtInflationData.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getSdtInflationData.d.ts","sourceRoot":"","sources":["../../../../src/lockers/utils/getSdtInflationData.ts"],"names":[],"mappings":"AAWA,QAAA,MAAM,mBAAmB,aAAoB,GAAG;;;;;cAwC/C,CAAA;AAED,eAAe,mBAAmB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sdt.d.ts","sourceRoot":"","sources":["../../../../src/strategies/utils/sdt.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGtD,MAAM,MAAM,eAAe,GAAG;IAC5B,kBAAkB,EAAE,MAAM,CAAA;IAC1B,mBAAmB,EAAE,MAAM,CAAA;IAC3B,iBAAiB,EAAE,MAAM,CAAA;IACzB,kBAAkB,EAAE,MAAM,CAAA;CAC3B,CAAA;AAiCD,eAAO,MAAM,oBAAoB,iBACjB,MAAM,gBACN,MAAM,kBACJ,MAAM,iBACP,MAAM,kBACL,MAAM,qBACH,MAAM,2BACA,MAAM,oBACb,MAAM,YACd,MAAM,WACP,MAAM;;;;;CA4DhB,CAAA;AAED,eAAO,MAAM,mBAAmB,aAAoB,GAAG,WAAW,MAAM,KAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAwC7G,CAAA;AAED,eAAO,MAAM,aAAa,oBACP,eAAe,cACpB,WAAW,YACb,GAAG,WACJ,GAAG,gBACE,MAAM,KACnB,MAsCF,CAAA;AAED,eAAO,MAAM,SAAS,gBACP,GAAG,mBACC,eAAe,WACvB,GAAG,gBACE,MAAM,YACV,GAAG,KACZ,MAgBF,CAAA"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { mainnet } from 'viem/chains'
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
ETH_SECONDS_PER_BLOCK,
|
|
5
|
-
LOCKERS_MASTERCHEF_PID,
|
|
6
|
-
STRATEGIES_MASTERCHEF_PID,
|
|
7
|
-
contracts,
|
|
8
|
-
} from '@stake-dao/constants'
|
|
9
|
-
import { parseAbi } from 'viem'
|
|
10
|
-
import { multicall } from '../../utils.js'
|
|
11
|
-
|
|
12
|
-
const getSdtInflationData = async (provider: any) => {
|
|
13
|
-
const chainId = await provider.getChainId()
|
|
14
|
-
if (chainId === mainnet.id) {
|
|
15
|
-
const rawSdtMasterchefData = await multicall(
|
|
16
|
-
provider,
|
|
17
|
-
[
|
|
18
|
-
{ address: contracts.sdtMasterchef![1]!, name: 'sdtPerBlock' },
|
|
19
|
-
{ address: contracts.sdtMasterchef![1]!, name: 'totalAllocPoint' },
|
|
20
|
-
{ address: contracts.sdtMasterchef![1]!, name: 'poolInfo', params: [LOCKERS_MASTERCHEF_PID] },
|
|
21
|
-
{ address: contracts.sdtMasterchef![1]!, name: 'poolInfo', params: [STRATEGIES_MASTERCHEF_PID] },
|
|
22
|
-
],
|
|
23
|
-
parseAbi([
|
|
24
|
-
'function sdtPerBlock() external view returns (uint256)',
|
|
25
|
-
'function totalAllocPoint() external view returns (uint256)',
|
|
26
|
-
'function poolInfo(uint256) external view returns (address,uint256,uint256)',
|
|
27
|
-
]),
|
|
28
|
-
)
|
|
29
|
-
|
|
30
|
-
const sdtPerBlock = rawSdtMasterchefData[0].result as unknown as bigint
|
|
31
|
-
const totalAllocPoint = rawSdtMasterchefData[1].result as unknown as bigint
|
|
32
|
-
const lockerPoolInfo = rawSdtMasterchefData[2].result as unknown as bigint
|
|
33
|
-
const stratPoolInfo = rawSdtMasterchefData[3].result as unknown as bigint
|
|
34
|
-
|
|
35
|
-
const lockersAllocPoint = lockerPoolInfo[1] as unknown as bigint
|
|
36
|
-
const stratsAllocPoint = stratPoolInfo[1] as unknown as bigint
|
|
37
|
-
|
|
38
|
-
const lockersSdtPerBlock = (lockersAllocPoint * sdtPerBlock) / totalAllocPoint
|
|
39
|
-
const lockersSdtPerSecond = BigInt(lockersSdtPerBlock) / BigInt(ETH_SECONDS_PER_BLOCK)
|
|
40
|
-
|
|
41
|
-
const stratsSdtPerBlock = (stratsAllocPoint * sdtPerBlock) / totalAllocPoint
|
|
42
|
-
const stratsSdtPerSecond = BigInt(stratsSdtPerBlock) / BigInt(ETH_SECONDS_PER_BLOCK)
|
|
43
|
-
|
|
44
|
-
return {
|
|
45
|
-
lockersSdtPerBlock,
|
|
46
|
-
lockersSdtPerSecond,
|
|
47
|
-
stratsSdtPerBlock,
|
|
48
|
-
stratsSdtPerSecond,
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
return undefined
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export default getSdtInflationData
|