@continuumdao/ctm-mpc-defi 0.2.56 → 0.2.57
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 +304 -134
- package/dist/agent/catalog.cjs.map +1 -1
- package/dist/agent/catalog.d.ts +162 -42
- package/dist/agent/catalog.js +304 -136
- package/dist/agent/catalog.js.map +1 -1
- package/dist/agent/skills/aave-v4/SKILL.md +26 -3
- package/dist/agent/skills/aerodrome/SKILL.md +3 -1
- package/dist/agent/skills/curve-dao/SKILL.md +2 -2
- package/dist/agent/skills/uniswap-v4/SKILL.md +2 -2
- package/dist/index.cjs +165 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +166 -20
- package/dist/index.js.map +1 -1
- package/dist/protocols/evm/aave-v4/index.cjs +198 -15
- package/dist/protocols/evm/aave-v4/index.cjs.map +1 -1
- package/dist/protocols/evm/aave-v4/index.d.ts +62 -7
- package/dist/protocols/evm/aave-v4/index.js +189 -16
- package/dist/protocols/evm/aave-v4/index.js.map +1 -1
- package/dist/protocols/evm/aerodrome/index.cjs +152 -63
- package/dist/protocols/evm/aerodrome/index.cjs.map +1 -1
- package/dist/protocols/evm/aerodrome/index.d.ts +30 -58
- package/dist/protocols/evm/aerodrome/index.js +151 -64
- package/dist/protocols/evm/aerodrome/index.js.map +1 -1
- package/dist/protocols/evm/compound-v3/index.cjs +115 -2
- package/dist/protocols/evm/compound-v3/index.cjs.map +1 -1
- package/dist/protocols/evm/compound-v3/index.js +116 -3
- package/dist/protocols/evm/compound-v3/index.js.map +1 -1
- package/dist/protocols/evm/curve-dao/index.cjs +120 -5
- package/dist/protocols/evm/curve-dao/index.cjs.map +1 -1
- package/dist/protocols/evm/curve-dao/index.js +120 -5
- package/dist/protocols/evm/curve-dao/index.js.map +1 -1
- package/dist/protocols/evm/euler-v2/index.cjs +121 -6
- package/dist/protocols/evm/euler-v2/index.cjs.map +1 -1
- package/dist/protocols/evm/euler-v2/index.js +121 -6
- package/dist/protocols/evm/euler-v2/index.js.map +1 -1
- package/dist/protocols/evm/morpho/index.cjs +129 -57
- package/dist/protocols/evm/morpho/index.cjs.map +1 -1
- package/dist/protocols/evm/morpho/index.d.ts +2 -1
- package/dist/protocols/evm/morpho/index.js +129 -58
- package/dist/protocols/evm/morpho/index.js.map +1 -1
- package/dist/protocols/evm/pendle/index.cjs +129 -10
- package/dist/protocols/evm/pendle/index.cjs.map +1 -1
- package/dist/protocols/evm/pendle/index.js +129 -10
- package/dist/protocols/evm/pendle/index.js.map +1 -1
- package/dist/protocols/evm/uniswap-v4/index.cjs +164 -17
- package/dist/protocols/evm/uniswap-v4/index.cjs.map +1 -1
- package/dist/protocols/evm/uniswap-v4/index.js +165 -18
- package/dist/protocols/evm/uniswap-v4/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -25,6 +25,106 @@ async function postJsonViaOptionalProxy(args) {
|
|
|
25
25
|
}
|
|
26
26
|
return await r.json();
|
|
27
27
|
}
|
|
28
|
+
var COINBASE_B20_STOCK_DECIMALS = 8;
|
|
29
|
+
var COINBASE_B20_ASSET_PREFIX = "0xb200000000000000000000";
|
|
30
|
+
function isCoinbaseB20AssetToken(address) {
|
|
31
|
+
try {
|
|
32
|
+
return viem.getAddress(address).toLowerCase().startsWith(COINBASE_B20_ASSET_PREFIX);
|
|
33
|
+
} catch {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function looksLikeCoinbaseStockSymbol(symbol) {
|
|
38
|
+
return /^[A-Za-z][A-Za-z0-9]{0,8}(?:\.[A-Za-z][A-Za-z0-9]{0,4})?c$/.test((symbol ?? "").trim());
|
|
39
|
+
}
|
|
40
|
+
var COINBASE_TOKENIZED_STOCKS_API_URL = "https://api.coinbase.com/v1/tokenized-stocks";
|
|
41
|
+
var CATALOG_TTL_MS = 15 * 60 * 1e3;
|
|
42
|
+
var CATALOG_MAX = 500;
|
|
43
|
+
var catalogRows = null;
|
|
44
|
+
var catalogAt = 0;
|
|
45
|
+
var catalogInflight = null;
|
|
46
|
+
var catalogBySymbol = /* @__PURE__ */ new Map();
|
|
47
|
+
var catalogByAddress = /* @__PURE__ */ new Map();
|
|
48
|
+
function indexCatalog(rows) {
|
|
49
|
+
catalogRows = rows;
|
|
50
|
+
catalogAt = Date.now();
|
|
51
|
+
catalogBySymbol.clear();
|
|
52
|
+
catalogByAddress.clear();
|
|
53
|
+
for (const row of rows) {
|
|
54
|
+
catalogBySymbol.set(row.symbol.toLowerCase(), row);
|
|
55
|
+
catalogByAddress.set(row.address.toLowerCase(), row);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function parseCoinbaseTokenizedStocksPayload(payload) {
|
|
59
|
+
const tokens = Array.isArray(payload) ? payload : payload && typeof payload === "object" && Array.isArray(payload.tokens) ? payload.tokens : [];
|
|
60
|
+
const out = [];
|
|
61
|
+
const seen = /* @__PURE__ */ new Set();
|
|
62
|
+
for (const row of tokens) {
|
|
63
|
+
if (!row || typeof row !== "object") continue;
|
|
64
|
+
const rec = row;
|
|
65
|
+
const symbol = typeof rec.symbol === "string" ? rec.symbol.trim() : "";
|
|
66
|
+
const addressRaw = typeof rec.contract_address === "string" ? rec.contract_address.trim() : "";
|
|
67
|
+
if (!looksLikeCoinbaseStockSymbol(symbol) || !isCoinbaseB20AssetToken(addressRaw)) continue;
|
|
68
|
+
const address = viem.getAddress(addressRaw);
|
|
69
|
+
const key = address.toLowerCase();
|
|
70
|
+
if (seen.has(key)) continue;
|
|
71
|
+
seen.add(key);
|
|
72
|
+
const name = typeof rec.name === "string" && rec.name.trim() ? rec.name.trim() : symbol;
|
|
73
|
+
const iconUrl = typeof rec.icon_url === "string" && rec.icon_url.trim() ? rec.icon_url.trim() : void 0;
|
|
74
|
+
const decimals = typeof rec.decimals === "number" && Number.isInteger(rec.decimals) && rec.decimals >= 0 && rec.decimals <= 18 ? rec.decimals : COINBASE_B20_STOCK_DECIMALS;
|
|
75
|
+
out.push({ address, symbol, name, decimals, iconUrl });
|
|
76
|
+
if (out.length >= CATALOG_MAX) break;
|
|
77
|
+
}
|
|
78
|
+
return out;
|
|
79
|
+
}
|
|
80
|
+
async function fetchCoinbaseB20StockCatalog() {
|
|
81
|
+
const merged = [];
|
|
82
|
+
const seen = /* @__PURE__ */ new Set();
|
|
83
|
+
let pageToken = "";
|
|
84
|
+
for (let page = 0; page < 4; page++) {
|
|
85
|
+
const url = new URL(COINBASE_TOKENIZED_STOCKS_API_URL);
|
|
86
|
+
url.searchParams.set("page_size", "500");
|
|
87
|
+
if (pageToken) url.searchParams.set("page_token", pageToken);
|
|
88
|
+
const res = await fetch(url, { cache: "no-store", signal: AbortSignal.timeout(8e3) });
|
|
89
|
+
if (!res.ok) break;
|
|
90
|
+
const json = await res.json();
|
|
91
|
+
for (const row of parseCoinbaseTokenizedStocksPayload(json)) {
|
|
92
|
+
const key = row.address.toLowerCase();
|
|
93
|
+
if (seen.has(key)) continue;
|
|
94
|
+
seen.add(key);
|
|
95
|
+
merged.push(row);
|
|
96
|
+
if (merged.length >= CATALOG_MAX) break;
|
|
97
|
+
}
|
|
98
|
+
pageToken = typeof json.next_page_token === "string" ? json.next_page_token.trim() : "";
|
|
99
|
+
if (!pageToken || merged.length >= CATALOG_MAX) break;
|
|
100
|
+
}
|
|
101
|
+
if (merged.length > 0) indexCatalog(merged);
|
|
102
|
+
return catalogRows ?? [];
|
|
103
|
+
}
|
|
104
|
+
async function ensureCoinbaseB20StockCatalog() {
|
|
105
|
+
if (catalogRows && catalogRows.length > 0 && Date.now() - catalogAt < CATALOG_TTL_MS) return catalogRows;
|
|
106
|
+
if (!catalogInflight) {
|
|
107
|
+
catalogInflight = fetchCoinbaseB20StockCatalog().finally(() => {
|
|
108
|
+
catalogInflight = null;
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
try {
|
|
112
|
+
return await catalogInflight;
|
|
113
|
+
} catch {
|
|
114
|
+
return catalogRows ?? [];
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
function lookupCoinbaseB20StockToken(token) {
|
|
118
|
+
const key = (token ?? "").trim();
|
|
119
|
+
if (!key) return null;
|
|
120
|
+
const fromCatalog = catalogBySymbol.get(key.toLowerCase());
|
|
121
|
+
if (fromCatalog) return fromCatalog;
|
|
122
|
+
try {
|
|
123
|
+
return catalogByAddress.get(viem.getAddress(key).toLowerCase()) ?? null;
|
|
124
|
+
} catch {
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
28
128
|
|
|
29
129
|
// src/protocols/evm/aave-v4/api.ts
|
|
30
130
|
var AAVE_V4_GRAPHQL_URL = "https://api.v4.aave.com/graphql";
|
|
@@ -266,6 +366,42 @@ function ensureAaveV4ChainTokenCache(chainId) {
|
|
|
266
366
|
aaveV4ChainTokenCache.set(chainId, p);
|
|
267
367
|
return p;
|
|
268
368
|
}
|
|
369
|
+
var AAVE_V4_BSTOCKS_CHAIN_ID = 8453;
|
|
370
|
+
var AAVE_V4_UI_MARKETS = [
|
|
371
|
+
{ id: "main", label: "Main" },
|
|
372
|
+
{ id: "core", label: "Core" },
|
|
373
|
+
{ id: "bluechip", label: "Bluechip" },
|
|
374
|
+
{ id: "bstocks", label: "bStocks" }
|
|
375
|
+
];
|
|
376
|
+
function isAaveV4BStocksHubName(hubName) {
|
|
377
|
+
const n = (hubName ?? "").trim().toLowerCase().replace(/\s+/g, " ");
|
|
378
|
+
if (!n) return false;
|
|
379
|
+
if (n === "coinbase stocks" || n === "coinbase stocks hub" || n === "equities" || n === "equities hub" || n === "tokenised stocks" || n === "tokenized stocks" || n === "base stocks" || n === "bstocks" || n === "b stocks" || n === "mag-7" || n === "mag7") {
|
|
380
|
+
return true;
|
|
381
|
+
}
|
|
382
|
+
return n.includes("coinbase") && n.includes("stock");
|
|
383
|
+
}
|
|
384
|
+
function parseAaveV4UiMarketId(raw) {
|
|
385
|
+
const t = (raw ?? "").trim().toLowerCase().replace(/\s+/g, " ");
|
|
386
|
+
if (!t) return void 0;
|
|
387
|
+
if (t === "core") return "core";
|
|
388
|
+
if (t === "bluechip" || t === "prime" || t === "institutional") return "bluechip";
|
|
389
|
+
if (t === "main" || t === "plus" || t === "default") return "main";
|
|
390
|
+
if (t === "bstocks" || t === "bstock" || t === "b stocks" || t === "stocks" || t === "stock" || t === "equities" || t === "equity" || t === "coinbase stocks" || t === "tokenized stocks" || t === "tokenised stocks") {
|
|
391
|
+
return "bstocks";
|
|
392
|
+
}
|
|
393
|
+
return void 0;
|
|
394
|
+
}
|
|
395
|
+
function normalizeAaveV4UiMarketId(raw, fallback = "main") {
|
|
396
|
+
if (typeof raw !== "string") return fallback;
|
|
397
|
+
return parseAaveV4UiMarketId(raw) ?? fallback;
|
|
398
|
+
}
|
|
399
|
+
function resolveAaveV4UnderlyingAddress(token) {
|
|
400
|
+
const raw = (token ?? "").trim();
|
|
401
|
+
if (!raw) return null;
|
|
402
|
+
if (viem.isAddress(raw)) return viem.getAddress(raw);
|
|
403
|
+
return lookupCoinbaseB20StockToken(raw)?.address ?? null;
|
|
404
|
+
}
|
|
269
405
|
var aaveV4HubsByChain = /* @__PURE__ */ new Map();
|
|
270
406
|
var aaveV4HubReserves = /* @__PURE__ */ new Map();
|
|
271
407
|
function hubReservesKey(chainId, hub) {
|
|
@@ -296,12 +432,22 @@ function resolveAaveV4HubForUiMarket(hubs, market, chainId) {
|
|
|
296
432
|
const set = new Set(names.map((n) => n.toLowerCase()));
|
|
297
433
|
return on.find((h) => set.has((h.name ?? "").trim().toLowerCase())) ?? null;
|
|
298
434
|
};
|
|
435
|
+
if (market === "bstocks") return on.find((h) => isAaveV4BStocksHubName(h.name)) ?? null;
|
|
299
436
|
if (market === "core") return find(["core"]);
|
|
300
437
|
if (market === "bluechip") return find(["prime", "bluechip", "institutional"]);
|
|
301
|
-
|
|
438
|
+
const named = find(["plus", "main", "default"]);
|
|
439
|
+
if (named) return named;
|
|
440
|
+
return on.find((h) => !isAaveV4BStocksHubName(h.name)) ?? null;
|
|
441
|
+
}
|
|
442
|
+
function aaveV4UiMarketsForHubs(hubs, chainId) {
|
|
443
|
+
const available = AAVE_V4_UI_MARKETS.filter(
|
|
444
|
+
(m) => resolveAaveV4HubForUiMarket(hubs, m.id, chainId) != null
|
|
445
|
+
);
|
|
446
|
+
return available.length ? available : AAVE_V4_UI_MARKETS;
|
|
302
447
|
}
|
|
303
448
|
function aaveV4UiMarketIdForHubName(hubName) {
|
|
304
449
|
const n = (hubName ?? "").trim().toLowerCase();
|
|
450
|
+
if (isAaveV4BStocksHubName(hubName)) return "bstocks";
|
|
305
451
|
if (n === "core") return "core";
|
|
306
452
|
if (n === "plus" || n === "main" || n === "default") return "main";
|
|
307
453
|
if (n === "prime" || n === "bluechip" || n === "institutional") return "bluechip";
|
|
@@ -313,6 +459,7 @@ function aaveV4HubAutoPickTiebreakOrder(a, b) {
|
|
|
313
459
|
if (n === "core") return 0;
|
|
314
460
|
if (n === "plus" || n === "main" || n === "default") return 1;
|
|
315
461
|
if (n === "prime" || n === "bluechip" || n === "institutional") return 2;
|
|
462
|
+
if (isAaveV4BStocksHubName(name)) return 4;
|
|
316
463
|
return 3;
|
|
317
464
|
};
|
|
318
465
|
const ra = rank(a.name);
|
|
@@ -339,9 +486,10 @@ function aaveV4SuppliableHumanFromHubReserve(r) {
|
|
|
339
486
|
async function findAaveV4HubReserveForChainUnderlying(args) {
|
|
340
487
|
const onChain = args.hubs.filter((h) => h.chain.chainId === args.chainId);
|
|
341
488
|
if (!onChain.length) return null;
|
|
342
|
-
const prefer = viem.getAddress(args.preferHub.address);
|
|
489
|
+
const prefer = args.preferHub ? viem.getAddress(args.preferHub.address) : null;
|
|
343
490
|
const order = (() => {
|
|
344
|
-
const rest = onChain.filter((h) => viem.getAddress(h.address) !== prefer).sort(aaveV4HubAutoPickTiebreakOrder);
|
|
491
|
+
const rest = onChain.filter((h) => !prefer || viem.getAddress(h.address) !== prefer).sort(aaveV4HubAutoPickTiebreakOrder);
|
|
492
|
+
if (!prefer) return rest;
|
|
345
493
|
const first = onChain.find((h) => viem.getAddress(h.address) === prefer);
|
|
346
494
|
return first ? [first, ...rest] : rest;
|
|
347
495
|
})();
|
|
@@ -372,8 +520,8 @@ async function findAaveV4HubReserveForChainUnderlying(args) {
|
|
|
372
520
|
const sortKey = (a, b) => {
|
|
373
521
|
const d = aaveV4HubReserveBorrowApyForSort(a.debtReserve) - aaveV4HubReserveBorrowApyForSort(b.debtReserve);
|
|
374
522
|
if (d !== 0) return d;
|
|
375
|
-
const pa = viem.getAddress(a.hub.address) === prefer ? 0 : 1;
|
|
376
|
-
const pb = viem.getAddress(b.hub.address) === prefer ? 0 : 1;
|
|
523
|
+
const pa = prefer && viem.getAddress(a.hub.address) === prefer ? 0 : 1;
|
|
524
|
+
const pb = prefer && viem.getAddress(b.hub.address) === prefer ? 0 : 1;
|
|
377
525
|
if (pa !== pb) return pa - pb;
|
|
378
526
|
return aaveV4HubAutoPickTiebreakOrder(a.hub, b.hub);
|
|
379
527
|
};
|
|
@@ -2431,6 +2579,7 @@ function matchesAssetFilter(opts) {
|
|
|
2431
2579
|
}
|
|
2432
2580
|
|
|
2433
2581
|
// src/protocols/evm/aave-v4/reads.ts
|
|
2582
|
+
var AAVE_V4_BSTOCKS_MARKET_NOTES = "Coinbase tokenized stocks (bStocks) on the Aave v4 Coinbase Stocks hub (Base, chainId 8453). AAPLc, AMZNc, GOOGLc, METAc, MSFTc, NVDAc, and TSLAc are collateral-only. USDC is the only borrow asset. marketId is bstocks. Tickers resolve (AAPLc). Chainlink equity feeds are 24/5 (last price held on weekends and US market holidays). Not for U.S. persons. Equity supply APY is typically 0; incentives may appear via Merkl.";
|
|
2434
2583
|
function parseAaveV4ApyPercent(apy) {
|
|
2435
2584
|
const n = parseFloat((apy?.normalized ?? "").trim());
|
|
2436
2585
|
if (Number.isFinite(n) && n >= 0) return n;
|
|
@@ -2510,10 +2659,21 @@ function isAaveV4HubReserveActive(reserve) {
|
|
|
2510
2659
|
function filterActiveAaveV4HubReserves(reserves) {
|
|
2511
2660
|
return reserves.filter(isAaveV4HubReserveActive);
|
|
2512
2661
|
}
|
|
2513
|
-
function
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2662
|
+
function isAaveV4StockListQuery(filter) {
|
|
2663
|
+
return /^(stocks?|bstocks?|b stocks|tokenized stocks|tokenised stocks|coinbase stocks|equities)$/.test(
|
|
2664
|
+
filter.trim().toLowerCase()
|
|
2665
|
+
);
|
|
2666
|
+
}
|
|
2667
|
+
function rowMatchesUnderlyingFilter(row, filter) {
|
|
2668
|
+
if (isAaveV4StockListQuery(filter)) return isCoinbaseB20AssetToken(row.underlying);
|
|
2669
|
+
if (matchesAssetFilter({ address: row.underlying, symbol: row.symbol, filter })) return true;
|
|
2670
|
+
const stock = lookupCoinbaseB20StockToken(filter);
|
|
2671
|
+
if (!stock) return false;
|
|
2672
|
+
try {
|
|
2673
|
+
return viem.getAddress(row.underlying) === stock.address;
|
|
2674
|
+
} catch {
|
|
2675
|
+
return false;
|
|
2676
|
+
}
|
|
2517
2677
|
}
|
|
2518
2678
|
async function collectHubMarketRows(args) {
|
|
2519
2679
|
const markets = [];
|
|
@@ -2532,6 +2692,7 @@ async function collectHubMarketRows(args) {
|
|
|
2532
2692
|
return markets;
|
|
2533
2693
|
}
|
|
2534
2694
|
async function aaveV4FetchMarketsSummary(args) {
|
|
2695
|
+
await ensureCoinbaseB20StockCatalog().catch(() => []);
|
|
2535
2696
|
const hubs = await fetchAaveV4HubsForChain(args.chainId);
|
|
2536
2697
|
if (!hubs.length) {
|
|
2537
2698
|
return {
|
|
@@ -2540,7 +2701,7 @@ async function aaveV4FetchMarketsSummary(args) {
|
|
|
2540
2701
|
notes: `Aave v4 lists no hubs on chain ${args.chainId}. Check get_defi_protocol_supported_chains.`
|
|
2541
2702
|
};
|
|
2542
2703
|
}
|
|
2543
|
-
const wantMarket =
|
|
2704
|
+
const wantMarket = parseAaveV4UiMarketId(args.marketId);
|
|
2544
2705
|
let selected = hubs;
|
|
2545
2706
|
let marketNote = "";
|
|
2546
2707
|
if (wantMarket) {
|
|
@@ -2555,18 +2716,16 @@ async function aaveV4FetchMarketsSummary(args) {
|
|
|
2555
2716
|
let markets = await collectHubMarketRows({ chainId: args.chainId, hubs: selected });
|
|
2556
2717
|
const rawUnderlying = (args.underlying ?? "").trim();
|
|
2557
2718
|
if (rawUnderlying) {
|
|
2558
|
-
markets = markets.filter(
|
|
2559
|
-
(m) => matchesAssetFilter({ address: m.underlying, symbol: m.symbol, filter: rawUnderlying })
|
|
2560
|
-
);
|
|
2719
|
+
markets = markets.filter((m) => rowMatchesUnderlyingFilter(m, rawUnderlying));
|
|
2561
2720
|
}
|
|
2562
2721
|
markets.sort(sortBySupplyApyDesc);
|
|
2563
|
-
const notes = "Supply/borrow APY from Aave v4 GraphQL (api.v4.aave.com). These are APY (compounded), not APR. Each live spoke is a row (unused zero-liquidity listings omitted). Copy underlying + marketId for build_*_multisign. Do not web-search Aave rates." + marketNote;
|
|
2722
|
+
const notes = "Supply/borrow APY from Aave v4 GraphQL (api.v4.aave.com). These are APY (compounded), not APR. Each live spoke is a row (unused zero-liquidity listings omitted). Copy underlying + marketId for build_*_multisign. marketId bstocks is the Base Coinbase Stocks hub (tokenized equities as collateral, USDC borrow). Tickers such as AAPLc resolve. Do not web-search Aave rates." + marketNote;
|
|
2564
2723
|
return { chainId: args.chainId, markets, notes };
|
|
2565
2724
|
}
|
|
2566
2725
|
async function aaveV4FetchMarketSummary(args) {
|
|
2567
2726
|
const addr = (args.underlying ?? "").trim();
|
|
2568
2727
|
if (!addr) {
|
|
2569
|
-
throw new Error("underlying is required (ERC-20 address or ticker such as USDT).");
|
|
2728
|
+
throw new Error("underlying is required (ERC-20 address or ticker such as USDT or AAPLc).");
|
|
2570
2729
|
}
|
|
2571
2730
|
const out = await aaveV4FetchMarketsSummary({
|
|
2572
2731
|
chainId: args.chainId,
|
|
@@ -2581,6 +2740,20 @@ async function aaveV4FetchMarketSummary(args) {
|
|
|
2581
2740
|
}
|
|
2582
2741
|
return out;
|
|
2583
2742
|
}
|
|
2743
|
+
async function aaveV4FetchStockMarketsSummary(args) {
|
|
2744
|
+
const chainId = args.chainId ?? AAVE_V4_BSTOCKS_CHAIN_ID;
|
|
2745
|
+
const out = await aaveV4FetchMarketsSummary({
|
|
2746
|
+
chainId,
|
|
2747
|
+
marketId: "bstocks",
|
|
2748
|
+
underlying: args.underlying
|
|
2749
|
+
});
|
|
2750
|
+
const extra = out.markets.length ? "" : " No Coinbase Stocks hub reserves matched.";
|
|
2751
|
+
return {
|
|
2752
|
+
chainId: out.chainId,
|
|
2753
|
+
markets: out.markets,
|
|
2754
|
+
notes: `${AAVE_V4_BSTOCKS_MARKET_NOTES}${extra} ${out.notes}`
|
|
2755
|
+
};
|
|
2756
|
+
}
|
|
2584
2757
|
var MERKL_API_BASE = "https://api.merkl.xyz";
|
|
2585
2758
|
var MERKL_DISTRIBUTOR_ADDRESS = "0x3Ef3D8bA38EBe18DB133cEc108f4D14CE00Dd9Ae";
|
|
2586
2759
|
var MERKL_DISTRIBUTOR_CLAIM_GAS_FALLBACK = 500000n;
|
|
@@ -2756,12 +2929,15 @@ var aaveV4ProtocolModule = {
|
|
|
2756
2929
|
};
|
|
2757
2930
|
registerProtocolModule(aaveV4ProtocolModule);
|
|
2758
2931
|
|
|
2932
|
+
exports.AAVE_V4_BSTOCKS_CHAIN_ID = AAVE_V4_BSTOCKS_CHAIN_ID;
|
|
2933
|
+
exports.AAVE_V4_BSTOCKS_MARKET_NOTES = AAVE_V4_BSTOCKS_MARKET_NOTES;
|
|
2759
2934
|
exports.AAVE_V4_GRAPHQL_URL = AAVE_V4_GRAPHQL_URL;
|
|
2760
2935
|
exports.AAVE_V4_PROTOCOL_ID = AAVE_V4_PROTOCOL_ID;
|
|
2761
2936
|
exports.AAVE_V4_SPOKE_BORROW_DEFAULT_GAS_UNITS = AAVE_V4_SPOKE_BORROW_DEFAULT_GAS_UNITS;
|
|
2762
2937
|
exports.AAVE_V4_SPOKE_REPAY_DEFAULT_GAS_UNITS = AAVE_V4_SPOKE_REPAY_DEFAULT_GAS_UNITS;
|
|
2763
2938
|
exports.AAVE_V4_SPOKE_SUPPLY_DEFAULT_GAS_UNITS = AAVE_V4_SPOKE_SUPPLY_DEFAULT_GAS_UNITS;
|
|
2764
2939
|
exports.AAVE_V4_SPOKE_WITHDRAW_DEFAULT_GAS_UNITS = AAVE_V4_SPOKE_WITHDRAW_DEFAULT_GAS_UNITS;
|
|
2940
|
+
exports.AAVE_V4_UI_MARKETS = AAVE_V4_UI_MARKETS;
|
|
2765
2941
|
exports.MERKL_API_BASE = MERKL_API_BASE;
|
|
2766
2942
|
exports.MERKL_DISTRIBUTOR_ADDRESS = MERKL_DISTRIBUTOR_ADDRESS;
|
|
2767
2943
|
exports.MERKL_DISTRIBUTOR_CLAIM_GAS_FALLBACK = MERKL_DISTRIBUTOR_CLAIM_GAS_FALLBACK;
|
|
@@ -2774,12 +2950,14 @@ exports.aaveV4BorrowHealthGate = aaveV4BorrowHealthGate;
|
|
|
2774
2950
|
exports.aaveV4FetchMarketSummary = aaveV4FetchMarketSummary;
|
|
2775
2951
|
exports.aaveV4FetchMarketsSummary = aaveV4FetchMarketsSummary;
|
|
2776
2952
|
exports.aaveV4FetchMerklRewardsSummary = aaveV4FetchMerklRewardsSummary;
|
|
2953
|
+
exports.aaveV4FetchStockMarketsSummary = aaveV4FetchStockMarketsSummary;
|
|
2777
2954
|
exports.aaveV4Gql = aaveV4Gql;
|
|
2778
2955
|
exports.aaveV4KeyForNodeAssetRow = aaveV4KeyForNodeAssetRow;
|
|
2779
2956
|
exports.aaveV4MarketRowFromHubReserve = aaveV4MarketRowFromHubReserve;
|
|
2780
2957
|
exports.aaveV4ProtocolModule = aaveV4ProtocolModule;
|
|
2781
2958
|
exports.aaveV4RepayHealthGate = aaveV4RepayHealthGate;
|
|
2782
2959
|
exports.aaveV4UiMarketIdForHubName = aaveV4UiMarketIdForHubName;
|
|
2960
|
+
exports.aaveV4UiMarketsForHubs = aaveV4UiMarketsForHubs;
|
|
2783
2961
|
exports.aaveV4UserHasAvailableBorrowCollateralForContextOnSpoke = aaveV4UserHasAvailableBorrowCollateralForContextOnSpoke;
|
|
2784
2962
|
exports.aaveV4WithdrawHealthGate = aaveV4WithdrawHealthGate;
|
|
2785
2963
|
exports.aggregateV4SupplyDisplay = aggregateV4SupplyDisplay;
|
|
@@ -2795,6 +2973,7 @@ exports.buildEvmMultisignBodyEulerV2MerklDistributorClaim = buildEvmMultisignBod
|
|
|
2795
2973
|
exports.buildEvmMultisignBodyEulerV2ReulUnlock = buildEvmMultisignBodyEulerV2ReulUnlock;
|
|
2796
2974
|
exports.encodeMerklDistributorClaimData = encodeMerklDistributorClaimData;
|
|
2797
2975
|
exports.ensureAaveV4ChainTokenCache = ensureAaveV4ChainTokenCache;
|
|
2976
|
+
exports.ensureCoinbaseB20StockCatalog = ensureCoinbaseB20StockCatalog;
|
|
2798
2977
|
exports.fetchAaveV4Chains = fetchAaveV4Chains;
|
|
2799
2978
|
exports.fetchAaveV4ClaimRewardsCalldata = fetchAaveV4ClaimRewardsCalldata;
|
|
2800
2979
|
exports.fetchAaveV4HubReserves = fetchAaveV4HubReserves;
|
|
@@ -2829,6 +3008,7 @@ exports.formatAaveV4ReserveLiquidityFromSummary = formatAaveV4ReserveLiquidityFr
|
|
|
2829
3008
|
exports.formatAaveV4RiskDisplay = formatAaveV4RiskDisplay;
|
|
2830
3009
|
exports.formatAaveV4RiskNotionalString = formatAaveV4RiskNotionalString;
|
|
2831
3010
|
exports.formatAaveV4TokenAmount = formatAaveV4TokenAmount;
|
|
3011
|
+
exports.isAaveV4BStocksHubName = isAaveV4BStocksHubName;
|
|
2832
3012
|
exports.isAaveV4DepositEvmSignRequest = isAaveV4DepositEvmSignRequest;
|
|
2833
3013
|
exports.isAaveV4HubReserveActive = isAaveV4HubReserveActive;
|
|
2834
3014
|
exports.isMerklRewardEulLeaf = isMerklRewardEulLeaf;
|
|
@@ -2838,7 +3018,9 @@ exports.loadAaveV4SupportedChainIdsFromV4Api = loadAaveV4SupportedChainIdsFromV4
|
|
|
2838
3018
|
exports.loadMerklUserRewardsJson = loadMerklUserRewardsJson;
|
|
2839
3019
|
exports.merklLeafToRow = merklLeafToRow;
|
|
2840
3020
|
exports.merklUserRewardsUrl = merklUserRewardsUrl;
|
|
3021
|
+
exports.normalizeAaveV4UiMarketId = normalizeAaveV4UiMarketId;
|
|
2841
3022
|
exports.parseAaveV4ApyPercent = parseAaveV4ApyPercent;
|
|
3023
|
+
exports.parseAaveV4UiMarketId = parseAaveV4UiMarketId;
|
|
2842
3024
|
exports.parseBigDecimalHf = parseBigDecimalHf;
|
|
2843
3025
|
exports.parseMerklUserRewardsToLeaves = parseMerklUserRewardsToLeaves;
|
|
2844
3026
|
exports.pickAaveV4ReserveRowForSpoke = pickAaveV4ReserveRowForSpoke;
|
|
@@ -2847,6 +3029,7 @@ exports.previewAaveV4RepayResultingHf = previewAaveV4RepayResultingHf;
|
|
|
2847
3029
|
exports.previewAaveV4WithdrawResultingHf = previewAaveV4WithdrawResultingHf;
|
|
2848
3030
|
exports.resolveAaveV4DepositGasUnitsFromSignRequest = resolveAaveV4DepositGasUnitsFromSignRequest;
|
|
2849
3031
|
exports.resolveAaveV4HubForUiMarket = resolveAaveV4HubForUiMarket;
|
|
3032
|
+
exports.resolveAaveV4UnderlyingAddress = resolveAaveV4UnderlyingAddress;
|
|
2850
3033
|
exports.selectFirstRootMerklLeaves = selectFirstRootMerklLeaves;
|
|
2851
3034
|
exports.selectWalletWideMerklClaimLeaves = selectWalletWideMerklClaimLeaves;
|
|
2852
3035
|
//# sourceMappingURL=index.cjs.map
|