@stake-dao/reader 0.2.2 → 0.2.3
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/strategies/curve/fetch/curveApiData/config.js +4 -0
- package/dist/esm/strategies/curve/fetch/curveApiData/config.js.map +1 -1
- package/dist/esm/strategies/curve/fetch/index.js +2 -1
- package/dist/esm/strategies/curve/fetch/index.js.map +1 -1
- package/dist/esm/strategies/yearn/fetch/index.js +8 -3
- package/dist/esm/strategies/yearn/fetch/index.js.map +1 -1
- package/dist/esm/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/strategies/curve/fetch/curveApiData/config.d.ts +4 -0
- package/dist/types/strategies/curve/fetch/curveApiData/config.d.ts.map +1 -1
- package/dist/types/strategies/curve/fetch/index.d.ts.map +1 -1
- package/dist/types/strategies/yearn/fetch/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/strategies/curve/fetch/curveApiData/config.ts +6 -0
- package/src/strategies/curve/fetch/index.ts +4 -1
- package/src/strategies/yearn/fetch/index.ts +9 -3
|
@@ -19,6 +19,10 @@ export declare const GAUGES_CHUNK_SIZE: {
|
|
|
19
19
|
export declare const TOKENS_CHUNK_SIZE = 100;
|
|
20
20
|
export declare const GAUGES_WEIGHTS_CHUNK_SIZE = 100;
|
|
21
21
|
export declare const GAUGES_REGISTRY_CHUNK_SIZE = 30;
|
|
22
|
+
export declare const BROKEN_VAULTS: {
|
|
23
|
+
1: string[];
|
|
24
|
+
42161: never[];
|
|
25
|
+
};
|
|
22
26
|
export declare const BROKEN_GAUGES: {
|
|
23
27
|
1: string[];
|
|
24
28
|
42161: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../../src/strategies/curve/fetch/curveApiData/config.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG;IACrB,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,aAAa,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,UAAU,EAAE;IAAE,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ,EAAE,CAAA;CAoBvD,CAAA;AAED,eAAO,MAAM,iBAAiB;;;CAG7B,CAAA;AAED,eAAO,MAAM,UAAU,KAAK,CAAA;AAC5B,eAAO,MAAM,iBAAiB;;;CAAuB,CAAA;AACrD,eAAO,MAAM,iBAAiB,MAAM,CAAA;AACpC,eAAO,MAAM,yBAAyB,MAAM,CAAA;AAC5C,eAAO,MAAM,0BAA0B,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../../src/strategies/curve/fetch/curveApiData/config.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG;IACrB,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,aAAa,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,UAAU,EAAE;IAAE,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ,EAAE,CAAA;CAoBvD,CAAA;AAED,eAAO,MAAM,iBAAiB;;;CAG7B,CAAA;AAED,eAAO,MAAM,UAAU,KAAK,CAAA;AAC5B,eAAO,MAAM,iBAAiB;;;CAAuB,CAAA;AACrD,eAAO,MAAM,iBAAiB,MAAM,CAAA;AACpC,eAAO,MAAM,yBAAyB,MAAM,CAAA;AAC5C,eAAO,MAAM,0BAA0B,KAAK,CAAA;AAE5C,eAAO,MAAM,aAAa;;;CAGzB,CAAA;AAED,eAAO,MAAM,aAAa;;;CAGzB,CAAA;AAED,eAAO,MAAM,aAAa;;;;;;;CAWzB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/strategies/curve/fetch/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAE/C,OAAO,KAAK,EAIV,YAAY,EACZ,YAAY,EACZ,aAAa,EACd,MAAM,gBAAgB,CAAA;AAKvB,OAAO,EAAE,KAAK,eAAe,EAAa,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/strategies/curve/fetch/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAE/C,OAAO,KAAK,EAIV,YAAY,EACZ,YAAY,EACZ,aAAa,EACd,MAAM,gBAAgB,CAAA;AAKvB,OAAO,EAAE,KAAK,eAAe,EAAa,MAAM,oBAAoB,CAAA;AAKpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAA;AAK3E,UAAU,WAAW;IACnB,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,QAAQ,EAAE,GAAG,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,cAAc,EAAE,MAAM,CAAA;IACtB,QAAQ,EAAE,aAAa,CAAA;IACvB,OAAO,EAAE,YAAY,CAAA;IACrB,eAAe,EAAE,MAAM,CAAA;IACvB,eAAe,EAAE,eAAe,CAAA;IAChC,aAAa,EAAE,iBAAiB,CAAA;CACjC;AAED,eAAO,MAAM,UAAU,mHAUpB,WAAW,KAAG,OAAO,CAAC,YAAY,CAwPpC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/strategies/yearn/fetch/index.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,KAAK,EAAe,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAE5F,OAAO,EAAE,KAAK,eAAe,EAAoC,MAAM,sBAAsB,CAAA;AAiC7F,UAAU,WAAW;IACnB,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,QAAQ,EAAE,GAAG,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,cAAc,EAAE,MAAM,CAAA;IACtB,QAAQ,EAAE,aAAa,CAAA;IACvB,OAAO,EAAE,YAAY,CAAA;IACrB,eAAe,EAAE,MAAM,CAAA;IACvB,eAAe,EAAE,eAAe,CAAA;CACjC;AAED,eAAO,MAAM,UAAU,oGASpB,WAAW,KAAG,OAAO,CAAC,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/strategies/yearn/fetch/index.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,KAAK,EAAe,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAE5F,OAAO,EAAE,KAAK,eAAe,EAAoC,MAAM,sBAAsB,CAAA;AAiC7F,UAAU,WAAW;IACnB,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,QAAQ,EAAE,GAAG,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,cAAc,EAAE,MAAM,CAAA;IACtB,QAAQ,EAAE,aAAa,CAAA;IACvB,OAAO,EAAE,YAAY,CAAA;IACrB,eAAe,EAAE,MAAM,CAAA;IACvB,eAAe,EAAE,eAAe,CAAA;CACjC;AAED,eAAO,MAAM,UAAU,oGASpB,WAAW,KAAG,OAAO,CAAC,YAAY,CA6KpC,CAAA"}
|
package/package.json
CHANGED
|
@@ -37,6 +37,12 @@ export const GAUGES_CHUNK_SIZE = { 1: 60, 42161: 40 }
|
|
|
37
37
|
export const TOKENS_CHUNK_SIZE = 100
|
|
38
38
|
export const GAUGES_WEIGHTS_CHUNK_SIZE = 100
|
|
39
39
|
export const GAUGES_REGISTRY_CHUNK_SIZE = 30
|
|
40
|
+
|
|
41
|
+
export const BROKEN_VAULTS = {
|
|
42
|
+
1: ['0xb385321d34f7a53979E253d70b8F79C82609116E'],
|
|
43
|
+
42161: [],
|
|
44
|
+
}
|
|
45
|
+
|
|
40
46
|
export const BROKEN_GAUGES = {
|
|
41
47
|
1: ['0x210A1c8E5663CC328F799e1c91215B5dba2F4458', '0xd3dFD8f308c9e6d88d7C09c9a6575C691c810407'],
|
|
42
48
|
42161: ['0x0304F3aAdcc16597D277c12f4b12213e1F075F80'],
|
|
@@ -19,6 +19,7 @@ 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'
|
|
22
|
+
import { BROKEN_VAULTS } from './curveApiData/config.js'
|
|
22
23
|
import type { GaugesWeightsData } from './curveApiData/getGaugesWeights.js'
|
|
23
24
|
import { getCvxApr } from './getCvxApr.js'
|
|
24
25
|
import getOnlyboostData from './getOnlyboostData.js'
|
|
@@ -54,7 +55,9 @@ export const fetchCurve = async ({
|
|
|
54
55
|
? decodeNewFactoryEvent(apisData.explorerData)
|
|
55
56
|
: decodeEtherscanFactoryEvent(apisData.explorerData)
|
|
56
57
|
|
|
57
|
-
const allVaultAndLp = curveStrats.strats[chainId]!.concat(newVaultAndLp)
|
|
58
|
+
const allVaultAndLp = curveStrats.strats[chainId]!.concat(newVaultAndLp).filter(
|
|
59
|
+
(s) => !BROKEN_VAULTS[chainId].includes(s.vault),
|
|
60
|
+
)
|
|
58
61
|
|
|
59
62
|
const strats: any[] = await buildCurveStrategies(provider, allVaultAndLp, chainId, apisData.curveApiData)
|
|
60
63
|
|
|
@@ -144,10 +144,16 @@ export const fetchYearn = async ({
|
|
|
144
144
|
const boost = getBoost('yearn', chunkedRawData[index][2].result, chunkedRawData[index][3].result)
|
|
145
145
|
|
|
146
146
|
const lpPriceInUsd = yearnGauge.lpPriceInUsd
|
|
147
|
-
const underlyingApy = yearnGauge.underlyingApr
|
|
148
147
|
const minApr = yearnGauge.minApr
|
|
149
148
|
const maxApr = yearnGauge.maxApr
|
|
150
149
|
|
|
150
|
+
const underlyingReward = [
|
|
151
|
+
{
|
|
152
|
+
...s.underlyingReward,
|
|
153
|
+
apy: yearnGauge.underlyingApr,
|
|
154
|
+
},
|
|
155
|
+
]
|
|
156
|
+
|
|
151
157
|
const sdGaugeTotalSupply = chunkedRawData[index][10].result
|
|
152
158
|
const tvl = Number(formatEther(sdGaugeTotalSupply)) * lpPriceInUsd
|
|
153
159
|
|
|
@@ -187,7 +193,7 @@ export const fetchYearn = async ({
|
|
|
187
193
|
}
|
|
188
194
|
|
|
189
195
|
const sdtApr = getSdtApr(rewardsData, sdtEmissionData, sdGauge, lpPriceInUsd, undefined)
|
|
190
|
-
const apr = getAprBreakdown(s, rewardsData, boost, sdtApr)
|
|
196
|
+
const apr = getAprBreakdown({ ...s, underlyingReward }, rewardsData, boost, sdtApr)
|
|
191
197
|
|
|
192
198
|
return {
|
|
193
199
|
key: s.key,
|
|
@@ -204,7 +210,7 @@ export const fetchYearn = async ({
|
|
|
204
210
|
rewards: rewardsData,
|
|
205
211
|
name: s.coins.reduce((res: string, current) => `${res}/${current.symbol}`, '').slice(1),
|
|
206
212
|
tradingApy: 0,
|
|
207
|
-
|
|
213
|
+
underlyingReward,
|
|
208
214
|
gaugesProjectedApr: [],
|
|
209
215
|
minApr,
|
|
210
216
|
maxApr,
|