@strkfarm/sdk 1.1.5 → 1.1.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/index.browser.global.js +396 -248
- package/dist/index.browser.mjs +174 -38
- package/dist/index.d.ts +4 -1
- package/dist/index.js +174 -38
- package/dist/index.mjs +174 -38
- package/package.json +2 -1
- package/src/global.ts +32 -0
- package/src/interfaces/common.tsx +1 -0
- package/src/modules/harvests.ts +2 -1
- package/src/modules/pricer.ts +25 -8
- package/src/strategies/constants.ts +5 -1
- package/src/strategies/ekubo-cl-vault.tsx +104 -25
- package/src/strategies/universal-adapters/vesu-adapter.ts +2 -1
- package/src/strategies/vesu-rebalance.tsx +3 -3
|
@@ -290,10 +290,10 @@ export class EkuboCLVault extends BaseStrategy<
|
|
|
290
290
|
*/
|
|
291
291
|
async netAPY(
|
|
292
292
|
blockIdentifier: BlockIdentifier = "latest",
|
|
293
|
-
sinceBlocks =
|
|
293
|
+
sinceBlocks = 600000
|
|
294
294
|
): Promise<number> {
|
|
295
295
|
// no special provisions required to account for defi spring rewards
|
|
296
|
-
// or strategy fees, bcz this returns realisitic apy based on
|
|
296
|
+
// or strategy fees, bcz this returns realisitic apy based on 30day performance
|
|
297
297
|
|
|
298
298
|
const tvlNow = await this._getTVL(blockIdentifier);
|
|
299
299
|
const supplyNow = await this.totalSupply(blockIdentifier);
|
|
@@ -321,14 +321,14 @@ export class EkuboCLVault extends BaseStrategy<
|
|
|
321
321
|
const supplyBefore = await this.totalSupply(blockBefore);
|
|
322
322
|
const priceBefore = await this.getCurrentPrice(blockBefore);
|
|
323
323
|
|
|
324
|
-
const tvlInToken0Now = tvlNow.amount0
|
|
325
|
-
.multipliedBy(priceNow.price)
|
|
324
|
+
const tvlInToken0Now = (tvlNow.amount0
|
|
325
|
+
.multipliedBy(priceNow.price))
|
|
326
326
|
.plus(tvlNow.amount1);
|
|
327
327
|
const tvlPerShareNow = tvlInToken0Now
|
|
328
328
|
.multipliedBy(1e18)
|
|
329
329
|
.dividedBy(adjustedSupplyNow.toString());
|
|
330
|
-
const tvlInToken0Bf = tvlBefore.amount0
|
|
331
|
-
.multipliedBy(priceBefore.price)
|
|
330
|
+
const tvlInToken0Bf = (tvlBefore.amount0
|
|
331
|
+
.multipliedBy(priceBefore.price))
|
|
332
332
|
.plus(tvlBefore.amount1);
|
|
333
333
|
const tvlPerShareBf = tvlInToken0Bf
|
|
334
334
|
.multipliedBy(1e18)
|
|
@@ -1668,6 +1668,17 @@ const faqs: FAQ[] = [
|
|
|
1668
1668
|
},
|
|
1669
1669
|
];
|
|
1670
1670
|
|
|
1671
|
+
function getLSTFAQs(lstSymbol: string): FAQ[] {
|
|
1672
|
+
return [
|
|
1673
|
+
...faqs,
|
|
1674
|
+
{
|
|
1675
|
+
question: "Why might I see a negative APY?",
|
|
1676
|
+
answer:
|
|
1677
|
+
`A negative APY can occur when ${lstSymbol}'s price drops on DEXes. This is usually temporary and tends to recover within a few days or a week.`,
|
|
1678
|
+
},
|
|
1679
|
+
]
|
|
1680
|
+
}
|
|
1681
|
+
|
|
1671
1682
|
const xSTRKSTRK: IStrategyMetadata<CLVaultStrategySettings> = {
|
|
1672
1683
|
name: "Ekubo xSTRK/STRK",
|
|
1673
1684
|
description: <></>,
|
|
@@ -1692,7 +1703,7 @@ const xSTRKSTRK: IStrategyMetadata<CLVaultStrategySettings> = {
|
|
|
1692
1703
|
notARisks: getNoRiskTags(_corelatedPoolRiskFactors),
|
|
1693
1704
|
},
|
|
1694
1705
|
apyMethodology:
|
|
1695
|
-
"APY based on
|
|
1706
|
+
"APY based on 30-day historical performance, including fees and rewards.",
|
|
1696
1707
|
additionalInfo: {
|
|
1697
1708
|
newBounds: {
|
|
1698
1709
|
lower: -1,
|
|
@@ -1709,14 +1720,7 @@ const xSTRKSTRK: IStrategyMetadata<CLVaultStrategySettings> = {
|
|
|
1709
1720
|
},
|
|
1710
1721
|
quoteAsset: Global.getDefaultTokens().find((t) => t.symbol === "STRK")!,
|
|
1711
1722
|
},
|
|
1712
|
-
faqs:
|
|
1713
|
-
...faqs,
|
|
1714
|
-
{
|
|
1715
|
-
question: "Why might I see a negative APY?",
|
|
1716
|
-
answer:
|
|
1717
|
-
"A negative APY can occur when xSTRK's price drops on DEXes. This is usually temporary and tends to recover within a few days or a week.",
|
|
1718
|
-
},
|
|
1719
|
-
],
|
|
1723
|
+
faqs: getLSTFAQs("xSTRK"),
|
|
1720
1724
|
points: [{
|
|
1721
1725
|
multiplier: 1,
|
|
1722
1726
|
logo: 'https://endur.fi/favicon.ico',
|
|
@@ -1726,6 +1730,79 @@ const xSTRKSTRK: IStrategyMetadata<CLVaultStrategySettings> = {
|
|
|
1726
1730
|
investmentSteps: []
|
|
1727
1731
|
};
|
|
1728
1732
|
|
|
1733
|
+
const lstStrategies: IStrategyMetadata<CLVaultStrategySettings>[] = [
|
|
1734
|
+
xSTRKSTRK,
|
|
1735
|
+
{
|
|
1736
|
+
...xSTRKSTRK,
|
|
1737
|
+
name: "Ekubo xWBTC/WBTC",
|
|
1738
|
+
description: <></>,
|
|
1739
|
+
address: ContractAddr.from(
|
|
1740
|
+
"0x2ea99b4971d3c277fa4a9b4beb7d4d7d169e683393a29eef263d5d57b4380a"
|
|
1741
|
+
),
|
|
1742
|
+
launchBlock: 2338309,
|
|
1743
|
+
// must be same order as poolKey token0 and token1
|
|
1744
|
+
depositTokens: [
|
|
1745
|
+
Global.getDefaultTokens().find((t) => t.symbol === "WBTC")!,
|
|
1746
|
+
Global.getDefaultTokens().find((t) => t.symbol === "xWBTC")!,
|
|
1747
|
+
],
|
|
1748
|
+
additionalInfo: {
|
|
1749
|
+
...xSTRKSTRK.additionalInfo,
|
|
1750
|
+
quoteAsset: Global.getDefaultTokens().find((t) => t.symbol === "WBTC")!,
|
|
1751
|
+
lstContract: Global.getDefaultTokens().find((t) => t.symbol === "xWBTC")!.address,
|
|
1752
|
+
},
|
|
1753
|
+
faqs: getLSTFAQs("xWBTC"),
|
|
1754
|
+
points: [],
|
|
1755
|
+
contractDetails: [],
|
|
1756
|
+
investmentSteps: []
|
|
1757
|
+
},
|
|
1758
|
+
{
|
|
1759
|
+
...xSTRKSTRK,
|
|
1760
|
+
name: "Ekubo xtBTC/tBTC",
|
|
1761
|
+
description: <></>,
|
|
1762
|
+
address: ContractAddr.from(
|
|
1763
|
+
"0x785dc3dfc4e80ef2690a99512481e3ed3a5266180adda5a47e856245d68a4af"
|
|
1764
|
+
),
|
|
1765
|
+
launchBlock: 2344809,
|
|
1766
|
+
// must be same order as poolKey token0 and token1
|
|
1767
|
+
depositTokens: [
|
|
1768
|
+
Global.getDefaultTokens().find((t) => t.symbol === "xtBTC")!,
|
|
1769
|
+
Global.getDefaultTokens().find((t) => t.symbol === "tBTC")!,
|
|
1770
|
+
],
|
|
1771
|
+
additionalInfo: {
|
|
1772
|
+
...xSTRKSTRK.additionalInfo,
|
|
1773
|
+
quoteAsset: Global.getDefaultTokens().find((t) => t.symbol === "tBTC")!,
|
|
1774
|
+
lstContract: Global.getDefaultTokens().find((t) => t.symbol === "xtBTC")!.address,
|
|
1775
|
+
},
|
|
1776
|
+
faqs: getLSTFAQs("xtBTC"),
|
|
1777
|
+
points: [],
|
|
1778
|
+
contractDetails: [],
|
|
1779
|
+
investmentSteps: []
|
|
1780
|
+
},
|
|
1781
|
+
{
|
|
1782
|
+
...xSTRKSTRK,
|
|
1783
|
+
name: "Ekubo xsBTC/solvBTC",
|
|
1784
|
+
description: <></>,
|
|
1785
|
+
address: ContractAddr.from(
|
|
1786
|
+
"0x3af1c7faa7c464cf2c494e988972ad1939f1103dbfb6e47e9bf0c47e49b14ef"
|
|
1787
|
+
),
|
|
1788
|
+
launchBlock: 2344809,
|
|
1789
|
+
// must be same order as poolKey token0 and token1
|
|
1790
|
+
depositTokens: [
|
|
1791
|
+
Global.getDefaultTokens().find((t) => t.symbol === "xsBTC")!,
|
|
1792
|
+
Global.getDefaultTokens().find((t) => t.symbol === "solvBTC")!,
|
|
1793
|
+
],
|
|
1794
|
+
additionalInfo: {
|
|
1795
|
+
...xSTRKSTRK.additionalInfo,
|
|
1796
|
+
quoteAsset: Global.getDefaultTokens().find((t) => t.symbol === "solvBTC")!,
|
|
1797
|
+
lstContract: Global.getDefaultTokens().find((t) => t.symbol === "xsBTC")!.address,
|
|
1798
|
+
},
|
|
1799
|
+
faqs: getLSTFAQs("xsBTC"),
|
|
1800
|
+
points: [],
|
|
1801
|
+
contractDetails: [],
|
|
1802
|
+
investmentSteps: []
|
|
1803
|
+
},
|
|
1804
|
+
];
|
|
1805
|
+
|
|
1729
1806
|
const ETHUSDCRe7Strategy: IStrategyMetadata<CLVaultStrategySettings> = {
|
|
1730
1807
|
...xSTRKSTRK,
|
|
1731
1808
|
name: "Ekubo ETH/USDC",
|
|
@@ -1733,12 +1810,14 @@ const ETHUSDCRe7Strategy: IStrategyMetadata<CLVaultStrategySettings> = {
|
|
|
1733
1810
|
address: ContractAddr.from(
|
|
1734
1811
|
"0x160d8fa4569ef6a12e6bf47cb943d7b5ebba8a41a69a14c1d943050ba5ff947"
|
|
1735
1812
|
),
|
|
1736
|
-
launchBlock:
|
|
1813
|
+
launchBlock: 1504232,
|
|
1737
1814
|
// must be same order as poolKey token0 and token1
|
|
1738
1815
|
depositTokens: [
|
|
1739
1816
|
Global.getDefaultTokens().find((t) => t.symbol === "ETH")!,
|
|
1740
1817
|
Global.getDefaultTokens().find((t) => t.symbol === "USDC")!
|
|
1741
1818
|
],
|
|
1819
|
+
apyMethodology:
|
|
1820
|
+
"APY based on 7-day historical performance, including fees and rewards.",
|
|
1742
1821
|
additionalInfo: {
|
|
1743
1822
|
newBounds: "Managed by Re7",
|
|
1744
1823
|
truePrice: 1,
|
|
@@ -1773,7 +1852,7 @@ const RE7Strategies: IStrategyMetadata<CLVaultStrategySettings>[] = [
|
|
|
1773
1852
|
address: ContractAddr.from(
|
|
1774
1853
|
"0x3a4f8debaf12af97bb911099bc011d63d6c208d4c5ba8e15d7f437785b0aaa2"
|
|
1775
1854
|
),
|
|
1776
|
-
launchBlock:
|
|
1855
|
+
launchBlock: 1506139,
|
|
1777
1856
|
// must be same order as poolKey token0 and token1
|
|
1778
1857
|
depositTokens: [
|
|
1779
1858
|
Global.getDefaultTokens().find((t) => t.symbol === "USDC")!,
|
|
@@ -1788,7 +1867,7 @@ const RE7Strategies: IStrategyMetadata<CLVaultStrategySettings>[] = [
|
|
|
1788
1867
|
address: ContractAddr.from(
|
|
1789
1868
|
"0x351b36d0d9d8b40010658825adeeddb1397436cd41acd0ff6c6e23aaa8b5b30"
|
|
1790
1869
|
),
|
|
1791
|
-
launchBlock:
|
|
1870
|
+
launchBlock: 1504079,
|
|
1792
1871
|
// must be same order as poolKey token0 and token1
|
|
1793
1872
|
depositTokens: [
|
|
1794
1873
|
Global.getDefaultTokens().find((t) => t.symbol === "STRK")!,
|
|
@@ -1803,7 +1882,7 @@ const RE7Strategies: IStrategyMetadata<CLVaultStrategySettings>[] = [
|
|
|
1803
1882
|
address: ContractAddr.from(
|
|
1804
1883
|
"0x4ce3024b0ee879009112d7b0e073f8a87153dd35b029347d4247ffe48d28f51"
|
|
1805
1884
|
),
|
|
1806
|
-
launchBlock:
|
|
1885
|
+
launchBlock: 1504149,
|
|
1807
1886
|
// must be same order as poolKey token0 and token1
|
|
1808
1887
|
depositTokens: [
|
|
1809
1888
|
Global.getDefaultTokens().find((t) => t.symbol === "STRK")!,
|
|
@@ -1818,7 +1897,7 @@ const RE7Strategies: IStrategyMetadata<CLVaultStrategySettings>[] = [
|
|
|
1818
1897
|
address: ContractAddr.from(
|
|
1819
1898
|
"0x2bcaef2eb7706875a5fdc6853dd961a0590f850bc3a031c59887189b5e84ba1"
|
|
1820
1899
|
),
|
|
1821
|
-
launchBlock:
|
|
1900
|
+
launchBlock: 1506144,
|
|
1822
1901
|
// must be same order as poolKey token0 and token1
|
|
1823
1902
|
depositTokens: [
|
|
1824
1903
|
Global.getDefaultTokens().find((t) => t.symbol === "WBTC")!,
|
|
@@ -1848,7 +1927,7 @@ const RE7Strategies: IStrategyMetadata<CLVaultStrategySettings>[] = [
|
|
|
1848
1927
|
address: ContractAddr.from(
|
|
1849
1928
|
"0x1c9232b8186d9317652f05055615f18a120c2ad9e5ee96c39e031c257fb945b"
|
|
1850
1929
|
),
|
|
1851
|
-
launchBlock:
|
|
1930
|
+
launchBlock: 1506145,
|
|
1852
1931
|
// must be same order as poolKey token0 and token1
|
|
1853
1932
|
depositTokens: [
|
|
1854
1933
|
Global.getDefaultTokens().find((t) => t.symbol === "WBTC")!,
|
|
@@ -1863,7 +1942,7 @@ const RE7Strategies: IStrategyMetadata<CLVaultStrategySettings>[] = [
|
|
|
1863
1942
|
address: ContractAddr.from(
|
|
1864
1943
|
"0x1248e385c23a929a015ec298a26560fa7745bbd6e41a886550e337b02714b1b"
|
|
1865
1944
|
),
|
|
1866
|
-
launchBlock:
|
|
1945
|
+
launchBlock: 1506147,
|
|
1867
1946
|
// must be same order as poolKey token0 and token1
|
|
1868
1947
|
depositTokens: [
|
|
1869
1948
|
Global.getDefaultTokens().find((t) => t.symbol === "WBTC")!,
|
|
@@ -1877,7 +1956,7 @@ const RE7Strategies: IStrategyMetadata<CLVaultStrategySettings>[] = [
|
|
|
1877
1956
|
* Represents the Ekubo CL Vault Strategies.
|
|
1878
1957
|
*/
|
|
1879
1958
|
export const EkuboCLVaultStrategies: IStrategyMetadata<CLVaultStrategySettings>[] = [
|
|
1880
|
-
|
|
1959
|
+
...[lstStrategies[0]],
|
|
1881
1960
|
...RE7Strategies,
|
|
1882
1961
|
];
|
|
1883
1962
|
|
|
@@ -1916,9 +1995,9 @@ EkuboCLVaultStrategies.forEach((s) => {
|
|
|
1916
1995
|
<div style={{display: "flex", flexDirection: "column", gap: "10px", color: 'var(--chakra-colors-text_secondary)'}}>
|
|
1917
1996
|
<p style={{}}>1. During withdrawal, you may receive either or both tokens depending
|
|
1918
1997
|
on market conditions and prevailing prices.</p>
|
|
1919
|
-
{s.
|
|
1998
|
+
{s.additionalInfo.lstContract && <p style={{}}>
|
|
1920
1999
|
2. Sometimes you might see a negative APY — this is usually not a big
|
|
1921
|
-
deal. It happens when
|
|
2000
|
+
deal. It happens when {s.name.split(" ")[1].split('/')[0]}'s price drops on DEXes, but things
|
|
1922
2001
|
typically bounce back within a few days or a week.
|
|
1923
2002
|
</p>}
|
|
1924
2003
|
</div>
|
|
@@ -10,6 +10,7 @@ import VesuPoolIDs from "@/data/vesu_pools.json";
|
|
|
10
10
|
import { getAPIUsingHeadlessBrowser } from "@/node/headless";
|
|
11
11
|
import { Global } from "@/global";
|
|
12
12
|
import { VESU_REWARDS_CONTRACT } from "@/modules/harvests";
|
|
13
|
+
import { ENDPOINTS } from "../constants";
|
|
13
14
|
|
|
14
15
|
interface VesuPoolsInfo { pools: any[]; isErrorPoolsAPI: boolean };
|
|
15
16
|
|
|
@@ -350,7 +351,7 @@ export class VesuAdapter extends BaseAdapter {
|
|
|
350
351
|
let pools: any[] = [];
|
|
351
352
|
try {
|
|
352
353
|
const data = await getAPIUsingHeadlessBrowser(
|
|
353
|
-
|
|
354
|
+
`${ENDPOINTS.VESU_BASE}/pools`
|
|
354
355
|
);
|
|
355
356
|
pools = data.data;
|
|
356
357
|
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
import { getAPIUsingHeadlessBrowser } from "@/node/headless";
|
|
28
28
|
import { VesuHarvests } from "@/modules/harvests";
|
|
29
29
|
import VesuPoolIDs from "@/data/vesu_pools.json";
|
|
30
|
-
import { COMMON_CONTRACTS } from "./constants";
|
|
30
|
+
import { COMMON_CONTRACTS, ENDPOINTS } from "./constants";
|
|
31
31
|
|
|
32
32
|
interface PoolProps {
|
|
33
33
|
pool_id: ContractAddr;
|
|
@@ -223,7 +223,7 @@ export class VesuRebalance extends BaseStrategy<
|
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
static async getAllPossibleVerifiedPools(asset: ContractAddr) {
|
|
226
|
-
const data = await getAPIUsingHeadlessBrowser(
|
|
226
|
+
const data = await getAPIUsingHeadlessBrowser(`${ENDPOINTS.VESU_BASE}/pools`);
|
|
227
227
|
const verifiedPools = data.data.filter((d: any) => d.isVerified);
|
|
228
228
|
const pools = verifiedPools
|
|
229
229
|
.map((p: any) => {
|
|
@@ -490,7 +490,7 @@ export class VesuRebalance extends BaseStrategy<
|
|
|
490
490
|
let pools: any[] = [];
|
|
491
491
|
try {
|
|
492
492
|
const data = await getAPIUsingHeadlessBrowser(
|
|
493
|
-
|
|
493
|
+
`${ENDPOINTS.VESU_BASE}/pools`
|
|
494
494
|
);
|
|
495
495
|
pools = data.data;
|
|
496
496
|
|