@continuumdao/ctm-mpc-defi 0.2.32 → 0.2.34
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 +117 -163
- package/dist/agent/catalog.cjs.map +1 -1
- package/dist/agent/catalog.js +117 -163
- package/dist/agent/catalog.js.map +1 -1
- package/dist/agent/skills/euler-v2/SKILL.md +1 -1
- package/dist/core/index.cjs +9 -0
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.ts +3 -1
- package/dist/core/index.js +8 -1
- package/dist/core/index.js.map +1 -1
- package/dist/index.cjs +9 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/protocols/evm/aave-v4/index.cjs.map +1 -1
- package/dist/protocols/evm/aave-v4/index.js.map +1 -1
- package/dist/protocols/evm/euler-v2/index.cjs +301 -294
- package/dist/protocols/evm/euler-v2/index.cjs.map +1 -1
- package/dist/protocols/evm/euler-v2/index.d.ts +37 -4
- package/dist/protocols/evm/euler-v2/index.js +299 -296
- package/dist/protocols/evm/euler-v2/index.js.map +1 -1
- package/dist/protocols/evm/maple/index.cjs.map +1 -1
- package/dist/protocols/evm/maple/index.js.map +1 -1
- package/dist/protocols/evm/morpho/index.cjs.map +1 -1
- package/dist/protocols/evm/morpho/index.js.map +1 -1
- package/dist/protocols/evm/sky/index.cjs.map +1 -1
- package/dist/protocols/evm/sky/index.js.map +1 -1
- package/dist/protocols/evm/uniswap-v4/index.cjs.map +1 -1
- package/dist/protocols/evm/uniswap-v4/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { parseAbi, getAddress, defineChain, createPublicClient, http, parseUnits, encodeFunctionData, zeroAddress, maxUint256,
|
|
1
|
+
import { parseAbi, getAddress, defineChain, createPublicClient, http, parseUnits, encodeFunctionData, zeroAddress, maxUint256, isAddress, formatUnits, parseGwei, serializeTransaction, keccak256 } from 'viem';
|
|
2
2
|
import { fetchChainFeeParams, gasLimitFromEstimateAndChainConfig, gweiToDecimalString, proposalTxParamsToFeeSnapshot, alignEip1559FeesWithLatestBase, getClientIdFromKeyGenResult } from '@continuumdao/continuum-node-sdk';
|
|
3
3
|
|
|
4
4
|
// src/core/registry.ts
|
|
@@ -1577,6 +1577,15 @@ async function postJsonViaOptionalProxy(args) {
|
|
|
1577
1577
|
}
|
|
1578
1578
|
return await r.json();
|
|
1579
1579
|
}
|
|
1580
|
+
async function getJsonViaOptionalProxy(args) {
|
|
1581
|
+
const url = args.directUrl;
|
|
1582
|
+
const r = await fetch(url, { method: "GET", headers: { accept: "application/json" } });
|
|
1583
|
+
if (!r.ok) {
|
|
1584
|
+
const t = await r.text().catch(() => "");
|
|
1585
|
+
throw new Error(t ? `HTTP ${r.status}: ${t.slice(0, 200)}` : `HTTP ${r.status}`);
|
|
1586
|
+
}
|
|
1587
|
+
return await r.json();
|
|
1588
|
+
}
|
|
1580
1589
|
|
|
1581
1590
|
// src/protocols/evm/aave-v4/api.ts
|
|
1582
1591
|
var AAVE_V4_GRAPHQL_URL = "https://api.v4.aave.com/graphql";
|
|
@@ -1610,177 +1619,79 @@ async function fetchAaveV4NativeWrappedToken(chainId) {
|
|
|
1610
1619
|
if (t && isAddress(t)) return getAddress(t);
|
|
1611
1620
|
return null;
|
|
1612
1621
|
}
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
var
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
const
|
|
1627
|
-
const
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
}
|
|
1649
|
-
try {
|
|
1650
|
-
rawBorrowCap16 = Number(BigInt((args.borrowCapRaw ?? "").trim() || "0") & 0xffffn);
|
|
1651
|
-
} catch {
|
|
1652
|
-
rawBorrowCap16 = 0;
|
|
1653
|
-
}
|
|
1654
|
-
return {
|
|
1655
|
-
rawSupplyCap16,
|
|
1656
|
-
rawBorrowCap16,
|
|
1657
|
-
supplyCapWei: eulerSubgraphVaultCapToUnderlyingWei(args.supplyCapRaw),
|
|
1658
|
-
borrowCapWei: eulerSubgraphVaultCapToUnderlyingWei(args.borrowCapRaw),
|
|
1659
|
-
cashWei: args.cashWei,
|
|
1660
|
-
totalBorrowsWei: args.totalBorrowsWei,
|
|
1661
|
-
totalAssetsWei: args.totalAssetsWei
|
|
1662
|
-
};
|
|
1663
|
-
}
|
|
1664
|
-
function formatEulerResolvedCapOrCashForUi(wei, decimals, symbolSuffix) {
|
|
1665
|
-
if (wei >= EULER_EVAULT_CAP_UNLIMITED_WEI - 3n) return "Unlimited";
|
|
1666
|
-
if (wei === 0n) return symbolSuffix ? `0 ${symbolSuffix}` : "0";
|
|
1667
|
-
try {
|
|
1668
|
-
const s = formatUnits(wei, decimals);
|
|
1669
|
-
const n = Number(s);
|
|
1670
|
-
if (Number.isFinite(n) && Math.abs(n) >= 1e9) return `${n.toExponential(2)}${symbolSuffix ? ` ${symbolSuffix}` : ""}`;
|
|
1671
|
-
return symbolSuffix ? `${s} ${symbolSuffix}` : s;
|
|
1672
|
-
} catch {
|
|
1673
|
-
return wei.toString();
|
|
1622
|
+
|
|
1623
|
+
// src/protocols/evm/euler-v2/eulerV3Api.ts
|
|
1624
|
+
var EULER_V3_API_BASE = "https://v3.euler.finance";
|
|
1625
|
+
function qs(params) {
|
|
1626
|
+
const u = new URLSearchParams();
|
|
1627
|
+
for (const [k, v] of Object.entries(params)) {
|
|
1628
|
+
if (v == null) continue;
|
|
1629
|
+
u.set(k, String(v));
|
|
1630
|
+
}
|
|
1631
|
+
const s = u.toString();
|
|
1632
|
+
return s ? `?${s}` : "";
|
|
1633
|
+
}
|
|
1634
|
+
async function eulerV3Get(path, params = {}) {
|
|
1635
|
+
const rel = path.startsWith("/") ? path : `/${path}`;
|
|
1636
|
+
const query = qs(params);
|
|
1637
|
+
const directUrl = `${EULER_V3_API_BASE}${rel}${query}`;
|
|
1638
|
+
rel.replace(/^\/v3\/?/, "");
|
|
1639
|
+
return getJsonViaOptionalProxy({ directUrl});
|
|
1640
|
+
}
|
|
1641
|
+
async function paginateV3Vaults(path, chainId, extra = {}) {
|
|
1642
|
+
const out = [];
|
|
1643
|
+
let offset = 0;
|
|
1644
|
+
const limit = 100;
|
|
1645
|
+
while (true) {
|
|
1646
|
+
const page = await eulerV3Get(path, {
|
|
1647
|
+
chainId,
|
|
1648
|
+
limit,
|
|
1649
|
+
offset,
|
|
1650
|
+
...extra
|
|
1651
|
+
});
|
|
1652
|
+
const rows = page.data ?? [];
|
|
1653
|
+
out.push(...rows);
|
|
1654
|
+
const total = typeof page.meta?.total === "number" ? page.meta.total : out.length;
|
|
1655
|
+
offset += rows.length;
|
|
1656
|
+
if (!rows.length || offset >= total) break;
|
|
1674
1657
|
}
|
|
1658
|
+
return out;
|
|
1675
1659
|
}
|
|
1676
|
-
function
|
|
1677
|
-
|
|
1678
|
-
if (supplyCapWei === 0n) return 0n;
|
|
1679
|
-
if (supplyCapWei >= EULER_EVAULT_CAP_UNLIMITED_WEI - 3n) return EULER_EVAULT_CAP_UNLIMITED_WEI;
|
|
1680
|
-
if (totalAssetsWei >= supplyCapWei) return 0n;
|
|
1681
|
-
return supplyCapWei - totalAssetsWei;
|
|
1660
|
+
async function fetchEulerV3EvkVaults(args) {
|
|
1661
|
+
return paginateV3Vaults("/v3/evk/vaults", args.chainId, args.asset ? { asset: args.asset } : {});
|
|
1682
1662
|
}
|
|
1683
|
-
function
|
|
1684
|
-
|
|
1685
|
-
if (borrowCapWei === 0n) return 0n;
|
|
1686
|
-
if (borrowCapWei >= EULER_EVAULT_CAP_UNLIMITED_WEI - 3n) return cashWei;
|
|
1687
|
-
const capLeft = borrowCapWei > totalBorrowsWei ? borrowCapWei - totalBorrowsWei : 0n;
|
|
1688
|
-
return cashWei < capLeft ? cashWei : capLeft;
|
|
1689
|
-
}
|
|
1690
|
-
async function fetchEulerVaultOnChainLendMetrics(args) {
|
|
1691
|
-
const ch = defineChain({
|
|
1692
|
-
id: args.chainId,
|
|
1693
|
-
name: "EulerVaultRead",
|
|
1694
|
-
nativeCurrency: { decimals: 18, name: "x", symbol: "x" },
|
|
1695
|
-
rpcUrls: { default: { http: [args.rpcUrl] } }
|
|
1696
|
-
});
|
|
1697
|
-
const client = createPublicClient({ chain: ch, transport: http(args.rpcUrl) });
|
|
1698
|
-
const addr = getAddress(args.evault);
|
|
1699
|
-
const [[supplyRaw, borrowRaw], cashWei, totalBorrowsWei, totalAssetsWei] = await Promise.all([
|
|
1700
|
-
client.readContract({
|
|
1701
|
-
address: addr,
|
|
1702
|
-
abi: eulerVaultLendAbi,
|
|
1703
|
-
functionName: "caps"
|
|
1704
|
-
}),
|
|
1705
|
-
client.readContract({
|
|
1706
|
-
address: addr,
|
|
1707
|
-
abi: eulerVaultLendAbi,
|
|
1708
|
-
functionName: "cash"
|
|
1709
|
-
}),
|
|
1710
|
-
client.readContract({
|
|
1711
|
-
address: addr,
|
|
1712
|
-
abi: eulerVaultLendAbi,
|
|
1713
|
-
functionName: "totalBorrows"
|
|
1714
|
-
}),
|
|
1715
|
-
client.readContract({
|
|
1716
|
-
address: addr,
|
|
1717
|
-
abi: eulerVaultLendAbi,
|
|
1718
|
-
functionName: "totalAssets"
|
|
1719
|
-
})
|
|
1720
|
-
]);
|
|
1721
|
-
const rs = Number(supplyRaw);
|
|
1722
|
-
const rb = Number(borrowRaw);
|
|
1723
|
-
return {
|
|
1724
|
-
rawSupplyCap16: rs,
|
|
1725
|
-
rawBorrowCap16: rb,
|
|
1726
|
-
supplyCapWei: resolveEulerAmountCapToWei(rs),
|
|
1727
|
-
borrowCapWei: resolveEulerAmountCapToWei(rb),
|
|
1728
|
-
cashWei,
|
|
1729
|
-
totalBorrowsWei,
|
|
1730
|
-
totalAssetsWei
|
|
1731
|
-
};
|
|
1663
|
+
async function fetchEulerV3EarnVaults(args) {
|
|
1664
|
+
return paginateV3Vaults("/v3/earn/vaults", args.chainId, args.asset ? { asset: args.asset } : {});
|
|
1732
1665
|
}
|
|
1733
|
-
async function
|
|
1734
|
-
const
|
|
1735
|
-
const
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
async function worker() {
|
|
1741
|
-
while (idx < list.length) {
|
|
1742
|
-
const i = idx++;
|
|
1743
|
-
const row = list[i];
|
|
1744
|
-
try {
|
|
1745
|
-
const ev = getAddress(row.evault.trim());
|
|
1746
|
-
const data = await fetchEulerVaultOnChainLendMetrics({
|
|
1747
|
-
rpcUrl: rpc,
|
|
1748
|
-
chainId: args.chainId,
|
|
1749
|
-
evault: ev
|
|
1750
|
-
});
|
|
1751
|
-
out.set(row.key, { ok: true, data });
|
|
1752
|
-
} catch (e) {
|
|
1753
|
-
out.set(row.key, {
|
|
1754
|
-
ok: false,
|
|
1755
|
-
message: e instanceof Error ? e.message : "On-chain read failed"
|
|
1756
|
-
});
|
|
1757
|
-
}
|
|
1758
|
-
}
|
|
1666
|
+
async function fetchEulerV3ActiveChainIds() {
|
|
1667
|
+
const page = await eulerV3Get("/v3/chains");
|
|
1668
|
+
const ids = [];
|
|
1669
|
+
for (const row of page.data ?? []) {
|
|
1670
|
+
if (typeof row.id !== "number" || !Number.isFinite(row.id)) continue;
|
|
1671
|
+
if ((row.status ?? "active") !== "active") continue;
|
|
1672
|
+
ids.push(row.id);
|
|
1759
1673
|
}
|
|
1760
|
-
|
|
1761
|
-
return out;
|
|
1674
|
+
return ids.sort((a, b) => a - b);
|
|
1762
1675
|
}
|
|
1763
1676
|
|
|
1764
1677
|
// src/protocols/evm/euler-v2/eulerV2Subgraph.ts
|
|
1765
1678
|
var EULER_V2_GOLDSKY_SUBGRAPH_URL_BY_CHAIN_ID = {
|
|
1766
|
-
1: "https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-
|
|
1767
|
-
8453: "https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-
|
|
1768
|
-
1923: "https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-
|
|
1769
|
-
146: "https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-
|
|
1770
|
-
60808: "https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-
|
|
1771
|
-
80094: "https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-
|
|
1772
|
-
43114: "https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-
|
|
1773
|
-
42161: "https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-
|
|
1774
|
-
130: "https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
9745: "https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-v2-plasma/latest/gn",
|
|
1783
|
-
5e3: "https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-v2-mantle/latest/gn"
|
|
1679
|
+
1: "https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-simple-mainnet/latest/gn",
|
|
1680
|
+
8453: "https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-simple-base/latest/gn",
|
|
1681
|
+
1923: "https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-simple-swell/latest/gn",
|
|
1682
|
+
146: "https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-simple-sonic/latest/gn",
|
|
1683
|
+
60808: "https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-simple-bob/latest/gn",
|
|
1684
|
+
80094: "https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-simple-berachain/latest/gn",
|
|
1685
|
+
43114: "https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-simple-avalanche/latest/gn",
|
|
1686
|
+
42161: "https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-simple-arbitrum/latest/gn",
|
|
1687
|
+
130: "https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-simple-unichain/latest/gn",
|
|
1688
|
+
56: "https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-simple-bsc/latest/gn",
|
|
1689
|
+
999: "https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-simple-hyperevm/latest/gn",
|
|
1690
|
+
239: "https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-simple-tac/latest/gn",
|
|
1691
|
+
9745: "https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-simple-plasma/latest/gn",
|
|
1692
|
+
137: "https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-simple-polygon/latest/gn",
|
|
1693
|
+
59144: "https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-simple-linea/latest/gn",
|
|
1694
|
+
143: "https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-simple-monad/latest/gn"
|
|
1784
1695
|
};
|
|
1785
1696
|
var WRAPPED_NATIVE_FALLBACK = {
|
|
1786
1697
|
1: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
|
|
@@ -1788,6 +1699,10 @@ var WRAPPED_NATIVE_FALLBACK = {
|
|
|
1788
1699
|
56: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
|
|
1789
1700
|
100: "0xe91d153e0b41518a2ce8dd3d7944fa863463a97d",
|
|
1790
1701
|
130: "0x4200000000000000000000000000000000000006",
|
|
1702
|
+
137: "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",
|
|
1703
|
+
// Polygon: WPOL
|
|
1704
|
+
143: "0x3bd359C1119dA7Da1D913D1C4D2B7c461115433A",
|
|
1705
|
+
// Monad: WMON
|
|
1791
1706
|
146: "0x03980325872071166574bcd94670450917897468",
|
|
1792
1707
|
239: "0xB63B9f0eb4A6E6f191529D71d4D88cc8900Df2C9",
|
|
1793
1708
|
// TAC: WTAC (https://docs.tac.build/ecosystem/token-list)
|
|
@@ -1799,6 +1714,8 @@ var WRAPPED_NATIVE_FALLBACK = {
|
|
|
1799
1714
|
43114: "0xB31f66AA3C1e785363F0875A1B74D27b85FE0459",
|
|
1800
1715
|
5e3: "0x78c1b0C915c4FAA5FffA6CAbf0219DA63d7f4cb8",
|
|
1801
1716
|
// Mantle: WMNT
|
|
1717
|
+
59144: "0xe5D7C2a44FfDDf6b295A15c148167daaAf5Cf34f",
|
|
1718
|
+
// Linea: WETH
|
|
1802
1719
|
57073: "0x4200000000000000000000000000000000000006",
|
|
1803
1720
|
60808: "0x4200000000000000000000000000000000000006",
|
|
1804
1721
|
80094: "0x6969696969696969696969696969696969696969",
|
|
@@ -1897,85 +1814,20 @@ function normAssetAddr(raw) {
|
|
|
1897
1814
|
if (!s || !isAddress(s)) return null;
|
|
1898
1815
|
return getAddress(s).toLowerCase();
|
|
1899
1816
|
}
|
|
1900
|
-
function
|
|
1901
|
-
|
|
1817
|
+
function v3VaultShowsBorrow(totalBorrows, explorableBorrow) {
|
|
1818
|
+
if (explorableBorrow === true) return true;
|
|
1902
1819
|
try {
|
|
1903
|
-
|
|
1820
|
+
return BigInt((totalBorrows ?? "0").trim() || "0") > 0n;
|
|
1904
1821
|
} catch {
|
|
1905
|
-
|
|
1906
|
-
}
|
|
1907
|
-
if (borrows > 0n) return true;
|
|
1908
|
-
const w = eulerSubgraphVaultCapToUnderlyingWei(borrowCap);
|
|
1909
|
-
if (w >= EULER_EVAULT_CAP_UNLIMITED_WEI - 3n) return true;
|
|
1910
|
-
return w > 0n;
|
|
1911
|
-
}
|
|
1912
|
-
var VAULT_PAGE = `
|
|
1913
|
-
query V($first: Int!, $skip: Int!) {
|
|
1914
|
-
eulerVaults(first: $first, skip: $skip) {
|
|
1915
|
-
asset
|
|
1916
|
-
borrowCap
|
|
1917
|
-
state { totalBorrows }
|
|
1918
|
-
}
|
|
1919
|
-
}
|
|
1920
|
-
`;
|
|
1921
|
-
var EARN_PAGE = `
|
|
1922
|
-
query E($first: Int!, $skip: Int!) {
|
|
1923
|
-
eulerEarnVaults(first: $first, skip: $skip) {
|
|
1924
|
-
asset
|
|
1925
|
-
}
|
|
1926
|
-
}
|
|
1927
|
-
`;
|
|
1928
|
-
async function paginateEulerVaultRows(chainId) {
|
|
1929
|
-
const out = [];
|
|
1930
|
-
let skip = 0;
|
|
1931
|
-
const first = 1e3;
|
|
1932
|
-
while (true) {
|
|
1933
|
-
const d = await eulerV2QueryGraphQl(chainId, VAULT_PAGE, { first, skip });
|
|
1934
|
-
const rows = d.eulerVaults ?? [];
|
|
1935
|
-
if (!rows.length) break;
|
|
1936
|
-
for (const r of rows) {
|
|
1937
|
-
const tb = (r.state?.totalBorrows ?? "0").toString();
|
|
1938
|
-
out.push({ asset: r.asset ?? null, borrowCap: r.borrowCap, totalBorrows: tb });
|
|
1939
|
-
}
|
|
1940
|
-
if (rows.length < first) break;
|
|
1941
|
-
skip += first;
|
|
1942
|
-
}
|
|
1943
|
-
return out;
|
|
1944
|
-
}
|
|
1945
|
-
async function paginateEulerEarnAssets(chainId) {
|
|
1946
|
-
const assets = [];
|
|
1947
|
-
let skip = 0;
|
|
1948
|
-
const first = 1e3;
|
|
1949
|
-
while (true) {
|
|
1950
|
-
const d = await eulerV2QueryGraphQl(
|
|
1951
|
-
chainId,
|
|
1952
|
-
EARN_PAGE,
|
|
1953
|
-
{
|
|
1954
|
-
first,
|
|
1955
|
-
skip
|
|
1956
|
-
}
|
|
1957
|
-
);
|
|
1958
|
-
const rows = d.eulerEarnVaults ?? [];
|
|
1959
|
-
if (!rows.length) break;
|
|
1960
|
-
for (const r of rows) {
|
|
1961
|
-
const a = normAssetAddr(r.asset ?? void 0);
|
|
1962
|
-
if (a) assets.push(a);
|
|
1963
|
-
}
|
|
1964
|
-
if (rows.length < first) break;
|
|
1965
|
-
skip += first;
|
|
1822
|
+
return false;
|
|
1966
1823
|
}
|
|
1967
|
-
return assets;
|
|
1968
1824
|
}
|
|
1969
1825
|
var eulerV2ChainAssetCache = /* @__PURE__ */ new Map();
|
|
1970
1826
|
async function fetchEulerV2ChainAssetCache(chainId) {
|
|
1971
|
-
const
|
|
1972
|
-
if (!endpoint) {
|
|
1973
|
-
return { nativeWrapped: null, modesByUnderlying: /* @__PURE__ */ new Map() };
|
|
1974
|
-
}
|
|
1975
|
-
const [nativeWrapped, vaultRows, earnAssets] = await Promise.all([
|
|
1827
|
+
const [nativeWrapped, evkVaults, earnVaults] = await Promise.all([
|
|
1976
1828
|
resolveEulerWrappedNativeToken(chainId),
|
|
1977
|
-
|
|
1978
|
-
|
|
1829
|
+
fetchEulerV3EvkVaults({ chainId }),
|
|
1830
|
+
fetchEulerV3EarnVaults({ chainId }).catch(() => [])
|
|
1979
1831
|
]);
|
|
1980
1832
|
const modes = /* @__PURE__ */ new Map();
|
|
1981
1833
|
const bump = (addr, patch) => {
|
|
@@ -1986,13 +1838,17 @@ async function fetchEulerV2ChainAssetCache(chainId) {
|
|
|
1986
1838
|
earn: cur.earn || !!patch.earn
|
|
1987
1839
|
});
|
|
1988
1840
|
};
|
|
1989
|
-
for (const
|
|
1990
|
-
|
|
1991
|
-
|
|
1841
|
+
for (const v of earnVaults) {
|
|
1842
|
+
const a = normAssetAddr(v.asset?.address ?? void 0);
|
|
1843
|
+
if (a) bump(a, { earn: true });
|
|
1844
|
+
}
|
|
1845
|
+
for (const v of evkVaults) {
|
|
1846
|
+
const a = normAssetAddr(v.asset?.address ?? void 0);
|
|
1992
1847
|
if (!a) continue;
|
|
1848
|
+
const vis = v.visibility;
|
|
1993
1849
|
bump(a, {
|
|
1994
|
-
lend:
|
|
1995
|
-
borrow:
|
|
1850
|
+
lend: vis?.explorableLend !== false,
|
|
1851
|
+
borrow: v3VaultShowsBorrow(v.totalBorrows, vis?.explorableBorrow)
|
|
1996
1852
|
});
|
|
1997
1853
|
}
|
|
1998
1854
|
return { nativeWrapped, modesByUnderlying: modes };
|
|
@@ -2069,47 +1925,162 @@ function eulerLabelsLookupLabelForVault(labelMap, evaultAddress) {
|
|
|
2069
1925
|
const v = labelMap.get(k);
|
|
2070
1926
|
return typeof v === "string" && v.trim() ? v.trim() : void 0;
|
|
2071
1927
|
}
|
|
1928
|
+
var EULER_EVAULT_CAP_UNLIMITED_WEI = (1n << 256n) - 1n;
|
|
1929
|
+
var UINT256_MAX = EULER_EVAULT_CAP_UNLIMITED_WEI;
|
|
1930
|
+
var EULER_EVAULT_SUPPLY_CAP_UNLIMITED_WEI = EULER_EVAULT_CAP_UNLIMITED_WEI;
|
|
1931
|
+
var EULER_V2_PREFER_ON_CHAIN_LEND_METRICS = false;
|
|
1932
|
+
var eulerVaultLendAbi = parseAbi([
|
|
1933
|
+
"function caps() view returns (uint16 supplyCap, uint16 borrowCap)",
|
|
1934
|
+
"function cash() view returns (uint256)",
|
|
1935
|
+
"function totalBorrows() view returns (uint256)",
|
|
1936
|
+
"function totalAssets() view returns (uint256)"
|
|
1937
|
+
]);
|
|
1938
|
+
function resolveEulerAmountCapToWei(rawCap16) {
|
|
1939
|
+
const amountCap = BigInt(rawCap16) & 0xffffn;
|
|
1940
|
+
if (amountCap === 0n) return UINT256_MAX;
|
|
1941
|
+
const exp = amountCap & 63n;
|
|
1942
|
+
const mantissa = amountCap >> 6n;
|
|
1943
|
+
return 10n ** exp * mantissa / 100n;
|
|
1944
|
+
}
|
|
1945
|
+
var resolveEulerAmountCapToSupplyWei = resolveEulerAmountCapToWei;
|
|
1946
|
+
function eulerSubgraphVaultCapToUnderlyingWei(raw) {
|
|
1947
|
+
try {
|
|
1948
|
+
const v = BigInt((raw ?? "").trim() || "0");
|
|
1949
|
+
if (v >= UINT256_MAX - 3n) return v;
|
|
1950
|
+
if (v <= 0xffffn) return resolveEulerAmountCapToWei(v);
|
|
1951
|
+
return v;
|
|
1952
|
+
} catch {
|
|
1953
|
+
return 0n;
|
|
1954
|
+
}
|
|
1955
|
+
}
|
|
1956
|
+
function eulerVaultLendMetricsFromIndexerVaultState(args) {
|
|
1957
|
+
let rawSupplyCap16 = 0;
|
|
1958
|
+
let rawBorrowCap16 = 0;
|
|
1959
|
+
try {
|
|
1960
|
+
rawSupplyCap16 = Number(BigInt((args.supplyCapRaw ?? "").trim() || "0") & 0xffffn);
|
|
1961
|
+
} catch {
|
|
1962
|
+
rawSupplyCap16 = 0;
|
|
1963
|
+
}
|
|
1964
|
+
try {
|
|
1965
|
+
rawBorrowCap16 = Number(BigInt((args.borrowCapRaw ?? "").trim() || "0") & 0xffffn);
|
|
1966
|
+
} catch {
|
|
1967
|
+
rawBorrowCap16 = 0;
|
|
1968
|
+
}
|
|
1969
|
+
return {
|
|
1970
|
+
rawSupplyCap16,
|
|
1971
|
+
rawBorrowCap16,
|
|
1972
|
+
supplyCapWei: eulerSubgraphVaultCapToUnderlyingWei(args.supplyCapRaw),
|
|
1973
|
+
borrowCapWei: eulerSubgraphVaultCapToUnderlyingWei(args.borrowCapRaw),
|
|
1974
|
+
cashWei: args.cashWei,
|
|
1975
|
+
totalBorrowsWei: args.totalBorrowsWei,
|
|
1976
|
+
totalAssetsWei: args.totalAssetsWei
|
|
1977
|
+
};
|
|
1978
|
+
}
|
|
1979
|
+
function formatEulerResolvedCapOrCashForUi(wei, decimals, symbolSuffix) {
|
|
1980
|
+
if (wei >= EULER_EVAULT_CAP_UNLIMITED_WEI - 3n) return "Unlimited";
|
|
1981
|
+
if (wei === 0n) return symbolSuffix ? `0 ${symbolSuffix}` : "0";
|
|
1982
|
+
try {
|
|
1983
|
+
const s = formatUnits(wei, decimals);
|
|
1984
|
+
const n = Number(s);
|
|
1985
|
+
if (Number.isFinite(n) && Math.abs(n) >= 1e9) return `${n.toExponential(2)}${symbolSuffix ? ` ${symbolSuffix}` : ""}`;
|
|
1986
|
+
return symbolSuffix ? `${s} ${symbolSuffix}` : s;
|
|
1987
|
+
} catch {
|
|
1988
|
+
return wei.toString();
|
|
1989
|
+
}
|
|
1990
|
+
}
|
|
1991
|
+
function eulerVaultMaxNewSupplyWei(metrics) {
|
|
1992
|
+
const { supplyCapWei, totalAssetsWei } = metrics;
|
|
1993
|
+
if (supplyCapWei === 0n) return 0n;
|
|
1994
|
+
if (supplyCapWei >= EULER_EVAULT_CAP_UNLIMITED_WEI - 3n) return EULER_EVAULT_CAP_UNLIMITED_WEI;
|
|
1995
|
+
if (totalAssetsWei >= supplyCapWei) return 0n;
|
|
1996
|
+
return supplyCapWei - totalAssetsWei;
|
|
1997
|
+
}
|
|
1998
|
+
function eulerVaultMaxNewBorrowWei(metrics) {
|
|
1999
|
+
const { cashWei, borrowCapWei, totalBorrowsWei } = metrics;
|
|
2000
|
+
if (borrowCapWei === 0n) return 0n;
|
|
2001
|
+
if (borrowCapWei >= EULER_EVAULT_CAP_UNLIMITED_WEI - 3n) return cashWei;
|
|
2002
|
+
const capLeft = borrowCapWei > totalBorrowsWei ? borrowCapWei - totalBorrowsWei : 0n;
|
|
2003
|
+
return cashWei < capLeft ? cashWei : capLeft;
|
|
2004
|
+
}
|
|
2005
|
+
async function fetchEulerVaultOnChainLendMetrics(args) {
|
|
2006
|
+
const ch = defineChain({
|
|
2007
|
+
id: args.chainId,
|
|
2008
|
+
name: "EulerVaultRead",
|
|
2009
|
+
nativeCurrency: { decimals: 18, name: "x", symbol: "x" },
|
|
2010
|
+
rpcUrls: { default: { http: [args.rpcUrl] } }
|
|
2011
|
+
});
|
|
2012
|
+
const client = createPublicClient({ chain: ch, transport: http(args.rpcUrl) });
|
|
2013
|
+
const addr = getAddress(args.evault);
|
|
2014
|
+
const [[supplyRaw, borrowRaw], cashWei, totalBorrowsWei, totalAssetsWei] = await Promise.all([
|
|
2015
|
+
client.readContract({
|
|
2016
|
+
address: addr,
|
|
2017
|
+
abi: eulerVaultLendAbi,
|
|
2018
|
+
functionName: "caps"
|
|
2019
|
+
}),
|
|
2020
|
+
client.readContract({
|
|
2021
|
+
address: addr,
|
|
2022
|
+
abi: eulerVaultLendAbi,
|
|
2023
|
+
functionName: "cash"
|
|
2024
|
+
}),
|
|
2025
|
+
client.readContract({
|
|
2026
|
+
address: addr,
|
|
2027
|
+
abi: eulerVaultLendAbi,
|
|
2028
|
+
functionName: "totalBorrows"
|
|
2029
|
+
}),
|
|
2030
|
+
client.readContract({
|
|
2031
|
+
address: addr,
|
|
2032
|
+
abi: eulerVaultLendAbi,
|
|
2033
|
+
functionName: "totalAssets"
|
|
2034
|
+
})
|
|
2035
|
+
]);
|
|
2036
|
+
const rs = Number(supplyRaw);
|
|
2037
|
+
const rb = Number(borrowRaw);
|
|
2038
|
+
return {
|
|
2039
|
+
rawSupplyCap16: rs,
|
|
2040
|
+
rawBorrowCap16: rb,
|
|
2041
|
+
supplyCapWei: resolveEulerAmountCapToWei(rs),
|
|
2042
|
+
borrowCapWei: resolveEulerAmountCapToWei(rb),
|
|
2043
|
+
cashWei,
|
|
2044
|
+
totalBorrowsWei,
|
|
2045
|
+
totalAssetsWei
|
|
2046
|
+
};
|
|
2047
|
+
}
|
|
2048
|
+
async function fetchEulerVaultOnChainLendMetricsForVaults(args) {
|
|
2049
|
+
const rpc = (args.rpcUrl ?? "").trim();
|
|
2050
|
+
const out = /* @__PURE__ */ new Map();
|
|
2051
|
+
if (!rpc || !args.vaults.length) return out;
|
|
2052
|
+
const concurrency = 8;
|
|
2053
|
+
let idx = 0;
|
|
2054
|
+
const list = [...args.vaults];
|
|
2055
|
+
async function worker() {
|
|
2056
|
+
while (idx < list.length) {
|
|
2057
|
+
const i = idx++;
|
|
2058
|
+
const row = list[i];
|
|
2059
|
+
try {
|
|
2060
|
+
const ev = getAddress(row.evault.trim());
|
|
2061
|
+
const data = await fetchEulerVaultOnChainLendMetrics({
|
|
2062
|
+
rpcUrl: rpc,
|
|
2063
|
+
chainId: args.chainId,
|
|
2064
|
+
evault: ev
|
|
2065
|
+
});
|
|
2066
|
+
out.set(row.key, { ok: true, data });
|
|
2067
|
+
} catch (e) {
|
|
2068
|
+
out.set(row.key, {
|
|
2069
|
+
ok: false,
|
|
2070
|
+
message: e instanceof Error ? e.message : "On-chain read failed"
|
|
2071
|
+
});
|
|
2072
|
+
}
|
|
2073
|
+
}
|
|
2074
|
+
}
|
|
2075
|
+
await Promise.all(Array.from({ length: Math.min(concurrency, list.length) }, () => worker()));
|
|
2076
|
+
return out;
|
|
2077
|
+
}
|
|
2072
2078
|
|
|
2073
2079
|
// src/protocols/evm/euler-v2/eulerV2LendMarkets.ts
|
|
2074
2080
|
var erc20StringMetaAbi = parseAbi([
|
|
2075
2081
|
"function name() view returns (string)",
|
|
2076
2082
|
"function symbol() view returns (string)"
|
|
2077
2083
|
]);
|
|
2078
|
-
var LEND_VAULT_PAGE = `
|
|
2079
|
-
query EulerLendVaults($first: Int!, $skip: Int!, $asset: Bytes!) {
|
|
2080
|
-
eulerVaults(
|
|
2081
|
-
first: $first
|
|
2082
|
-
skip: $skip
|
|
2083
|
-
where: { asset: $asset }
|
|
2084
|
-
orderBy: state__supplyApy
|
|
2085
|
-
orderDirection: desc
|
|
2086
|
-
) {
|
|
2087
|
-
id
|
|
2088
|
-
evc
|
|
2089
|
-
evault
|
|
2090
|
-
name
|
|
2091
|
-
symbol
|
|
2092
|
-
asset
|
|
2093
|
-
decimals
|
|
2094
|
-
supplyCap
|
|
2095
|
-
borrowCap
|
|
2096
|
-
interestFee
|
|
2097
|
-
perspectives
|
|
2098
|
-
collaterals
|
|
2099
|
-
oracle
|
|
2100
|
-
unitOfAccount
|
|
2101
|
-
governonAdmin
|
|
2102
|
-
state {
|
|
2103
|
-
cash
|
|
2104
|
-
totalBorrows
|
|
2105
|
-
totalShares
|
|
2106
|
-
supplyApy
|
|
2107
|
-
borrowApy
|
|
2108
|
-
timestamp
|
|
2109
|
-
}
|
|
2110
|
-
}
|
|
2111
|
-
}
|
|
2112
|
-
`;
|
|
2113
2084
|
var COLLATERAL_META = `
|
|
2114
2085
|
query EulerCollateralVaults($first: Int!, $ids: [Bytes!]!) {
|
|
2115
2086
|
eulerVaults(first: $first, where: { id_in: $ids }) {
|
|
@@ -2315,23 +2286,42 @@ function vaultCashAndBorrows(r) {
|
|
|
2315
2286
|
}
|
|
2316
2287
|
return { cash, borrows };
|
|
2317
2288
|
}
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
const
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
const
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2289
|
+
function v3ApyPercentToRayString(apyPercent) {
|
|
2290
|
+
if (apyPercent == null || !Number.isFinite(apyPercent) || apyPercent <= 0) return "0";
|
|
2291
|
+
const fraction = apyPercent / 100;
|
|
2292
|
+
const ray = BigInt(Math.round(fraction * 1e9)) * 10n ** 18n;
|
|
2293
|
+
return ray.toString();
|
|
2294
|
+
}
|
|
2295
|
+
function v3VaultToGqlRow(v) {
|
|
2296
|
+
let cash = 0n;
|
|
2297
|
+
let borrows = 0n;
|
|
2298
|
+
try {
|
|
2299
|
+
const assets = BigInt((v.totalAssets ?? "0").trim() || "0");
|
|
2300
|
+
borrows = BigInt((v.totalBorrows ?? "0").trim() || "0");
|
|
2301
|
+
cash = assets > borrows ? assets - borrows : 0n;
|
|
2302
|
+
} catch {
|
|
2303
|
+
cash = 0n;
|
|
2304
|
+
borrows = 0n;
|
|
2333
2305
|
}
|
|
2334
|
-
|
|
2306
|
+
const addr = (v.address ?? "").trim();
|
|
2307
|
+
return {
|
|
2308
|
+
id: addr || null,
|
|
2309
|
+
evault: addr || null,
|
|
2310
|
+
name: v.name ?? null,
|
|
2311
|
+
symbol: v.symbol ?? null,
|
|
2312
|
+
asset: v.asset?.address ?? null,
|
|
2313
|
+
decimals: v.decimals != null ? String(v.decimals) : "18",
|
|
2314
|
+
state: {
|
|
2315
|
+
cash: cash.toString(),
|
|
2316
|
+
totalBorrows: borrows.toString(),
|
|
2317
|
+
supplyApy: v3ApyPercentToRayString(v.supplyApy),
|
|
2318
|
+
borrowApy: v3ApyPercentToRayString(v.borrowApy)
|
|
2319
|
+
}
|
|
2320
|
+
};
|
|
2321
|
+
}
|
|
2322
|
+
async function paginateLendVaultRows(chainId, assetLower) {
|
|
2323
|
+
const rows = await fetchEulerV3EvkVaults({ chainId, asset: assetLower });
|
|
2324
|
+
return rows.map(v3VaultToGqlRow);
|
|
2335
2325
|
}
|
|
2336
2326
|
async function fetchCollateralVaultMeta(chainId, collateralIds) {
|
|
2337
2327
|
const map = /* @__PURE__ */ new Map();
|
|
@@ -2339,7 +2329,12 @@ async function fetchCollateralVaultMeta(chainId, collateralIds) {
|
|
|
2339
2329
|
const chunkSize = 400;
|
|
2340
2330
|
for (let i = 0; i < uniq.length; i += chunkSize) {
|
|
2341
2331
|
const chunk = uniq.slice(i, i + chunkSize);
|
|
2342
|
-
|
|
2332
|
+
let d;
|
|
2333
|
+
try {
|
|
2334
|
+
d = await eulerV2QueryGraphQl(chainId, COLLATERAL_META, { first: chunk.length, ids: chunk });
|
|
2335
|
+
} catch {
|
|
2336
|
+
continue;
|
|
2337
|
+
}
|
|
2343
2338
|
for (const r of d.eulerVaults ?? []) {
|
|
2344
2339
|
const id = normId(r.id ?? void 0);
|
|
2345
2340
|
if (!id) continue;
|
|
@@ -3811,10 +3806,18 @@ async function loadEulerV2PortfolioUsdSnapshot(args) {
|
|
|
3811
3806
|
|
|
3812
3807
|
// src/protocols/evm/euler-v2/loadEulerV2SupportedChainIds.ts
|
|
3813
3808
|
var cached = null;
|
|
3814
|
-
function loadEulerV2SupportedChainIds() {
|
|
3815
|
-
if (cached) return
|
|
3809
|
+
async function loadEulerV2SupportedChainIds() {
|
|
3810
|
+
if (cached) return cached;
|
|
3811
|
+
try {
|
|
3812
|
+
const ids = await fetchEulerV3ActiveChainIds();
|
|
3813
|
+
if (ids.length) {
|
|
3814
|
+
cached = new Set(ids);
|
|
3815
|
+
return cached;
|
|
3816
|
+
}
|
|
3817
|
+
} catch {
|
|
3818
|
+
}
|
|
3816
3819
|
cached = new Set(Object.keys(EULER_V2_GOLDSKY_SUBGRAPH_URL_BY_CHAIN_ID).map((k) => Number(k)));
|
|
3817
|
-
return
|
|
3820
|
+
return cached;
|
|
3818
3821
|
}
|
|
3819
3822
|
|
|
3820
3823
|
// src/protocols/evm/euler-v2/index.ts
|
|
@@ -3839,6 +3842,6 @@ var eulerV2ProtocolModule = {
|
|
|
3839
3842
|
};
|
|
3840
3843
|
registerProtocolModule(eulerV2ProtocolModule);
|
|
3841
3844
|
|
|
3842
|
-
export { EULER_EVAULT_CAP_UNLIMITED_WEI, EULER_EVAULT_SUPPLY_CAP_UNLIMITED_WEI, EULER_REUL_UNLOCK_GAS_FALLBACK, EULER_SAME_ASSET_BORROW_APPROVAL_BUFFER_BPS, EULER_SAME_ASSET_BORROW_MAX_ROUNDS, EULER_SAME_ASSET_BORROW_PROTOCOL_HEADROOM_BPS, EULER_SAME_ASSET_BORROW_RATIO_STOP_EPS_BPS, EULER_V2_GOLDSKY_SUBGRAPH_URL_BY_CHAIN_ID, EULER_V2_ISOLATED_VAULT_DEPOSIT_FALLBACK_GAS, EULER_V2_PREFER_ON_CHAIN_LEND_METRICS, EULER_V2_PROTOCOL_ID, EULER_V2_VAULT_WITHDRAW_FALLBACK_GAS, REUL_FULL_VEST_SEC, REUL_LOCK_DAY_SEC, buildEvmMultisignBodyEulerV2BorrowCollateralDepositBatch, buildEvmMultisignBodyEulerV2BorrowCollateralWithdrawBatch, buildEvmMultisignBodyEulerV2BorrowRepayBatch, buildEvmMultisignBodyEulerV2IsolatedBorrowBatch, buildEvmMultisignBodyEulerV2IsolatedLendDepositBatch, buildEvmMultisignBodyEulerV2VaultWithdraw, clampEulerUnderlyingDecimalsForEulerUi, encodeEulerReulWithdrawToByLockTimestampsData, ensureEulerV2ChainAssetCache, estimateBorrowHumanFromLtv, eulerBorrowAndCollateralSameAsset, eulerLabelsAppendUnderlyingIfDistinct, eulerLabelsLookupLabelForVault, eulerReulUnlockAbi, eulerSameAssetApproveAmountWithBuffer, eulerSameAssetTotalCollateralPullWei, eulerSubgraphVaultCapToUnderlyingWei, eulerV2FetchLendVaultsSummary, eulerV2GoldskyUrlForChain, eulerV2KeyForNodeAssetRow, eulerV2ProtocolModule, eulerV2QueryGraphQl, eulerVaultLendMetricsFromIndexerVaultState, eulerVaultMaxNewBorrowWei, eulerVaultMaxNewSupplyWei, eulerWrappedGasTokenAliasesLower, fetchCoingeckoTokenUsdByContract, fetchEulerBorrowCollateralMaxWithdrawAssetsWei, fetchEulerLabelsEarnVaultAllowlist, fetchEulerLabelsEntityNameByAddress, fetchEulerLabelsVaultNameMap, fetchEulerLendEarnVaultEffectiveMaxWithdrawWei, fetchEulerReulVestingTranches, fetchEulerV2BorrowDebtWei, fetchEulerV2BorrowOracleQuoteSnapshot, fetchEulerV2BorrowPairLtvs, fetchEulerV2ChainAssetCache, fetchEulerV2EarnOfferingsForRowAsset, fetchEulerV2IsolatedLendMarketsForRowAsset, fetchEulerV2TrackingBorrowEntries, fetchEulerV2TrackingDepositEntries, fetchEulerVaultAssetDecimals, fetchEulerVaultMaxWithdrawWei, fetchEulerVaultOnChainLendMetrics, fetchEulerVaultOnChainLendMetricsForVaults, fetchEulerVaultUnderlyingMeta, flattenEulerV2BorrowCollateralRows, formatEulerRayApyPercent, formatEulerRaySupplyApyPercent, formatEulerResolvedCapOrCashForUi, loadEulerV2BorrowPositionsForOwner, loadEulerV2LendSupplyPositionsForOwner, loadEulerV2PortfolioUsdSnapshot, loadEulerV2SupportedChainIds, maxCollateralWeiCappedByBorrowLiquidity, mergeEulerV2PositionsTabRows, parseEulerTrackingBorrowEntry, planSameAssetLeveragedBorrows, resolveEulerAmountCapToSupplyWei, resolveEulerAmountCapToWei, resolveEulerWrappedNativeToken };
|
|
3845
|
+
export { EULER_EVAULT_CAP_UNLIMITED_WEI, EULER_EVAULT_SUPPLY_CAP_UNLIMITED_WEI, EULER_REUL_UNLOCK_GAS_FALLBACK, EULER_SAME_ASSET_BORROW_APPROVAL_BUFFER_BPS, EULER_SAME_ASSET_BORROW_MAX_ROUNDS, EULER_SAME_ASSET_BORROW_PROTOCOL_HEADROOM_BPS, EULER_SAME_ASSET_BORROW_RATIO_STOP_EPS_BPS, EULER_V2_GOLDSKY_SUBGRAPH_URL_BY_CHAIN_ID, EULER_V2_ISOLATED_VAULT_DEPOSIT_FALLBACK_GAS, EULER_V2_PREFER_ON_CHAIN_LEND_METRICS, EULER_V2_PROTOCOL_ID, EULER_V2_VAULT_WITHDRAW_FALLBACK_GAS, EULER_V3_API_BASE, REUL_FULL_VEST_SEC, REUL_LOCK_DAY_SEC, buildEvmMultisignBodyEulerV2BorrowCollateralDepositBatch, buildEvmMultisignBodyEulerV2BorrowCollateralWithdrawBatch, buildEvmMultisignBodyEulerV2BorrowRepayBatch, buildEvmMultisignBodyEulerV2IsolatedBorrowBatch, buildEvmMultisignBodyEulerV2IsolatedLendDepositBatch, buildEvmMultisignBodyEulerV2VaultWithdraw, clampEulerUnderlyingDecimalsForEulerUi, encodeEulerReulWithdrawToByLockTimestampsData, ensureEulerV2ChainAssetCache, estimateBorrowHumanFromLtv, eulerBorrowAndCollateralSameAsset, eulerLabelsAppendUnderlyingIfDistinct, eulerLabelsLookupLabelForVault, eulerReulUnlockAbi, eulerSameAssetApproveAmountWithBuffer, eulerSameAssetTotalCollateralPullWei, eulerSubgraphVaultCapToUnderlyingWei, eulerV2FetchLendVaultsSummary, eulerV2GoldskyUrlForChain, eulerV2KeyForNodeAssetRow, eulerV2ProtocolModule, eulerV2QueryGraphQl, eulerVaultLendMetricsFromIndexerVaultState, eulerVaultMaxNewBorrowWei, eulerVaultMaxNewSupplyWei, eulerWrappedGasTokenAliasesLower, fetchCoingeckoTokenUsdByContract, fetchEulerBorrowCollateralMaxWithdrawAssetsWei, fetchEulerLabelsEarnVaultAllowlist, fetchEulerLabelsEntityNameByAddress, fetchEulerLabelsVaultNameMap, fetchEulerLendEarnVaultEffectiveMaxWithdrawWei, fetchEulerReulVestingTranches, fetchEulerV2BorrowDebtWei, fetchEulerV2BorrowOracleQuoteSnapshot, fetchEulerV2BorrowPairLtvs, fetchEulerV2ChainAssetCache, fetchEulerV2EarnOfferingsForRowAsset, fetchEulerV2IsolatedLendMarketsForRowAsset, fetchEulerV2TrackingBorrowEntries, fetchEulerV2TrackingDepositEntries, fetchEulerV3ActiveChainIds, fetchEulerV3EarnVaults, fetchEulerV3EvkVaults, fetchEulerVaultAssetDecimals, fetchEulerVaultMaxWithdrawWei, fetchEulerVaultOnChainLendMetrics, fetchEulerVaultOnChainLendMetricsForVaults, fetchEulerVaultUnderlyingMeta, flattenEulerV2BorrowCollateralRows, formatEulerRayApyPercent, formatEulerRaySupplyApyPercent, formatEulerResolvedCapOrCashForUi, loadEulerV2BorrowPositionsForOwner, loadEulerV2LendSupplyPositionsForOwner, loadEulerV2PortfolioUsdSnapshot, loadEulerV2SupportedChainIds, maxCollateralWeiCappedByBorrowLiquidity, mergeEulerV2PositionsTabRows, parseEulerTrackingBorrowEntry, planSameAssetLeveragedBorrows, resolveEulerAmountCapToSupplyWei, resolveEulerAmountCapToWei, resolveEulerWrappedNativeToken };
|
|
3843
3846
|
//# sourceMappingURL=index.js.map
|
|
3844
3847
|
//# sourceMappingURL=index.js.map
|