@continuumdao/ctm-mpc-defi 0.2.34 → 0.2.35
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/agent/catalog.cjs +712 -44
- package/dist/agent/catalog.cjs.map +1 -1
- package/dist/agent/catalog.d.ts +1630 -244
- package/dist/agent/catalog.js +678 -45
- package/dist/agent/catalog.js.map +1 -1
- package/dist/agent/skills/aave-v4/SKILL.md +19 -4
- package/dist/agent/skills/aerodrome/SKILL.md +2 -2
- package/dist/agent/skills/compound-v3/SKILL.md +2 -2
- package/dist/agent/skills/curve-dao/SKILL.md +14 -0
- package/dist/agent/skills/ethena/SKILL.md +3 -1
- package/dist/agent/skills/euler-v2/SKILL.md +1 -1
- package/dist/agent/skills/gmx/SKILL.md +1 -1
- package/dist/agent/skills/hyperliquid/SKILL.md +7 -5
- package/dist/agent/skills/lido/SKILL.md +3 -0
- package/dist/agent/skills/maple-syrup/SKILL.md +35 -3
- package/dist/agent/skills/morpho/SKILL.md +1 -1
- package/dist/agent/skills/sky/SKILL.md +2 -0
- package/dist/agent/skills/yield-compare/SKILL.md +78 -0
- package/dist/index.cjs +129 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +129 -27
- package/dist/index.js.map +1 -1
- package/dist/protocols/evm/aave-v4/index.cjs +170 -0
- package/dist/protocols/evm/aave-v4/index.cjs.map +1 -1
- package/dist/protocols/evm/aave-v4/index.d.ts +59 -1
- package/dist/protocols/evm/aave-v4/index.js +164 -1
- package/dist/protocols/evm/aave-v4/index.js.map +1 -1
- package/dist/protocols/evm/aerodrome/index.cjs +1308 -901
- package/dist/protocols/evm/aerodrome/index.cjs.map +1 -1
- package/dist/protocols/evm/aerodrome/index.d.ts +69 -2
- package/dist/protocols/evm/aerodrome/index.js +1217 -807
- package/dist/protocols/evm/aerodrome/index.js.map +1 -1
- package/dist/protocols/evm/compound-v3/index.cjs +82 -6
- package/dist/protocols/evm/compound-v3/index.cjs.map +1 -1
- package/dist/protocols/evm/compound-v3/index.d.ts +89 -1
- package/dist/protocols/evm/compound-v3/index.js +80 -7
- package/dist/protocols/evm/compound-v3/index.js.map +1 -1
- package/dist/protocols/evm/curve-dao/index.cjs +447 -18
- package/dist/protocols/evm/curve-dao/index.cjs.map +1 -1
- package/dist/protocols/evm/curve-dao/index.d.ts +108 -1
- package/dist/protocols/evm/curve-dao/index.js +440 -19
- package/dist/protocols/evm/curve-dao/index.js.map +1 -1
- package/dist/protocols/evm/ethena/index.cjs +89 -0
- package/dist/protocols/evm/ethena/index.cjs.map +1 -1
- package/dist/protocols/evm/ethena/index.d.ts +17 -1
- package/dist/protocols/evm/ethena/index.js +89 -2
- package/dist/protocols/evm/ethena/index.js.map +1 -1
- package/dist/protocols/evm/euler-v2/index.cjs +29 -0
- package/dist/protocols/evm/euler-v2/index.cjs.map +1 -1
- package/dist/protocols/evm/euler-v2/index.d.ts +21 -1
- package/dist/protocols/evm/euler-v2/index.js +29 -1
- package/dist/protocols/evm/euler-v2/index.js.map +1 -1
- package/dist/protocols/evm/gmx/index.cjs +83 -1
- package/dist/protocols/evm/gmx/index.cjs.map +1 -1
- package/dist/protocols/evm/gmx/index.d.ts +22 -2
- package/dist/protocols/evm/gmx/index.js +80 -2
- package/dist/protocols/evm/gmx/index.js.map +1 -1
- package/dist/protocols/evm/hyperliquid/index.cjs +67 -11
- package/dist/protocols/evm/hyperliquid/index.cjs.map +1 -1
- package/dist/protocols/evm/hyperliquid/index.d.ts +39 -2
- package/dist/protocols/evm/hyperliquid/index.js +64 -12
- package/dist/protocols/evm/hyperliquid/index.js.map +1 -1
- package/dist/protocols/evm/lido/index.cjs +13 -0
- package/dist/protocols/evm/lido/index.cjs.map +1 -1
- package/dist/protocols/evm/lido/index.d.ts +9 -1
- package/dist/protocols/evm/lido/index.js +13 -1
- package/dist/protocols/evm/lido/index.js.map +1 -1
- package/dist/protocols/evm/maple/index.cjs +129 -1
- package/dist/protocols/evm/maple/index.cjs.map +1 -1
- package/dist/protocols/evm/maple/index.d.ts +45 -1
- package/dist/protocols/evm/maple/index.js +124 -3
- package/dist/protocols/evm/maple/index.js.map +1 -1
- package/dist/protocols/evm/morpho/index.cjs +34 -7
- package/dist/protocols/evm/morpho/index.cjs.map +1 -1
- package/dist/protocols/evm/morpho/index.d.ts +23 -1
- package/dist/protocols/evm/morpho/index.js +34 -8
- package/dist/protocols/evm/morpho/index.js.map +1 -1
- package/dist/protocols/evm/sky/index.cjs +52 -0
- package/dist/protocols/evm/sky/index.cjs.map +1 -1
- package/dist/protocols/evm/sky/index.d.ts +16 -1
- package/dist/protocols/evm/sky/index.js +50 -1
- package/dist/protocols/evm/sky/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,26 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getAddress, zeroAddress, encodePacked, parseUnits, formatUnits, encodeFunctionData, defineChain, createPublicClient, http, parseGwei, serializeTransaction, keccak256 } from 'viem';
|
|
2
2
|
import { fetchChainFeeParams, gasLimitFromEstimateAndChainConfig, gweiToDecimalString, proposalTxParamsToFeeSnapshot, alignEip1559FeesWithLatestBase, getClientIdFromKeyGenResult } from '@continuumdao/continuum-node-sdk';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
function
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __esm = (fn, res) => function __init() {
|
|
7
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
8
|
+
};
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
14
13
|
|
|
15
14
|
// src/core/expiry.ts
|
|
16
|
-
var DEFAULT_DEFI_MULTISIGN_EXPIRY_SECONDS
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
var AERODROME_WETH_BASE = "0x4200000000000000000000000000000000000006";
|
|
23
|
-
var AERODROME_USDC_BASE = "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
|
|
15
|
+
var DEFAULT_DEFI_MULTISIGN_EXPIRY_SECONDS;
|
|
16
|
+
var init_expiry = __esm({
|
|
17
|
+
"src/core/expiry.ts"() {
|
|
18
|
+
DEFAULT_DEFI_MULTISIGN_EXPIRY_SECONDS = 30 * 60;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
24
21
|
function isAerodromeChainSupported(chainId) {
|
|
25
22
|
const n = typeof chainId === "number" ? chainId : Number.parseInt(String(chainId), 10);
|
|
26
23
|
return n === AERODROME_CHAIN_ID;
|
|
@@ -51,38 +48,17 @@ function isAerodromeNativeToken(address) {
|
|
|
51
48
|
return false;
|
|
52
49
|
}
|
|
53
50
|
}
|
|
54
|
-
var
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
mixedQuoterV3: "0xCd2A7D98e82D6107eac1828ce8DeAA6acB65b555",
|
|
66
|
-
nfpm: "0x827922686190790b37229fd06084350E74485b72",
|
|
67
|
-
/** Oldest Slipstream CL factory (Gauges V1). Path bit 1<<20. */
|
|
68
|
-
clFactory: "0x5e7BB104d84c7CB9B682AaC2F3d509f5F406809A",
|
|
69
|
-
/** Slipstream CL factory 2 (gauge caps). Raw tickSpacing in MixedQuoterV3. */
|
|
70
|
-
clFactory2: "0xaDe65c38CD4849aDBA595a4323a8C7DdfE89716a",
|
|
71
|
-
/** Newest Slipstream CL factory (Gauges V3) — Coinbase B20 stock pools. Path bit 1<<19. */
|
|
72
|
-
clFactory3: "0xf8f2eB4940CFE7d13603DDDD87f123820Fc061Ef",
|
|
73
|
-
universalRouter: "0x6Cb442acF35158D5eDa88fe602221b67B400Be3E",
|
|
74
|
-
swapRouter: "0xBE6D8f0d05cC4be24d5167a3eF062215bE6D18a5",
|
|
75
|
-
swapRouter2: "0xcbBb8035cAc7D4B3Ca7aBb74cF7BdF900215Ce0D",
|
|
76
|
-
swapRouter3: "0x698Cb2b6dd822994581fEa6eA4Fc755d1363A92F",
|
|
77
|
-
pricesOracle: "0xee717411f6E44F9feE011835C8E6FAaC5dEfF166",
|
|
78
|
-
slipstreamHelper: "0x0AD09A66af0154a84e86F761313d02d0abB6edd5",
|
|
79
|
-
lpSugar: "0x69dD9db6d8f8E7d83887A704f447b1a584b599A1",
|
|
80
|
-
sugarSlipstreamHelper: "0x9c62ab10577fB3C20A22E231b7703Ed6D456CC7a",
|
|
81
|
-
swapper: "0x91616a7B9CF6D23f8C17845581051EBdC4BcB916",
|
|
82
|
-
weth: AERODROME_WETH_BASE
|
|
83
|
-
};
|
|
84
|
-
var SUGAR_ENV_URL = "https://raw.githubusercontent.com/velodrome-finance/sugar/main/deployments/base.env";
|
|
85
|
-
var SECURITY_MDX_URL = "https://raw.githubusercontent.com/aerodrome-finance/docs/main/content/security.mdx";
|
|
51
|
+
var AERODROME_PROTOCOL_ID, AERODROME_CHAIN_ID, AERODROME_NATIVE_PLACEHOLDER, AERODROME_WETH_BASE, AERODROME_USDC_BASE;
|
|
52
|
+
var init_support = __esm({
|
|
53
|
+
"src/protocols/evm/aerodrome/support.ts"() {
|
|
54
|
+
init_expiry();
|
|
55
|
+
AERODROME_PROTOCOL_ID = "aerodrome";
|
|
56
|
+
AERODROME_CHAIN_ID = 8453;
|
|
57
|
+
AERODROME_NATIVE_PLACEHOLDER = zeroAddress;
|
|
58
|
+
AERODROME_WETH_BASE = "0x4200000000000000000000000000000000000006";
|
|
59
|
+
AERODROME_USDC_BASE = "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
|
|
60
|
+
}
|
|
61
|
+
});
|
|
86
62
|
function asAddr(raw) {
|
|
87
63
|
const s = (raw ?? "").trim();
|
|
88
64
|
if (!s) return null;
|
|
@@ -154,7 +130,6 @@ function mergeLoaded(sugar, docs) {
|
|
|
154
130
|
weth: pick(asAddr(AERODROME_WETH_BASE), fb.weth)
|
|
155
131
|
};
|
|
156
132
|
}
|
|
157
|
-
var cache = null;
|
|
158
133
|
async function fetchText(url) {
|
|
159
134
|
try {
|
|
160
135
|
const res = await fetch(url, { cache: "force-cache" });
|
|
@@ -190,778 +165,822 @@ function aerodromeClSwapRouterForFactory(addrs, factory) {
|
|
|
190
165
|
if (f === addrs.clFactory2.toLowerCase()) return addrs.swapRouter2;
|
|
191
166
|
return addrs.swapRouter;
|
|
192
167
|
}
|
|
168
|
+
var AERODROME_BASE_ADDRESSES_FALLBACK, SUGAR_ENV_URL, SECURITY_MDX_URL, cache;
|
|
169
|
+
var init_addresses = __esm({
|
|
170
|
+
"src/protocols/evm/aerodrome/addresses.ts"() {
|
|
171
|
+
init_support();
|
|
172
|
+
AERODROME_BASE_ADDRESSES_FALLBACK = {
|
|
173
|
+
chainId: AERODROME_CHAIN_ID,
|
|
174
|
+
aero: "0x940181a94A35A4569E4529A3CDfB74e38FD98631",
|
|
175
|
+
router: "0xcF77a3Ba9A5CA399B7c97c74d54e5b1Beb874E43",
|
|
176
|
+
poolFactory: "0x420DD381b31aEf6683db6B902084cB0FFECe40Da",
|
|
177
|
+
factoryRegistry: "0x5C3F18F06CC09CA1910767A34a20F771039E37C0",
|
|
178
|
+
voter: "0x16613524e02ad97eDfeF371bC883F2F5d6C480A5",
|
|
179
|
+
votingEscrow: "0xeBf418Fe2512e7E6bd9b87a8F0f294aCDC67e6B4",
|
|
180
|
+
rewardsDistributor: "0x227f65131A261548b057215bB1D5Ab2997964C7d",
|
|
181
|
+
mixedQuoter: "0x0A5aA5D3a4d28014f967Bf0f29EAA3FF9807D5c6",
|
|
182
|
+
/** MixedRouteQuoterV3 — v2 + all three CL factories (bitmask path encoding). */
|
|
183
|
+
mixedQuoterV3: "0xCd2A7D98e82D6107eac1828ce8DeAA6acB65b555",
|
|
184
|
+
nfpm: "0x827922686190790b37229fd06084350E74485b72",
|
|
185
|
+
/** Oldest Slipstream CL factory (Gauges V1). Path bit 1<<20. */
|
|
186
|
+
clFactory: "0x5e7BB104d84c7CB9B682AaC2F3d509f5F406809A",
|
|
187
|
+
/** Slipstream CL factory 2 (gauge caps). Raw tickSpacing in MixedQuoterV3. */
|
|
188
|
+
clFactory2: "0xaDe65c38CD4849aDBA595a4323a8C7DdfE89716a",
|
|
189
|
+
/** Newest Slipstream CL factory (Gauges V3) — Coinbase B20 stock pools. Path bit 1<<19. */
|
|
190
|
+
clFactory3: "0xf8f2eB4940CFE7d13603DDDD87f123820Fc061Ef",
|
|
191
|
+
universalRouter: "0x6Cb442acF35158D5eDa88fe602221b67B400Be3E",
|
|
192
|
+
swapRouter: "0xBE6D8f0d05cC4be24d5167a3eF062215bE6D18a5",
|
|
193
|
+
swapRouter2: "0xcbBb8035cAc7D4B3Ca7aBb74cF7BdF900215Ce0D",
|
|
194
|
+
swapRouter3: "0x698Cb2b6dd822994581fEa6eA4Fc755d1363A92F",
|
|
195
|
+
pricesOracle: "0xee717411f6E44F9feE011835C8E6FAaC5dEfF166",
|
|
196
|
+
slipstreamHelper: "0x0AD09A66af0154a84e86F761313d02d0abB6edd5",
|
|
197
|
+
lpSugar: "0x69dD9db6d8f8E7d83887A704f447b1a584b599A1",
|
|
198
|
+
sugarSlipstreamHelper: "0x9c62ab10577fB3C20A22E231b7703Ed6D456CC7a",
|
|
199
|
+
swapper: "0x91616a7B9CF6D23f8C17845581051EBdC4BcB916",
|
|
200
|
+
weth: AERODROME_WETH_BASE
|
|
201
|
+
};
|
|
202
|
+
SUGAR_ENV_URL = "https://raw.githubusercontent.com/velodrome-finance/sugar/main/deployments/base.env";
|
|
203
|
+
SECURITY_MDX_URL = "https://raw.githubusercontent.com/aerodrome-finance/docs/main/content/security.mdx";
|
|
204
|
+
cache = null;
|
|
205
|
+
}
|
|
206
|
+
});
|
|
193
207
|
|
|
194
208
|
// src/protocols/evm/aerodrome/abi.ts
|
|
195
|
-
var lpSugarAbi
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
stateMutability: "view",
|
|
200
|
-
inputs: [
|
|
201
|
-
{ name: "_limit", type: "uint256" },
|
|
202
|
-
{ name: "_offset", type: "uint256" },
|
|
203
|
-
{ name: "_account", type: "address" },
|
|
204
|
-
{ name: "_addresses", type: "address[]" }
|
|
205
|
-
],
|
|
206
|
-
outputs: [
|
|
209
|
+
var lpSugarAbi, routerAbi, mixedQuoterAbi, mixedQuoterV3Abi, v2PoolFactoryAbi, clPoolFactoryAbi, clPoolAbi, sugarHelperAbi, nfpmAbi, clSwapRouterAbi, poolClaimFeesAbi, gaugeAbi, clGaugeAbi, aerodromePoolMetaAbi, aerodromeVoterAbi, erc20Abi;
|
|
210
|
+
var init_abi = __esm({
|
|
211
|
+
"src/protocols/evm/aerodrome/abi.ts"() {
|
|
212
|
+
lpSugarAbi = [
|
|
207
213
|
{
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
{ name: "
|
|
213
|
-
{ name: "
|
|
214
|
-
{ name: "
|
|
215
|
-
{ name: "
|
|
216
|
-
|
|
214
|
+
type: "function",
|
|
215
|
+
name: "tokens",
|
|
216
|
+
stateMutability: "view",
|
|
217
|
+
inputs: [
|
|
218
|
+
{ name: "_limit", type: "uint256" },
|
|
219
|
+
{ name: "_offset", type: "uint256" },
|
|
220
|
+
{ name: "_account", type: "address" },
|
|
221
|
+
{ name: "_addresses", type: "address[]" }
|
|
222
|
+
],
|
|
223
|
+
outputs: [
|
|
224
|
+
{
|
|
225
|
+
name: "",
|
|
226
|
+
type: "tuple[]",
|
|
227
|
+
components: [
|
|
228
|
+
{ name: "token_address", type: "address" },
|
|
229
|
+
{ name: "symbol", type: "string" },
|
|
230
|
+
{ name: "decimals", type: "uint8" },
|
|
231
|
+
{ name: "account_balance", type: "uint256" },
|
|
232
|
+
{ name: "listed", type: "bool" },
|
|
233
|
+
{ name: "emerging", type: "bool" }
|
|
234
|
+
]
|
|
235
|
+
}
|
|
217
236
|
]
|
|
218
|
-
}
|
|
219
|
-
]
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
type: "function",
|
|
223
|
-
name: "forSwaps",
|
|
224
|
-
stateMutability: "view",
|
|
225
|
-
inputs: [
|
|
226
|
-
{ name: "_limit", type: "uint256" },
|
|
227
|
-
{ name: "_offset", type: "uint256" }
|
|
228
|
-
],
|
|
229
|
-
outputs: [
|
|
237
|
+
},
|
|
230
238
|
{
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
{ name: "
|
|
236
|
-
{ name: "
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
{
|
|
239
|
+
type: "function",
|
|
240
|
+
name: "forSwaps",
|
|
241
|
+
stateMutability: "view",
|
|
242
|
+
inputs: [
|
|
243
|
+
{ name: "_limit", type: "uint256" },
|
|
244
|
+
{ name: "_offset", type: "uint256" }
|
|
245
|
+
],
|
|
246
|
+
outputs: [
|
|
247
|
+
{
|
|
248
|
+
name: "",
|
|
249
|
+
type: "tuple[]",
|
|
250
|
+
components: [
|
|
251
|
+
{ name: "lp", type: "address" },
|
|
252
|
+
{ name: "type", type: "int24" },
|
|
253
|
+
{ name: "token0", type: "address" },
|
|
254
|
+
{ name: "token1", type: "address" },
|
|
255
|
+
{ name: "factory", type: "address" },
|
|
256
|
+
{ name: "pool_fee", type: "uint256" }
|
|
257
|
+
]
|
|
258
|
+
}
|
|
240
259
|
]
|
|
241
|
-
}
|
|
242
|
-
]
|
|
243
|
-
},
|
|
244
|
-
{
|
|
245
|
-
type: "function",
|
|
246
|
-
name: "all",
|
|
247
|
-
stateMutability: "view",
|
|
248
|
-
inputs: [
|
|
249
|
-
{ name: "_limit", type: "uint256" },
|
|
250
|
-
{ name: "_offset", type: "uint256" },
|
|
251
|
-
{ name: "_filter", type: "uint256" }
|
|
252
|
-
],
|
|
253
|
-
outputs: [
|
|
260
|
+
},
|
|
254
261
|
{
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
{ name: "
|
|
260
|
-
{ name: "
|
|
261
|
-
{ name: "
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
{
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
262
|
+
type: "function",
|
|
263
|
+
name: "all",
|
|
264
|
+
stateMutability: "view",
|
|
265
|
+
inputs: [
|
|
266
|
+
{ name: "_limit", type: "uint256" },
|
|
267
|
+
{ name: "_offset", type: "uint256" },
|
|
268
|
+
{ name: "_filter", type: "uint256" }
|
|
269
|
+
],
|
|
270
|
+
outputs: [
|
|
271
|
+
{
|
|
272
|
+
name: "",
|
|
273
|
+
type: "tuple[]",
|
|
274
|
+
components: [
|
|
275
|
+
{ name: "lp", type: "address" },
|
|
276
|
+
{ name: "symbol", type: "string" },
|
|
277
|
+
{ name: "decimals", type: "uint8" },
|
|
278
|
+
{ name: "liquidity", type: "uint256" },
|
|
279
|
+
{ name: "type", type: "int24" },
|
|
280
|
+
{ name: "tick", type: "int24" },
|
|
281
|
+
{ name: "sqrt_ratio", type: "uint160" },
|
|
282
|
+
{ name: "token0", type: "address" },
|
|
283
|
+
{ name: "reserve0", type: "uint256" },
|
|
284
|
+
{ name: "staked0", type: "uint256" },
|
|
285
|
+
{ name: "token1", type: "address" },
|
|
286
|
+
{ name: "reserve1", type: "uint256" },
|
|
287
|
+
{ name: "staked1", type: "uint256" },
|
|
288
|
+
{ name: "gauge", type: "address" },
|
|
289
|
+
{ name: "gauge_liquidity", type: "uint256" },
|
|
290
|
+
{ name: "gauge_alive", type: "bool" },
|
|
291
|
+
{ name: "fee", type: "address" },
|
|
292
|
+
{ name: "bribe", type: "address" },
|
|
293
|
+
{ name: "factory", type: "address" },
|
|
294
|
+
{ name: "emissions", type: "uint256" },
|
|
295
|
+
{ name: "emissions_token", type: "address" },
|
|
296
|
+
{ name: "emissions_cap", type: "uint256" },
|
|
297
|
+
{ name: "pool_fee", type: "uint256" },
|
|
298
|
+
{ name: "unstaked_fee", type: "uint256" },
|
|
299
|
+
{ name: "token0_fees", type: "uint256" },
|
|
300
|
+
{ name: "token1_fees", type: "uint256" },
|
|
301
|
+
{ name: "locked", type: "uint256" },
|
|
302
|
+
{ name: "emerging", type: "uint256" },
|
|
303
|
+
{ name: "created_at", type: "uint32" },
|
|
304
|
+
{ name: "nfpm", type: "address" },
|
|
305
|
+
{ name: "alm", type: "address" },
|
|
306
|
+
{ name: "root", type: "address" }
|
|
307
|
+
]
|
|
308
|
+
}
|
|
290
309
|
]
|
|
291
|
-
}
|
|
292
|
-
]
|
|
293
|
-
},
|
|
294
|
-
{
|
|
295
|
-
type: "function",
|
|
296
|
-
name: "byAddress",
|
|
297
|
-
stateMutability: "view",
|
|
298
|
-
inputs: [{ name: "_address", type: "address" }],
|
|
299
|
-
outputs: [
|
|
310
|
+
},
|
|
300
311
|
{
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
{
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
312
|
+
type: "function",
|
|
313
|
+
name: "byAddress",
|
|
314
|
+
stateMutability: "view",
|
|
315
|
+
inputs: [{ name: "_address", type: "address" }],
|
|
316
|
+
outputs: [
|
|
317
|
+
{
|
|
318
|
+
name: "",
|
|
319
|
+
type: "tuple",
|
|
320
|
+
components: [
|
|
321
|
+
{ name: "lp", type: "address" },
|
|
322
|
+
{ name: "symbol", type: "string" },
|
|
323
|
+
{ name: "decimals", type: "uint8" },
|
|
324
|
+
{ name: "liquidity", type: "uint256" },
|
|
325
|
+
{ name: "type", type: "int24" },
|
|
326
|
+
{ name: "tick", type: "int24" },
|
|
327
|
+
{ name: "sqrt_ratio", type: "uint160" },
|
|
328
|
+
{ name: "token0", type: "address" },
|
|
329
|
+
{ name: "reserve0", type: "uint256" },
|
|
330
|
+
{ name: "staked0", type: "uint256" },
|
|
331
|
+
{ name: "token1", type: "address" },
|
|
332
|
+
{ name: "reserve1", type: "uint256" },
|
|
333
|
+
{ name: "staked1", type: "uint256" },
|
|
334
|
+
{ name: "gauge", type: "address" },
|
|
335
|
+
{ name: "gauge_liquidity", type: "uint256" },
|
|
336
|
+
{ name: "gauge_alive", type: "bool" },
|
|
337
|
+
{ name: "fee", type: "address" },
|
|
338
|
+
{ name: "bribe", type: "address" },
|
|
339
|
+
{ name: "factory", type: "address" },
|
|
340
|
+
{ name: "emissions", type: "uint256" },
|
|
341
|
+
{ name: "emissions_token", type: "address" },
|
|
342
|
+
{ name: "emissions_cap", type: "uint256" },
|
|
343
|
+
{ name: "pool_fee", type: "uint256" },
|
|
344
|
+
{ name: "unstaked_fee", type: "uint256" },
|
|
345
|
+
{ name: "token0_fees", type: "uint256" },
|
|
346
|
+
{ name: "token1_fees", type: "uint256" },
|
|
347
|
+
{ name: "locked", type: "uint256" },
|
|
348
|
+
{ name: "emerging", type: "uint256" },
|
|
349
|
+
{ name: "created_at", type: "uint32" },
|
|
350
|
+
{ name: "nfpm", type: "address" },
|
|
351
|
+
{ name: "alm", type: "address" },
|
|
352
|
+
{ name: "root", type: "address" }
|
|
353
|
+
]
|
|
354
|
+
}
|
|
336
355
|
]
|
|
337
|
-
}
|
|
338
|
-
]
|
|
339
|
-
},
|
|
340
|
-
{
|
|
341
|
-
type: "function",
|
|
342
|
-
name: "count",
|
|
343
|
-
stateMutability: "view",
|
|
344
|
-
inputs: [],
|
|
345
|
-
outputs: [{ name: "", type: "uint256" }]
|
|
346
|
-
},
|
|
347
|
-
{
|
|
348
|
-
type: "function",
|
|
349
|
-
name: "positions",
|
|
350
|
-
stateMutability: "view",
|
|
351
|
-
inputs: [
|
|
352
|
-
{ name: "_limit", type: "uint256" },
|
|
353
|
-
{ name: "_offset", type: "uint256" },
|
|
354
|
-
{ name: "_account", type: "address" }
|
|
355
|
-
],
|
|
356
|
-
outputs: [
|
|
356
|
+
},
|
|
357
357
|
{
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
{ name: "
|
|
370
|
-
{ name: "
|
|
371
|
-
{ name: "
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
{
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
358
|
+
type: "function",
|
|
359
|
+
name: "count",
|
|
360
|
+
stateMutability: "view",
|
|
361
|
+
inputs: [],
|
|
362
|
+
outputs: [{ name: "", type: "uint256" }]
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
type: "function",
|
|
366
|
+
name: "positions",
|
|
367
|
+
stateMutability: "view",
|
|
368
|
+
inputs: [
|
|
369
|
+
{ name: "_limit", type: "uint256" },
|
|
370
|
+
{ name: "_offset", type: "uint256" },
|
|
371
|
+
{ name: "_account", type: "address" }
|
|
372
|
+
],
|
|
373
|
+
outputs: [
|
|
374
|
+
{
|
|
375
|
+
name: "",
|
|
376
|
+
type: "tuple[]",
|
|
377
|
+
components: [
|
|
378
|
+
{ name: "id", type: "uint256" },
|
|
379
|
+
{ name: "lp", type: "address" },
|
|
380
|
+
{ name: "liquidity", type: "uint256" },
|
|
381
|
+
{ name: "staked", type: "uint256" },
|
|
382
|
+
{ name: "amount0", type: "uint256" },
|
|
383
|
+
{ name: "amount1", type: "uint256" },
|
|
384
|
+
{ name: "staked0", type: "uint256" },
|
|
385
|
+
{ name: "staked1", type: "uint256" },
|
|
386
|
+
{ name: "unstaked_earned0", type: "uint256" },
|
|
387
|
+
{ name: "unstaked_earned1", type: "uint256" },
|
|
388
|
+
{ name: "emissions_earned", type: "uint256" },
|
|
389
|
+
{ name: "tick_lower", type: "int24" },
|
|
390
|
+
{ name: "tick_upper", type: "int24" },
|
|
391
|
+
{ name: "sqrt_ratio_lower", type: "uint160" },
|
|
392
|
+
{ name: "sqrt_ratio_upper", type: "uint160" },
|
|
393
|
+
{ name: "locker", type: "address" },
|
|
394
|
+
{ name: "unlocks_at", type: "uint32" },
|
|
395
|
+
{ name: "alm", type: "address" }
|
|
396
|
+
]
|
|
397
|
+
}
|
|
379
398
|
]
|
|
380
399
|
}
|
|
381
|
-
]
|
|
382
|
-
|
|
383
|
-
];
|
|
384
|
-
var routerAbi = [
|
|
385
|
-
{
|
|
386
|
-
type: "function",
|
|
387
|
-
name: "weth",
|
|
388
|
-
stateMutability: "view",
|
|
389
|
-
inputs: [],
|
|
390
|
-
outputs: [{ name: "", type: "address" }]
|
|
391
|
-
},
|
|
392
|
-
{
|
|
393
|
-
type: "function",
|
|
394
|
-
name: "defaultFactory",
|
|
395
|
-
stateMutability: "view",
|
|
396
|
-
inputs: [],
|
|
397
|
-
outputs: [{ name: "", type: "address" }]
|
|
398
|
-
},
|
|
399
|
-
{
|
|
400
|
-
type: "function",
|
|
401
|
-
name: "poolFor",
|
|
402
|
-
stateMutability: "view",
|
|
403
|
-
inputs: [
|
|
404
|
-
{ name: "tokenA", type: "address" },
|
|
405
|
-
{ name: "tokenB", type: "address" },
|
|
406
|
-
{ name: "stable", type: "bool" },
|
|
407
|
-
{ name: "_factory", type: "address" }
|
|
408
|
-
],
|
|
409
|
-
outputs: [{ name: "pool", type: "address" }]
|
|
410
|
-
},
|
|
411
|
-
{
|
|
412
|
-
type: "function",
|
|
413
|
-
name: "getAmountsOut",
|
|
414
|
-
stateMutability: "view",
|
|
415
|
-
inputs: [
|
|
416
|
-
{ name: "amountIn", type: "uint256" },
|
|
400
|
+
];
|
|
401
|
+
routerAbi = [
|
|
417
402
|
{
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
403
|
+
type: "function",
|
|
404
|
+
name: "weth",
|
|
405
|
+
stateMutability: "view",
|
|
406
|
+
inputs: [],
|
|
407
|
+
outputs: [{ name: "", type: "address" }]
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
type: "function",
|
|
411
|
+
name: "defaultFactory",
|
|
412
|
+
stateMutability: "view",
|
|
413
|
+
inputs: [],
|
|
414
|
+
outputs: [{ name: "", type: "address" }]
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
type: "function",
|
|
418
|
+
name: "poolFor",
|
|
419
|
+
stateMutability: "view",
|
|
420
|
+
inputs: [
|
|
421
|
+
{ name: "tokenA", type: "address" },
|
|
422
|
+
{ name: "tokenB", type: "address" },
|
|
423
423
|
{ name: "stable", type: "bool" },
|
|
424
|
-
{ name: "
|
|
425
|
-
]
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
outputs: [{ name: "amounts", type: "uint256[]" }]
|
|
429
|
-
},
|
|
430
|
-
{
|
|
431
|
-
type: "function",
|
|
432
|
-
name: "quoteAddLiquidity",
|
|
433
|
-
stateMutability: "view",
|
|
434
|
-
inputs: [
|
|
435
|
-
{ name: "tokenA", type: "address" },
|
|
436
|
-
{ name: "tokenB", type: "address" },
|
|
437
|
-
{ name: "stable", type: "bool" },
|
|
438
|
-
{ name: "_factory", type: "address" },
|
|
439
|
-
{ name: "amountADesired", type: "uint256" },
|
|
440
|
-
{ name: "amountBDesired", type: "uint256" }
|
|
441
|
-
],
|
|
442
|
-
outputs: [
|
|
443
|
-
{ name: "amountA", type: "uint256" },
|
|
444
|
-
{ name: "amountB", type: "uint256" },
|
|
445
|
-
{ name: "liquidity", type: "uint256" }
|
|
446
|
-
]
|
|
447
|
-
},
|
|
448
|
-
{
|
|
449
|
-
type: "function",
|
|
450
|
-
name: "addLiquidity",
|
|
451
|
-
stateMutability: "nonpayable",
|
|
452
|
-
inputs: [
|
|
453
|
-
{ name: "tokenA", type: "address" },
|
|
454
|
-
{ name: "tokenB", type: "address" },
|
|
455
|
-
{ name: "stable", type: "bool" },
|
|
456
|
-
{ name: "amountADesired", type: "uint256" },
|
|
457
|
-
{ name: "amountBDesired", type: "uint256" },
|
|
458
|
-
{ name: "amountAMin", type: "uint256" },
|
|
459
|
-
{ name: "amountBMin", type: "uint256" },
|
|
460
|
-
{ name: "to", type: "address" },
|
|
461
|
-
{ name: "deadline", type: "uint256" }
|
|
462
|
-
],
|
|
463
|
-
outputs: [
|
|
464
|
-
{ name: "amountA", type: "uint256" },
|
|
465
|
-
{ name: "amountB", type: "uint256" },
|
|
466
|
-
{ name: "liquidity", type: "uint256" }
|
|
467
|
-
]
|
|
468
|
-
},
|
|
469
|
-
{
|
|
470
|
-
type: "function",
|
|
471
|
-
name: "addLiquidityETH",
|
|
472
|
-
stateMutability: "payable",
|
|
473
|
-
inputs: [
|
|
474
|
-
{ name: "token", type: "address" },
|
|
475
|
-
{ name: "stable", type: "bool" },
|
|
476
|
-
{ name: "amountTokenDesired", type: "uint256" },
|
|
477
|
-
{ name: "amountTokenMin", type: "uint256" },
|
|
478
|
-
{ name: "amountETHMin", type: "uint256" },
|
|
479
|
-
{ name: "to", type: "address" },
|
|
480
|
-
{ name: "deadline", type: "uint256" }
|
|
481
|
-
],
|
|
482
|
-
outputs: [
|
|
483
|
-
{ name: "amountToken", type: "uint256" },
|
|
484
|
-
{ name: "amountETH", type: "uint256" },
|
|
485
|
-
{ name: "liquidity", type: "uint256" }
|
|
486
|
-
]
|
|
487
|
-
},
|
|
488
|
-
{
|
|
489
|
-
type: "function",
|
|
490
|
-
name: "removeLiquidity",
|
|
491
|
-
stateMutability: "nonpayable",
|
|
492
|
-
inputs: [
|
|
493
|
-
{ name: "tokenA", type: "address" },
|
|
494
|
-
{ name: "tokenB", type: "address" },
|
|
495
|
-
{ name: "stable", type: "bool" },
|
|
496
|
-
{ name: "liquidity", type: "uint256" },
|
|
497
|
-
{ name: "amountAMin", type: "uint256" },
|
|
498
|
-
{ name: "amountBMin", type: "uint256" },
|
|
499
|
-
{ name: "to", type: "address" },
|
|
500
|
-
{ name: "deadline", type: "uint256" }
|
|
501
|
-
],
|
|
502
|
-
outputs: [
|
|
503
|
-
{ name: "amountA", type: "uint256" },
|
|
504
|
-
{ name: "amountB", type: "uint256" }
|
|
505
|
-
]
|
|
506
|
-
},
|
|
507
|
-
{
|
|
508
|
-
type: "function",
|
|
509
|
-
name: "removeLiquidityETH",
|
|
510
|
-
stateMutability: "nonpayable",
|
|
511
|
-
inputs: [
|
|
512
|
-
{ name: "token", type: "address" },
|
|
513
|
-
{ name: "stable", type: "bool" },
|
|
514
|
-
{ name: "liquidity", type: "uint256" },
|
|
515
|
-
{ name: "amountTokenMin", type: "uint256" },
|
|
516
|
-
{ name: "amountETHMin", type: "uint256" },
|
|
517
|
-
{ name: "to", type: "address" },
|
|
518
|
-
{ name: "deadline", type: "uint256" }
|
|
519
|
-
],
|
|
520
|
-
outputs: [
|
|
521
|
-
{ name: "amountToken", type: "uint256" },
|
|
522
|
-
{ name: "amountETH", type: "uint256" }
|
|
523
|
-
]
|
|
524
|
-
},
|
|
525
|
-
{
|
|
526
|
-
type: "function",
|
|
527
|
-
name: "swapExactTokensForTokens",
|
|
528
|
-
stateMutability: "nonpayable",
|
|
529
|
-
inputs: [
|
|
530
|
-
{ name: "amountIn", type: "uint256" },
|
|
531
|
-
{ name: "amountOutMin", type: "uint256" },
|
|
424
|
+
{ name: "_factory", type: "address" }
|
|
425
|
+
],
|
|
426
|
+
outputs: [{ name: "pool", type: "address" }]
|
|
427
|
+
},
|
|
532
428
|
{
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
{ name: "
|
|
429
|
+
type: "function",
|
|
430
|
+
name: "getAmountsOut",
|
|
431
|
+
stateMutability: "view",
|
|
432
|
+
inputs: [
|
|
433
|
+
{ name: "amountIn", type: "uint256" },
|
|
434
|
+
{
|
|
435
|
+
name: "routes",
|
|
436
|
+
type: "tuple[]",
|
|
437
|
+
components: [
|
|
438
|
+
{ name: "from", type: "address" },
|
|
439
|
+
{ name: "to", type: "address" },
|
|
440
|
+
{ name: "stable", type: "bool" },
|
|
441
|
+
{ name: "factory", type: "address" }
|
|
442
|
+
]
|
|
443
|
+
}
|
|
444
|
+
],
|
|
445
|
+
outputs: [{ name: "amounts", type: "uint256[]" }]
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
type: "function",
|
|
449
|
+
name: "quoteAddLiquidity",
|
|
450
|
+
stateMutability: "view",
|
|
451
|
+
inputs: [
|
|
452
|
+
{ name: "tokenA", type: "address" },
|
|
453
|
+
{ name: "tokenB", type: "address" },
|
|
538
454
|
{ name: "stable", type: "bool" },
|
|
539
|
-
{ name: "
|
|
455
|
+
{ name: "_factory", type: "address" },
|
|
456
|
+
{ name: "amountADesired", type: "uint256" },
|
|
457
|
+
{ name: "amountBDesired", type: "uint256" }
|
|
458
|
+
],
|
|
459
|
+
outputs: [
|
|
460
|
+
{ name: "amountA", type: "uint256" },
|
|
461
|
+
{ name: "amountB", type: "uint256" },
|
|
462
|
+
{ name: "liquidity", type: "uint256" }
|
|
540
463
|
]
|
|
541
464
|
},
|
|
542
|
-
{ name: "to", type: "address" },
|
|
543
|
-
{ name: "deadline", type: "uint256" }
|
|
544
|
-
],
|
|
545
|
-
outputs: [{ name: "amounts", type: "uint256[]" }]
|
|
546
|
-
},
|
|
547
|
-
{
|
|
548
|
-
type: "function",
|
|
549
|
-
name: "swapExactETHForTokens",
|
|
550
|
-
stateMutability: "payable",
|
|
551
|
-
inputs: [
|
|
552
|
-
{ name: "amountOutMin", type: "uint256" },
|
|
553
465
|
{
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
466
|
+
type: "function",
|
|
467
|
+
name: "addLiquidity",
|
|
468
|
+
stateMutability: "nonpayable",
|
|
469
|
+
inputs: [
|
|
470
|
+
{ name: "tokenA", type: "address" },
|
|
471
|
+
{ name: "tokenB", type: "address" },
|
|
472
|
+
{ name: "stable", type: "bool" },
|
|
473
|
+
{ name: "amountADesired", type: "uint256" },
|
|
474
|
+
{ name: "amountBDesired", type: "uint256" },
|
|
475
|
+
{ name: "amountAMin", type: "uint256" },
|
|
476
|
+
{ name: "amountBMin", type: "uint256" },
|
|
558
477
|
{ name: "to", type: "address" },
|
|
478
|
+
{ name: "deadline", type: "uint256" }
|
|
479
|
+
],
|
|
480
|
+
outputs: [
|
|
481
|
+
{ name: "amountA", type: "uint256" },
|
|
482
|
+
{ name: "amountB", type: "uint256" },
|
|
483
|
+
{ name: "liquidity", type: "uint256" }
|
|
484
|
+
]
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
type: "function",
|
|
488
|
+
name: "addLiquidityETH",
|
|
489
|
+
stateMutability: "payable",
|
|
490
|
+
inputs: [
|
|
491
|
+
{ name: "token", type: "address" },
|
|
559
492
|
{ name: "stable", type: "bool" },
|
|
560
|
-
{ name: "
|
|
493
|
+
{ name: "amountTokenDesired", type: "uint256" },
|
|
494
|
+
{ name: "amountTokenMin", type: "uint256" },
|
|
495
|
+
{ name: "amountETHMin", type: "uint256" },
|
|
496
|
+
{ name: "to", type: "address" },
|
|
497
|
+
{ name: "deadline", type: "uint256" }
|
|
498
|
+
],
|
|
499
|
+
outputs: [
|
|
500
|
+
{ name: "amountToken", type: "uint256" },
|
|
501
|
+
{ name: "amountETH", type: "uint256" },
|
|
502
|
+
{ name: "liquidity", type: "uint256" }
|
|
561
503
|
]
|
|
562
504
|
},
|
|
563
|
-
{ name: "to", type: "address" },
|
|
564
|
-
{ name: "deadline", type: "uint256" }
|
|
565
|
-
],
|
|
566
|
-
outputs: [{ name: "amounts", type: "uint256[]" }]
|
|
567
|
-
},
|
|
568
|
-
{
|
|
569
|
-
type: "function",
|
|
570
|
-
name: "swapExactTokensForETH",
|
|
571
|
-
stateMutability: "nonpayable",
|
|
572
|
-
inputs: [
|
|
573
|
-
{ name: "amountIn", type: "uint256" },
|
|
574
|
-
{ name: "amountOutMin", type: "uint256" },
|
|
575
505
|
{
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
506
|
+
type: "function",
|
|
507
|
+
name: "removeLiquidity",
|
|
508
|
+
stateMutability: "nonpayable",
|
|
509
|
+
inputs: [
|
|
510
|
+
{ name: "tokenA", type: "address" },
|
|
511
|
+
{ name: "tokenB", type: "address" },
|
|
512
|
+
{ name: "stable", type: "bool" },
|
|
513
|
+
{ name: "liquidity", type: "uint256" },
|
|
514
|
+
{ name: "amountAMin", type: "uint256" },
|
|
515
|
+
{ name: "amountBMin", type: "uint256" },
|
|
580
516
|
{ name: "to", type: "address" },
|
|
517
|
+
{ name: "deadline", type: "uint256" }
|
|
518
|
+
],
|
|
519
|
+
outputs: [
|
|
520
|
+
{ name: "amountA", type: "uint256" },
|
|
521
|
+
{ name: "amountB", type: "uint256" }
|
|
522
|
+
]
|
|
523
|
+
},
|
|
524
|
+
{
|
|
525
|
+
type: "function",
|
|
526
|
+
name: "removeLiquidityETH",
|
|
527
|
+
stateMutability: "nonpayable",
|
|
528
|
+
inputs: [
|
|
529
|
+
{ name: "token", type: "address" },
|
|
581
530
|
{ name: "stable", type: "bool" },
|
|
582
|
-
{ name: "
|
|
531
|
+
{ name: "liquidity", type: "uint256" },
|
|
532
|
+
{ name: "amountTokenMin", type: "uint256" },
|
|
533
|
+
{ name: "amountETHMin", type: "uint256" },
|
|
534
|
+
{ name: "to", type: "address" },
|
|
535
|
+
{ name: "deadline", type: "uint256" }
|
|
536
|
+
],
|
|
537
|
+
outputs: [
|
|
538
|
+
{ name: "amountToken", type: "uint256" },
|
|
539
|
+
{ name: "amountETH", type: "uint256" }
|
|
583
540
|
]
|
|
584
541
|
},
|
|
585
|
-
{ name: "to", type: "address" },
|
|
586
|
-
{ name: "deadline", type: "uint256" }
|
|
587
|
-
],
|
|
588
|
-
outputs: [{ name: "amounts", type: "uint256[]" }]
|
|
589
|
-
}
|
|
590
|
-
];
|
|
591
|
-
var mixedQuoterAbi = [
|
|
592
|
-
{
|
|
593
|
-
type: "function",
|
|
594
|
-
name: "quoteExactInput",
|
|
595
|
-
stateMutability: "nonpayable",
|
|
596
|
-
inputs: [
|
|
597
|
-
{ name: "path", type: "bytes" },
|
|
598
|
-
{ name: "amountIn", type: "uint256" }
|
|
599
|
-
],
|
|
600
|
-
outputs: [
|
|
601
|
-
{ name: "amountOut", type: "uint256" },
|
|
602
|
-
{ name: "v3RouteStartTickSpacing", type: "uint160[]" },
|
|
603
|
-
{ name: "v3RouteStartSqrtPriceX96AfterList", type: "uint160[]" },
|
|
604
|
-
{ name: "v3RouteInitializedTicksCrossedList", type: "uint32[]" },
|
|
605
|
-
{ name: "v3SwapGasEstimate", type: "uint256" }
|
|
606
|
-
]
|
|
607
|
-
}
|
|
608
|
-
];
|
|
609
|
-
var mixedQuoterV3Abi = [
|
|
610
|
-
{
|
|
611
|
-
type: "function",
|
|
612
|
-
name: "quoteExactInput",
|
|
613
|
-
stateMutability: "nonpayable",
|
|
614
|
-
inputs: [
|
|
615
|
-
{ name: "path", type: "bytes" },
|
|
616
|
-
{ name: "amountIn", type: "uint256" }
|
|
617
|
-
],
|
|
618
|
-
outputs: [
|
|
619
|
-
{ name: "amountOut", type: "uint256" },
|
|
620
|
-
{ name: "v3SqrtPriceX96AfterList", type: "uint160[]" },
|
|
621
|
-
{ name: "v3InitializedTicksCrossedList", type: "uint32[]" },
|
|
622
|
-
{ name: "v3SwapGasEstimate", type: "uint256" }
|
|
623
|
-
]
|
|
624
|
-
}
|
|
625
|
-
];
|
|
626
|
-
var v2PoolFactoryAbi = [
|
|
627
|
-
{
|
|
628
|
-
type: "function",
|
|
629
|
-
name: "getPool",
|
|
630
|
-
stateMutability: "view",
|
|
631
|
-
inputs: [
|
|
632
|
-
{ name: "tokenA", type: "address" },
|
|
633
|
-
{ name: "tokenB", type: "address" },
|
|
634
|
-
{ name: "stable", type: "bool" }
|
|
635
|
-
],
|
|
636
|
-
outputs: [{ name: "", type: "address" }]
|
|
637
|
-
}
|
|
638
|
-
];
|
|
639
|
-
var clPoolFactoryAbi = [
|
|
640
|
-
{
|
|
641
|
-
type: "function",
|
|
642
|
-
name: "getPool",
|
|
643
|
-
stateMutability: "view",
|
|
644
|
-
inputs: [
|
|
645
|
-
{ name: "tokenA", type: "address" },
|
|
646
|
-
{ name: "tokenB", type: "address" },
|
|
647
|
-
{ name: "tickSpacing", type: "int24" }
|
|
648
|
-
],
|
|
649
|
-
outputs: [{ name: "", type: "address" }]
|
|
650
|
-
},
|
|
651
|
-
{
|
|
652
|
-
type: "function",
|
|
653
|
-
name: "tickSpacings",
|
|
654
|
-
stateMutability: "view",
|
|
655
|
-
inputs: [],
|
|
656
|
-
outputs: [{ name: "", type: "int24[]" }]
|
|
657
|
-
}
|
|
658
|
-
];
|
|
659
|
-
var clPoolAbi = [
|
|
660
|
-
{
|
|
661
|
-
type: "function",
|
|
662
|
-
name: "slot0",
|
|
663
|
-
stateMutability: "view",
|
|
664
|
-
inputs: [],
|
|
665
|
-
outputs: [
|
|
666
|
-
{ name: "sqrtPriceX96", type: "uint160" },
|
|
667
|
-
{ name: "tick", type: "int24" },
|
|
668
|
-
{ name: "observationIndex", type: "uint16" },
|
|
669
|
-
{ name: "observationCardinality", type: "uint16" },
|
|
670
|
-
{ name: "observationCardinalityNext", type: "uint16" },
|
|
671
|
-
{ name: "unlocked", type: "bool" }
|
|
672
|
-
]
|
|
673
|
-
},
|
|
674
|
-
{
|
|
675
|
-
type: "function",
|
|
676
|
-
name: "liquidity",
|
|
677
|
-
stateMutability: "view",
|
|
678
|
-
inputs: [],
|
|
679
|
-
outputs: [{ name: "", type: "uint128" }]
|
|
680
|
-
}
|
|
681
|
-
];
|
|
682
|
-
var sugarHelperAbi = [
|
|
683
|
-
{
|
|
684
|
-
type: "function",
|
|
685
|
-
name: "estimateAmount0",
|
|
686
|
-
stateMutability: "view",
|
|
687
|
-
inputs: [
|
|
688
|
-
{ name: "amount1", type: "uint256" },
|
|
689
|
-
{ name: "sqrtRatioX96", type: "uint160" },
|
|
690
|
-
{ name: "sqrtRatioAX96", type: "uint160" },
|
|
691
|
-
{ name: "sqrtRatioBX96", type: "uint160" }
|
|
692
|
-
],
|
|
693
|
-
outputs: [{ name: "", type: "uint256" }]
|
|
694
|
-
},
|
|
695
|
-
{
|
|
696
|
-
type: "function",
|
|
697
|
-
name: "estimateAmount1",
|
|
698
|
-
stateMutability: "view",
|
|
699
|
-
inputs: [
|
|
700
|
-
{ name: "amount0", type: "uint256" },
|
|
701
|
-
{ name: "sqrtRatioX96", type: "uint160" },
|
|
702
|
-
{ name: "sqrtRatioAX96", type: "uint160" },
|
|
703
|
-
{ name: "sqrtRatioBX96", type: "uint160" }
|
|
704
|
-
],
|
|
705
|
-
outputs: [{ name: "", type: "uint256" }]
|
|
706
|
-
}
|
|
707
|
-
];
|
|
708
|
-
var nfpmAbi = [
|
|
709
|
-
{
|
|
710
|
-
type: "function",
|
|
711
|
-
name: "mint",
|
|
712
|
-
stateMutability: "payable",
|
|
713
|
-
inputs: [
|
|
714
542
|
{
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
{ name: "
|
|
720
|
-
{ name: "
|
|
721
|
-
{
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
543
|
+
type: "function",
|
|
544
|
+
name: "swapExactTokensForTokens",
|
|
545
|
+
stateMutability: "nonpayable",
|
|
546
|
+
inputs: [
|
|
547
|
+
{ name: "amountIn", type: "uint256" },
|
|
548
|
+
{ name: "amountOutMin", type: "uint256" },
|
|
549
|
+
{
|
|
550
|
+
name: "routes",
|
|
551
|
+
type: "tuple[]",
|
|
552
|
+
components: [
|
|
553
|
+
{ name: "from", type: "address" },
|
|
554
|
+
{ name: "to", type: "address" },
|
|
555
|
+
{ name: "stable", type: "bool" },
|
|
556
|
+
{ name: "factory", type: "address" }
|
|
557
|
+
]
|
|
558
|
+
},
|
|
559
|
+
{ name: "to", type: "address" },
|
|
560
|
+
{ name: "deadline", type: "uint256" }
|
|
561
|
+
],
|
|
562
|
+
outputs: [{ name: "amounts", type: "uint256[]" }]
|
|
563
|
+
},
|
|
564
|
+
{
|
|
565
|
+
type: "function",
|
|
566
|
+
name: "swapExactETHForTokens",
|
|
567
|
+
stateMutability: "payable",
|
|
568
|
+
inputs: [
|
|
569
|
+
{ name: "amountOutMin", type: "uint256" },
|
|
570
|
+
{
|
|
571
|
+
name: "routes",
|
|
572
|
+
type: "tuple[]",
|
|
573
|
+
components: [
|
|
574
|
+
{ name: "from", type: "address" },
|
|
575
|
+
{ name: "to", type: "address" },
|
|
576
|
+
{ name: "stable", type: "bool" },
|
|
577
|
+
{ name: "factory", type: "address" }
|
|
578
|
+
]
|
|
579
|
+
},
|
|
580
|
+
{ name: "to", type: "address" },
|
|
581
|
+
{ name: "deadline", type: "uint256" }
|
|
582
|
+
],
|
|
583
|
+
outputs: [{ name: "amounts", type: "uint256[]" }]
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
type: "function",
|
|
587
|
+
name: "swapExactTokensForETH",
|
|
588
|
+
stateMutability: "nonpayable",
|
|
589
|
+
inputs: [
|
|
590
|
+
{ name: "amountIn", type: "uint256" },
|
|
591
|
+
{ name: "amountOutMin", type: "uint256" },
|
|
592
|
+
{
|
|
593
|
+
name: "routes",
|
|
594
|
+
type: "tuple[]",
|
|
595
|
+
components: [
|
|
596
|
+
{ name: "from", type: "address" },
|
|
597
|
+
{ name: "to", type: "address" },
|
|
598
|
+
{ name: "stable", type: "bool" },
|
|
599
|
+
{ name: "factory", type: "address" }
|
|
600
|
+
]
|
|
601
|
+
},
|
|
602
|
+
{ name: "to", type: "address" },
|
|
603
|
+
{ name: "deadline", type: "uint256" }
|
|
604
|
+
],
|
|
605
|
+
outputs: [{ name: "amounts", type: "uint256[]" }]
|
|
606
|
+
}
|
|
607
|
+
];
|
|
608
|
+
mixedQuoterAbi = [
|
|
609
|
+
{
|
|
610
|
+
type: "function",
|
|
611
|
+
name: "quoteExactInput",
|
|
612
|
+
stateMutability: "nonpayable",
|
|
613
|
+
inputs: [
|
|
614
|
+
{ name: "path", type: "bytes" },
|
|
615
|
+
{ name: "amountIn", type: "uint256" }
|
|
616
|
+
],
|
|
617
|
+
outputs: [
|
|
618
|
+
{ name: "amountOut", type: "uint256" },
|
|
619
|
+
{ name: "v3RouteStartTickSpacing", type: "uint160[]" },
|
|
620
|
+
{ name: "v3RouteStartSqrtPriceX96AfterList", type: "uint160[]" },
|
|
621
|
+
{ name: "v3RouteInitializedTicksCrossedList", type: "uint32[]" },
|
|
622
|
+
{ name: "v3SwapGasEstimate", type: "uint256" }
|
|
730
623
|
]
|
|
731
624
|
}
|
|
732
|
-
]
|
|
733
|
-
|
|
734
|
-
{ name: "tokenId", type: "uint256" },
|
|
735
|
-
{ name: "liquidity", type: "uint128" },
|
|
736
|
-
{ name: "amount0", type: "uint256" },
|
|
737
|
-
{ name: "amount1", type: "uint256" }
|
|
738
|
-
]
|
|
739
|
-
},
|
|
740
|
-
{
|
|
741
|
-
type: "function",
|
|
742
|
-
name: "increaseLiquidity",
|
|
743
|
-
stateMutability: "payable",
|
|
744
|
-
inputs: [
|
|
625
|
+
];
|
|
626
|
+
mixedQuoterV3Abi = [
|
|
745
627
|
{
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
{ name: "
|
|
751
|
-
{ name: "
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
{ name: "
|
|
628
|
+
type: "function",
|
|
629
|
+
name: "quoteExactInput",
|
|
630
|
+
stateMutability: "nonpayable",
|
|
631
|
+
inputs: [
|
|
632
|
+
{ name: "path", type: "bytes" },
|
|
633
|
+
{ name: "amountIn", type: "uint256" }
|
|
634
|
+
],
|
|
635
|
+
outputs: [
|
|
636
|
+
{ name: "amountOut", type: "uint256" },
|
|
637
|
+
{ name: "v3SqrtPriceX96AfterList", type: "uint160[]" },
|
|
638
|
+
{ name: "v3InitializedTicksCrossedList", type: "uint32[]" },
|
|
639
|
+
{ name: "v3SwapGasEstimate", type: "uint256" }
|
|
755
640
|
]
|
|
756
641
|
}
|
|
757
|
-
]
|
|
758
|
-
|
|
759
|
-
{
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
642
|
+
];
|
|
643
|
+
v2PoolFactoryAbi = [
|
|
644
|
+
{
|
|
645
|
+
type: "function",
|
|
646
|
+
name: "getPool",
|
|
647
|
+
stateMutability: "view",
|
|
648
|
+
inputs: [
|
|
649
|
+
{ name: "tokenA", type: "address" },
|
|
650
|
+
{ name: "tokenB", type: "address" },
|
|
651
|
+
{ name: "stable", type: "bool" }
|
|
652
|
+
],
|
|
653
|
+
outputs: [{ name: "", type: "address" }]
|
|
654
|
+
}
|
|
655
|
+
];
|
|
656
|
+
clPoolFactoryAbi = [
|
|
657
|
+
{
|
|
658
|
+
type: "function",
|
|
659
|
+
name: "getPool",
|
|
660
|
+
stateMutability: "view",
|
|
661
|
+
inputs: [
|
|
662
|
+
{ name: "tokenA", type: "address" },
|
|
663
|
+
{ name: "tokenB", type: "address" },
|
|
664
|
+
{ name: "tickSpacing", type: "int24" }
|
|
665
|
+
],
|
|
666
|
+
outputs: [{ name: "", type: "address" }]
|
|
667
|
+
},
|
|
668
|
+
{
|
|
669
|
+
type: "function",
|
|
670
|
+
name: "tickSpacings",
|
|
671
|
+
stateMutability: "view",
|
|
672
|
+
inputs: [],
|
|
673
|
+
outputs: [{ name: "", type: "int24[]" }]
|
|
674
|
+
}
|
|
675
|
+
];
|
|
676
|
+
clPoolAbi = [
|
|
677
|
+
{
|
|
678
|
+
type: "function",
|
|
679
|
+
name: "slot0",
|
|
680
|
+
stateMutability: "view",
|
|
681
|
+
inputs: [],
|
|
682
|
+
outputs: [
|
|
683
|
+
{ name: "sqrtPriceX96", type: "uint160" },
|
|
684
|
+
{ name: "tick", type: "int24" },
|
|
685
|
+
{ name: "observationIndex", type: "uint16" },
|
|
686
|
+
{ name: "observationCardinality", type: "uint16" },
|
|
687
|
+
{ name: "observationCardinalityNext", type: "uint16" },
|
|
688
|
+
{ name: "unlocked", type: "bool" }
|
|
689
|
+
]
|
|
690
|
+
},
|
|
769
691
|
{
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
692
|
+
type: "function",
|
|
693
|
+
name: "liquidity",
|
|
694
|
+
stateMutability: "view",
|
|
695
|
+
inputs: [],
|
|
696
|
+
outputs: [{ name: "", type: "uint128" }]
|
|
697
|
+
}
|
|
698
|
+
];
|
|
699
|
+
sugarHelperAbi = [
|
|
700
|
+
{
|
|
701
|
+
type: "function",
|
|
702
|
+
name: "estimateAmount0",
|
|
703
|
+
stateMutability: "view",
|
|
704
|
+
inputs: [
|
|
705
|
+
{ name: "amount1", type: "uint256" },
|
|
706
|
+
{ name: "sqrtRatioX96", type: "uint160" },
|
|
707
|
+
{ name: "sqrtRatioAX96", type: "uint160" },
|
|
708
|
+
{ name: "sqrtRatioBX96", type: "uint160" }
|
|
709
|
+
],
|
|
710
|
+
outputs: [{ name: "", type: "uint256" }]
|
|
711
|
+
},
|
|
712
|
+
{
|
|
713
|
+
type: "function",
|
|
714
|
+
name: "estimateAmount1",
|
|
715
|
+
stateMutability: "view",
|
|
716
|
+
inputs: [
|
|
717
|
+
{ name: "amount0", type: "uint256" },
|
|
718
|
+
{ name: "sqrtRatioX96", type: "uint160" },
|
|
719
|
+
{ name: "sqrtRatioAX96", type: "uint160" },
|
|
720
|
+
{ name: "sqrtRatioBX96", type: "uint160" }
|
|
721
|
+
],
|
|
722
|
+
outputs: [{ name: "", type: "uint256" }]
|
|
723
|
+
}
|
|
724
|
+
];
|
|
725
|
+
nfpmAbi = [
|
|
726
|
+
{
|
|
727
|
+
type: "function",
|
|
728
|
+
name: "mint",
|
|
729
|
+
stateMutability: "payable",
|
|
730
|
+
inputs: [
|
|
731
|
+
{
|
|
732
|
+
name: "params",
|
|
733
|
+
type: "tuple",
|
|
734
|
+
components: [
|
|
735
|
+
{ name: "token0", type: "address" },
|
|
736
|
+
{ name: "token1", type: "address" },
|
|
737
|
+
{ name: "tickSpacing", type: "int24" },
|
|
738
|
+
{ name: "tickLower", type: "int24" },
|
|
739
|
+
{ name: "tickUpper", type: "int24" },
|
|
740
|
+
{ name: "amount0Desired", type: "uint256" },
|
|
741
|
+
{ name: "amount1Desired", type: "uint256" },
|
|
742
|
+
{ name: "amount0Min", type: "uint256" },
|
|
743
|
+
{ name: "amount1Min", type: "uint256" },
|
|
744
|
+
{ name: "recipient", type: "address" },
|
|
745
|
+
{ name: "deadline", type: "uint256" },
|
|
746
|
+
{ name: "sqrtPriceX96", type: "uint160" }
|
|
747
|
+
]
|
|
748
|
+
}
|
|
749
|
+
],
|
|
750
|
+
outputs: [
|
|
773
751
|
{ name: "tokenId", type: "uint256" },
|
|
774
752
|
{ name: "liquidity", type: "uint128" },
|
|
775
|
-
{ name: "
|
|
776
|
-
{ name: "
|
|
777
|
-
{ name: "deadline", type: "uint256" }
|
|
753
|
+
{ name: "amount0", type: "uint256" },
|
|
754
|
+
{ name: "amount1", type: "uint256" }
|
|
778
755
|
]
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
type: "function",
|
|
759
|
+
name: "increaseLiquidity",
|
|
760
|
+
stateMutability: "payable",
|
|
761
|
+
inputs: [
|
|
762
|
+
{
|
|
763
|
+
name: "params",
|
|
764
|
+
type: "tuple",
|
|
765
|
+
components: [
|
|
766
|
+
{ name: "tokenId", type: "uint256" },
|
|
767
|
+
{ name: "amount0Desired", type: "uint256" },
|
|
768
|
+
{ name: "amount1Desired", type: "uint256" },
|
|
769
|
+
{ name: "amount0Min", type: "uint256" },
|
|
770
|
+
{ name: "amount1Min", type: "uint256" },
|
|
771
|
+
{ name: "deadline", type: "uint256" }
|
|
772
|
+
]
|
|
773
|
+
}
|
|
774
|
+
],
|
|
775
|
+
outputs: [
|
|
776
|
+
{ name: "liquidity", type: "uint128" },
|
|
777
|
+
{ name: "amount0", type: "uint256" },
|
|
778
|
+
{ name: "amount1", type: "uint256" }
|
|
779
|
+
]
|
|
780
|
+
},
|
|
781
|
+
{
|
|
782
|
+
type: "function",
|
|
783
|
+
name: "decreaseLiquidity",
|
|
784
|
+
stateMutability: "payable",
|
|
785
|
+
inputs: [
|
|
786
|
+
{
|
|
787
|
+
name: "params",
|
|
788
|
+
type: "tuple",
|
|
789
|
+
components: [
|
|
790
|
+
{ name: "tokenId", type: "uint256" },
|
|
791
|
+
{ name: "liquidity", type: "uint128" },
|
|
792
|
+
{ name: "amount0Min", type: "uint256" },
|
|
793
|
+
{ name: "amount1Min", type: "uint256" },
|
|
794
|
+
{ name: "deadline", type: "uint256" }
|
|
795
|
+
]
|
|
796
|
+
}
|
|
797
|
+
],
|
|
798
|
+
outputs: [
|
|
799
|
+
{ name: "amount0", type: "uint256" },
|
|
800
|
+
{ name: "amount1", type: "uint256" }
|
|
801
|
+
]
|
|
802
|
+
},
|
|
803
|
+
{
|
|
804
|
+
type: "function",
|
|
805
|
+
name: "collect",
|
|
806
|
+
stateMutability: "payable",
|
|
807
|
+
inputs: [
|
|
808
|
+
{
|
|
809
|
+
name: "params",
|
|
810
|
+
type: "tuple",
|
|
811
|
+
components: [
|
|
812
|
+
{ name: "tokenId", type: "uint256" },
|
|
813
|
+
{ name: "recipient", type: "address" },
|
|
814
|
+
{ name: "amount0Max", type: "uint128" },
|
|
815
|
+
{ name: "amount1Max", type: "uint128" }
|
|
816
|
+
]
|
|
817
|
+
}
|
|
818
|
+
],
|
|
819
|
+
outputs: [
|
|
820
|
+
{ name: "amount0", type: "uint256" },
|
|
821
|
+
{ name: "amount1", type: "uint256" }
|
|
822
|
+
]
|
|
823
|
+
},
|
|
824
|
+
{
|
|
825
|
+
type: "function",
|
|
826
|
+
name: "burn",
|
|
827
|
+
stateMutability: "payable",
|
|
828
|
+
inputs: [{ name: "tokenId", type: "uint256" }],
|
|
829
|
+
outputs: []
|
|
830
|
+
},
|
|
831
|
+
{
|
|
832
|
+
type: "function",
|
|
833
|
+
name: "approve",
|
|
834
|
+
stateMutability: "nonpayable",
|
|
835
|
+
inputs: [
|
|
836
|
+
{ name: "to", type: "address" },
|
|
837
|
+
{ name: "tokenId", type: "uint256" }
|
|
838
|
+
],
|
|
839
|
+
outputs: []
|
|
779
840
|
}
|
|
780
|
-
]
|
|
781
|
-
|
|
782
|
-
{ name: "amount0", type: "uint256" },
|
|
783
|
-
{ name: "amount1", type: "uint256" }
|
|
784
|
-
]
|
|
785
|
-
},
|
|
786
|
-
{
|
|
787
|
-
type: "function",
|
|
788
|
-
name: "collect",
|
|
789
|
-
stateMutability: "payable",
|
|
790
|
-
inputs: [
|
|
841
|
+
];
|
|
842
|
+
clSwapRouterAbi = [
|
|
791
843
|
{
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
{
|
|
797
|
-
|
|
798
|
-
|
|
844
|
+
type: "function",
|
|
845
|
+
name: "exactInputSingle",
|
|
846
|
+
stateMutability: "payable",
|
|
847
|
+
inputs: [
|
|
848
|
+
{
|
|
849
|
+
name: "params",
|
|
850
|
+
type: "tuple",
|
|
851
|
+
components: [
|
|
852
|
+
{ name: "tokenIn", type: "address" },
|
|
853
|
+
{ name: "tokenOut", type: "address" },
|
|
854
|
+
{ name: "tickSpacing", type: "int24" },
|
|
855
|
+
{ name: "recipient", type: "address" },
|
|
856
|
+
{ name: "deadline", type: "uint256" },
|
|
857
|
+
{ name: "amountIn", type: "uint256" },
|
|
858
|
+
{ name: "amountOutMinimum", type: "uint256" },
|
|
859
|
+
{ name: "sqrtPriceLimitX96", type: "uint160" }
|
|
860
|
+
]
|
|
861
|
+
}
|
|
862
|
+
],
|
|
863
|
+
outputs: [{ name: "amountOut", type: "uint256" }]
|
|
864
|
+
}
|
|
865
|
+
];
|
|
866
|
+
poolClaimFeesAbi = [
|
|
867
|
+
{
|
|
868
|
+
type: "function",
|
|
869
|
+
name: "claimFees",
|
|
870
|
+
stateMutability: "nonpayable",
|
|
871
|
+
inputs: [],
|
|
872
|
+
outputs: [
|
|
873
|
+
{ name: "claimed0", type: "uint256" },
|
|
874
|
+
{ name: "claimed1", type: "uint256" }
|
|
799
875
|
]
|
|
800
876
|
}
|
|
801
|
-
]
|
|
802
|
-
|
|
803
|
-
{ name: "amount0", type: "uint256" },
|
|
804
|
-
{ name: "amount1", type: "uint256" }
|
|
805
|
-
]
|
|
806
|
-
},
|
|
807
|
-
{
|
|
808
|
-
type: "function",
|
|
809
|
-
name: "burn",
|
|
810
|
-
stateMutability: "payable",
|
|
811
|
-
inputs: [{ name: "tokenId", type: "uint256" }],
|
|
812
|
-
outputs: []
|
|
813
|
-
},
|
|
814
|
-
{
|
|
815
|
-
type: "function",
|
|
816
|
-
name: "approve",
|
|
817
|
-
stateMutability: "nonpayable",
|
|
818
|
-
inputs: [
|
|
819
|
-
{ name: "to", type: "address" },
|
|
820
|
-
{ name: "tokenId", type: "uint256" }
|
|
821
|
-
],
|
|
822
|
-
outputs: []
|
|
823
|
-
}
|
|
824
|
-
];
|
|
825
|
-
var clSwapRouterAbi = [
|
|
826
|
-
{
|
|
827
|
-
type: "function",
|
|
828
|
-
name: "exactInputSingle",
|
|
829
|
-
stateMutability: "payable",
|
|
830
|
-
inputs: [
|
|
877
|
+
];
|
|
878
|
+
gaugeAbi = [
|
|
831
879
|
{
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
880
|
+
type: "function",
|
|
881
|
+
name: "deposit",
|
|
882
|
+
stateMutability: "nonpayable",
|
|
883
|
+
inputs: [{ name: "_amount", type: "uint256" }],
|
|
884
|
+
outputs: []
|
|
885
|
+
},
|
|
886
|
+
{
|
|
887
|
+
type: "function",
|
|
888
|
+
name: "withdraw",
|
|
889
|
+
stateMutability: "nonpayable",
|
|
890
|
+
inputs: [{ name: "_amount", type: "uint256" }],
|
|
891
|
+
outputs: []
|
|
892
|
+
},
|
|
893
|
+
{
|
|
894
|
+
type: "function",
|
|
895
|
+
name: "getReward",
|
|
896
|
+
stateMutability: "nonpayable",
|
|
897
|
+
inputs: [{ name: "_account", type: "address" }],
|
|
898
|
+
outputs: []
|
|
899
|
+
}
|
|
900
|
+
];
|
|
901
|
+
clGaugeAbi = [
|
|
902
|
+
{
|
|
903
|
+
type: "function",
|
|
904
|
+
name: "deposit",
|
|
905
|
+
stateMutability: "nonpayable",
|
|
906
|
+
inputs: [{ name: "tokenId", type: "uint256" }],
|
|
907
|
+
outputs: []
|
|
908
|
+
},
|
|
909
|
+
{
|
|
910
|
+
type: "function",
|
|
911
|
+
name: "withdraw",
|
|
912
|
+
stateMutability: "nonpayable",
|
|
913
|
+
inputs: [{ name: "tokenId", type: "uint256" }],
|
|
914
|
+
outputs: []
|
|
915
|
+
},
|
|
916
|
+
{
|
|
917
|
+
type: "function",
|
|
918
|
+
name: "getReward",
|
|
919
|
+
stateMutability: "nonpayable",
|
|
920
|
+
inputs: [{ name: "tokenId", type: "uint256" }],
|
|
921
|
+
outputs: []
|
|
922
|
+
}
|
|
923
|
+
];
|
|
924
|
+
aerodromePoolMetaAbi = [
|
|
925
|
+
{ type: "function", name: "symbol", stateMutability: "view", inputs: [], outputs: [{ type: "string" }] },
|
|
926
|
+
{ type: "function", name: "token0", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
927
|
+
{ type: "function", name: "token1", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
928
|
+
{ type: "function", name: "stable", stateMutability: "view", inputs: [], outputs: [{ type: "bool" }] },
|
|
929
|
+
{
|
|
930
|
+
type: "function",
|
|
931
|
+
name: "getReserves",
|
|
932
|
+
stateMutability: "view",
|
|
933
|
+
inputs: [],
|
|
934
|
+
outputs: [
|
|
935
|
+
{ name: "_reserve0", type: "uint256" },
|
|
936
|
+
{ name: "_reserve1", type: "uint256" },
|
|
937
|
+
{ name: "_blockTimestampLast", type: "uint256" }
|
|
843
938
|
]
|
|
844
939
|
}
|
|
845
|
-
]
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
{ name: "
|
|
857
|
-
{ name: "
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
]
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
inputs: [{ name: "tokenId", type: "uint256" }],
|
|
890
|
-
outputs: []
|
|
891
|
-
},
|
|
892
|
-
{
|
|
893
|
-
type: "function",
|
|
894
|
-
name: "withdraw",
|
|
895
|
-
stateMutability: "nonpayable",
|
|
896
|
-
inputs: [{ name: "tokenId", type: "uint256" }],
|
|
897
|
-
outputs: []
|
|
898
|
-
},
|
|
899
|
-
{
|
|
900
|
-
type: "function",
|
|
901
|
-
name: "getReward",
|
|
902
|
-
stateMutability: "nonpayable",
|
|
903
|
-
inputs: [{ name: "tokenId", type: "uint256" }],
|
|
904
|
-
outputs: []
|
|
905
|
-
}
|
|
906
|
-
];
|
|
907
|
-
var aerodromePoolMetaAbi = [
|
|
908
|
-
{ type: "function", name: "symbol", stateMutability: "view", inputs: [], outputs: [{ type: "string" }] },
|
|
909
|
-
{ type: "function", name: "token0", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
910
|
-
{ type: "function", name: "token1", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
911
|
-
{ type: "function", name: "stable", stateMutability: "view", inputs: [], outputs: [{ type: "bool" }] },
|
|
912
|
-
{
|
|
913
|
-
type: "function",
|
|
914
|
-
name: "getReserves",
|
|
915
|
-
stateMutability: "view",
|
|
916
|
-
inputs: [],
|
|
917
|
-
outputs: [
|
|
918
|
-
{ name: "_reserve0", type: "uint256" },
|
|
919
|
-
{ name: "_reserve1", type: "uint256" },
|
|
920
|
-
{ name: "_blockTimestampLast", type: "uint256" }
|
|
921
|
-
]
|
|
922
|
-
}
|
|
923
|
-
];
|
|
924
|
-
var aerodromeVoterAbi = [
|
|
925
|
-
{
|
|
926
|
-
type: "function",
|
|
927
|
-
name: "gauges",
|
|
928
|
-
stateMutability: "view",
|
|
929
|
-
inputs: [{ name: "pool", type: "address" }],
|
|
930
|
-
outputs: [{ type: "address" }]
|
|
931
|
-
}
|
|
932
|
-
];
|
|
933
|
-
var erc20Abi = [
|
|
934
|
-
{ type: "function", name: "name", stateMutability: "view", inputs: [], outputs: [{ type: "string" }] },
|
|
935
|
-
{ type: "function", name: "decimals", stateMutability: "view", inputs: [], outputs: [{ type: "uint8" }] },
|
|
936
|
-
{ type: "function", name: "totalSupply", stateMutability: "view", inputs: [], outputs: [{ type: "uint256" }] },
|
|
937
|
-
{
|
|
938
|
-
type: "function",
|
|
939
|
-
name: "allowance",
|
|
940
|
-
stateMutability: "view",
|
|
941
|
-
inputs: [
|
|
942
|
-
{ name: "owner", type: "address" },
|
|
943
|
-
{ name: "spender", type: "address" }
|
|
944
|
-
],
|
|
945
|
-
outputs: [{ type: "uint256" }]
|
|
946
|
-
},
|
|
947
|
-
{
|
|
948
|
-
type: "function",
|
|
949
|
-
name: "approve",
|
|
950
|
-
stateMutability: "nonpayable",
|
|
951
|
-
inputs: [
|
|
952
|
-
{ name: "spender", type: "address" },
|
|
953
|
-
{ name: "amount", type: "uint256" }
|
|
954
|
-
],
|
|
955
|
-
outputs: [{ type: "bool" }]
|
|
956
|
-
},
|
|
957
|
-
{
|
|
958
|
-
type: "function",
|
|
959
|
-
name: "symbol",
|
|
960
|
-
stateMutability: "view",
|
|
961
|
-
inputs: [],
|
|
962
|
-
outputs: [{ type: "string" }]
|
|
963
|
-
}
|
|
964
|
-
];
|
|
940
|
+
];
|
|
941
|
+
aerodromeVoterAbi = [
|
|
942
|
+
{
|
|
943
|
+
type: "function",
|
|
944
|
+
name: "gauges",
|
|
945
|
+
stateMutability: "view",
|
|
946
|
+
inputs: [{ name: "pool", type: "address" }],
|
|
947
|
+
outputs: [{ type: "address" }]
|
|
948
|
+
}
|
|
949
|
+
];
|
|
950
|
+
erc20Abi = [
|
|
951
|
+
{ type: "function", name: "name", stateMutability: "view", inputs: [], outputs: [{ type: "string" }] },
|
|
952
|
+
{ type: "function", name: "decimals", stateMutability: "view", inputs: [], outputs: [{ type: "uint8" }] },
|
|
953
|
+
{ type: "function", name: "totalSupply", stateMutability: "view", inputs: [], outputs: [{ type: "uint256" }] },
|
|
954
|
+
{
|
|
955
|
+
type: "function",
|
|
956
|
+
name: "allowance",
|
|
957
|
+
stateMutability: "view",
|
|
958
|
+
inputs: [
|
|
959
|
+
{ name: "owner", type: "address" },
|
|
960
|
+
{ name: "spender", type: "address" }
|
|
961
|
+
],
|
|
962
|
+
outputs: [{ type: "uint256" }]
|
|
963
|
+
},
|
|
964
|
+
{
|
|
965
|
+
type: "function",
|
|
966
|
+
name: "approve",
|
|
967
|
+
stateMutability: "nonpayable",
|
|
968
|
+
inputs: [
|
|
969
|
+
{ name: "spender", type: "address" },
|
|
970
|
+
{ name: "amount", type: "uint256" }
|
|
971
|
+
],
|
|
972
|
+
outputs: [{ type: "bool" }]
|
|
973
|
+
},
|
|
974
|
+
{
|
|
975
|
+
type: "function",
|
|
976
|
+
name: "symbol",
|
|
977
|
+
stateMutability: "view",
|
|
978
|
+
inputs: [],
|
|
979
|
+
outputs: [{ type: "string" }]
|
|
980
|
+
}
|
|
981
|
+
];
|
|
982
|
+
}
|
|
983
|
+
});
|
|
965
984
|
function aerodromePublicClient(rpcUrl) {
|
|
966
985
|
const url = requireAerodromeRpcUrl(rpcUrl);
|
|
967
986
|
const chain = defineChain({
|
|
@@ -978,29 +997,11 @@ function aerodromePublicClient(rpcUrl) {
|
|
|
978
997
|
});
|
|
979
998
|
return createPublicClient({ chain, transport: http(url) });
|
|
980
999
|
}
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
{ symbol: "METAc", name: "Meta Platforms Inc.", address: "0xb2000000000000000000008bC8786B856E61707C" },
|
|
987
|
-
{ symbol: "GOOGLc", name: "Alphabet Inc.", address: "0xb2000000000000000000002D0BA3164cc74f58B7" },
|
|
988
|
-
{ symbol: "AMZNc", name: "Amazon.com Inc.", address: "0xb200000000000000000000d9192b6B456483C2E8" },
|
|
989
|
-
{ symbol: "TSLAc", name: "Tesla Inc.", address: "0xb2000000000000000000001e800a7f5189430cD0" },
|
|
990
|
-
{ symbol: "MSFTc", name: "Microsoft Corporation", address: "0xB200000000000000000000Ab99cFa739E253872B" },
|
|
991
|
-
{ symbol: "COINc", name: "Coinbase Global Inc.", address: "0xb200000000000000000000c85a31389D71F3ecfb" },
|
|
992
|
-
{ symbol: "MSTRc", name: "Strategy Inc.", address: "0xb2000000000000000000004884b426556b92883d" },
|
|
993
|
-
{ symbol: "CRCLc", name: "Circle Internet Group Inc.", address: "0xB20000000000000000000019f6E7C675b73C2e4D" },
|
|
994
|
-
{ symbol: "INTCc", name: "Intel Corporation", address: "0xB2000000000000000000004AFF16039bA04bdFBc" },
|
|
995
|
-
{ symbol: "SNDKc", name: "Sandisk Corporation", address: "0xb200000000000000000000397293Cb8cda9a10c5" },
|
|
996
|
-
{ symbol: "SPCXc", name: "Space Exploration Technologies Corp.", address: "0xb2000000000000000000007b9fcbd005511aCBd5" }
|
|
997
|
-
];
|
|
998
|
-
var AERODROME_COINBASE_STOCK_DECIMALS = 8;
|
|
999
|
-
var AERODROME_B20_ASSET_PREFIX = "0xb200000000000000000000";
|
|
1000
|
-
var BASE_STOCKS_DOCS_URLS = [
|
|
1001
|
-
"https://docs.base.org/base-chain/asset-issuance/tokenized-stocks-on-base.md",
|
|
1002
|
-
"https://docs.base.org/base-chain/asset-issuance/tokenized-stocks-on-base"
|
|
1003
|
-
];
|
|
1000
|
+
var init_client = __esm({
|
|
1001
|
+
"src/protocols/evm/aerodrome/client.ts"() {
|
|
1002
|
+
init_support();
|
|
1003
|
+
}
|
|
1004
|
+
});
|
|
1004
1005
|
function isAerodromeB20AssetToken(address) {
|
|
1005
1006
|
try {
|
|
1006
1007
|
return getAddress(address).toLowerCase().startsWith(AERODROME_B20_ASSET_PREFIX);
|
|
@@ -1090,8 +1091,6 @@ async function assertAerodromeStockIssued(args) {
|
|
|
1090
1091
|
function aerodromeCoinbaseStockAddresses() {
|
|
1091
1092
|
return AERODROME_COINBASE_STOCK_TOKENS.map((t) => getAddress(t.address));
|
|
1092
1093
|
}
|
|
1093
|
-
var MAX_DOCS_CHARS = 4e5;
|
|
1094
|
-
var MAX_OFFICIAL_STOCKS = 40;
|
|
1095
1094
|
function parseBaseTokenizedStockDocs(text) {
|
|
1096
1095
|
try {
|
|
1097
1096
|
if (typeof text !== "string" || text.length < 20) return [];
|
|
@@ -1219,7 +1218,38 @@ async function aerodromeResolveStockTokens(args) {
|
|
|
1219
1218
|
return seedStockRows();
|
|
1220
1219
|
}
|
|
1221
1220
|
}
|
|
1222
|
-
var
|
|
1221
|
+
var AERODROME_COINBASE_STOCK_TOKENS, AERODROME_COINBASE_STOCK_DECIMALS, AERODROME_B20_ASSET_PREFIX, BASE_STOCKS_DOCS_URLS, MAX_DOCS_CHARS, MAX_OFFICIAL_STOCKS;
|
|
1222
|
+
var init_stockTokens = __esm({
|
|
1223
|
+
"src/protocols/evm/aerodrome/stockTokens.ts"() {
|
|
1224
|
+
init_addresses();
|
|
1225
|
+
init_abi();
|
|
1226
|
+
init_client();
|
|
1227
|
+
init_support();
|
|
1228
|
+
AERODROME_COINBASE_STOCK_TOKENS = [
|
|
1229
|
+
{ symbol: "AAPLc", name: "Apple Inc.", address: "0xb200000000000000000000C2e324d24d7eEcd1fb" },
|
|
1230
|
+
{ symbol: "NVDAc", name: "NVIDIA Corporation", address: "0xb20000000000000000000078ee7ce2fE4908108C" },
|
|
1231
|
+
{ symbol: "METAc", name: "Meta Platforms Inc.", address: "0xb2000000000000000000008bC8786B856E61707C" },
|
|
1232
|
+
{ symbol: "GOOGLc", name: "Alphabet Inc.", address: "0xb2000000000000000000002D0BA3164cc74f58B7" },
|
|
1233
|
+
{ symbol: "AMZNc", name: "Amazon.com Inc.", address: "0xb200000000000000000000d9192b6B456483C2E8" },
|
|
1234
|
+
{ symbol: "TSLAc", name: "Tesla Inc.", address: "0xb2000000000000000000001e800a7f5189430cD0" },
|
|
1235
|
+
{ symbol: "MSFTc", name: "Microsoft Corporation", address: "0xB200000000000000000000Ab99cFa739E253872B" },
|
|
1236
|
+
{ symbol: "COINc", name: "Coinbase Global Inc.", address: "0xb200000000000000000000c85a31389D71F3ecfb" },
|
|
1237
|
+
{ symbol: "MSTRc", name: "Strategy Inc.", address: "0xb2000000000000000000004884b426556b92883d" },
|
|
1238
|
+
{ symbol: "CRCLc", name: "Circle Internet Group Inc.", address: "0xB20000000000000000000019f6E7C675b73C2e4D" },
|
|
1239
|
+
{ symbol: "INTCc", name: "Intel Corporation", address: "0xB2000000000000000000004AFF16039bA04bdFBc" },
|
|
1240
|
+
{ symbol: "SNDKc", name: "Sandisk Corporation", address: "0xb200000000000000000000397293Cb8cda9a10c5" },
|
|
1241
|
+
{ symbol: "SPCXc", name: "Space Exploration Technologies Corp.", address: "0xb2000000000000000000007b9fcbd005511aCBd5" }
|
|
1242
|
+
];
|
|
1243
|
+
AERODROME_COINBASE_STOCK_DECIMALS = 8;
|
|
1244
|
+
AERODROME_B20_ASSET_PREFIX = "0xb200000000000000000000";
|
|
1245
|
+
BASE_STOCKS_DOCS_URLS = [
|
|
1246
|
+
"https://docs.base.org/base-chain/asset-issuance/tokenized-stocks-on-base.md",
|
|
1247
|
+
"https://docs.base.org/base-chain/asset-issuance/tokenized-stocks-on-base"
|
|
1248
|
+
];
|
|
1249
|
+
MAX_DOCS_CHARS = 4e5;
|
|
1250
|
+
MAX_OFFICIAL_STOCKS = 40;
|
|
1251
|
+
}
|
|
1252
|
+
});
|
|
1223
1253
|
function checksum(addr) {
|
|
1224
1254
|
return getAddress(addr);
|
|
1225
1255
|
}
|
|
@@ -1451,6 +1481,322 @@ async function aerodromeDiscoverPoolsSummary(args) {
|
|
|
1451
1481
|
notes: pools.length === 0 ? `No factory pool on the ${inLabel}/${outLabel} connector graph (direct + WETH/USDC/AERO hops). B20 stocks LP vs USDC; ETH\u2192stock quotes hop WETH\u2192USDC\u2192stock. Call ctm_aerodrome_quote with tickers for a price.` : `Factory-discovered pools on the ${inLabel}/${outLabel} connector graph (v2 + Slipstream 1/2/3). Not a Sugar dump. Call ctm_aerodrome_quote({ tokenIn: "${inLabel}", tokenOut: "${outLabel}", amountHuman }) for a price.`
|
|
1452
1482
|
};
|
|
1453
1483
|
}
|
|
1484
|
+
var FALLBACK_TICK_SPACINGS;
|
|
1485
|
+
var init_discover = __esm({
|
|
1486
|
+
"src/protocols/evm/aerodrome/discover.ts"() {
|
|
1487
|
+
init_abi();
|
|
1488
|
+
init_addresses();
|
|
1489
|
+
init_client();
|
|
1490
|
+
init_stockTokens();
|
|
1491
|
+
init_support();
|
|
1492
|
+
FALLBACK_TICK_SPACINGS = [1, 10, 50, 100, 200, 500, 2e3];
|
|
1493
|
+
}
|
|
1494
|
+
});
|
|
1495
|
+
|
|
1496
|
+
// src/protocols/evm/aerodrome/yields.ts
|
|
1497
|
+
var yields_exports = {};
|
|
1498
|
+
__export(yields_exports, {
|
|
1499
|
+
AERODROME_IMPORTANT_POOL_CAP: () => AERODROME_IMPORTANT_POOL_CAP,
|
|
1500
|
+
aerodromeFetchImportantPoolsSummary: () => aerodromeFetchImportantPoolsSummary,
|
|
1501
|
+
aerodromeFetchLpYieldsForPair: () => aerodromeFetchLpYieldsForPair,
|
|
1502
|
+
aerodromeFetchLpYieldsForPools: () => aerodromeFetchLpYieldsForPools,
|
|
1503
|
+
aerodromeFetchLpYieldsSummary: () => aerodromeFetchLpYieldsSummary,
|
|
1504
|
+
aerodromeFetchStockLpYieldsSummary: () => aerodromeFetchStockLpYieldsSummary,
|
|
1505
|
+
formatAerodromeLpYieldLabel: () => formatAerodromeLpYieldLabel
|
|
1506
|
+
});
|
|
1507
|
+
function poolKind2(type) {
|
|
1508
|
+
if (type === 0) return "stable";
|
|
1509
|
+
if (type === -1) return "volatile";
|
|
1510
|
+
return "cl";
|
|
1511
|
+
}
|
|
1512
|
+
function formatApr(pct) {
|
|
1513
|
+
if (pct == null || !Number.isFinite(pct) || pct < 0) return null;
|
|
1514
|
+
return `${pct.toFixed(2)}%`;
|
|
1515
|
+
}
|
|
1516
|
+
function formatAerodromeLpYieldLabel(row) {
|
|
1517
|
+
const kind = row.kind === "stable" ? "sAMM" : row.kind === "volatile" ? "vAMM" : "Slipstream";
|
|
1518
|
+
if (row.emissionsApr) {
|
|
1519
|
+
return `${row.emissionsApr} emissions APR (${kind})`;
|
|
1520
|
+
}
|
|
1521
|
+
return `Emissions APR not priced (${kind})`;
|
|
1522
|
+
}
|
|
1523
|
+
function isMainPair(token0, token1, aero) {
|
|
1524
|
+
const mains = new Set(BASE_MAIN_TOKEN_ADDRESSES);
|
|
1525
|
+
mains.add(aero.toLowerCase());
|
|
1526
|
+
return mains.has(token0.toLowerCase()) && mains.has(token1.toLowerCase());
|
|
1527
|
+
}
|
|
1528
|
+
async function fetchSugarYieldPage(args) {
|
|
1529
|
+
const addrs = await loadAerodromeAddresses();
|
|
1530
|
+
const client = aerodromePublicClient(args.rpcUrl);
|
|
1531
|
+
const rows = await client.readContract({
|
|
1532
|
+
address: addrs.lpSugar,
|
|
1533
|
+
abi: lpSugarAbi,
|
|
1534
|
+
functionName: "all",
|
|
1535
|
+
args: [BigInt(args.limit), BigInt(args.offset), 0n]
|
|
1536
|
+
});
|
|
1537
|
+
return rows.map((p) => ({
|
|
1538
|
+
lp: getAddress(p.lp),
|
|
1539
|
+
symbol: p.symbol,
|
|
1540
|
+
type: p.type,
|
|
1541
|
+
token0: getAddress(p.token0),
|
|
1542
|
+
token1: getAddress(p.token1),
|
|
1543
|
+
gauge: getAddress(p.gauge),
|
|
1544
|
+
gauge_alive: Boolean(p.gauge_alive),
|
|
1545
|
+
reserve0: p.reserve0,
|
|
1546
|
+
reserve1: p.reserve1,
|
|
1547
|
+
liquidity: p.liquidity,
|
|
1548
|
+
emissions: p.emissions,
|
|
1549
|
+
pool_fee: p.pool_fee
|
|
1550
|
+
}));
|
|
1551
|
+
}
|
|
1552
|
+
function aeroUsdPriceFromRows(rows, aero) {
|
|
1553
|
+
const aeroLo = aero.toLowerCase();
|
|
1554
|
+
const usdcLo = AERODROME_USDC_BASE.toLowerCase();
|
|
1555
|
+
for (const r of rows) {
|
|
1556
|
+
const t0 = r.token0.toLowerCase();
|
|
1557
|
+
const t1 = r.token1.toLowerCase();
|
|
1558
|
+
if (t0 === aeroLo && t1 === usdcLo || t0 === usdcLo && t1 === aeroLo) {
|
|
1559
|
+
const aeroRes = t0 === aeroLo ? Number(r.reserve0) / 1e18 : Number(r.reserve1) / 1e18;
|
|
1560
|
+
const usdcRes = t0 === usdcLo ? Number(r.reserve0) / 1e6 : Number(r.reserve1) / 1e6;
|
|
1561
|
+
if (aeroRes > 0 && usdcRes > 0) return usdcRes / aeroRes;
|
|
1562
|
+
}
|
|
1563
|
+
}
|
|
1564
|
+
return null;
|
|
1565
|
+
}
|
|
1566
|
+
function rowTvlUsd(r) {
|
|
1567
|
+
const fromLiq = Number(r.liquidity) / 1e18;
|
|
1568
|
+
if (Number.isFinite(fromLiq) && fromLiq > 1) return fromLiq;
|
|
1569
|
+
const t0 = r.token0.toLowerCase();
|
|
1570
|
+
const t1 = r.token1.toLowerCase();
|
|
1571
|
+
const usdc = AERODROME_USDC_BASE.toLowerCase();
|
|
1572
|
+
if (t0 === usdc) {
|
|
1573
|
+
const usd = Number(r.reserve0) / 1e6;
|
|
1574
|
+
return Number.isFinite(usd) && usd > 0 ? usd * 2 : null;
|
|
1575
|
+
}
|
|
1576
|
+
if (t1 === usdc) {
|
|
1577
|
+
const usd = Number(r.reserve1) / 1e6;
|
|
1578
|
+
return Number.isFinite(usd) && usd > 0 ? usd * 2 : null;
|
|
1579
|
+
}
|
|
1580
|
+
return null;
|
|
1581
|
+
}
|
|
1582
|
+
function toYieldRow(r, aeroUsd) {
|
|
1583
|
+
const tvlUsd = rowTvlUsd(r);
|
|
1584
|
+
const emissionsPerSec = Number(r.emissions) / 1e18;
|
|
1585
|
+
let emissionsApr = null;
|
|
1586
|
+
if (aeroUsd != null && tvlUsd != null && tvlUsd > 0 && Number.isFinite(emissionsPerSec) && emissionsPerSec > 0) {
|
|
1587
|
+
emissionsApr = emissionsPerSec * SECONDS_PER_YEAR * aeroUsd / tvlUsd * 100;
|
|
1588
|
+
}
|
|
1589
|
+
const feeBpsRaw = Number(r.pool_fee);
|
|
1590
|
+
const feeBps = Number.isFinite(feeBpsRaw) && feeBpsRaw > 0 ? feeBpsRaw : null;
|
|
1591
|
+
return {
|
|
1592
|
+
lp: r.lp,
|
|
1593
|
+
symbol: r.symbol,
|
|
1594
|
+
kind: poolKind2(Number(r.type)),
|
|
1595
|
+
token0: r.token0,
|
|
1596
|
+
token1: r.token1,
|
|
1597
|
+
gauge: r.gauge === zeroAddress ? "" : r.gauge,
|
|
1598
|
+
gaugeAlive: Boolean(r.gauge_alive),
|
|
1599
|
+
reserve0: r.reserve0.toString(),
|
|
1600
|
+
reserve1: r.reserve1.toString(),
|
|
1601
|
+
feeBps,
|
|
1602
|
+
feeApr: null,
|
|
1603
|
+
emissionsApr: formatApr(emissionsApr),
|
|
1604
|
+
totalApr: formatApr(emissionsApr),
|
|
1605
|
+
tvlUsd
|
|
1606
|
+
};
|
|
1607
|
+
}
|
|
1608
|
+
function rankAndCap(rows, query) {
|
|
1609
|
+
const q = (query ?? "").trim().toLowerCase();
|
|
1610
|
+
let filtered = rows.filter((r) => (r.tvlUsd ?? 0) > 0);
|
|
1611
|
+
if (q) {
|
|
1612
|
+
filtered = filtered.filter(
|
|
1613
|
+
(r) => [r.symbol, r.lp, r.token0, r.token1, r.kind].join(" ").toLowerCase().includes(q)
|
|
1614
|
+
);
|
|
1615
|
+
}
|
|
1616
|
+
filtered.sort((a, b) => (b.tvlUsd ?? 0) - (a.tvlUsd ?? 0));
|
|
1617
|
+
return filtered.slice(0, AERODROME_IMPORTANT_POOL_CAP);
|
|
1618
|
+
}
|
|
1619
|
+
async function scanSugarTop(rpcUrl) {
|
|
1620
|
+
const pages = [];
|
|
1621
|
+
for (let i = 0; i < SUGAR_SCAN_PAGES; i++) {
|
|
1622
|
+
const page = await fetchSugarYieldPage({ rpcUrl, limit: SUGAR_PAGE, offset: i * SUGAR_PAGE });
|
|
1623
|
+
pages.push(page);
|
|
1624
|
+
if (page.length < SUGAR_PAGE) break;
|
|
1625
|
+
}
|
|
1626
|
+
return pages.flat();
|
|
1627
|
+
}
|
|
1628
|
+
async function aerodromeFetchImportantPoolsSummary(args) {
|
|
1629
|
+
if (!isAerodromeChainSupported(args.chainId)) {
|
|
1630
|
+
throw new Error(`Aerodrome is Base-only (chainId ${AERODROME_CHAIN_ID}).`);
|
|
1631
|
+
}
|
|
1632
|
+
const addrs = await loadAerodromeAddresses();
|
|
1633
|
+
const scanned = await scanSugarTop(args.rpcUrl);
|
|
1634
|
+
const aeroUsd = aeroUsdPriceFromRows(scanned, addrs.aero);
|
|
1635
|
+
const main = scanned.filter((r) => isMainPair(r.token0, r.token1, addrs.aero));
|
|
1636
|
+
const pools = rankAndCap(main.map((r) => toYieldRow(r, aeroUsd)), args.query);
|
|
1637
|
+
return {
|
|
1638
|
+
chainId: AERODROME_CHAIN_ID,
|
|
1639
|
+
pools,
|
|
1640
|
+
notes: `At most ${AERODROME_IMPORTANT_POOL_CAP} important Base pairs (ETH/WETH, USDC, AERO, major stables), TVL-ranked. Not an LpSugar.all dump. feeApr is omitted (Sugar exposes fee tier, not volume). emissionsApr uses on-chain AERO/USDC when priced.`
|
|
1641
|
+
};
|
|
1642
|
+
}
|
|
1643
|
+
async function aerodromeFetchLpYieldsSummary(args) {
|
|
1644
|
+
return aerodromeFetchImportantPoolsSummary(args);
|
|
1645
|
+
}
|
|
1646
|
+
async function fetchSugarByAddress(rpcUrl, lp) {
|
|
1647
|
+
const addrs = await loadAerodromeAddresses();
|
|
1648
|
+
const client = aerodromePublicClient(rpcUrl);
|
|
1649
|
+
try {
|
|
1650
|
+
const p = await client.readContract({
|
|
1651
|
+
address: addrs.lpSugar,
|
|
1652
|
+
abi: lpSugarAbi,
|
|
1653
|
+
functionName: "byAddress",
|
|
1654
|
+
args: [lp]
|
|
1655
|
+
});
|
|
1656
|
+
if (!p?.lp || p.lp === zeroAddress) return null;
|
|
1657
|
+
return {
|
|
1658
|
+
lp: getAddress(p.lp),
|
|
1659
|
+
symbol: p.symbol,
|
|
1660
|
+
type: p.type,
|
|
1661
|
+
token0: getAddress(p.token0),
|
|
1662
|
+
token1: getAddress(p.token1),
|
|
1663
|
+
gauge: getAddress(p.gauge),
|
|
1664
|
+
gauge_alive: Boolean(p.gauge_alive),
|
|
1665
|
+
reserve0: p.reserve0,
|
|
1666
|
+
reserve1: p.reserve1,
|
|
1667
|
+
liquidity: p.liquidity,
|
|
1668
|
+
emissions: p.emissions,
|
|
1669
|
+
pool_fee: p.pool_fee
|
|
1670
|
+
};
|
|
1671
|
+
} catch {
|
|
1672
|
+
return null;
|
|
1673
|
+
}
|
|
1674
|
+
}
|
|
1675
|
+
function resolveYieldToken(addr, weth) {
|
|
1676
|
+
if (isAerodromeNativeToken(addr)) return getAddress(weth);
|
|
1677
|
+
return getAddress(addr);
|
|
1678
|
+
}
|
|
1679
|
+
async function aeroUsdFromUsdcPool(rpcUrl, aero) {
|
|
1680
|
+
const aeroUsdc = await aerodromeDiscoverDirectPools({
|
|
1681
|
+
rpcUrl,
|
|
1682
|
+
tokenA: getAddress(aero),
|
|
1683
|
+
tokenB: getAddress(AERODROME_USDC_BASE)
|
|
1684
|
+
});
|
|
1685
|
+
const prefer = aeroUsdc.find((p) => p.kind === "volatile") ?? aeroUsdc[0];
|
|
1686
|
+
if (!prefer) return null;
|
|
1687
|
+
const raw = await fetchSugarByAddress(rpcUrl, prefer.lp);
|
|
1688
|
+
return raw ? aeroUsdPriceFromRows([raw], aero) : null;
|
|
1689
|
+
}
|
|
1690
|
+
async function aerodromeFetchLpYieldsForPools(args) {
|
|
1691
|
+
if (!isAerodromeChainSupported(args.chainId)) {
|
|
1692
|
+
throw new Error(`Aerodrome is Base-only (chainId ${AERODROME_CHAIN_ID}).`);
|
|
1693
|
+
}
|
|
1694
|
+
const addrs = await loadAerodromeAddresses();
|
|
1695
|
+
const aeroUsd = await aeroUsdFromUsdcPool(args.rpcUrl, addrs.aero);
|
|
1696
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1697
|
+
const pools = [];
|
|
1698
|
+
for (const rawLp of args.lps) {
|
|
1699
|
+
let lp;
|
|
1700
|
+
try {
|
|
1701
|
+
lp = getAddress(rawLp);
|
|
1702
|
+
} catch {
|
|
1703
|
+
continue;
|
|
1704
|
+
}
|
|
1705
|
+
if (lp === zeroAddress || seen.has(lp.toLowerCase())) continue;
|
|
1706
|
+
seen.add(lp.toLowerCase());
|
|
1707
|
+
const raw = await fetchSugarByAddress(args.rpcUrl, lp);
|
|
1708
|
+
if (raw) pools.push(toYieldRow(raw, aeroUsd));
|
|
1709
|
+
}
|
|
1710
|
+
return {
|
|
1711
|
+
chainId: AERODROME_CHAIN_ID,
|
|
1712
|
+
pools,
|
|
1713
|
+
notes: "Same Sugar emissions formula as fetch_lp_yields (AERO/USDC priced). feeApr is omitted (Sugar has fee tier, not volume)."
|
|
1714
|
+
};
|
|
1715
|
+
}
|
|
1716
|
+
async function aerodromeFetchLpYieldsForPair(args) {
|
|
1717
|
+
if (!isAerodromeChainSupported(args.chainId)) {
|
|
1718
|
+
throw new Error(`Aerodrome is Base-only (chainId ${AERODROME_CHAIN_ID}).`);
|
|
1719
|
+
}
|
|
1720
|
+
const addrs = await loadAerodromeAddresses();
|
|
1721
|
+
const tokenA = resolveYieldToken(args.tokenA, addrs.weth);
|
|
1722
|
+
const tokenB = resolveYieldToken(args.tokenB, addrs.weth);
|
|
1723
|
+
if (tokenA.toLowerCase() === tokenB.toLowerCase()) {
|
|
1724
|
+
return { chainId: AERODROME_CHAIN_ID, pools: [], notes: "Pair tokens must differ." };
|
|
1725
|
+
}
|
|
1726
|
+
const discovered = await aerodromeDiscoverDirectPools({ rpcUrl: args.rpcUrl, tokenA, tokenB });
|
|
1727
|
+
return aerodromeFetchLpYieldsForPools({
|
|
1728
|
+
chainId: args.chainId,
|
|
1729
|
+
rpcUrl: args.rpcUrl,
|
|
1730
|
+
lps: discovered.map((p) => p.lp)
|
|
1731
|
+
});
|
|
1732
|
+
}
|
|
1733
|
+
async function aerodromeFetchStockLpYieldsSummary(args) {
|
|
1734
|
+
if (!isAerodromeChainSupported(args.chainId)) {
|
|
1735
|
+
throw new Error(`Aerodrome is Base-only (chainId ${AERODROME_CHAIN_ID}).`);
|
|
1736
|
+
}
|
|
1737
|
+
const addrs = await loadAerodromeAddresses();
|
|
1738
|
+
const scanned = await scanSugarTop(args.rpcUrl);
|
|
1739
|
+
const aeroUsd = aeroUsdPriceFromRows(scanned, addrs.aero);
|
|
1740
|
+
const stock = scanned.filter((r) => isAerodromeB20AssetToken(r.token0) || isAerodromeB20AssetToken(r.token1));
|
|
1741
|
+
const pools = rankAndCap(stock.map((r) => toYieldRow(r, aeroUsd)), args.query);
|
|
1742
|
+
return {
|
|
1743
|
+
chainId: AERODROME_CHAIN_ID,
|
|
1744
|
+
pools,
|
|
1745
|
+
notes: "Coinbase B20 stock LP yields only (typically STOCK/USDC Slipstream). Separate from main-pair fetch_lp_yields. HIP-3 / Arcus stock trading is not this list."
|
|
1746
|
+
};
|
|
1747
|
+
}
|
|
1748
|
+
var AERODROME_IMPORTANT_POOL_CAP, SUGAR_PAGE, SUGAR_SCAN_PAGES, SECONDS_PER_YEAR, BASE_MAIN_TOKEN_ADDRESSES;
|
|
1749
|
+
var init_yields = __esm({
|
|
1750
|
+
"src/protocols/evm/aerodrome/yields.ts"() {
|
|
1751
|
+
init_abi();
|
|
1752
|
+
init_addresses();
|
|
1753
|
+
init_client();
|
|
1754
|
+
init_discover();
|
|
1755
|
+
init_stockTokens();
|
|
1756
|
+
init_support();
|
|
1757
|
+
AERODROME_IMPORTANT_POOL_CAP = 100;
|
|
1758
|
+
SUGAR_PAGE = 50;
|
|
1759
|
+
SUGAR_SCAN_PAGES = 4;
|
|
1760
|
+
SECONDS_PER_YEAR = 365.25 * 24 * 60 * 60;
|
|
1761
|
+
BASE_MAIN_TOKEN_ADDRESSES = new Set(
|
|
1762
|
+
[
|
|
1763
|
+
AERODROME_WETH_BASE,
|
|
1764
|
+
AERODROME_USDC_BASE,
|
|
1765
|
+
AERODROME_BASE_ADDRESSES_FALLBACK.aero,
|
|
1766
|
+
"0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb",
|
|
1767
|
+
"0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2",
|
|
1768
|
+
"0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34",
|
|
1769
|
+
"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22",
|
|
1770
|
+
"0xc1CBa3fCea344f92D9239c08C0568f6F2F0ee452"
|
|
1771
|
+
].map((a) => a.toLowerCase())
|
|
1772
|
+
);
|
|
1773
|
+
}
|
|
1774
|
+
});
|
|
1775
|
+
|
|
1776
|
+
// src/core/registry.ts
|
|
1777
|
+
var modules = [];
|
|
1778
|
+
function registerProtocolModule(mod) {
|
|
1779
|
+
const existing = modules.findIndex((m) => m.id === mod.id);
|
|
1780
|
+
if (existing >= 0) {
|
|
1781
|
+
modules[existing] = mod;
|
|
1782
|
+
} else {
|
|
1783
|
+
modules.push(mod);
|
|
1784
|
+
}
|
|
1785
|
+
}
|
|
1786
|
+
|
|
1787
|
+
// src/protocols/evm/aerodrome/index.ts
|
|
1788
|
+
init_support();
|
|
1789
|
+
init_support();
|
|
1790
|
+
init_addresses();
|
|
1791
|
+
init_stockTokens();
|
|
1792
|
+
init_discover();
|
|
1793
|
+
|
|
1794
|
+
// src/protocols/evm/aerodrome/sugar.ts
|
|
1795
|
+
init_abi();
|
|
1796
|
+
init_addresses();
|
|
1797
|
+
init_client();
|
|
1798
|
+
init_support();
|
|
1799
|
+
init_stockTokens();
|
|
1454
1800
|
function poolKind(type) {
|
|
1455
1801
|
if (type === 0) return "stable";
|
|
1456
1802
|
if (type === -1) return "volatile";
|
|
@@ -1743,6 +2089,7 @@ function formatAerodromePriceImpact(percent0to100) {
|
|
|
1743
2089
|
}
|
|
1744
2090
|
|
|
1745
2091
|
// src/protocols/evm/aerodrome/sdkSession.ts
|
|
2092
|
+
init_support();
|
|
1746
2093
|
async function loadSdkJs() {
|
|
1747
2094
|
try {
|
|
1748
2095
|
return await import('@dromos-labs/sdk.js');
|
|
@@ -1831,6 +2178,15 @@ async function tryAerodromeSdkUnsignedSwap(args) {
|
|
|
1831
2178
|
return null;
|
|
1832
2179
|
}
|
|
1833
2180
|
}
|
|
2181
|
+
|
|
2182
|
+
// src/protocols/evm/aerodrome/quote.ts
|
|
2183
|
+
init_abi();
|
|
2184
|
+
init_addresses();
|
|
2185
|
+
init_client();
|
|
2186
|
+
init_discover();
|
|
2187
|
+
init_stockTokens();
|
|
2188
|
+
init_support();
|
|
2189
|
+
init_stockTokens();
|
|
1834
2190
|
var AERODROME_STABLE_FILLER = 2097152;
|
|
1835
2191
|
var AERODROME_VOLATILE_FILLER = 4194304;
|
|
1836
2192
|
var AERODROME_CL_FACTORY_OLDEST_BIT = 1048576;
|
|
@@ -2104,6 +2460,10 @@ async function aerodromeQuote(args) {
|
|
|
2104
2460
|
};
|
|
2105
2461
|
}
|
|
2106
2462
|
|
|
2463
|
+
// src/protocols/evm/aerodrome/swapMultisign.ts
|
|
2464
|
+
init_abi();
|
|
2465
|
+
init_addresses();
|
|
2466
|
+
|
|
2107
2467
|
// src/core/purpose.ts
|
|
2108
2468
|
function mergePurposeText(purposeText, purposeSuffix) {
|
|
2109
2469
|
const t = (purposeText ?? "").trim();
|
|
@@ -2339,6 +2699,9 @@ async function buildEvmMultisignBatch(args) {
|
|
|
2339
2699
|
}
|
|
2340
2700
|
|
|
2341
2701
|
// src/protocols/evm/aerodrome/batch.ts
|
|
2702
|
+
init_abi();
|
|
2703
|
+
init_client();
|
|
2704
|
+
init_support();
|
|
2342
2705
|
async function pushErc20ApproveIfNeeded(args) {
|
|
2343
2706
|
const client = aerodromePublicClient(args.rpcUrl);
|
|
2344
2707
|
const allowance = await client.readContract({
|
|
@@ -2404,6 +2767,7 @@ async function buildAerodromeMultisignBatch(args) {
|
|
|
2404
2767
|
}
|
|
2405
2768
|
|
|
2406
2769
|
// src/protocols/evm/aerodrome/swapMultisign.ts
|
|
2770
|
+
init_support();
|
|
2407
2771
|
function applySlippage(amountOut, slippagePercent) {
|
|
2408
2772
|
if (!Number.isFinite(slippagePercent) || slippagePercent <= 0 || slippagePercent >= 100) {
|
|
2409
2773
|
throw new Error("Slippage must be between 0 and 100 (exclusive).");
|
|
@@ -2705,6 +3069,14 @@ async function buildEvmMultisignBodyAerodromeSwapBatch(args) {
|
|
|
2705
3069
|
}
|
|
2706
3070
|
});
|
|
2707
3071
|
}
|
|
3072
|
+
|
|
3073
|
+
// src/protocols/evm/aerodrome/liquidityBasic.ts
|
|
3074
|
+
init_abi();
|
|
3075
|
+
init_addresses();
|
|
3076
|
+
init_client();
|
|
3077
|
+
init_discover();
|
|
3078
|
+
init_stockTokens();
|
|
3079
|
+
init_support();
|
|
2708
3080
|
var OTHER_SIDE_DESIRED = 10n ** 36n;
|
|
2709
3081
|
var Q96 = 1n << 96n;
|
|
2710
3082
|
function pairTokenLabel(address, isNative) {
|
|
@@ -2925,6 +3297,12 @@ async function estimateClOtherSide(client, helper, amount, sqrtP, amountIs0) {
|
|
|
2925
3297
|
if (sqrtP === 0n) return 0n;
|
|
2926
3298
|
return amountIs0 ? amount * sqrtP / Q96 * sqrtP / Q96 : amount * Q96 / sqrtP * Q96 / sqrtP;
|
|
2927
3299
|
}
|
|
3300
|
+
|
|
3301
|
+
// src/protocols/evm/aerodrome/liquidityBasicMultisign.ts
|
|
3302
|
+
init_abi();
|
|
3303
|
+
init_addresses();
|
|
3304
|
+
init_client();
|
|
3305
|
+
init_support();
|
|
2928
3306
|
function minAfterSlippage(amount, slippagePercent) {
|
|
2929
3307
|
if (!Number.isFinite(slippagePercent) || slippagePercent <= 0 || slippagePercent >= 100) {
|
|
2930
3308
|
throw new Error("Slippage must be between 0 and 100 (exclusive).");
|
|
@@ -3103,6 +3481,12 @@ async function buildEvmMultisignBodyAerodromeRemoveLiquidityBatch(args) {
|
|
|
3103
3481
|
})
|
|
3104
3482
|
});
|
|
3105
3483
|
}
|
|
3484
|
+
|
|
3485
|
+
// src/protocols/evm/aerodrome/liquidityCl.ts
|
|
3486
|
+
init_abi();
|
|
3487
|
+
init_addresses();
|
|
3488
|
+
init_client();
|
|
3489
|
+
init_support();
|
|
3106
3490
|
async function aerodromeQuoteClDeposit(args) {
|
|
3107
3491
|
if (!isAerodromeChainSupported(args.chainId)) {
|
|
3108
3492
|
throw new Error(`Aerodrome is Base-only (chainId ${AERODROME_CHAIN_ID}).`);
|
|
@@ -3149,6 +3533,11 @@ async function aerodromeQuoteClDeposit(args) {
|
|
|
3149
3533
|
sqrtPriceX96: args.sqrtPriceX96
|
|
3150
3534
|
};
|
|
3151
3535
|
}
|
|
3536
|
+
|
|
3537
|
+
// src/protocols/evm/aerodrome/liquidityClMultisign.ts
|
|
3538
|
+
init_abi();
|
|
3539
|
+
init_addresses();
|
|
3540
|
+
init_support();
|
|
3152
3541
|
function minAfterSlippage2(amount, slippagePercent) {
|
|
3153
3542
|
if (!Number.isFinite(slippagePercent) || slippagePercent <= 0 || slippagePercent >= 100) {
|
|
3154
3543
|
throw new Error("Slippage must be between 0 and 100 (exclusive).");
|
|
@@ -3417,6 +3806,10 @@ async function buildEvmMultisignBodyAerodromeClBurnBatch(args) {
|
|
|
3417
3806
|
})
|
|
3418
3807
|
});
|
|
3419
3808
|
}
|
|
3809
|
+
|
|
3810
|
+
// src/protocols/evm/aerodrome/gaugeMultisign.ts
|
|
3811
|
+
init_abi();
|
|
3812
|
+
init_support();
|
|
3420
3813
|
async function buildEvmMultisignBodyAerodromeGaugeStakeBatch(args) {
|
|
3421
3814
|
const executor = getAddress(args.executorAddress);
|
|
3422
3815
|
const gauge = getAddress(args.gauge);
|
|
@@ -3598,6 +3991,10 @@ async function buildEvmMultisignBodyAerodromeClaimEmissionsBatch(args) {
|
|
|
3598
3991
|
});
|
|
3599
3992
|
}
|
|
3600
3993
|
|
|
3994
|
+
// src/protocols/evm/aerodrome/reads.ts
|
|
3995
|
+
init_support();
|
|
3996
|
+
init_addresses();
|
|
3997
|
+
|
|
3601
3998
|
// src/protocols/evm/aerodrome/purpose.ts
|
|
3602
3999
|
function buildAerodromeSwapPurposePrefill(args) {
|
|
3603
4000
|
const symIn = (args.tokenInSymbol || "").trim() || "token in";
|
|
@@ -3633,6 +4030,7 @@ function aerodromePositionKey(row) {
|
|
|
3633
4030
|
}
|
|
3634
4031
|
|
|
3635
4032
|
// src/protocols/evm/aerodrome/reads.ts
|
|
4033
|
+
init_stockTokens();
|
|
3636
4034
|
function mergeStocksIntoListed(tokens, stocks) {
|
|
3637
4035
|
const byAddr = new Map(tokens.map((t) => [t.address.toLowerCase(), { ...t }]));
|
|
3638
4036
|
for (const stock of stocks) {
|
|
@@ -3695,8 +4093,19 @@ async function aerodromeFetchListedTokensSummary(args) {
|
|
|
3695
4093
|
};
|
|
3696
4094
|
}
|
|
3697
4095
|
async function aerodromeFetchPoolsSummary(args) {
|
|
3698
|
-
const
|
|
3699
|
-
|
|
4096
|
+
const { aerodromeFetchImportantPoolsSummary: aerodromeFetchImportantPoolsSummary2 } = await Promise.resolve().then(() => (init_yields(), yields_exports));
|
|
4097
|
+
const { pools, notes } = await aerodromeFetchImportantPoolsSummary2({
|
|
4098
|
+
chainId: args.chainId,
|
|
4099
|
+
rpcUrl: args.rpcUrl,
|
|
4100
|
+
query: args.query
|
|
4101
|
+
});
|
|
4102
|
+
const offset = Math.max(0, args.offset ?? 0);
|
|
4103
|
+
const limit = Math.min(Math.max(args.limit ?? pools.length, 1), pools.length);
|
|
4104
|
+
return {
|
|
4105
|
+
chainId: AERODROME_CHAIN_ID,
|
|
4106
|
+
pools: pools.slice(offset, offset + limit),
|
|
4107
|
+
notes
|
|
4108
|
+
};
|
|
3700
4109
|
}
|
|
3701
4110
|
async function aerodromeFetchPositionsSummary(args) {
|
|
3702
4111
|
const account = (args.account ?? args.executorAddress ?? "").trim();
|
|
@@ -3730,6 +4139,7 @@ async function aerodromeFetchPositionsSummary(args) {
|
|
|
3730
4139
|
}
|
|
3731
4140
|
|
|
3732
4141
|
// src/protocols/evm/aerodrome/index.ts
|
|
4142
|
+
init_yields();
|
|
3733
4143
|
var aerodromeProtocolModule = {
|
|
3734
4144
|
id: AERODROME_PROTOCOL_ID,
|
|
3735
4145
|
chainCategory: "evm",
|
|
@@ -3838,6 +4248,6 @@ var aerodromeProtocolModule = {
|
|
|
3838
4248
|
};
|
|
3839
4249
|
registerProtocolModule(aerodromeProtocolModule);
|
|
3840
4250
|
|
|
3841
|
-
export { AERODROME_B20_ASSET_PREFIX, AERODROME_BASE_ADDRESSES_FALLBACK, AERODROME_CHAIN_ID, AERODROME_CL_FACTORY_NEWEST_BIT, AERODROME_CL_FACTORY_OLDEST_BIT, AERODROME_COINBASE_STOCK_DECIMALS, AERODROME_COINBASE_STOCK_TOKENS, AERODROME_NATIVE_PLACEHOLDER, AERODROME_PROTOCOL_ID, AERODROME_STABLE_FILLER, AERODROME_USDC_BASE, AERODROME_VOLATILE_FILLER, AERODROME_WETH_BASE, aerodromeClFactoryList, aerodromeClSwapRouterForFactory, aerodromeCoinbaseStockAddresses, aerodromeDiscoverConnectorPools, aerodromeDiscoverConnectorPoolsLoaded, aerodromeDiscoverDirectPools, aerodromeDiscoverPoolsSummary, aerodromeFallbackAddresses, aerodromeFetchListedTokens, aerodromeFetchListedTokensSummary, aerodromeFetchPools, aerodromeFetchPoolsByAddress, aerodromeFetchPoolsSummary, aerodromeFetchPositions, aerodromeFetchPositionsSummary, aerodromeFetchPositionsWithPools, aerodromeFetchSwapPools, aerodromeMixedPathFiller, aerodromeOnChainDeadlineUnix, aerodromePositionKey, aerodromePositionLabel, aerodromeProbeAmountIn, aerodromeProtocolModule, aerodromeQuote, aerodromeQuoteAddLiquidity, aerodromeQuoteClDeposit, aerodromeResolveStockTokens, aerodromeUnissuedStockMessage, assertAerodromeStockIssued, buildAerodromeLiquidityPurposePrefill, buildAerodromeRewardsPurposePrefill, buildAerodromeSwapPurposePrefill, buildEvmMultisignBodyAerodromeAddLiquidityBatch, buildEvmMultisignBodyAerodromeClBurnBatch, buildEvmMultisignBodyAerodromeClCollectBatch, buildEvmMultisignBodyAerodromeClDecreaseBatch, buildEvmMultisignBodyAerodromeClIncreaseBatch, buildEvmMultisignBodyAerodromeClMintBatch, buildEvmMultisignBodyAerodromeClaimEmissionsBatch, buildEvmMultisignBodyAerodromeClaimFeesBatch, buildEvmMultisignBodyAerodromeGaugeStakeBatch, buildEvmMultisignBodyAerodromeGaugeUnstakeBatch, buildEvmMultisignBodyAerodromeRemoveLiquidityBatch, buildEvmMultisignBodyAerodromeSwapBatch, computeAerodromePriceImpactPercent, encodeAerodromeMixedPath, fetchOfficialBaseTokenizedStocks, findAerodromePaths, formatAerodromePriceImpact, isAerodromeB20AssetToken, isAerodromeChainSupported, isAerodromeCoinbaseStockToken, isAerodromeNativeToken, loadAerodromeAddresses, looksLikeCoinbaseStockSymbol, lookupAerodromeKnownToken, parseBaseTokenizedStockDocs, parseSecurityMdxAddresses, parseSugarBaseEnv, quoteAerodromeHopsAmountOut, requireAerodromeRpcUrl, resetAerodromeAddressCache, resolveAerodromeErc20OrWeth, tryAerodromeSdkQuote, tryAerodromeSdkUnsignedSwap };
|
|
4251
|
+
export { AERODROME_B20_ASSET_PREFIX, AERODROME_BASE_ADDRESSES_FALLBACK, AERODROME_CHAIN_ID, AERODROME_CL_FACTORY_NEWEST_BIT, AERODROME_CL_FACTORY_OLDEST_BIT, AERODROME_COINBASE_STOCK_DECIMALS, AERODROME_COINBASE_STOCK_TOKENS, AERODROME_IMPORTANT_POOL_CAP, AERODROME_NATIVE_PLACEHOLDER, AERODROME_PROTOCOL_ID, AERODROME_STABLE_FILLER, AERODROME_USDC_BASE, AERODROME_VOLATILE_FILLER, AERODROME_WETH_BASE, aerodromeClFactoryList, aerodromeClSwapRouterForFactory, aerodromeCoinbaseStockAddresses, aerodromeDiscoverConnectorPools, aerodromeDiscoverConnectorPoolsLoaded, aerodromeDiscoverDirectPools, aerodromeDiscoverPoolsSummary, aerodromeFallbackAddresses, aerodromeFetchImportantPoolsSummary, aerodromeFetchListedTokens, aerodromeFetchListedTokensSummary, aerodromeFetchLpYieldsForPair, aerodromeFetchLpYieldsForPools, aerodromeFetchLpYieldsSummary, aerodromeFetchPools, aerodromeFetchPoolsByAddress, aerodromeFetchPoolsSummary, aerodromeFetchPositions, aerodromeFetchPositionsSummary, aerodromeFetchPositionsWithPools, aerodromeFetchStockLpYieldsSummary, aerodromeFetchSwapPools, aerodromeMixedPathFiller, aerodromeOnChainDeadlineUnix, aerodromePositionKey, aerodromePositionLabel, aerodromeProbeAmountIn, aerodromeProtocolModule, aerodromeQuote, aerodromeQuoteAddLiquidity, aerodromeQuoteClDeposit, aerodromeResolveStockTokens, aerodromeUnissuedStockMessage, assertAerodromeStockIssued, buildAerodromeLiquidityPurposePrefill, buildAerodromeRewardsPurposePrefill, buildAerodromeSwapPurposePrefill, buildEvmMultisignBodyAerodromeAddLiquidityBatch, buildEvmMultisignBodyAerodromeClBurnBatch, buildEvmMultisignBodyAerodromeClCollectBatch, buildEvmMultisignBodyAerodromeClDecreaseBatch, buildEvmMultisignBodyAerodromeClIncreaseBatch, buildEvmMultisignBodyAerodromeClMintBatch, buildEvmMultisignBodyAerodromeClaimEmissionsBatch, buildEvmMultisignBodyAerodromeClaimFeesBatch, buildEvmMultisignBodyAerodromeGaugeStakeBatch, buildEvmMultisignBodyAerodromeGaugeUnstakeBatch, buildEvmMultisignBodyAerodromeRemoveLiquidityBatch, buildEvmMultisignBodyAerodromeSwapBatch, computeAerodromePriceImpactPercent, encodeAerodromeMixedPath, fetchOfficialBaseTokenizedStocks, findAerodromePaths, formatAerodromeLpYieldLabel, formatAerodromePriceImpact, isAerodromeB20AssetToken, isAerodromeChainSupported, isAerodromeCoinbaseStockToken, isAerodromeNativeToken, loadAerodromeAddresses, looksLikeCoinbaseStockSymbol, lookupAerodromeKnownToken, parseBaseTokenizedStockDocs, parseSecurityMdxAddresses, parseSugarBaseEnv, quoteAerodromeHopsAmountOut, requireAerodromeRpcUrl, resetAerodromeAddressCache, resolveAerodromeErc20OrWeth, tryAerodromeSdkQuote, tryAerodromeSdkUnsignedSwap };
|
|
3842
4252
|
//# sourceMappingURL=index.js.map
|
|
3843
4253
|
//# sourceMappingURL=index.js.map
|