@gearbox-protocol/sdk 3.0.1 → 3.0.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/cjs/sdk/chain/chains.js +15 -1
- package/dist/cjs/sdk/constants/address-provider.js +2 -1
- package/dist/cjs/sdk/constants/addresses.js +8 -4
- package/dist/cjs/sdk/constants/networks.js +9 -4
- package/dist/cjs/sdk/router/RouterV300Contract.js +2 -1
- package/dist/cjs/sdk/sdk-gov-legacy/contracts/contracts.js +74 -37
- package/dist/cjs/sdk/sdk-gov-legacy/tokens/quoted.js +2 -1
- package/dist/cjs/sdk/sdk-gov-legacy/tokens/token.js +4 -2
- package/dist/cjs/sdk/sdk-gov-legacy/tokens/tokenData.js +2 -1
- package/dist/cjs/sdk/sdk-legacy/core/endpoint.js +2 -1
- package/dist/cjs/sdk/sdk-legacy/gearboxRewards/api.js +26 -26
- package/dist/esm/sdk/chain/chains.js +16 -1
- package/dist/esm/sdk/constants/address-provider.js +2 -1
- package/dist/esm/sdk/constants/addresses.js +8 -4
- package/dist/esm/sdk/constants/networks.js +9 -4
- package/dist/esm/sdk/router/RouterV300Contract.js +2 -1
- package/dist/esm/sdk/sdk-gov-legacy/contracts/contracts.js +74 -37
- package/dist/esm/sdk/sdk-gov-legacy/tokens/quoted.js +2 -1
- package/dist/esm/sdk/sdk-gov-legacy/tokens/token.js +4 -2
- package/dist/esm/sdk/sdk-gov-legacy/tokens/tokenData.js +2 -1
- package/dist/esm/sdk/sdk-legacy/core/endpoint.js +2 -1
- package/dist/esm/sdk/sdk-legacy/gearboxRewards/api.js +26 -26
- package/dist/types/sdk/chain/chains.d.ts +2 -2
- package/package.json +1 -1
|
@@ -40,7 +40,8 @@ const SUPPORTED_NETWORKS = [
|
|
|
40
40
|
"MegaETH",
|
|
41
41
|
"Monad",
|
|
42
42
|
"Berachain",
|
|
43
|
-
"Avalanche"
|
|
43
|
+
"Avalanche",
|
|
44
|
+
"BNB"
|
|
44
45
|
];
|
|
45
46
|
const NetworkType = import_zod.z.enum(SUPPORTED_NETWORKS);
|
|
46
47
|
function withPublicNode(chain, subdomain) {
|
|
@@ -193,6 +194,19 @@ const chains = {
|
|
|
193
194
|
}
|
|
194
195
|
},
|
|
195
196
|
"avalanche-c-chain-rpc"
|
|
197
|
+
),
|
|
198
|
+
BNB: withPublicNode(
|
|
199
|
+
{
|
|
200
|
+
...import_chains.bsc,
|
|
201
|
+
network: "BNB",
|
|
202
|
+
defaultMarketConfigurators: {},
|
|
203
|
+
isPublic: false,
|
|
204
|
+
wellKnownToken: {
|
|
205
|
+
address: "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d",
|
|
206
|
+
symbol: "USDC"
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
"bsc-rpc"
|
|
196
210
|
)
|
|
197
211
|
};
|
|
198
212
|
function getChain(chainIdOrNetworkType) {
|
|
@@ -101,7 +101,8 @@ const ADDRESS_PROVIDER = {
|
|
|
101
101
|
MegaETH: import_addresses.NOT_DEPLOYED,
|
|
102
102
|
Monad: import_addresses.NOT_DEPLOYED,
|
|
103
103
|
Berachain: import_addresses.NOT_DEPLOYED,
|
|
104
|
-
Avalanche: import_addresses.NOT_DEPLOYED
|
|
104
|
+
Avalanche: import_addresses.NOT_DEPLOYED,
|
|
105
|
+
BNB: import_addresses.NOT_DEPLOYED
|
|
105
106
|
};
|
|
106
107
|
const ADDRESS_PROVIDER_V310 = "0xBaB2014Dd88223E168bA06911c06df638311a097";
|
|
107
108
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -40,7 +40,8 @@ const TIMELOCK = {
|
|
|
40
40
|
MegaETH: NOT_DEPLOYED,
|
|
41
41
|
Monad: NOT_DEPLOYED,
|
|
42
42
|
Berachain: NOT_DEPLOYED,
|
|
43
|
-
Avalanche: NOT_DEPLOYED
|
|
43
|
+
Avalanche: NOT_DEPLOYED,
|
|
44
|
+
BNB: NOT_DEPLOYED
|
|
44
45
|
};
|
|
45
46
|
const GEARBOX_MULTISIG = {
|
|
46
47
|
Mainnet: "0xA7D5DDc1b8557914F158076b228AA91eF613f1D5",
|
|
@@ -52,7 +53,8 @@ const GEARBOX_MULTISIG = {
|
|
|
52
53
|
MegaETH: NOT_DEPLOYED,
|
|
53
54
|
Monad: NOT_DEPLOYED,
|
|
54
55
|
Berachain: NOT_DEPLOYED,
|
|
55
|
-
Avalanche: NOT_DEPLOYED
|
|
56
|
+
Avalanche: NOT_DEPLOYED,
|
|
57
|
+
BNB: NOT_DEPLOYED
|
|
56
58
|
};
|
|
57
59
|
const GEARBOX_RISK_CURATORS = {
|
|
58
60
|
Mainnet: [TIMELOCK.Mainnet],
|
|
@@ -64,7 +66,8 @@ const GEARBOX_RISK_CURATORS = {
|
|
|
64
66
|
MegaETH: [],
|
|
65
67
|
Monad: [],
|
|
66
68
|
Berachain: [],
|
|
67
|
-
Avalanche: []
|
|
69
|
+
Avalanche: [],
|
|
70
|
+
BNB: []
|
|
68
71
|
};
|
|
69
72
|
const DEPRECIATED_POOLS = {
|
|
70
73
|
Mainnet: {
|
|
@@ -78,7 +81,8 @@ const DEPRECIATED_POOLS = {
|
|
|
78
81
|
MegaETH: {},
|
|
79
82
|
Monad: {},
|
|
80
83
|
Berachain: {},
|
|
81
|
-
Avalanche: {}
|
|
84
|
+
Avalanche: {},
|
|
85
|
+
BNB: {}
|
|
82
86
|
};
|
|
83
87
|
// Annotate the CommonJS export names for ESM import in node:
|
|
84
88
|
0 && (module.exports = {
|
|
@@ -37,7 +37,9 @@ const ADDRESS_PROVIDER_BLOCK = {
|
|
|
37
37
|
// arbitrary not deployed yet
|
|
38
38
|
Berachain: 2788903n,
|
|
39
39
|
// arbitrary not deployed yet
|
|
40
|
-
Avalanche: 31594758n
|
|
40
|
+
Avalanche: 31594758n,
|
|
41
|
+
// arbitrary not deployed yet
|
|
42
|
+
BNB: 48553569n
|
|
41
43
|
// arbitrary not deployed yet
|
|
42
44
|
};
|
|
43
45
|
const BLOCK_DURATION_BY_NETWORK = {
|
|
@@ -52,7 +54,8 @@ const BLOCK_DURATION_BY_NETWORK = {
|
|
|
52
54
|
Monad: 1,
|
|
53
55
|
// on testnet
|
|
54
56
|
Berachain: 1.9,
|
|
55
|
-
Avalanche: 1.7
|
|
57
|
+
Avalanche: 1.7,
|
|
58
|
+
BNB: 3
|
|
56
59
|
};
|
|
57
60
|
const RAMP_TIME = 30 * 24 * 60 * 60 * 1.2;
|
|
58
61
|
const RAMP_DURATION_BY_NETWORK = {
|
|
@@ -69,7 +72,8 @@ const RAMP_DURATION_BY_NETWORK = {
|
|
|
69
72
|
),
|
|
70
73
|
Avalanche: BigInt(
|
|
71
74
|
Math.floor(RAMP_TIME / BLOCK_DURATION_BY_NETWORK.Avalanche)
|
|
72
|
-
)
|
|
75
|
+
),
|
|
76
|
+
BNB: BigInt(Math.floor(RAMP_TIME / BLOCK_DURATION_BY_NETWORK.BNB))
|
|
73
77
|
};
|
|
74
78
|
const WEEK = 7 * 24 * 60 * 60;
|
|
75
79
|
const BLOCKS_PER_WEEK_BY_NETWORK = {
|
|
@@ -82,7 +86,8 @@ const BLOCKS_PER_WEEK_BY_NETWORK = {
|
|
|
82
86
|
MegaETH: BigInt(Math.floor(WEEK / BLOCK_DURATION_BY_NETWORK.MegaETH)),
|
|
83
87
|
Monad: BigInt(Math.floor(WEEK / BLOCK_DURATION_BY_NETWORK.Monad)),
|
|
84
88
|
Berachain: BigInt(Math.floor(WEEK / BLOCK_DURATION_BY_NETWORK.Berachain)),
|
|
85
|
-
Avalanche: BigInt(Math.floor(WEEK / BLOCK_DURATION_BY_NETWORK.Avalanche))
|
|
89
|
+
Avalanche: BigInt(Math.floor(WEEK / BLOCK_DURATION_BY_NETWORK.Avalanche)),
|
|
90
|
+
BNB: BigInt(Math.floor(WEEK / BLOCK_DURATION_BY_NETWORK.BNB))
|
|
86
91
|
};
|
|
87
92
|
// Annotate the CommonJS export names for ESM import in node:
|
|
88
93
|
0 && (module.exports = {
|
|
@@ -298,7 +298,8 @@ class RouterV300Contract extends import_AbstractRouterContract.AbstractRouterCon
|
|
|
298
298
|
MegaETH: "0x0",
|
|
299
299
|
Monad: "0x0",
|
|
300
300
|
Berachain: "0x0",
|
|
301
|
-
Avalanche: "0x0"
|
|
301
|
+
Avalanche: "0x0",
|
|
302
|
+
BNB: "0x0"
|
|
302
303
|
};
|
|
303
304
|
const pendleRouter = PENDLE_ROUTER_BY_NETWORK[this.sdk.provider.networkType];
|
|
304
305
|
const pendleAdapter = cm.creditManager.adapters.mustGet(pendleRouter);
|
|
@@ -830,7 +830,8 @@ const contractsByNetwork = {
|
|
|
830
830
|
Avalanche: {},
|
|
831
831
|
MegaETH: {},
|
|
832
832
|
Monad: {},
|
|
833
|
-
Berachain: {}
|
|
833
|
+
Berachain: {},
|
|
834
|
+
BNB: {}
|
|
834
835
|
};
|
|
835
836
|
const UNISWAP_V3_QUOTER = "0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6";
|
|
836
837
|
const CAMELOT_V3_QUOTER = "0x0Fc73040b26E9bC8514fA028D998E73A254Fa76E";
|
|
@@ -937,7 +938,8 @@ const contractParams = {
|
|
|
937
938
|
MegaETH: import_constants.NOT_DEPLOYED,
|
|
938
939
|
Monad: import_constants.NOT_DEPLOYED,
|
|
939
940
|
Berachain: import_constants.NOT_DEPLOYED,
|
|
940
|
-
Avalanche: import_constants.NOT_DEPLOYED
|
|
941
|
+
Avalanche: import_constants.NOT_DEPLOYED,
|
|
942
|
+
BNB: import_constants.NOT_DEPLOYED
|
|
941
943
|
},
|
|
942
944
|
tokens: ["WETH", "STETH"],
|
|
943
945
|
lpToken: "steCRV"
|
|
@@ -956,7 +958,8 @@ const contractParams = {
|
|
|
956
958
|
MegaETH: import_constants.NOT_DEPLOYED,
|
|
957
959
|
Monad: import_constants.NOT_DEPLOYED,
|
|
958
960
|
Berachain: import_constants.NOT_DEPLOYED,
|
|
959
|
-
Avalanche: import_constants.NOT_DEPLOYED
|
|
961
|
+
Avalanche: import_constants.NOT_DEPLOYED,
|
|
962
|
+
BNB: import_constants.NOT_DEPLOYED
|
|
960
963
|
},
|
|
961
964
|
tokens: ["WETH", "wstETH"],
|
|
962
965
|
lpToken: "wstETHCRV"
|
|
@@ -975,7 +978,8 @@ const contractParams = {
|
|
|
975
978
|
MegaETH: import_constants.NOT_DEPLOYED,
|
|
976
979
|
Monad: import_constants.NOT_DEPLOYED,
|
|
977
980
|
Berachain: import_constants.NOT_DEPLOYED,
|
|
978
|
-
Avalanche: import_constants.NOT_DEPLOYED
|
|
981
|
+
Avalanche: import_constants.NOT_DEPLOYED,
|
|
982
|
+
BNB: import_constants.NOT_DEPLOYED
|
|
979
983
|
},
|
|
980
984
|
tokens: ["GEAR", "WETH"],
|
|
981
985
|
lpToken: "GEAR"
|
|
@@ -1506,7 +1510,8 @@ const contractParams = {
|
|
|
1506
1510
|
MegaETH: import_constants.NOT_DEPLOYED,
|
|
1507
1511
|
Monad: import_constants.NOT_DEPLOYED,
|
|
1508
1512
|
Berachain: import_constants.NOT_DEPLOYED,
|
|
1509
|
-
Avalanche: import_constants.NOT_DEPLOYED
|
|
1513
|
+
Avalanche: import_constants.NOT_DEPLOYED,
|
|
1514
|
+
BNB: import_constants.NOT_DEPLOYED
|
|
1510
1515
|
}
|
|
1511
1516
|
}
|
|
1512
1517
|
]
|
|
@@ -1529,7 +1534,8 @@ const contractParams = {
|
|
|
1529
1534
|
MegaETH: import_constants.NOT_DEPLOYED,
|
|
1530
1535
|
Monad: import_constants.NOT_DEPLOYED,
|
|
1531
1536
|
Berachain: import_constants.NOT_DEPLOYED,
|
|
1532
|
-
Avalanche: import_constants.NOT_DEPLOYED
|
|
1537
|
+
Avalanche: import_constants.NOT_DEPLOYED,
|
|
1538
|
+
BNB: import_constants.NOT_DEPLOYED
|
|
1533
1539
|
}
|
|
1534
1540
|
}
|
|
1535
1541
|
]
|
|
@@ -1552,7 +1558,8 @@ const contractParams = {
|
|
|
1552
1558
|
MegaETH: import_constants.NOT_DEPLOYED,
|
|
1553
1559
|
Monad: import_constants.NOT_DEPLOYED,
|
|
1554
1560
|
Berachain: import_constants.NOT_DEPLOYED,
|
|
1555
|
-
Avalanche: import_constants.NOT_DEPLOYED
|
|
1561
|
+
Avalanche: import_constants.NOT_DEPLOYED,
|
|
1562
|
+
BNB: import_constants.NOT_DEPLOYED
|
|
1556
1563
|
}
|
|
1557
1564
|
}
|
|
1558
1565
|
]
|
|
@@ -1575,7 +1582,8 @@ const contractParams = {
|
|
|
1575
1582
|
MegaETH: import_constants.NOT_DEPLOYED,
|
|
1576
1583
|
Monad: import_constants.NOT_DEPLOYED,
|
|
1577
1584
|
Berachain: import_constants.NOT_DEPLOYED,
|
|
1578
|
-
Avalanche: import_constants.NOT_DEPLOYED
|
|
1585
|
+
Avalanche: import_constants.NOT_DEPLOYED,
|
|
1586
|
+
BNB: import_constants.NOT_DEPLOYED
|
|
1579
1587
|
}
|
|
1580
1588
|
}
|
|
1581
1589
|
]
|
|
@@ -1597,7 +1605,8 @@ const contractParams = {
|
|
|
1597
1605
|
MegaETH: import_constants.NOT_DEPLOYED,
|
|
1598
1606
|
Monad: import_constants.NOT_DEPLOYED,
|
|
1599
1607
|
Berachain: import_constants.NOT_DEPLOYED,
|
|
1600
|
-
Avalanche: import_constants.NOT_DEPLOYED
|
|
1608
|
+
Avalanche: import_constants.NOT_DEPLOYED,
|
|
1609
|
+
BNB: import_constants.NOT_DEPLOYED
|
|
1601
1610
|
}
|
|
1602
1611
|
}
|
|
1603
1612
|
]
|
|
@@ -1619,7 +1628,8 @@ const contractParams = {
|
|
|
1619
1628
|
MegaETH: import_constants.NOT_DEPLOYED,
|
|
1620
1629
|
Monad: import_constants.NOT_DEPLOYED,
|
|
1621
1630
|
Berachain: import_constants.NOT_DEPLOYED,
|
|
1622
|
-
Avalanche: import_constants.NOT_DEPLOYED
|
|
1631
|
+
Avalanche: import_constants.NOT_DEPLOYED,
|
|
1632
|
+
BNB: import_constants.NOT_DEPLOYED
|
|
1623
1633
|
}
|
|
1624
1634
|
}
|
|
1625
1635
|
]
|
|
@@ -1648,7 +1658,8 @@ const contractParams = {
|
|
|
1648
1658
|
MegaETH: import_constants.NOT_DEPLOYED,
|
|
1649
1659
|
Monad: import_constants.NOT_DEPLOYED,
|
|
1650
1660
|
Berachain: import_constants.NOT_DEPLOYED,
|
|
1651
|
-
Avalanche: import_constants.NOT_DEPLOYED
|
|
1661
|
+
Avalanche: import_constants.NOT_DEPLOYED,
|
|
1662
|
+
BNB: import_constants.NOT_DEPLOYED
|
|
1652
1663
|
}
|
|
1653
1664
|
}
|
|
1654
1665
|
]
|
|
@@ -1670,7 +1681,8 @@ const contractParams = {
|
|
|
1670
1681
|
MegaETH: import_constants.NOT_DEPLOYED,
|
|
1671
1682
|
Monad: import_constants.NOT_DEPLOYED,
|
|
1672
1683
|
Berachain: import_constants.NOT_DEPLOYED,
|
|
1673
|
-
Avalanche: import_constants.NOT_DEPLOYED
|
|
1684
|
+
Avalanche: import_constants.NOT_DEPLOYED,
|
|
1685
|
+
BNB: import_constants.NOT_DEPLOYED
|
|
1674
1686
|
}
|
|
1675
1687
|
}
|
|
1676
1688
|
]
|
|
@@ -1692,7 +1704,8 @@ const contractParams = {
|
|
|
1692
1704
|
MegaETH: import_constants.NOT_DEPLOYED,
|
|
1693
1705
|
Monad: import_constants.NOT_DEPLOYED,
|
|
1694
1706
|
Berachain: import_constants.NOT_DEPLOYED,
|
|
1695
|
-
Avalanche: import_constants.NOT_DEPLOYED
|
|
1707
|
+
Avalanche: import_constants.NOT_DEPLOYED,
|
|
1708
|
+
BNB: import_constants.NOT_DEPLOYED
|
|
1696
1709
|
}
|
|
1697
1710
|
}
|
|
1698
1711
|
]
|
|
@@ -1714,7 +1727,8 @@ const contractParams = {
|
|
|
1714
1727
|
MegaETH: import_constants.NOT_DEPLOYED,
|
|
1715
1728
|
Monad: import_constants.NOT_DEPLOYED,
|
|
1716
1729
|
Berachain: import_constants.NOT_DEPLOYED,
|
|
1717
|
-
Avalanche: import_constants.NOT_DEPLOYED
|
|
1730
|
+
Avalanche: import_constants.NOT_DEPLOYED,
|
|
1731
|
+
BNB: import_constants.NOT_DEPLOYED
|
|
1718
1732
|
}
|
|
1719
1733
|
}
|
|
1720
1734
|
]
|
|
@@ -1736,7 +1750,8 @@ const contractParams = {
|
|
|
1736
1750
|
MegaETH: import_constants.NOT_DEPLOYED,
|
|
1737
1751
|
Monad: import_constants.NOT_DEPLOYED,
|
|
1738
1752
|
Berachain: import_constants.NOT_DEPLOYED,
|
|
1739
|
-
Avalanche: import_constants.NOT_DEPLOYED
|
|
1753
|
+
Avalanche: import_constants.NOT_DEPLOYED,
|
|
1754
|
+
BNB: import_constants.NOT_DEPLOYED
|
|
1740
1755
|
}
|
|
1741
1756
|
}
|
|
1742
1757
|
]
|
|
@@ -1758,7 +1773,8 @@ const contractParams = {
|
|
|
1758
1773
|
MegaETH: import_constants.NOT_DEPLOYED,
|
|
1759
1774
|
Monad: import_constants.NOT_DEPLOYED,
|
|
1760
1775
|
Berachain: import_constants.NOT_DEPLOYED,
|
|
1761
|
-
Avalanche: import_constants.NOT_DEPLOYED
|
|
1776
|
+
Avalanche: import_constants.NOT_DEPLOYED,
|
|
1777
|
+
BNB: import_constants.NOT_DEPLOYED
|
|
1762
1778
|
}
|
|
1763
1779
|
}
|
|
1764
1780
|
]
|
|
@@ -1780,7 +1796,8 @@ const contractParams = {
|
|
|
1780
1796
|
MegaETH: import_constants.NOT_DEPLOYED,
|
|
1781
1797
|
Monad: import_constants.NOT_DEPLOYED,
|
|
1782
1798
|
Berachain: import_constants.NOT_DEPLOYED,
|
|
1783
|
-
Avalanche: import_constants.NOT_DEPLOYED
|
|
1799
|
+
Avalanche: import_constants.NOT_DEPLOYED,
|
|
1800
|
+
BNB: import_constants.NOT_DEPLOYED
|
|
1784
1801
|
}
|
|
1785
1802
|
}
|
|
1786
1803
|
]
|
|
@@ -1802,7 +1819,8 @@ const contractParams = {
|
|
|
1802
1819
|
MegaETH: import_constants.NOT_DEPLOYED,
|
|
1803
1820
|
Monad: import_constants.NOT_DEPLOYED,
|
|
1804
1821
|
Berachain: import_constants.NOT_DEPLOYED,
|
|
1805
|
-
Avalanche: import_constants.NOT_DEPLOYED
|
|
1822
|
+
Avalanche: import_constants.NOT_DEPLOYED,
|
|
1823
|
+
BNB: import_constants.NOT_DEPLOYED
|
|
1806
1824
|
}
|
|
1807
1825
|
}
|
|
1808
1826
|
]
|
|
@@ -1841,7 +1859,8 @@ const contractParams = {
|
|
|
1841
1859
|
MegaETH: import_constants.NOT_DEPLOYED,
|
|
1842
1860
|
Monad: import_constants.NOT_DEPLOYED,
|
|
1843
1861
|
Berachain: import_constants.NOT_DEPLOYED,
|
|
1844
|
-
Avalanche: import_constants.NOT_DEPLOYED
|
|
1862
|
+
Avalanche: import_constants.NOT_DEPLOYED,
|
|
1863
|
+
BNB: import_constants.NOT_DEPLOYED
|
|
1845
1864
|
}
|
|
1846
1865
|
}
|
|
1847
1866
|
]
|
|
@@ -1863,7 +1882,8 @@ const contractParams = {
|
|
|
1863
1882
|
MegaETH: import_constants.NOT_DEPLOYED,
|
|
1864
1883
|
Monad: import_constants.NOT_DEPLOYED,
|
|
1865
1884
|
Berachain: import_constants.NOT_DEPLOYED,
|
|
1866
|
-
Avalanche: import_constants.NOT_DEPLOYED
|
|
1885
|
+
Avalanche: import_constants.NOT_DEPLOYED,
|
|
1886
|
+
BNB: import_constants.NOT_DEPLOYED
|
|
1867
1887
|
}
|
|
1868
1888
|
}
|
|
1869
1889
|
]
|
|
@@ -1885,7 +1905,8 @@ const contractParams = {
|
|
|
1885
1905
|
MegaETH: import_constants.NOT_DEPLOYED,
|
|
1886
1906
|
Monad: import_constants.NOT_DEPLOYED,
|
|
1887
1907
|
Berachain: import_constants.NOT_DEPLOYED,
|
|
1888
|
-
Avalanche: import_constants.NOT_DEPLOYED
|
|
1908
|
+
Avalanche: import_constants.NOT_DEPLOYED,
|
|
1909
|
+
BNB: import_constants.NOT_DEPLOYED
|
|
1889
1910
|
}
|
|
1890
1911
|
},
|
|
1891
1912
|
{
|
|
@@ -1899,7 +1920,8 @@ const contractParams = {
|
|
|
1899
1920
|
MegaETH: import_constants.NOT_DEPLOYED,
|
|
1900
1921
|
Monad: import_constants.NOT_DEPLOYED,
|
|
1901
1922
|
Berachain: import_constants.NOT_DEPLOYED,
|
|
1902
|
-
Avalanche: import_constants.NOT_DEPLOYED
|
|
1923
|
+
Avalanche: import_constants.NOT_DEPLOYED,
|
|
1924
|
+
BNB: import_constants.NOT_DEPLOYED
|
|
1903
1925
|
}
|
|
1904
1926
|
}
|
|
1905
1927
|
]
|
|
@@ -1921,7 +1943,8 @@ const contractParams = {
|
|
|
1921
1943
|
MegaETH: import_constants.NOT_DEPLOYED,
|
|
1922
1944
|
Monad: import_constants.NOT_DEPLOYED,
|
|
1923
1945
|
Berachain: import_constants.NOT_DEPLOYED,
|
|
1924
|
-
Avalanche: import_constants.NOT_DEPLOYED
|
|
1946
|
+
Avalanche: import_constants.NOT_DEPLOYED,
|
|
1947
|
+
BNB: import_constants.NOT_DEPLOYED
|
|
1925
1948
|
}
|
|
1926
1949
|
},
|
|
1927
1950
|
{
|
|
@@ -1935,7 +1958,8 @@ const contractParams = {
|
|
|
1935
1958
|
MegaETH: import_constants.NOT_DEPLOYED,
|
|
1936
1959
|
Monad: import_constants.NOT_DEPLOYED,
|
|
1937
1960
|
Berachain: import_constants.NOT_DEPLOYED,
|
|
1938
|
-
Avalanche: import_constants.NOT_DEPLOYED
|
|
1961
|
+
Avalanche: import_constants.NOT_DEPLOYED,
|
|
1962
|
+
BNB: import_constants.NOT_DEPLOYED
|
|
1939
1963
|
}
|
|
1940
1964
|
}
|
|
1941
1965
|
]
|
|
@@ -1957,7 +1981,8 @@ const contractParams = {
|
|
|
1957
1981
|
MegaETH: import_constants.NOT_DEPLOYED,
|
|
1958
1982
|
Monad: import_constants.NOT_DEPLOYED,
|
|
1959
1983
|
Berachain: import_constants.NOT_DEPLOYED,
|
|
1960
|
-
Avalanche: import_constants.NOT_DEPLOYED
|
|
1984
|
+
Avalanche: import_constants.NOT_DEPLOYED,
|
|
1985
|
+
BNB: import_constants.NOT_DEPLOYED
|
|
1961
1986
|
}
|
|
1962
1987
|
},
|
|
1963
1988
|
{
|
|
@@ -1971,7 +1996,8 @@ const contractParams = {
|
|
|
1971
1996
|
MegaETH: import_constants.NOT_DEPLOYED,
|
|
1972
1997
|
Monad: import_constants.NOT_DEPLOYED,
|
|
1973
1998
|
Berachain: import_constants.NOT_DEPLOYED,
|
|
1974
|
-
Avalanche: import_constants.NOT_DEPLOYED
|
|
1999
|
+
Avalanche: import_constants.NOT_DEPLOYED,
|
|
2000
|
+
BNB: import_constants.NOT_DEPLOYED
|
|
1975
2001
|
}
|
|
1976
2002
|
}
|
|
1977
2003
|
]
|
|
@@ -1993,7 +2019,8 @@ const contractParams = {
|
|
|
1993
2019
|
MegaETH: import_constants.NOT_DEPLOYED,
|
|
1994
2020
|
Monad: import_constants.NOT_DEPLOYED,
|
|
1995
2021
|
Berachain: import_constants.NOT_DEPLOYED,
|
|
1996
|
-
Avalanche: import_constants.NOT_DEPLOYED
|
|
2022
|
+
Avalanche: import_constants.NOT_DEPLOYED,
|
|
2023
|
+
BNB: import_constants.NOT_DEPLOYED
|
|
1997
2024
|
}
|
|
1998
2025
|
},
|
|
1999
2026
|
{
|
|
@@ -2007,7 +2034,8 @@ const contractParams = {
|
|
|
2007
2034
|
MegaETH: import_constants.NOT_DEPLOYED,
|
|
2008
2035
|
Monad: import_constants.NOT_DEPLOYED,
|
|
2009
2036
|
Berachain: import_constants.NOT_DEPLOYED,
|
|
2010
|
-
Avalanche: import_constants.NOT_DEPLOYED
|
|
2037
|
+
Avalanche: import_constants.NOT_DEPLOYED,
|
|
2038
|
+
BNB: import_constants.NOT_DEPLOYED
|
|
2011
2039
|
}
|
|
2012
2040
|
}
|
|
2013
2041
|
]
|
|
@@ -2029,7 +2057,8 @@ const contractParams = {
|
|
|
2029
2057
|
MegaETH: import_constants.NOT_DEPLOYED,
|
|
2030
2058
|
Monad: import_constants.NOT_DEPLOYED,
|
|
2031
2059
|
Berachain: import_constants.NOT_DEPLOYED,
|
|
2032
|
-
Avalanche: import_constants.NOT_DEPLOYED
|
|
2060
|
+
Avalanche: import_constants.NOT_DEPLOYED,
|
|
2061
|
+
BNB: import_constants.NOT_DEPLOYED
|
|
2033
2062
|
}
|
|
2034
2063
|
},
|
|
2035
2064
|
{
|
|
@@ -2043,7 +2072,8 @@ const contractParams = {
|
|
|
2043
2072
|
MegaETH: import_constants.NOT_DEPLOYED,
|
|
2044
2073
|
Monad: import_constants.NOT_DEPLOYED,
|
|
2045
2074
|
Berachain: import_constants.NOT_DEPLOYED,
|
|
2046
|
-
Avalanche: import_constants.NOT_DEPLOYED
|
|
2075
|
+
Avalanche: import_constants.NOT_DEPLOYED,
|
|
2076
|
+
BNB: import_constants.NOT_DEPLOYED
|
|
2047
2077
|
}
|
|
2048
2078
|
}
|
|
2049
2079
|
]
|
|
@@ -2065,7 +2095,8 @@ const contractParams = {
|
|
|
2065
2095
|
MegaETH: import_constants.NOT_DEPLOYED,
|
|
2066
2096
|
Monad: import_constants.NOT_DEPLOYED,
|
|
2067
2097
|
Berachain: import_constants.NOT_DEPLOYED,
|
|
2068
|
-
Avalanche: import_constants.NOT_DEPLOYED
|
|
2098
|
+
Avalanche: import_constants.NOT_DEPLOYED,
|
|
2099
|
+
BNB: import_constants.NOT_DEPLOYED
|
|
2069
2100
|
}
|
|
2070
2101
|
},
|
|
2071
2102
|
{
|
|
@@ -2079,7 +2110,8 @@ const contractParams = {
|
|
|
2079
2110
|
MegaETH: import_constants.NOT_DEPLOYED,
|
|
2080
2111
|
Monad: import_constants.NOT_DEPLOYED,
|
|
2081
2112
|
Berachain: import_constants.NOT_DEPLOYED,
|
|
2082
|
-
Avalanche: import_constants.NOT_DEPLOYED
|
|
2113
|
+
Avalanche: import_constants.NOT_DEPLOYED,
|
|
2114
|
+
BNB: import_constants.NOT_DEPLOYED
|
|
2083
2115
|
}
|
|
2084
2116
|
}
|
|
2085
2117
|
]
|
|
@@ -2101,7 +2133,8 @@ const contractParams = {
|
|
|
2101
2133
|
MegaETH: import_constants.NOT_DEPLOYED,
|
|
2102
2134
|
Monad: import_constants.NOT_DEPLOYED,
|
|
2103
2135
|
Berachain: import_constants.NOT_DEPLOYED,
|
|
2104
|
-
Avalanche: import_constants.NOT_DEPLOYED
|
|
2136
|
+
Avalanche: import_constants.NOT_DEPLOYED,
|
|
2137
|
+
BNB: import_constants.NOT_DEPLOYED
|
|
2105
2138
|
}
|
|
2106
2139
|
},
|
|
2107
2140
|
{
|
|
@@ -2115,7 +2148,8 @@ const contractParams = {
|
|
|
2115
2148
|
MegaETH: import_constants.NOT_DEPLOYED,
|
|
2116
2149
|
Monad: import_constants.NOT_DEPLOYED,
|
|
2117
2150
|
Berachain: import_constants.NOT_DEPLOYED,
|
|
2118
|
-
Avalanche: import_constants.NOT_DEPLOYED
|
|
2151
|
+
Avalanche: import_constants.NOT_DEPLOYED,
|
|
2152
|
+
BNB: import_constants.NOT_DEPLOYED
|
|
2119
2153
|
}
|
|
2120
2154
|
}
|
|
2121
2155
|
]
|
|
@@ -2134,7 +2168,8 @@ const contractParams = {
|
|
|
2134
2168
|
MegaETH: import_constants.NOT_DEPLOYED,
|
|
2135
2169
|
Monad: import_constants.NOT_DEPLOYED,
|
|
2136
2170
|
Berachain: import_constants.NOT_DEPLOYED,
|
|
2137
|
-
Avalanche: import_constants.NOT_DEPLOYED
|
|
2171
|
+
Avalanche: import_constants.NOT_DEPLOYED,
|
|
2172
|
+
BNB: import_constants.NOT_DEPLOYED
|
|
2138
2173
|
},
|
|
2139
2174
|
lpToken: "steCRV"
|
|
2140
2175
|
},
|
|
@@ -2161,7 +2196,8 @@ const contractParams = {
|
|
|
2161
2196
|
MegaETH: import_constants.NOT_DEPLOYED,
|
|
2162
2197
|
Monad: import_constants.NOT_DEPLOYED,
|
|
2163
2198
|
Berachain: import_constants.NOT_DEPLOYED,
|
|
2164
|
-
Avalanche: import_constants.NOT_DEPLOYED
|
|
2199
|
+
Avalanche: import_constants.NOT_DEPLOYED,
|
|
2200
|
+
BNB: import_constants.NOT_DEPLOYED
|
|
2165
2201
|
}
|
|
2166
2202
|
},
|
|
2167
2203
|
BALANCER_V3_ROUTER: {
|
|
@@ -2177,7 +2213,8 @@ const contractParams = {
|
|
|
2177
2213
|
MegaETH: import_constants.NOT_DEPLOYED,
|
|
2178
2214
|
Monad: import_constants.NOT_DEPLOYED,
|
|
2179
2215
|
Berachain: import_constants.NOT_DEPLOYED,
|
|
2180
|
-
Avalanche: import_constants.NOT_DEPLOYED
|
|
2216
|
+
Avalanche: import_constants.NOT_DEPLOYED,
|
|
2217
|
+
BNB: import_constants.NOT_DEPLOYED
|
|
2181
2218
|
}
|
|
2182
2219
|
},
|
|
2183
2220
|
AAVE_V2_LENDING_POOL: {
|
|
@@ -1609,7 +1609,8 @@ const tokenDataByNetwork = {
|
|
|
1609
1609
|
MegaETH: {},
|
|
1610
1610
|
Monad: {},
|
|
1611
1611
|
Berachain: {},
|
|
1612
|
-
Avalanche: {}
|
|
1612
|
+
Avalanche: {},
|
|
1613
|
+
BNB: {}
|
|
1613
1614
|
};
|
|
1614
1615
|
const tickerInfoTokensByNetwork = {
|
|
1615
1616
|
Mainnet: {
|
|
@@ -2005,7 +2006,8 @@ const tickerInfoTokensByNetwork = {
|
|
|
2005
2006
|
MegaETH: {},
|
|
2006
2007
|
Monad: {},
|
|
2007
2008
|
Berachain: {},
|
|
2008
|
-
Avalanche: {}
|
|
2009
|
+
Avalanche: {},
|
|
2010
|
+
BNB: {}
|
|
2009
2011
|
};
|
|
2010
2012
|
const tickerTokensByNetwork = Object.fromEntries(
|
|
2011
2013
|
Object.entries(tickerInfoTokensByNetwork).map(([network, data]) => {
|
|
@@ -39,7 +39,8 @@ const TESTNET_CHAINS = {
|
|
|
39
39
|
MegaETH: 7883,
|
|
40
40
|
Monad: 7884,
|
|
41
41
|
Berachain: 7885,
|
|
42
|
-
Avalanche: 7886
|
|
42
|
+
Avalanche: 7886,
|
|
43
|
+
BNB: 7887
|
|
43
44
|
};
|
|
44
45
|
const CHAINS_BY_ID = import_mappers.TypedObjectUtils.swapKeyValue(TESTNET_CHAINS);
|
|
45
46
|
const MAINNET_BY_TESTNET_ID = import_mappers.TypedObjectUtils.entries(TESTNET_CHAINS).reduce((acc, [n, testnetId]) => {
|
|
@@ -233,32 +233,32 @@ class GearboxRewardsApi {
|
|
|
233
233
|
acc[p.dieselToken] = p.address;
|
|
234
234
|
return acc;
|
|
235
235
|
}, {});
|
|
236
|
-
const extraRewards = (merkleXYZLm || []).reduce(
|
|
237
|
-
(
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
236
|
+
const extraRewards = (merkleXYZLm || []).reduce((acc, chainRewards) => {
|
|
237
|
+
chainRewards.rewards.forEach((reward) => {
|
|
238
|
+
const rewardToken = reward.token.address.toLowerCase();
|
|
239
|
+
reward.breakdowns.forEach((reason) => {
|
|
240
|
+
const poolToken = ((reason.reason || "").split("_").find((part) => part.startsWith("0x")) || "").toLowerCase();
|
|
241
|
+
const pool = poolByItsToken[poolToken];
|
|
242
|
+
const total = (0, import_utils.toBigInt)(reason.amount || 0);
|
|
243
|
+
const claimed = (0, import_utils.toBigInt)(reason.claimed || 0);
|
|
244
|
+
const claimable = import_math.BigIntMath.max(total - claimed, 0n);
|
|
245
|
+
const key = [pool, poolToken, rewardToken].join("_");
|
|
246
|
+
if (pool && claimable > 0n) {
|
|
247
|
+
const prevAmount = acc[key]?.amount || 0n;
|
|
248
|
+
acc[key] = {
|
|
249
|
+
pool,
|
|
250
|
+
poolToken,
|
|
251
|
+
rewardToken,
|
|
252
|
+
rewardTokenSymbol: reward.token.symbol,
|
|
253
|
+
rewardTokenDecimals: reward.token.decimals || 18,
|
|
254
|
+
amount: prevAmount + claimable,
|
|
255
|
+
type: "extraMerkle"
|
|
256
|
+
};
|
|
257
|
+
}
|
|
257
258
|
});
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
);
|
|
259
|
+
});
|
|
260
|
+
return acc;
|
|
261
|
+
}, {});
|
|
262
262
|
const gearboxLmRewards = poolTokens.map((address, i) => {
|
|
263
263
|
const info = baseRewardPoolsInfo[address];
|
|
264
264
|
const rewardToken = currentTokenData[info.symbol];
|
|
@@ -285,7 +285,7 @@ class GearboxRewardsApi {
|
|
|
285
285
|
{ nonZero: [], zero: [] }
|
|
286
286
|
);
|
|
287
287
|
return {
|
|
288
|
-
rewards: [...nonZero, ...extraRewards, zero]
|
|
288
|
+
rewards: [...nonZero, ...Object.values(extraRewards), zero]
|
|
289
289
|
};
|
|
290
290
|
}
|
|
291
291
|
static extractFulfilled(r, reportError, description) {
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
avalanche,
|
|
5
5
|
base,
|
|
6
6
|
berachain,
|
|
7
|
+
bsc,
|
|
7
8
|
mainnet,
|
|
8
9
|
megaethTestnet,
|
|
9
10
|
monadTestnet,
|
|
@@ -21,7 +22,8 @@ const SUPPORTED_NETWORKS = [
|
|
|
21
22
|
"MegaETH",
|
|
22
23
|
"Monad",
|
|
23
24
|
"Berachain",
|
|
24
|
-
"Avalanche"
|
|
25
|
+
"Avalanche",
|
|
26
|
+
"BNB"
|
|
25
27
|
];
|
|
26
28
|
const NetworkType = z.enum(SUPPORTED_NETWORKS);
|
|
27
29
|
function withPublicNode(chain, subdomain) {
|
|
@@ -174,6 +176,19 @@ const chains = {
|
|
|
174
176
|
}
|
|
175
177
|
},
|
|
176
178
|
"avalanche-c-chain-rpc"
|
|
179
|
+
),
|
|
180
|
+
BNB: withPublicNode(
|
|
181
|
+
{
|
|
182
|
+
...bsc,
|
|
183
|
+
network: "BNB",
|
|
184
|
+
defaultMarketConfigurators: {},
|
|
185
|
+
isPublic: false,
|
|
186
|
+
wellKnownToken: {
|
|
187
|
+
address: "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d",
|
|
188
|
+
symbol: "USDC"
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
"bsc-rpc"
|
|
177
192
|
)
|
|
178
193
|
};
|
|
179
194
|
function getChain(chainIdOrNetworkType) {
|
|
@@ -43,7 +43,8 @@ const ADDRESS_PROVIDER = {
|
|
|
43
43
|
MegaETH: NOT_DEPLOYED,
|
|
44
44
|
Monad: NOT_DEPLOYED,
|
|
45
45
|
Berachain: NOT_DEPLOYED,
|
|
46
|
-
Avalanche: NOT_DEPLOYED
|
|
46
|
+
Avalanche: NOT_DEPLOYED,
|
|
47
|
+
BNB: NOT_DEPLOYED
|
|
47
48
|
};
|
|
48
49
|
const ADDRESS_PROVIDER_V310 = "0xBaB2014Dd88223E168bA06911c06df638311a097";
|
|
49
50
|
export {
|
|
@@ -11,7 +11,8 @@ const TIMELOCK = {
|
|
|
11
11
|
MegaETH: NOT_DEPLOYED,
|
|
12
12
|
Monad: NOT_DEPLOYED,
|
|
13
13
|
Berachain: NOT_DEPLOYED,
|
|
14
|
-
Avalanche: NOT_DEPLOYED
|
|
14
|
+
Avalanche: NOT_DEPLOYED,
|
|
15
|
+
BNB: NOT_DEPLOYED
|
|
15
16
|
};
|
|
16
17
|
const GEARBOX_MULTISIG = {
|
|
17
18
|
Mainnet: "0xA7D5DDc1b8557914F158076b228AA91eF613f1D5",
|
|
@@ -23,7 +24,8 @@ const GEARBOX_MULTISIG = {
|
|
|
23
24
|
MegaETH: NOT_DEPLOYED,
|
|
24
25
|
Monad: NOT_DEPLOYED,
|
|
25
26
|
Berachain: NOT_DEPLOYED,
|
|
26
|
-
Avalanche: NOT_DEPLOYED
|
|
27
|
+
Avalanche: NOT_DEPLOYED,
|
|
28
|
+
BNB: NOT_DEPLOYED
|
|
27
29
|
};
|
|
28
30
|
const GEARBOX_RISK_CURATORS = {
|
|
29
31
|
Mainnet: [TIMELOCK.Mainnet],
|
|
@@ -35,7 +37,8 @@ const GEARBOX_RISK_CURATORS = {
|
|
|
35
37
|
MegaETH: [],
|
|
36
38
|
Monad: [],
|
|
37
39
|
Berachain: [],
|
|
38
|
-
Avalanche: []
|
|
40
|
+
Avalanche: [],
|
|
41
|
+
BNB: []
|
|
39
42
|
};
|
|
40
43
|
const DEPRECIATED_POOLS = {
|
|
41
44
|
Mainnet: {
|
|
@@ -49,7 +52,8 @@ const DEPRECIATED_POOLS = {
|
|
|
49
52
|
MegaETH: {},
|
|
50
53
|
Monad: {},
|
|
51
54
|
Berachain: {},
|
|
52
|
-
Avalanche: {}
|
|
55
|
+
Avalanche: {},
|
|
56
|
+
BNB: {}
|
|
53
57
|
};
|
|
54
58
|
export {
|
|
55
59
|
ADDRESS_0X0,
|
|
@@ -12,7 +12,9 @@ const ADDRESS_PROVIDER_BLOCK = {
|
|
|
12
12
|
// arbitrary not deployed yet
|
|
13
13
|
Berachain: 2788903n,
|
|
14
14
|
// arbitrary not deployed yet
|
|
15
|
-
Avalanche: 31594758n
|
|
15
|
+
Avalanche: 31594758n,
|
|
16
|
+
// arbitrary not deployed yet
|
|
17
|
+
BNB: 48553569n
|
|
16
18
|
// arbitrary not deployed yet
|
|
17
19
|
};
|
|
18
20
|
const BLOCK_DURATION_BY_NETWORK = {
|
|
@@ -27,7 +29,8 @@ const BLOCK_DURATION_BY_NETWORK = {
|
|
|
27
29
|
Monad: 1,
|
|
28
30
|
// on testnet
|
|
29
31
|
Berachain: 1.9,
|
|
30
|
-
Avalanche: 1.7
|
|
32
|
+
Avalanche: 1.7,
|
|
33
|
+
BNB: 3
|
|
31
34
|
};
|
|
32
35
|
const RAMP_TIME = 30 * 24 * 60 * 60 * 1.2;
|
|
33
36
|
const RAMP_DURATION_BY_NETWORK = {
|
|
@@ -44,7 +47,8 @@ const RAMP_DURATION_BY_NETWORK = {
|
|
|
44
47
|
),
|
|
45
48
|
Avalanche: BigInt(
|
|
46
49
|
Math.floor(RAMP_TIME / BLOCK_DURATION_BY_NETWORK.Avalanche)
|
|
47
|
-
)
|
|
50
|
+
),
|
|
51
|
+
BNB: BigInt(Math.floor(RAMP_TIME / BLOCK_DURATION_BY_NETWORK.BNB))
|
|
48
52
|
};
|
|
49
53
|
const WEEK = 7 * 24 * 60 * 60;
|
|
50
54
|
const BLOCKS_PER_WEEK_BY_NETWORK = {
|
|
@@ -57,7 +61,8 @@ const BLOCKS_PER_WEEK_BY_NETWORK = {
|
|
|
57
61
|
MegaETH: BigInt(Math.floor(WEEK / BLOCK_DURATION_BY_NETWORK.MegaETH)),
|
|
58
62
|
Monad: BigInt(Math.floor(WEEK / BLOCK_DURATION_BY_NETWORK.Monad)),
|
|
59
63
|
Berachain: BigInt(Math.floor(WEEK / BLOCK_DURATION_BY_NETWORK.Berachain)),
|
|
60
|
-
Avalanche: BigInt(Math.floor(WEEK / BLOCK_DURATION_BY_NETWORK.Avalanche))
|
|
64
|
+
Avalanche: BigInt(Math.floor(WEEK / BLOCK_DURATION_BY_NETWORK.Avalanche)),
|
|
65
|
+
BNB: BigInt(Math.floor(WEEK / BLOCK_DURATION_BY_NETWORK.BNB))
|
|
61
66
|
};
|
|
62
67
|
export {
|
|
63
68
|
ADDRESS_PROVIDER_BLOCK,
|
|
@@ -275,7 +275,8 @@ class RouterV300Contract extends AbstractRouterContract {
|
|
|
275
275
|
MegaETH: "0x0",
|
|
276
276
|
Monad: "0x0",
|
|
277
277
|
Berachain: "0x0",
|
|
278
|
-
Avalanche: "0x0"
|
|
278
|
+
Avalanche: "0x0",
|
|
279
|
+
BNB: "0x0"
|
|
279
280
|
};
|
|
280
281
|
const pendleRouter = PENDLE_ROUTER_BY_NETWORK[this.sdk.provider.networkType];
|
|
281
282
|
const pendleAdapter = cm.creditManager.adapters.mustGet(pendleRouter);
|
|
@@ -793,7 +793,8 @@ const contractsByNetwork = {
|
|
|
793
793
|
Avalanche: {},
|
|
794
794
|
MegaETH: {},
|
|
795
795
|
Monad: {},
|
|
796
|
-
Berachain: {}
|
|
796
|
+
Berachain: {},
|
|
797
|
+
BNB: {}
|
|
797
798
|
};
|
|
798
799
|
const UNISWAP_V3_QUOTER = "0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6";
|
|
799
800
|
const CAMELOT_V3_QUOTER = "0x0Fc73040b26E9bC8514fA028D998E73A254Fa76E";
|
|
@@ -900,7 +901,8 @@ const contractParams = {
|
|
|
900
901
|
MegaETH: NOT_DEPLOYED,
|
|
901
902
|
Monad: NOT_DEPLOYED,
|
|
902
903
|
Berachain: NOT_DEPLOYED,
|
|
903
|
-
Avalanche: NOT_DEPLOYED
|
|
904
|
+
Avalanche: NOT_DEPLOYED,
|
|
905
|
+
BNB: NOT_DEPLOYED
|
|
904
906
|
},
|
|
905
907
|
tokens: ["WETH", "STETH"],
|
|
906
908
|
lpToken: "steCRV"
|
|
@@ -919,7 +921,8 @@ const contractParams = {
|
|
|
919
921
|
MegaETH: NOT_DEPLOYED,
|
|
920
922
|
Monad: NOT_DEPLOYED,
|
|
921
923
|
Berachain: NOT_DEPLOYED,
|
|
922
|
-
Avalanche: NOT_DEPLOYED
|
|
924
|
+
Avalanche: NOT_DEPLOYED,
|
|
925
|
+
BNB: NOT_DEPLOYED
|
|
923
926
|
},
|
|
924
927
|
tokens: ["WETH", "wstETH"],
|
|
925
928
|
lpToken: "wstETHCRV"
|
|
@@ -938,7 +941,8 @@ const contractParams = {
|
|
|
938
941
|
MegaETH: NOT_DEPLOYED,
|
|
939
942
|
Monad: NOT_DEPLOYED,
|
|
940
943
|
Berachain: NOT_DEPLOYED,
|
|
941
|
-
Avalanche: NOT_DEPLOYED
|
|
944
|
+
Avalanche: NOT_DEPLOYED,
|
|
945
|
+
BNB: NOT_DEPLOYED
|
|
942
946
|
},
|
|
943
947
|
tokens: ["GEAR", "WETH"],
|
|
944
948
|
lpToken: "GEAR"
|
|
@@ -1469,7 +1473,8 @@ const contractParams = {
|
|
|
1469
1473
|
MegaETH: NOT_DEPLOYED,
|
|
1470
1474
|
Monad: NOT_DEPLOYED,
|
|
1471
1475
|
Berachain: NOT_DEPLOYED,
|
|
1472
|
-
Avalanche: NOT_DEPLOYED
|
|
1476
|
+
Avalanche: NOT_DEPLOYED,
|
|
1477
|
+
BNB: NOT_DEPLOYED
|
|
1473
1478
|
}
|
|
1474
1479
|
}
|
|
1475
1480
|
]
|
|
@@ -1492,7 +1497,8 @@ const contractParams = {
|
|
|
1492
1497
|
MegaETH: NOT_DEPLOYED,
|
|
1493
1498
|
Monad: NOT_DEPLOYED,
|
|
1494
1499
|
Berachain: NOT_DEPLOYED,
|
|
1495
|
-
Avalanche: NOT_DEPLOYED
|
|
1500
|
+
Avalanche: NOT_DEPLOYED,
|
|
1501
|
+
BNB: NOT_DEPLOYED
|
|
1496
1502
|
}
|
|
1497
1503
|
}
|
|
1498
1504
|
]
|
|
@@ -1515,7 +1521,8 @@ const contractParams = {
|
|
|
1515
1521
|
MegaETH: NOT_DEPLOYED,
|
|
1516
1522
|
Monad: NOT_DEPLOYED,
|
|
1517
1523
|
Berachain: NOT_DEPLOYED,
|
|
1518
|
-
Avalanche: NOT_DEPLOYED
|
|
1524
|
+
Avalanche: NOT_DEPLOYED,
|
|
1525
|
+
BNB: NOT_DEPLOYED
|
|
1519
1526
|
}
|
|
1520
1527
|
}
|
|
1521
1528
|
]
|
|
@@ -1538,7 +1545,8 @@ const contractParams = {
|
|
|
1538
1545
|
MegaETH: NOT_DEPLOYED,
|
|
1539
1546
|
Monad: NOT_DEPLOYED,
|
|
1540
1547
|
Berachain: NOT_DEPLOYED,
|
|
1541
|
-
Avalanche: NOT_DEPLOYED
|
|
1548
|
+
Avalanche: NOT_DEPLOYED,
|
|
1549
|
+
BNB: NOT_DEPLOYED
|
|
1542
1550
|
}
|
|
1543
1551
|
}
|
|
1544
1552
|
]
|
|
@@ -1560,7 +1568,8 @@ const contractParams = {
|
|
|
1560
1568
|
MegaETH: NOT_DEPLOYED,
|
|
1561
1569
|
Monad: NOT_DEPLOYED,
|
|
1562
1570
|
Berachain: NOT_DEPLOYED,
|
|
1563
|
-
Avalanche: NOT_DEPLOYED
|
|
1571
|
+
Avalanche: NOT_DEPLOYED,
|
|
1572
|
+
BNB: NOT_DEPLOYED
|
|
1564
1573
|
}
|
|
1565
1574
|
}
|
|
1566
1575
|
]
|
|
@@ -1582,7 +1591,8 @@ const contractParams = {
|
|
|
1582
1591
|
MegaETH: NOT_DEPLOYED,
|
|
1583
1592
|
Monad: NOT_DEPLOYED,
|
|
1584
1593
|
Berachain: NOT_DEPLOYED,
|
|
1585
|
-
Avalanche: NOT_DEPLOYED
|
|
1594
|
+
Avalanche: NOT_DEPLOYED,
|
|
1595
|
+
BNB: NOT_DEPLOYED
|
|
1586
1596
|
}
|
|
1587
1597
|
}
|
|
1588
1598
|
]
|
|
@@ -1611,7 +1621,8 @@ const contractParams = {
|
|
|
1611
1621
|
MegaETH: NOT_DEPLOYED,
|
|
1612
1622
|
Monad: NOT_DEPLOYED,
|
|
1613
1623
|
Berachain: NOT_DEPLOYED,
|
|
1614
|
-
Avalanche: NOT_DEPLOYED
|
|
1624
|
+
Avalanche: NOT_DEPLOYED,
|
|
1625
|
+
BNB: NOT_DEPLOYED
|
|
1615
1626
|
}
|
|
1616
1627
|
}
|
|
1617
1628
|
]
|
|
@@ -1633,7 +1644,8 @@ const contractParams = {
|
|
|
1633
1644
|
MegaETH: NOT_DEPLOYED,
|
|
1634
1645
|
Monad: NOT_DEPLOYED,
|
|
1635
1646
|
Berachain: NOT_DEPLOYED,
|
|
1636
|
-
Avalanche: NOT_DEPLOYED
|
|
1647
|
+
Avalanche: NOT_DEPLOYED,
|
|
1648
|
+
BNB: NOT_DEPLOYED
|
|
1637
1649
|
}
|
|
1638
1650
|
}
|
|
1639
1651
|
]
|
|
@@ -1655,7 +1667,8 @@ const contractParams = {
|
|
|
1655
1667
|
MegaETH: NOT_DEPLOYED,
|
|
1656
1668
|
Monad: NOT_DEPLOYED,
|
|
1657
1669
|
Berachain: NOT_DEPLOYED,
|
|
1658
|
-
Avalanche: NOT_DEPLOYED
|
|
1670
|
+
Avalanche: NOT_DEPLOYED,
|
|
1671
|
+
BNB: NOT_DEPLOYED
|
|
1659
1672
|
}
|
|
1660
1673
|
}
|
|
1661
1674
|
]
|
|
@@ -1677,7 +1690,8 @@ const contractParams = {
|
|
|
1677
1690
|
MegaETH: NOT_DEPLOYED,
|
|
1678
1691
|
Monad: NOT_DEPLOYED,
|
|
1679
1692
|
Berachain: NOT_DEPLOYED,
|
|
1680
|
-
Avalanche: NOT_DEPLOYED
|
|
1693
|
+
Avalanche: NOT_DEPLOYED,
|
|
1694
|
+
BNB: NOT_DEPLOYED
|
|
1681
1695
|
}
|
|
1682
1696
|
}
|
|
1683
1697
|
]
|
|
@@ -1699,7 +1713,8 @@ const contractParams = {
|
|
|
1699
1713
|
MegaETH: NOT_DEPLOYED,
|
|
1700
1714
|
Monad: NOT_DEPLOYED,
|
|
1701
1715
|
Berachain: NOT_DEPLOYED,
|
|
1702
|
-
Avalanche: NOT_DEPLOYED
|
|
1716
|
+
Avalanche: NOT_DEPLOYED,
|
|
1717
|
+
BNB: NOT_DEPLOYED
|
|
1703
1718
|
}
|
|
1704
1719
|
}
|
|
1705
1720
|
]
|
|
@@ -1721,7 +1736,8 @@ const contractParams = {
|
|
|
1721
1736
|
MegaETH: NOT_DEPLOYED,
|
|
1722
1737
|
Monad: NOT_DEPLOYED,
|
|
1723
1738
|
Berachain: NOT_DEPLOYED,
|
|
1724
|
-
Avalanche: NOT_DEPLOYED
|
|
1739
|
+
Avalanche: NOT_DEPLOYED,
|
|
1740
|
+
BNB: NOT_DEPLOYED
|
|
1725
1741
|
}
|
|
1726
1742
|
}
|
|
1727
1743
|
]
|
|
@@ -1743,7 +1759,8 @@ const contractParams = {
|
|
|
1743
1759
|
MegaETH: NOT_DEPLOYED,
|
|
1744
1760
|
Monad: NOT_DEPLOYED,
|
|
1745
1761
|
Berachain: NOT_DEPLOYED,
|
|
1746
|
-
Avalanche: NOT_DEPLOYED
|
|
1762
|
+
Avalanche: NOT_DEPLOYED,
|
|
1763
|
+
BNB: NOT_DEPLOYED
|
|
1747
1764
|
}
|
|
1748
1765
|
}
|
|
1749
1766
|
]
|
|
@@ -1765,7 +1782,8 @@ const contractParams = {
|
|
|
1765
1782
|
MegaETH: NOT_DEPLOYED,
|
|
1766
1783
|
Monad: NOT_DEPLOYED,
|
|
1767
1784
|
Berachain: NOT_DEPLOYED,
|
|
1768
|
-
Avalanche: NOT_DEPLOYED
|
|
1785
|
+
Avalanche: NOT_DEPLOYED,
|
|
1786
|
+
BNB: NOT_DEPLOYED
|
|
1769
1787
|
}
|
|
1770
1788
|
}
|
|
1771
1789
|
]
|
|
@@ -1804,7 +1822,8 @@ const contractParams = {
|
|
|
1804
1822
|
MegaETH: NOT_DEPLOYED,
|
|
1805
1823
|
Monad: NOT_DEPLOYED,
|
|
1806
1824
|
Berachain: NOT_DEPLOYED,
|
|
1807
|
-
Avalanche: NOT_DEPLOYED
|
|
1825
|
+
Avalanche: NOT_DEPLOYED,
|
|
1826
|
+
BNB: NOT_DEPLOYED
|
|
1808
1827
|
}
|
|
1809
1828
|
}
|
|
1810
1829
|
]
|
|
@@ -1826,7 +1845,8 @@ const contractParams = {
|
|
|
1826
1845
|
MegaETH: NOT_DEPLOYED,
|
|
1827
1846
|
Monad: NOT_DEPLOYED,
|
|
1828
1847
|
Berachain: NOT_DEPLOYED,
|
|
1829
|
-
Avalanche: NOT_DEPLOYED
|
|
1848
|
+
Avalanche: NOT_DEPLOYED,
|
|
1849
|
+
BNB: NOT_DEPLOYED
|
|
1830
1850
|
}
|
|
1831
1851
|
}
|
|
1832
1852
|
]
|
|
@@ -1848,7 +1868,8 @@ const contractParams = {
|
|
|
1848
1868
|
MegaETH: NOT_DEPLOYED,
|
|
1849
1869
|
Monad: NOT_DEPLOYED,
|
|
1850
1870
|
Berachain: NOT_DEPLOYED,
|
|
1851
|
-
Avalanche: NOT_DEPLOYED
|
|
1871
|
+
Avalanche: NOT_DEPLOYED,
|
|
1872
|
+
BNB: NOT_DEPLOYED
|
|
1852
1873
|
}
|
|
1853
1874
|
},
|
|
1854
1875
|
{
|
|
@@ -1862,7 +1883,8 @@ const contractParams = {
|
|
|
1862
1883
|
MegaETH: NOT_DEPLOYED,
|
|
1863
1884
|
Monad: NOT_DEPLOYED,
|
|
1864
1885
|
Berachain: NOT_DEPLOYED,
|
|
1865
|
-
Avalanche: NOT_DEPLOYED
|
|
1886
|
+
Avalanche: NOT_DEPLOYED,
|
|
1887
|
+
BNB: NOT_DEPLOYED
|
|
1866
1888
|
}
|
|
1867
1889
|
}
|
|
1868
1890
|
]
|
|
@@ -1884,7 +1906,8 @@ const contractParams = {
|
|
|
1884
1906
|
MegaETH: NOT_DEPLOYED,
|
|
1885
1907
|
Monad: NOT_DEPLOYED,
|
|
1886
1908
|
Berachain: NOT_DEPLOYED,
|
|
1887
|
-
Avalanche: NOT_DEPLOYED
|
|
1909
|
+
Avalanche: NOT_DEPLOYED,
|
|
1910
|
+
BNB: NOT_DEPLOYED
|
|
1888
1911
|
}
|
|
1889
1912
|
},
|
|
1890
1913
|
{
|
|
@@ -1898,7 +1921,8 @@ const contractParams = {
|
|
|
1898
1921
|
MegaETH: NOT_DEPLOYED,
|
|
1899
1922
|
Monad: NOT_DEPLOYED,
|
|
1900
1923
|
Berachain: NOT_DEPLOYED,
|
|
1901
|
-
Avalanche: NOT_DEPLOYED
|
|
1924
|
+
Avalanche: NOT_DEPLOYED,
|
|
1925
|
+
BNB: NOT_DEPLOYED
|
|
1902
1926
|
}
|
|
1903
1927
|
}
|
|
1904
1928
|
]
|
|
@@ -1920,7 +1944,8 @@ const contractParams = {
|
|
|
1920
1944
|
MegaETH: NOT_DEPLOYED,
|
|
1921
1945
|
Monad: NOT_DEPLOYED,
|
|
1922
1946
|
Berachain: NOT_DEPLOYED,
|
|
1923
|
-
Avalanche: NOT_DEPLOYED
|
|
1947
|
+
Avalanche: NOT_DEPLOYED,
|
|
1948
|
+
BNB: NOT_DEPLOYED
|
|
1924
1949
|
}
|
|
1925
1950
|
},
|
|
1926
1951
|
{
|
|
@@ -1934,7 +1959,8 @@ const contractParams = {
|
|
|
1934
1959
|
MegaETH: NOT_DEPLOYED,
|
|
1935
1960
|
Monad: NOT_DEPLOYED,
|
|
1936
1961
|
Berachain: NOT_DEPLOYED,
|
|
1937
|
-
Avalanche: NOT_DEPLOYED
|
|
1962
|
+
Avalanche: NOT_DEPLOYED,
|
|
1963
|
+
BNB: NOT_DEPLOYED
|
|
1938
1964
|
}
|
|
1939
1965
|
}
|
|
1940
1966
|
]
|
|
@@ -1956,7 +1982,8 @@ const contractParams = {
|
|
|
1956
1982
|
MegaETH: NOT_DEPLOYED,
|
|
1957
1983
|
Monad: NOT_DEPLOYED,
|
|
1958
1984
|
Berachain: NOT_DEPLOYED,
|
|
1959
|
-
Avalanche: NOT_DEPLOYED
|
|
1985
|
+
Avalanche: NOT_DEPLOYED,
|
|
1986
|
+
BNB: NOT_DEPLOYED
|
|
1960
1987
|
}
|
|
1961
1988
|
},
|
|
1962
1989
|
{
|
|
@@ -1970,7 +1997,8 @@ const contractParams = {
|
|
|
1970
1997
|
MegaETH: NOT_DEPLOYED,
|
|
1971
1998
|
Monad: NOT_DEPLOYED,
|
|
1972
1999
|
Berachain: NOT_DEPLOYED,
|
|
1973
|
-
Avalanche: NOT_DEPLOYED
|
|
2000
|
+
Avalanche: NOT_DEPLOYED,
|
|
2001
|
+
BNB: NOT_DEPLOYED
|
|
1974
2002
|
}
|
|
1975
2003
|
}
|
|
1976
2004
|
]
|
|
@@ -1992,7 +2020,8 @@ const contractParams = {
|
|
|
1992
2020
|
MegaETH: NOT_DEPLOYED,
|
|
1993
2021
|
Monad: NOT_DEPLOYED,
|
|
1994
2022
|
Berachain: NOT_DEPLOYED,
|
|
1995
|
-
Avalanche: NOT_DEPLOYED
|
|
2023
|
+
Avalanche: NOT_DEPLOYED,
|
|
2024
|
+
BNB: NOT_DEPLOYED
|
|
1996
2025
|
}
|
|
1997
2026
|
},
|
|
1998
2027
|
{
|
|
@@ -2006,7 +2035,8 @@ const contractParams = {
|
|
|
2006
2035
|
MegaETH: NOT_DEPLOYED,
|
|
2007
2036
|
Monad: NOT_DEPLOYED,
|
|
2008
2037
|
Berachain: NOT_DEPLOYED,
|
|
2009
|
-
Avalanche: NOT_DEPLOYED
|
|
2038
|
+
Avalanche: NOT_DEPLOYED,
|
|
2039
|
+
BNB: NOT_DEPLOYED
|
|
2010
2040
|
}
|
|
2011
2041
|
}
|
|
2012
2042
|
]
|
|
@@ -2028,7 +2058,8 @@ const contractParams = {
|
|
|
2028
2058
|
MegaETH: NOT_DEPLOYED,
|
|
2029
2059
|
Monad: NOT_DEPLOYED,
|
|
2030
2060
|
Berachain: NOT_DEPLOYED,
|
|
2031
|
-
Avalanche: NOT_DEPLOYED
|
|
2061
|
+
Avalanche: NOT_DEPLOYED,
|
|
2062
|
+
BNB: NOT_DEPLOYED
|
|
2032
2063
|
}
|
|
2033
2064
|
},
|
|
2034
2065
|
{
|
|
@@ -2042,7 +2073,8 @@ const contractParams = {
|
|
|
2042
2073
|
MegaETH: NOT_DEPLOYED,
|
|
2043
2074
|
Monad: NOT_DEPLOYED,
|
|
2044
2075
|
Berachain: NOT_DEPLOYED,
|
|
2045
|
-
Avalanche: NOT_DEPLOYED
|
|
2076
|
+
Avalanche: NOT_DEPLOYED,
|
|
2077
|
+
BNB: NOT_DEPLOYED
|
|
2046
2078
|
}
|
|
2047
2079
|
}
|
|
2048
2080
|
]
|
|
@@ -2064,7 +2096,8 @@ const contractParams = {
|
|
|
2064
2096
|
MegaETH: NOT_DEPLOYED,
|
|
2065
2097
|
Monad: NOT_DEPLOYED,
|
|
2066
2098
|
Berachain: NOT_DEPLOYED,
|
|
2067
|
-
Avalanche: NOT_DEPLOYED
|
|
2099
|
+
Avalanche: NOT_DEPLOYED,
|
|
2100
|
+
BNB: NOT_DEPLOYED
|
|
2068
2101
|
}
|
|
2069
2102
|
},
|
|
2070
2103
|
{
|
|
@@ -2078,7 +2111,8 @@ const contractParams = {
|
|
|
2078
2111
|
MegaETH: NOT_DEPLOYED,
|
|
2079
2112
|
Monad: NOT_DEPLOYED,
|
|
2080
2113
|
Berachain: NOT_DEPLOYED,
|
|
2081
|
-
Avalanche: NOT_DEPLOYED
|
|
2114
|
+
Avalanche: NOT_DEPLOYED,
|
|
2115
|
+
BNB: NOT_DEPLOYED
|
|
2082
2116
|
}
|
|
2083
2117
|
}
|
|
2084
2118
|
]
|
|
@@ -2097,7 +2131,8 @@ const contractParams = {
|
|
|
2097
2131
|
MegaETH: NOT_DEPLOYED,
|
|
2098
2132
|
Monad: NOT_DEPLOYED,
|
|
2099
2133
|
Berachain: NOT_DEPLOYED,
|
|
2100
|
-
Avalanche: NOT_DEPLOYED
|
|
2134
|
+
Avalanche: NOT_DEPLOYED,
|
|
2135
|
+
BNB: NOT_DEPLOYED
|
|
2101
2136
|
},
|
|
2102
2137
|
lpToken: "steCRV"
|
|
2103
2138
|
},
|
|
@@ -2124,7 +2159,8 @@ const contractParams = {
|
|
|
2124
2159
|
MegaETH: NOT_DEPLOYED,
|
|
2125
2160
|
Monad: NOT_DEPLOYED,
|
|
2126
2161
|
Berachain: NOT_DEPLOYED,
|
|
2127
|
-
Avalanche: NOT_DEPLOYED
|
|
2162
|
+
Avalanche: NOT_DEPLOYED,
|
|
2163
|
+
BNB: NOT_DEPLOYED
|
|
2128
2164
|
}
|
|
2129
2165
|
},
|
|
2130
2166
|
BALANCER_V3_ROUTER: {
|
|
@@ -2140,7 +2176,8 @@ const contractParams = {
|
|
|
2140
2176
|
MegaETH: NOT_DEPLOYED,
|
|
2141
2177
|
Monad: NOT_DEPLOYED,
|
|
2142
2178
|
Berachain: NOT_DEPLOYED,
|
|
2143
|
-
Avalanche: NOT_DEPLOYED
|
|
2179
|
+
Avalanche: NOT_DEPLOYED,
|
|
2180
|
+
BNB: NOT_DEPLOYED
|
|
2144
2181
|
}
|
|
2145
2182
|
},
|
|
2146
2183
|
AAVE_V2_LENDING_POOL: {
|
|
@@ -1575,7 +1575,8 @@ const tokenDataByNetwork = {
|
|
|
1575
1575
|
MegaETH: {},
|
|
1576
1576
|
Monad: {},
|
|
1577
1577
|
Berachain: {},
|
|
1578
|
-
Avalanche: {}
|
|
1578
|
+
Avalanche: {},
|
|
1579
|
+
BNB: {}
|
|
1579
1580
|
};
|
|
1580
1581
|
const tickerInfoTokensByNetwork = {
|
|
1581
1582
|
Mainnet: {
|
|
@@ -1971,7 +1972,8 @@ const tickerInfoTokensByNetwork = {
|
|
|
1971
1972
|
MegaETH: {},
|
|
1972
1973
|
Monad: {},
|
|
1973
1974
|
Berachain: {},
|
|
1974
|
-
Avalanche: {}
|
|
1975
|
+
Avalanche: {},
|
|
1976
|
+
BNB: {}
|
|
1975
1977
|
};
|
|
1976
1978
|
const tickerTokensByNetwork = Object.fromEntries(
|
|
1977
1979
|
Object.entries(tickerInfoTokensByNetwork).map(([network, data]) => {
|
|
@@ -10,7 +10,8 @@ const TESTNET_CHAINS = {
|
|
|
10
10
|
MegaETH: 7883,
|
|
11
11
|
Monad: 7884,
|
|
12
12
|
Berachain: 7885,
|
|
13
|
-
Avalanche: 7886
|
|
13
|
+
Avalanche: 7886,
|
|
14
|
+
BNB: 7887
|
|
14
15
|
};
|
|
15
16
|
const CHAINS_BY_ID = TypedObjectUtils.swapKeyValue(TESTNET_CHAINS);
|
|
16
17
|
const MAINNET_BY_TESTNET_ID = TypedObjectUtils.entries(TESTNET_CHAINS).reduce((acc, [n, testnetId]) => {
|
|
@@ -200,32 +200,32 @@ class GearboxRewardsApi {
|
|
|
200
200
|
acc[p.dieselToken] = p.address;
|
|
201
201
|
return acc;
|
|
202
202
|
}, {});
|
|
203
|
-
const extraRewards = (merkleXYZLm || []).reduce(
|
|
204
|
-
(
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
203
|
+
const extraRewards = (merkleXYZLm || []).reduce((acc, chainRewards) => {
|
|
204
|
+
chainRewards.rewards.forEach((reward) => {
|
|
205
|
+
const rewardToken = reward.token.address.toLowerCase();
|
|
206
|
+
reward.breakdowns.forEach((reason) => {
|
|
207
|
+
const poolToken = ((reason.reason || "").split("_").find((part) => part.startsWith("0x")) || "").toLowerCase();
|
|
208
|
+
const pool = poolByItsToken[poolToken];
|
|
209
|
+
const total = toBigInt(reason.amount || 0);
|
|
210
|
+
const claimed = toBigInt(reason.claimed || 0);
|
|
211
|
+
const claimable = BigIntMath.max(total - claimed, 0n);
|
|
212
|
+
const key = [pool, poolToken, rewardToken].join("_");
|
|
213
|
+
if (pool && claimable > 0n) {
|
|
214
|
+
const prevAmount = acc[key]?.amount || 0n;
|
|
215
|
+
acc[key] = {
|
|
216
|
+
pool,
|
|
217
|
+
poolToken,
|
|
218
|
+
rewardToken,
|
|
219
|
+
rewardTokenSymbol: reward.token.symbol,
|
|
220
|
+
rewardTokenDecimals: reward.token.decimals || 18,
|
|
221
|
+
amount: prevAmount + claimable,
|
|
222
|
+
type: "extraMerkle"
|
|
223
|
+
};
|
|
224
|
+
}
|
|
224
225
|
});
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
);
|
|
226
|
+
});
|
|
227
|
+
return acc;
|
|
228
|
+
}, {});
|
|
229
229
|
const gearboxLmRewards = poolTokens.map((address, i) => {
|
|
230
230
|
const info = baseRewardPoolsInfo[address];
|
|
231
231
|
const rewardToken = currentTokenData[info.symbol];
|
|
@@ -252,7 +252,7 @@ class GearboxRewardsApi {
|
|
|
252
252
|
{ nonZero: [], zero: [] }
|
|
253
253
|
);
|
|
254
254
|
return {
|
|
255
|
-
rewards: [...nonZero, ...extraRewards, zero]
|
|
255
|
+
rewards: [...nonZero, ...Object.values(extraRewards), zero]
|
|
256
256
|
};
|
|
257
257
|
}
|
|
258
258
|
static extractFulfilled(r, reportError, description) {
|
|
@@ -19,8 +19,8 @@ export interface GearboxChain extends Chain {
|
|
|
19
19
|
symbol: string;
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
export declare const SUPPORTED_NETWORKS: readonly ["Mainnet", "Arbitrum", "Optimism", "Base", "Sonic", "MegaETH", "Monad", "Berachain", "Avalanche"];
|
|
23
|
-
export declare const NetworkType: z.ZodEnum<["Mainnet", "Arbitrum", "Optimism", "Base", "Sonic", "MegaETH", "Monad", "Berachain", "Avalanche"]>;
|
|
22
|
+
export declare const SUPPORTED_NETWORKS: readonly ["Mainnet", "Arbitrum", "Optimism", "Base", "Sonic", "MegaETH", "Monad", "Berachain", "Avalanche", "BNB"];
|
|
23
|
+
export declare const NetworkType: z.ZodEnum<["Mainnet", "Arbitrum", "Optimism", "Base", "Sonic", "MegaETH", "Monad", "Berachain", "Avalanche", "BNB"]>;
|
|
24
24
|
export type NetworkType = z.infer<typeof NetworkType>;
|
|
25
25
|
export declare const chains: Record<NetworkType, GearboxChain>;
|
|
26
26
|
export declare function getChain(chainIdOrNetworkType: number | bigint | NetworkType): GearboxChain;
|