@1delta/margin-fetcher 5.0.0 → 5.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +64 -4
- package/dist/index.js +347 -341
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { parseAbi, keccak256, encodeAbiParameters, formatEther, BaseError, erc20Abi, stringToHex, pad, encodeFunctionData, formatUnits, isAddress, getAddress, decodeFunctionResult, decodeAbiParameters, concat, AbiEncodingLengthMismatchError, concatHex, toBytes, slice, hexToString, InvalidAddressError, boolToHex, integerRegex, numberToHex, bytesRegex, BytesSizeMismatchError, arrayRegex, UnsupportedPackedAbiType } from './chunk-YILYOOYB.js';
|
|
2
2
|
import './chunk-BYTNVMX7.js';
|
|
3
3
|
import './chunk-PR4QN5HX.js';
|
|
4
|
-
import { Lender, isExactly, isMidnight, isTerm, isTermMax, isTeller, isListaDao, isLiquityFamily, isRiver, isInverse, isUsdd, isCompoundV3Type, isFluid, isGearboxV3, isLlamaLend, LIQUITY_FAMILY_LENDERS, isAaveType, isCompoundV3, isMultiMarket, isSiloV2Type, isSiloV3Type, isDolomite,
|
|
4
|
+
import { Lender, isExactly, isMidnight, isTerm, isTermMax, isTeller, isListaDao, isLiquityFamily, isRiver, isInverse, isUsdd, isCompoundV3Type, isFluid, isGearboxV3, isLlamaLend, isFrankencoin, isResupply, LIQUITY_FAMILY_LENDERS, isAaveType, isCompoundV3, isMultiMarket, isSiloV2Type, isSiloV3Type, isDolomite, hasCrossMarginRisk, isEulerType, isAaveV4Type, isInit, isMorphoType, isCompoundV2Type, isVenusType, isSumerType, AAVE_V3_LENDERS, AAVE_V2_LENDERS, isAaveV2Type, isAaveV32Type, isAaveV3Type, isYLDR, isLista, hasSubAccounts, isTectonicType, isKineticType, isBenqiType } from '@1delta/lender-registry';
|
|
5
5
|
export { hasCrossMarginRisk, isAaveType, isAaveV2Type, isAaveV32Type, isAaveV3Type, isCompoundV3, isCompoundV3Type, isInit, isMorphoType, isMultiMarket, isYLDR } from '@1delta/lender-registry';
|
|
6
6
|
import { fetchTokenLists, fetchTokenList, aavePools, compoundV3Pools, initConfig, morphoPools, compoundV2Pools, eulerVaults, siloMarkets, siloV2LenderKey, siloMarketsV3, siloV3LenderKey, aaveV4Spokes, aaveV4SpokeLenderKey, fluidResolvers, gearboxResolvers, dolomiteConfigs, midnightConfig, termConfig, termMarketsByChain, exactlyConfig, liquityLendersByChain, riverLendersByChain, inverseLendersByChain, llamaLendLendersByChain, usddLendersByChain, frankencoinLendersByChain, resupplyLendersByChain, tellerConfigByChain, tellerPoolsByChain, termMaxConfigByChain, aaveReserves, compoundV3Reserves, liquityConfigFor, liquityBranchesByChain, riverConfigFor, riverChainData, termMaxApiBaseUrl, termMaxLenderKey, inverseConfigFor, inverseChainData, llamaLendConfigFor, llamaLendChainData, llamaLendApiBaseUrl, resupplyConfigFor, usddConfigFor, usddChainData, frankencoinConfigFor, frankencoinChainData, aaveOracles, morphoTypeMarkets, resolveMidnightApiBase, resolveTermApiBase, llamaLendMarketByVault, getSiloV2MarketEntry, getSiloV3MarketEntry, dolomiteEmode, aaveTokens, morphoTypeVaults, eulerConfigs, gearboxMarketCompressor, gearboxMarketConfigurators, gearboxV3LenderKey, midnightMarketsByChain, parseAaveV4SpokeLenderKey, gearboxAccountCompressor, compoundV2Tokens, exactlyMarketsByChain, aaveOraclesConfig, compoundV2Oracles, compoundV2TokenArray, compoundV2OraclesConfig, compoundV3OraclesData, compoundV3BaseData, compoundV2Reserves, aaveV4Oracles } from '@1delta/data-sdk';
|
|
7
7
|
import lodash from 'lodash';
|
|
@@ -10262,7 +10262,6 @@ var MORPHO_LENS = {
|
|
|
10262
10262
|
[Chain.PHAROS_MAINNET]: "0x8E24CfC19c6C00c524353CB8816f5f1c2F33c201",
|
|
10263
10263
|
[Chain.ROBINHOOD_CHAIN]: "0x8E24CfC19c6C00c524353CB8816f5f1c2F33c201",
|
|
10264
10264
|
[Chain.STABLE_MAINNET]: "0x8E24CfC19c6C00c524353CB8816f5f1c2F33c201",
|
|
10265
|
-
[Chain.CORN]: "0x8E24CfC19c6C00c524353CB8816f5f1c2F33c201",
|
|
10266
10265
|
[Chain.LISK]: "0x8E24CfC19c6C00c524353CB8816f5f1c2F33c201",
|
|
10267
10266
|
[Chain.ABSTRACT]: "0x8e24cfc19c6c00c524353cb8816f5f1c2f33c201",
|
|
10268
10267
|
[Chain.INK]: "0x0bd7473CbBf81d9dD936c61117eD230d95006CA2",
|
|
@@ -12716,8 +12715,7 @@ var SUMER_LENS = {
|
|
|
12716
12715
|
};
|
|
12717
12716
|
var MOONWELL_LENS = {
|
|
12718
12717
|
[Chain.OP_MAINNET]: "0xD6C66868f937f00604d0FB860241970D6CC2CBfE",
|
|
12719
|
-
[Chain.BASE]: "0x6834770aba6c2028f448e3259ddee4bcb879d459"
|
|
12720
|
-
[Chain.MOONBEAM]: "0xe76C8B8706faC85a8Fbdcac3C42e3E7823c73994"
|
|
12718
|
+
[Chain.BASE]: "0x6834770aba6c2028f448e3259ddee4bcb879d459"
|
|
12721
12719
|
};
|
|
12722
12720
|
var ENCLABS_LENS = {
|
|
12723
12721
|
[Chain.SONIC_MAINNET]: "0x3567B16050cB90236997eF47B1941502e85d65f3",
|
|
@@ -25715,7 +25713,6 @@ var INK_MULTICALL_ADDRESS = "0xA0fCec583AeE6176527C07B198e5561722332014";
|
|
|
25715
25713
|
var METIS_MULTICALL_ADDRESS = "0x7a59ddbB76521E8982Fa3A08598C9a83b14A6C07";
|
|
25716
25714
|
var IOTA_MULTICALL_ADDRESS = "0x9683D433621A83aA7dd290106e1da85251317F55";
|
|
25717
25715
|
var KAVA_MULTICALL_ADDRESS = "0x8B741B0D79BE80E135C880F7583d427B4D41F015";
|
|
25718
|
-
var CORN_MULTICALL_ADDRESS = "0x5d6b0f5335ec95cD2aB7E52f2A0750dd86502435";
|
|
25719
25716
|
var SAGA_MULTICALL_ADDRESS = "0x743E03cceB4af2efA3CC76838f6E8B50B63F184c";
|
|
25720
25717
|
var CYBER_MULTICALL_ADDRESS = "0x906d6eB9CF8f64e100e44f8f491b833a8d40B530";
|
|
25721
25718
|
var METAL_MULTICALL_ADDRESS = "0x5d6b0f5335ec95cD2aB7E52f2A0750dd86502435";
|
|
@@ -25749,7 +25746,6 @@ var MULTICALL_ADDRESS = {
|
|
|
25749
25746
|
[Chain.MODE]: MODE_MULTICALL_ADDRESS,
|
|
25750
25747
|
[Chain.INK]: INK_MULTICALL_ADDRESS,
|
|
25751
25748
|
[Chain.IOTA_EVM]: IOTA_MULTICALL_ADDRESS,
|
|
25752
|
-
[Chain.CORN]: CORN_MULTICALL_ADDRESS,
|
|
25753
25749
|
[Chain.SONIC_MAINNET]: SONIC_MULTICALL_ADDRESS,
|
|
25754
25750
|
[Chain.FANTOM_OPERA]: FANTOM_MULTICALL_ADDRESS,
|
|
25755
25751
|
[Chain.SCROLL]: SCROLL_MULTICALL_ADDRESS,
|
|
@@ -25799,13 +25795,13 @@ var REPAIR_BACKOFF_JITTER_MS = 60;
|
|
|
25799
25795
|
var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)));
|
|
25800
25796
|
var backoffForRound = (round) => REPAIR_BACKOFF_BASE_MS * 2 ** round + Math.random() * REPAIR_BACKOFF_JITTER_MS;
|
|
25801
25797
|
var endpointUrl = (client, rpcId) => client?.transport?.url ?? `rpc#${rpcId}`;
|
|
25802
|
-
var resolveEndpoint = (chainId,
|
|
25798
|
+
var resolveEndpoint = (chainId, getEvmClient16, startRpcId, tried, maxProbe = 12) => {
|
|
25803
25799
|
let fallback = null;
|
|
25804
25800
|
for (let probe = 0; probe < maxProbe; probe++) {
|
|
25805
25801
|
const rpcId = startRpcId + probe;
|
|
25806
25802
|
let client;
|
|
25807
25803
|
try {
|
|
25808
|
-
client =
|
|
25804
|
+
client = getEvmClient16(chainId, rpcId);
|
|
25809
25805
|
} catch {
|
|
25810
25806
|
break;
|
|
25811
25807
|
}
|
|
@@ -25835,7 +25831,7 @@ var recordPermanentFailures = (slots, offset, collector) => {
|
|
|
25835
25831
|
if (slots[i].permanent) collector.add(offset + i);
|
|
25836
25832
|
}
|
|
25837
25833
|
};
|
|
25838
|
-
var repairFailedSlots = async (chainId, contracts, slots,
|
|
25834
|
+
var repairFailedSlots = async (chainId, contracts, slots, getEvmClient16, nextRpcId, batchSize, logs, rounds = MULTICALL_REPAIR_ROUNDS, options) => {
|
|
25839
25835
|
let searchFrom = nextRpcId;
|
|
25840
25836
|
for (let round = 0; round < rounds; round++) {
|
|
25841
25837
|
const failedIdx = [];
|
|
@@ -25845,7 +25841,7 @@ var repairFailedSlots = async (chainId, contracts, slots, getEvmClient17, nextRp
|
|
|
25845
25841
|
if (failedIdx.length === 0) return slots;
|
|
25846
25842
|
const endpoint = resolveEndpoint(
|
|
25847
25843
|
chainId,
|
|
25848
|
-
|
|
25844
|
+
getEvmClient16,
|
|
25849
25845
|
searchFrom,
|
|
25850
25846
|
options?.tried
|
|
25851
25847
|
);
|
|
@@ -25897,9 +25893,9 @@ var repairFailedSlots = async (chainId, contracts, slots, getEvmClient17, nextRp
|
|
|
25897
25893
|
}
|
|
25898
25894
|
return slots;
|
|
25899
25895
|
};
|
|
25900
|
-
var multicallViemAbiArray = async (chainId, abi, calls,
|
|
25896
|
+
var multicallViemAbiArray = async (chainId, abi, calls, getEvmClient16, retry = true, providerId = 0, retries = maxRetries, allowFailure = true, batchSize = MULTICALL_DEFAULT_BATCH_SIZE, logs = false, retryFailed = false, permanentFailures, options) => {
|
|
25901
25897
|
const tried = options?.tried ?? /* @__PURE__ */ new Set();
|
|
25902
|
-
const endpoint = resolveEndpoint(chainId,
|
|
25898
|
+
const endpoint = resolveEndpoint(chainId, getEvmClient16, providerId, tried);
|
|
25903
25899
|
if (!endpoint) throw new Error("No usable RPC endpoint for " + chainId);
|
|
25904
25900
|
const endpointOptions = {
|
|
25905
25901
|
tried,
|
|
@@ -25936,7 +25932,7 @@ var multicallViemAbiArray = async (chainId, abi, calls, getEvmClient17, retry =
|
|
|
25936
25932
|
chainId,
|
|
25937
25933
|
abi,
|
|
25938
25934
|
calls,
|
|
25939
|
-
|
|
25935
|
+
getEvmClient16,
|
|
25940
25936
|
retry,
|
|
25941
25937
|
endpoint.rpcId + 1,
|
|
25942
25938
|
retries - 1,
|
|
@@ -25952,7 +25948,7 @@ var multicallViemAbiArray = async (chainId, abi, calls, getEvmClient17, retry =
|
|
|
25952
25948
|
chainId,
|
|
25953
25949
|
contracts,
|
|
25954
25950
|
slots,
|
|
25955
|
-
|
|
25951
|
+
getEvmClient16,
|
|
25956
25952
|
endpoint.rpcId + 1,
|
|
25957
25953
|
batchSize,
|
|
25958
25954
|
logs,
|
|
@@ -25976,7 +25972,7 @@ var multicallViemAbiArray = async (chainId, abi, calls, getEvmClient17, retry =
|
|
|
25976
25972
|
chainId,
|
|
25977
25973
|
abi,
|
|
25978
25974
|
calls,
|
|
25979
|
-
|
|
25975
|
+
getEvmClient16,
|
|
25980
25976
|
retry,
|
|
25981
25977
|
endpoint.rpcId + 1,
|
|
25982
25978
|
retries,
|
|
@@ -25989,13 +25985,13 @@ var multicallViemAbiArray = async (chainId, abi, calls, getEvmClient17, retry =
|
|
|
25989
25985
|
);
|
|
25990
25986
|
}
|
|
25991
25987
|
};
|
|
25992
|
-
var multicallShardedAbiArray = async (chainId, abi, calls,
|
|
25988
|
+
var multicallShardedAbiArray = async (chainId, abi, calls, getEvmClient16, poolSize, retries = maxRetries, allowFailure = true, batchSize = MULTICALL_DEFAULT_BATCH_SIZE, logs = false, retryFailed = false, permanentFailures, options) => {
|
|
25993
25989
|
if (poolSize <= 1) {
|
|
25994
25990
|
return multicallViemAbiArray(
|
|
25995
25991
|
chainId,
|
|
25996
25992
|
abi,
|
|
25997
25993
|
calls,
|
|
25998
|
-
|
|
25994
|
+
getEvmClient16,
|
|
25999
25995
|
true,
|
|
26000
25996
|
0,
|
|
26001
25997
|
retries,
|
|
@@ -26024,7 +26020,7 @@ var multicallShardedAbiArray = async (chainId, abi, calls, getEvmClient17, poolS
|
|
|
26024
26020
|
}
|
|
26025
26021
|
const results = new Array(contracts.length);
|
|
26026
26022
|
const runBatch = async (batch, rpcId, attemptsLeft, size, tried) => {
|
|
26027
|
-
const endpoint = resolveEndpoint(chainId,
|
|
26023
|
+
const endpoint = resolveEndpoint(chainId, getEvmClient16, rpcId, tried);
|
|
26028
26024
|
if (!endpoint) {
|
|
26029
26025
|
if (logs)
|
|
26030
26026
|
console.log(
|
|
@@ -26068,7 +26064,7 @@ var multicallShardedAbiArray = async (chainId, abi, calls, getEvmClient17, poolS
|
|
|
26068
26064
|
chainId,
|
|
26069
26065
|
batch.items,
|
|
26070
26066
|
slots,
|
|
26071
|
-
|
|
26067
|
+
getEvmClient16,
|
|
26072
26068
|
endpoint.rpcId + 1,
|
|
26073
26069
|
size,
|
|
26074
26070
|
logs,
|
|
@@ -36360,7 +36356,7 @@ function unflattenLenderData(pools) {
|
|
|
36360
36356
|
}
|
|
36361
36357
|
return result;
|
|
36362
36358
|
}
|
|
36363
|
-
var getLenderUserDataResult = async (chainId, queriesRaw,
|
|
36359
|
+
var getLenderUserDataResult = async (chainId, queriesRaw, getEvmClient16, allowFailure = true, batchSize = MULTICALL_DEFAULT_BATCH_SIZE, retries = 3, logs = false, concurrency = 1, permanentFailures, onEndpointFailure) => {
|
|
36364
36360
|
const queries = organizeUserQueries(queriesRaw);
|
|
36365
36361
|
const builtCalls = await Promise.all(
|
|
36366
36362
|
queries.map(async (query3) => {
|
|
@@ -36370,7 +36366,7 @@ var getLenderUserDataResult = async (chainId, queriesRaw, getEvmClient17, allowF
|
|
|
36370
36366
|
query3.lender,
|
|
36371
36367
|
query3.account,
|
|
36372
36368
|
query3.params,
|
|
36373
|
-
|
|
36369
|
+
getEvmClient16
|
|
36374
36370
|
);
|
|
36375
36371
|
return callData.map((call) => ({ call, abi: call.abi ?? abi }));
|
|
36376
36372
|
})
|
|
@@ -36380,7 +36376,7 @@ var getLenderUserDataResult = async (chainId, queriesRaw, getEvmClient17, allowF
|
|
|
36380
36376
|
chainId,
|
|
36381
36377
|
calls.map((call) => call.abi),
|
|
36382
36378
|
calls.map((call) => call.call),
|
|
36383
|
-
|
|
36379
|
+
getEvmClient16,
|
|
36384
36380
|
concurrency,
|
|
36385
36381
|
retries,
|
|
36386
36382
|
allowFailure,
|
|
@@ -39109,67 +39105,6 @@ var lombardLbtcvFetcher = createLombardVaultFetcher(
|
|
|
39109
39105
|
"VAULT_WRAPPER_BTCE",
|
|
39110
39106
|
"LBTCv"
|
|
39111
39107
|
);
|
|
39112
|
-
var CHAIN_ID6 = "1284";
|
|
39113
|
-
var STDOT = "0xbc7e02c4178a7df7d3e564323a5c359dc96c4db4";
|
|
39114
|
-
var ONE_E184 = 10n ** 18n;
|
|
39115
|
-
var WINDOW_SECONDS6 = 180 * 24 * 60 * 60;
|
|
39116
|
-
var BLOCK_TIME_SECONDS5 = 6;
|
|
39117
|
-
var WINDOW_BLOCKS5 = BigInt(Math.floor(WINDOW_SECONDS6 / BLOCK_TIME_SECONDS5));
|
|
39118
|
-
var MAX_RPC_TRIES5 = 5;
|
|
39119
|
-
var POOLED_BY_SHARES_ABI = [
|
|
39120
|
-
{
|
|
39121
|
-
name: "getPooledTokenByShares",
|
|
39122
|
-
type: "function",
|
|
39123
|
-
stateMutability: "view",
|
|
39124
|
-
inputs: [{ type: "uint256", name: "_sharesAmount" }],
|
|
39125
|
-
outputs: [{ type: "uint256" }]
|
|
39126
|
-
}
|
|
39127
|
-
];
|
|
39128
|
-
var readRateAt5 = (client, blockNumber) => client.readContract({
|
|
39129
|
-
address: STDOT,
|
|
39130
|
-
abi: POOLED_BY_SHARES_ABI,
|
|
39131
|
-
functionName: "getPooledTokenByShares",
|
|
39132
|
-
args: [ONE_E184],
|
|
39133
|
-
...blockNumber !== void 0 ? { blockNumber } : {}
|
|
39134
|
-
});
|
|
39135
|
-
var computeApr6 = async () => {
|
|
39136
|
-
let lastErr;
|
|
39137
|
-
for (let rpcId = 0; rpcId < MAX_RPC_TRIES5; rpcId++) {
|
|
39138
|
-
try {
|
|
39139
|
-
const client = getEvmClient(CHAIN_ID6, rpcId);
|
|
39140
|
-
const head = await client.getBlockNumber();
|
|
39141
|
-
const pastBlock = head > WINDOW_BLOCKS5 ? head - WINDOW_BLOCKS5 : 0n;
|
|
39142
|
-
const [rateNow, rateThen, headBlock, thenBlock] = await Promise.all([
|
|
39143
|
-
readRateAt5(client),
|
|
39144
|
-
readRateAt5(client, pastBlock),
|
|
39145
|
-
client.getBlock({ blockNumber: head }),
|
|
39146
|
-
client.getBlock({ blockNumber: pastBlock })
|
|
39147
|
-
]);
|
|
39148
|
-
if (rateNow < ONE_E184 || rateThen < ONE_E184 || rateNow < rateThen) {
|
|
39149
|
-
throw new Error(
|
|
39150
|
-
`non-archival or invalid rates (now=${rateNow}, then=${rateThen})`
|
|
39151
|
-
);
|
|
39152
|
-
}
|
|
39153
|
-
const elapsed = Number(headBlock.timestamp - thenBlock.timestamp);
|
|
39154
|
-
if (elapsed <= 0) throw new Error("non-positive elapsed window");
|
|
39155
|
-
const apr = annualizeRateDeltaPercent(rateNow, rateThen, elapsed);
|
|
39156
|
-
if (!Number.isFinite(apr) || apr < 0) throw new Error(`bad apr ${apr}`);
|
|
39157
|
-
return apr;
|
|
39158
|
-
} catch (e) {
|
|
39159
|
-
lastErr = e;
|
|
39160
|
-
}
|
|
39161
|
-
}
|
|
39162
|
-
throw new Error(
|
|
39163
|
-
`stDOT APR: no archival Moonbeam RPC returned valid historical state (${String(lastErr)})`
|
|
39164
|
-
);
|
|
39165
|
-
};
|
|
39166
|
-
var stDotFetcher = {
|
|
39167
|
-
label: "STDOT",
|
|
39168
|
-
fetch: async () => {
|
|
39169
|
-
const apr = await computeApr6();
|
|
39170
|
-
return { "StellaSwap Staked DOT::STDOT": apr };
|
|
39171
|
-
}
|
|
39172
|
-
};
|
|
39173
39108
|
|
|
39174
39109
|
// src/yields/intrinsic/fetchers/solv.ts
|
|
39175
39110
|
var BTCPLUS_STATS_URL = "https://api.solvprotocol.org/btcplus/stats";
|
|
@@ -39188,7 +39123,7 @@ var solvBtcPlusFetcher = {
|
|
|
39188
39123
|
var STCORE_KEY = "Liquid staked CORE::stCORE";
|
|
39189
39124
|
var DUALCORE_KEY = "b14g dualCORE::DUALCORE";
|
|
39190
39125
|
var SCORE_KEY = "StakedCore::SCORE";
|
|
39191
|
-
var
|
|
39126
|
+
var ONE_E184 = 10n ** 18n;
|
|
39192
39127
|
var EARN = "0xf5fa1728babc3f8d2a617397fac2696c958c3409";
|
|
39193
39128
|
var SCORE = "0xa20b3b97df3a02f9185175760300a06b4e0a2c05";
|
|
39194
39129
|
var GET_EXCHANGE_RATES_ABI = [
|
|
@@ -39263,7 +39198,7 @@ var computeScoreApr = async () => {
|
|
|
39263
39198
|
]);
|
|
39264
39199
|
const sup = supply;
|
|
39265
39200
|
if (sup <= 0n) return 0;
|
|
39266
|
-
return Number(staked *
|
|
39201
|
+
return Number(staked * ONE_E184 / sup) / 1e18;
|
|
39267
39202
|
};
|
|
39268
39203
|
for (const window of WINDOWS) {
|
|
39269
39204
|
for (let rpcId = 0; rpcId < 3; rpcId++) {
|
|
@@ -39331,7 +39266,7 @@ var monadLstFetcher = {
|
|
|
39331
39266
|
|
|
39332
39267
|
// src/yields/intrinsic/linearRewards.ts
|
|
39333
39268
|
var YEAR_SECONDS4 = 31536000n;
|
|
39334
|
-
var
|
|
39269
|
+
var ONE_E185 = 10n ** 18n;
|
|
39335
39270
|
var LINEAR_REWARDS_APR_ABI = [
|
|
39336
39271
|
{
|
|
39337
39272
|
name: "rewardsCycleData",
|
|
@@ -39375,19 +39310,19 @@ function linearRewardsApr(results, offset = 0) {
|
|
|
39375
39310
|
const [cycleEnd, lastSync, rewardCycleAmount] = cycle;
|
|
39376
39311
|
const window = BigInt(cycleEnd) - BigInt(lastSync);
|
|
39377
39312
|
const uncapped = window > 0n ? rewardCycleAmount / window : 0n;
|
|
39378
|
-
const cap = maxPerSecondPerAsset * storedTotalAssets /
|
|
39313
|
+
const cap = maxPerSecondPerAsset * storedTotalAssets / ONE_E185;
|
|
39379
39314
|
const perSecond = uncapped < cap ? uncapped : cap;
|
|
39380
|
-
return Number(perSecond * YEAR_SECONDS4 *
|
|
39315
|
+
return Number(perSecond * YEAR_SECONDS4 * ONE_E185 / storedTotalAssets) / 1e16;
|
|
39381
39316
|
}
|
|
39382
39317
|
|
|
39383
39318
|
// src/yields/intrinsic/fetchers/frax.ts
|
|
39384
|
-
var
|
|
39319
|
+
var CHAIN_ID6 = Chain.ETHEREUM_MAINNET;
|
|
39385
39320
|
var FRXETH_SUMMARY_URL = "https://api.frax.finance/v2/frxeth/summary/latest";
|
|
39386
39321
|
var SFRXETH = "0xac3e018457b222d93114458476f3e3416abbe38f";
|
|
39387
39322
|
var SFRXUSD = "0xcf62f905562626cfcdd2261162a51fd02fc9c5b6";
|
|
39388
39323
|
var SFRAX = "0xa663b02cf0a4b149d2ad41910cb81e23e1c41c32";
|
|
39389
39324
|
var YEAR_SECONDS5 = 31536000n;
|
|
39390
|
-
var
|
|
39325
|
+
var ONE_E186 = 10n ** 18n;
|
|
39391
39326
|
var SFRXETH_KEY = "SFRXETH";
|
|
39392
39327
|
var SFRXUSD_KEY = "SFRXUSD";
|
|
39393
39328
|
var SFRXUSD_GROUP_KEY = "Staked Frax USD::sfrxUSD";
|
|
@@ -39446,7 +39381,7 @@ var robustFetchJson2 = async (url, { timeoutMs = 5e3, attempts = 3 } = {}) => {
|
|
|
39446
39381
|
};
|
|
39447
39382
|
var fetchSfrxEthAprOnChain = async () => {
|
|
39448
39383
|
const [cycleEnd, lastSync, lastRewardAmount, totalAssets] = await multicallRetryUniversal({
|
|
39449
|
-
chain:
|
|
39384
|
+
chain: CHAIN_ID6,
|
|
39450
39385
|
abi: XERC4626_ABI,
|
|
39451
39386
|
calls: [
|
|
39452
39387
|
{ address: SFRXETH, name: "rewardsCycleEnd", params: [] },
|
|
@@ -39459,7 +39394,7 @@ var fetchSfrxEthAprOnChain = async () => {
|
|
|
39459
39394
|
const window = BigInt(cycleEnd) - BigInt(lastSync);
|
|
39460
39395
|
if (window <= 0n || totalAssets === 0n) return 0;
|
|
39461
39396
|
const perSecond = lastRewardAmount / window;
|
|
39462
|
-
return Number(perSecond * YEAR_SECONDS5 *
|
|
39397
|
+
return Number(perSecond * YEAR_SECONDS5 * ONE_E186 / totalAssets) / 1e16;
|
|
39463
39398
|
};
|
|
39464
39399
|
var fetchSfrxEthApr = async () => {
|
|
39465
39400
|
try {
|
|
@@ -39473,7 +39408,7 @@ var fetchSfrxEthApr = async () => {
|
|
|
39473
39408
|
};
|
|
39474
39409
|
var fetchFraxSavingsAprs = async () => {
|
|
39475
39410
|
const results = await multicallRetryUniversal({
|
|
39476
|
-
chain:
|
|
39411
|
+
chain: CHAIN_ID6,
|
|
39477
39412
|
abi: LINEAR_REWARDS_APR_ABI,
|
|
39478
39413
|
calls: [SFRXUSD, SFRAX].flatMap((address) => linearRewardsCalls(address)),
|
|
39479
39414
|
allowFailure: false
|
|
@@ -40826,46 +40761,6 @@ var LST_REGISTRY = {
|
|
|
40826
40761
|
isNativeUnderlying: false,
|
|
40827
40762
|
withdrawalMode: "dex-only"
|
|
40828
40763
|
}
|
|
40829
|
-
],
|
|
40830
|
-
"1284": [
|
|
40831
|
-
{
|
|
40832
|
-
// StellaSwap stDOT (Moonbeam) — liquid-staked DOT, built on the
|
|
40833
|
-
// lido-dot-ksm architecture that StellaSwap operates. Non-rebasing,
|
|
40834
|
-
// value-accruing: `totalSupply()` is shares and the rate comes from
|
|
40835
|
-
// `getPooledTokenByShares(1e18)` (1e18-scaled DOT-per-share, verified
|
|
40836
|
-
// on-chain 2026-06-04 ≈ 1.3413). `getTotalPooledToken()` is total
|
|
40837
|
-
// pooled DOT. Underlying is xcDOT (the XC-20 DOT, 10-dec). Mint by
|
|
40838
|
-
// approving xcDOT then `deposit(amount)` on the token (proxy impl
|
|
40839
|
-
// `0x0d54…efd3`). Exit: `redeem(amount)` → ~28-day Polkadot unbond →
|
|
40840
|
-
// `claimUnbonded()` (`getUnbonded(holder)` tracks waiting/unbonded);
|
|
40841
|
-
// instant exit only via the Pulsar V3 pool. `getCurrentAPY()` is not
|
|
40842
|
-
// exposed on-chain and there is no public APR API → no yieldFetcher
|
|
40843
|
-
// yet (APR best derived from an on-chain rate-delta like stCELO).
|
|
40844
|
-
// NB: a legacy Lido rebasing stDOT (`0xfa36…a108`, "KSM"-named getters)
|
|
40845
|
-
// also exists — this `0xbc7e…4db4` is the StellaSwap one.
|
|
40846
|
-
address: "0xbc7e02c4178a7df7d3e564323a5c359dc96c4db4",
|
|
40847
|
-
underlying: "0xffffffff1fcacbd218edc0eba20fc2308c778080",
|
|
40848
|
-
symbol: "stDOT",
|
|
40849
|
-
brand: "StellaSwap",
|
|
40850
|
-
decimals: 10,
|
|
40851
|
-
reader: "stellaStDot",
|
|
40852
|
-
isErc4626: false,
|
|
40853
|
-
isRebasing: false,
|
|
40854
|
-
isMintable: true,
|
|
40855
|
-
isNativeUnderlying: false,
|
|
40856
|
-
mintContract: "0xbc7e02c4178a7df7d3e564323a5c359dc96c4db4",
|
|
40857
|
-
mintInputAsset: "0xffffffff1fcacbd218edc0eba20fc2308c778080",
|
|
40858
|
-
withdrawalMode: "fixed-cooldown",
|
|
40859
|
-
// Polkadot unbonding is 28 eras (~28 days).
|
|
40860
|
-
withdrawalCooldownSeconds: 28 * 86400,
|
|
40861
|
-
// No on-chain `getCurrentAPY()` / public API → APR derived from the
|
|
40862
|
-
// on-chain rate-delta (`getPooledTokenByShares(1e18)` growth). The
|
|
40863
|
-
// rate steps in infrequent lumps, so the fetcher uses a 180-day
|
|
40864
|
-
// window to smooth to the realised ~9% (public Moonbeam RPCs serve
|
|
40865
|
-
// the deep archival reads; falls back to 0 if none do).
|
|
40866
|
-
yieldFetcher: stDotFetcher,
|
|
40867
|
-
yieldKey: "StellaSwap Staked DOT::STDOT"
|
|
40868
|
-
}
|
|
40869
40764
|
]
|
|
40870
40765
|
};
|
|
40871
40766
|
var getLstRegistry = (chainId) => LST_REGISTRY[chainId] ?? [];
|
|
@@ -41251,7 +41146,7 @@ var sparkSavingsFetcher = {
|
|
|
41251
41146
|
return out;
|
|
41252
41147
|
}
|
|
41253
41148
|
};
|
|
41254
|
-
var
|
|
41149
|
+
var CHAIN_ID7 = Chain.ETHEREUM_MAINNET;
|
|
41255
41150
|
var SREUSD = "0x557ab1e003951a73c12d16f0fea8490e39c33c35";
|
|
41256
41151
|
var SREUSD_KEY = "SREUSD";
|
|
41257
41152
|
var SREUSD_GROUP_KEY = "Savings reUSD::sreUSD";
|
|
@@ -41259,7 +41154,7 @@ var sreusdSavingsFetcher = {
|
|
|
41259
41154
|
label: "SREUSD",
|
|
41260
41155
|
fetch: async () => {
|
|
41261
41156
|
const results = await multicallRetryUniversal({
|
|
41262
|
-
chain:
|
|
41157
|
+
chain: CHAIN_ID7,
|
|
41263
41158
|
abi: LINEAR_REWARDS_APR_ABI,
|
|
41264
41159
|
calls: linearRewardsCalls(SREUSD),
|
|
41265
41160
|
allowFailure: false
|
|
@@ -41517,10 +41412,10 @@ var toriFetcher = {
|
|
|
41517
41412
|
return { [STRUSD_KEY]: apr, [STRUSD_GROUP_KEY]: apr };
|
|
41518
41413
|
}
|
|
41519
41414
|
};
|
|
41520
|
-
var
|
|
41415
|
+
var CHAIN_ID8 = Chain.ETHEREUM_MAINNET;
|
|
41521
41416
|
var SNUSD = "0x08efcc2f3e61185d0ea7f8830b3fec9bfa2ee313";
|
|
41522
41417
|
var YEAR_SECONDS8 = 31536000n;
|
|
41523
|
-
var
|
|
41418
|
+
var ONE_E187 = 10n ** 18n;
|
|
41524
41419
|
var SNUSD_KEY = "SNUSD";
|
|
41525
41420
|
var SNUSD_GROUP_KEY = "Staked NUSD::sNUSD";
|
|
41526
41421
|
var SNUSD_LEGACY_GROUP_KEY = "sNUSD::Staked NUSD";
|
|
@@ -41556,7 +41451,7 @@ var STAKED_NUSD_ABI = [
|
|
|
41556
41451
|
];
|
|
41557
41452
|
var fetchSnusdAprOnChain = async () => {
|
|
41558
41453
|
const [vestingAmount, lastDistribution, vestingPeriod, totalAssets] = await multicallRetryUniversal({
|
|
41559
|
-
chain:
|
|
41454
|
+
chain: CHAIN_ID8,
|
|
41560
41455
|
abi: STAKED_NUSD_ABI,
|
|
41561
41456
|
calls: [
|
|
41562
41457
|
{ address: SNUSD, name: "vestingAmount", params: [] },
|
|
@@ -41571,7 +41466,7 @@ var fetchSnusdAprOnChain = async () => {
|
|
|
41571
41466
|
const window = elapsed > vestingPeriod ? elapsed : vestingPeriod;
|
|
41572
41467
|
if (window <= 0n) return 0;
|
|
41573
41468
|
const perSecond = vestingAmount / window;
|
|
41574
|
-
return Number(perSecond * YEAR_SECONDS8 *
|
|
41469
|
+
return Number(perSecond * YEAR_SECONDS8 * ONE_E187 / totalAssets) / 1e16;
|
|
41575
41470
|
};
|
|
41576
41471
|
var snusdFetcher = {
|
|
41577
41472
|
label: "SNUSD",
|
|
@@ -41584,13 +41479,13 @@ var snusdFetcher = {
|
|
|
41584
41479
|
};
|
|
41585
41480
|
}
|
|
41586
41481
|
};
|
|
41587
|
-
var
|
|
41482
|
+
var CHAIN_ID9 = Chain.ETHEREUM_MAINNET;
|
|
41588
41483
|
var APYUSD = "0x38eeb52f0771140d10c4e9a9a72349a329fe8a6a";
|
|
41589
41484
|
var APYX_LINEAR_VEST = "0x0d62b4cc02b4b51ed19ddf41d7a7979cf394c99f";
|
|
41590
41485
|
var APYX_DISCOVER_URL = "https://api.apyx.fi/v1/rewards/seasons/2/discover";
|
|
41591
41486
|
var APYX_DEFILLAMA_POOL = "cb6139f9-4a68-4efd-8245-0312a92aee55";
|
|
41592
41487
|
var YEAR_SECONDS9 = 31536000n;
|
|
41593
|
-
var
|
|
41488
|
+
var ONE_E188 = 10n ** 18n;
|
|
41594
41489
|
var APYUSD_KEY = "APYUSD";
|
|
41595
41490
|
var APYUSD_GROUP_KEY = "apyUSD::APYUSD";
|
|
41596
41491
|
var APYUSD_LEGACY_GROUP_KEY = "apyUSD::apyUSD";
|
|
@@ -41619,7 +41514,7 @@ var APYX_READ_ABI = [
|
|
|
41619
41514
|
];
|
|
41620
41515
|
var fetchApyusdAprOnChain = async () => {
|
|
41621
41516
|
const [totalAssets, unvested, periodRemaining] = await multicallRetryUniversal({
|
|
41622
|
-
chain:
|
|
41517
|
+
chain: CHAIN_ID9,
|
|
41623
41518
|
abi: APYX_READ_ABI,
|
|
41624
41519
|
calls: [
|
|
41625
41520
|
{ address: APYUSD, name: "totalAssets", params: [] },
|
|
@@ -41636,7 +41531,7 @@ var fetchApyusdAprOnChain = async () => {
|
|
|
41636
41531
|
throw new Error("apyx vesting state empty");
|
|
41637
41532
|
}
|
|
41638
41533
|
const perSecond = unvested / periodRemaining;
|
|
41639
|
-
return Number(perSecond * YEAR_SECONDS9 *
|
|
41534
|
+
return Number(perSecond * YEAR_SECONDS9 * ONE_E188 / totalAssets) / 1e16;
|
|
41640
41535
|
};
|
|
41641
41536
|
var fetchApyusdApyFromApi = async () => {
|
|
41642
41537
|
const res = await fetch(APYX_DISCOVER_URL, {
|
|
@@ -52112,7 +52007,7 @@ var Erc4626PreviewRedeemAbi = [
|
|
|
52112
52007
|
];
|
|
52113
52008
|
|
|
52114
52009
|
// src/vaults/lst/readers/shared.ts
|
|
52115
|
-
var
|
|
52010
|
+
var ONE_E189 = 10n ** 18n;
|
|
52116
52011
|
var rescaleDecimals = (v, fromDec, toDec) => toDec >= fromDec ? v * 10n ** BigInt(toDec - fromDec) : v / 10n ** BigInt(fromDec - toDec);
|
|
52117
52012
|
var MULTICALL3_ADDRESS = "0xcA11bde05977b3631167028862bE2a173976CA11";
|
|
52118
52013
|
var Multicall3BalanceAbi = [
|
|
@@ -52155,7 +52050,7 @@ var readerBeetsStS = (entry) => ({
|
|
|
52155
52050
|
}
|
|
52156
52051
|
const liquidity = toBigInt13(pool);
|
|
52157
52052
|
return {
|
|
52158
|
-
totalAssets: totalSupply * exchangeRate /
|
|
52053
|
+
totalAssets: totalSupply * exchangeRate / ONE_E189,
|
|
52159
52054
|
totalSupply,
|
|
52160
52055
|
exchangeRate,
|
|
52161
52056
|
liquidity
|
|
@@ -52188,7 +52083,7 @@ var readerBenqiSavax = (entry) => ({
|
|
|
52188
52083
|
{
|
|
52189
52084
|
address: entry.address,
|
|
52190
52085
|
name: "getPooledAvaxByShares",
|
|
52191
|
-
params: [
|
|
52086
|
+
params: [ONE_E189]
|
|
52192
52087
|
},
|
|
52193
52088
|
{ address: entry.address, name: "totalPooledAvax", params: [] }
|
|
52194
52089
|
],
|
|
@@ -52199,7 +52094,7 @@ var readerBenqiSavax = (entry) => ({
|
|
|
52199
52094
|
if (totalSupply === void 0 || exchangeRate === void 0) {
|
|
52200
52095
|
return void 0;
|
|
52201
52096
|
}
|
|
52202
|
-
const totalAssets = toBigInt13(totalPooled) ?? totalSupply * exchangeRate /
|
|
52097
|
+
const totalAssets = toBigInt13(totalPooled) ?? totalSupply * exchangeRate / ONE_E189;
|
|
52203
52098
|
return {
|
|
52204
52099
|
totalAssets,
|
|
52205
52100
|
totalSupply,
|
|
@@ -52218,7 +52113,7 @@ var readerBgtWrapper1to1 = (entry) => ({
|
|
|
52218
52113
|
return {
|
|
52219
52114
|
totalAssets: totalSupply,
|
|
52220
52115
|
totalSupply,
|
|
52221
|
-
exchangeRate:
|
|
52116
|
+
exchangeRate: ONE_E189
|
|
52222
52117
|
};
|
|
52223
52118
|
}
|
|
52224
52119
|
});
|
|
@@ -52248,7 +52143,7 @@ var readerDineroBeraEth = (entry) => ({
|
|
|
52248
52143
|
return void 0;
|
|
52249
52144
|
}
|
|
52250
52145
|
return {
|
|
52251
|
-
totalAssets: totalSupply * exchangeRate /
|
|
52146
|
+
totalAssets: totalSupply * exchangeRate / ONE_E189,
|
|
52252
52147
|
totalSupply,
|
|
52253
52148
|
exchangeRate
|
|
52254
52149
|
};
|
|
@@ -52260,7 +52155,7 @@ var readerErc4626 = (entry) => ({
|
|
|
52260
52155
|
calls: [
|
|
52261
52156
|
{ address: entry.address, name: "totalAssets", params: [] },
|
|
52262
52157
|
{ address: entry.address, name: "totalSupply", params: [] },
|
|
52263
|
-
{ address: entry.address, name: "convertToAssets", params: [
|
|
52158
|
+
{ address: entry.address, name: "convertToAssets", params: [ONE_E189] }
|
|
52264
52159
|
],
|
|
52265
52160
|
abis: [Erc4626ReadAbi, TotalSupplyAbi, Erc4626ReadAbi],
|
|
52266
52161
|
parse: ([assets, supply, rate]) => {
|
|
@@ -52277,7 +52172,7 @@ var readerErc4626PreviewRedeem = (entry) => ({
|
|
|
52277
52172
|
calls: [
|
|
52278
52173
|
{ address: entry.address, name: "totalAssets", params: [] },
|
|
52279
52174
|
{ address: entry.address, name: "totalSupply", params: [] },
|
|
52280
|
-
{ address: entry.address, name: "previewRedeem", params: [
|
|
52175
|
+
{ address: entry.address, name: "previewRedeem", params: [ONE_E189] }
|
|
52281
52176
|
],
|
|
52282
52177
|
abis: [Erc4626PreviewRedeemAbi, TotalSupplyAbi, Erc4626PreviewRedeemAbi],
|
|
52283
52178
|
parse: ([assets, supply, rate]) => {
|
|
@@ -52357,7 +52252,7 @@ var readerEtherFiWeEth = (entry) => {
|
|
|
52357
52252
|
}
|
|
52358
52253
|
}
|
|
52359
52254
|
return {
|
|
52360
|
-
totalAssets: totalSupply * exchangeRate /
|
|
52255
|
+
totalAssets: totalSupply * exchangeRate / ONE_E189,
|
|
52361
52256
|
totalSupply,
|
|
52362
52257
|
exchangeRate,
|
|
52363
52258
|
liquidity
|
|
@@ -52390,7 +52285,7 @@ var readerHyperbeatBeHype = (entry) => {
|
|
|
52390
52285
|
return {
|
|
52391
52286
|
totalAssets: totalSupply,
|
|
52392
52287
|
totalSupply,
|
|
52393
|
-
exchangeRate:
|
|
52288
|
+
exchangeRate: ONE_E189
|
|
52394
52289
|
};
|
|
52395
52290
|
}
|
|
52396
52291
|
};
|
|
@@ -52398,7 +52293,7 @@ var readerHyperbeatBeHype = (entry) => {
|
|
|
52398
52293
|
return {
|
|
52399
52294
|
calls: [
|
|
52400
52295
|
{ address: entry.address, name: "totalSupply", params: [] },
|
|
52401
|
-
{ address: stakingCore, name: "BeHYPEToHYPE", params: [
|
|
52296
|
+
{ address: stakingCore, name: "BeHYPEToHYPE", params: [ONE_E189] }
|
|
52402
52297
|
],
|
|
52403
52298
|
abis: [TotalSupplyAbi, HyperbeatStakingCoreAbi],
|
|
52404
52299
|
parse: ([supply, rate]) => {
|
|
@@ -52408,7 +52303,7 @@ var readerHyperbeatBeHype = (entry) => {
|
|
|
52408
52303
|
return void 0;
|
|
52409
52304
|
}
|
|
52410
52305
|
return {
|
|
52411
|
-
totalAssets: totalSupply * exchangeRate /
|
|
52306
|
+
totalAssets: totalSupply * exchangeRate / ONE_E189,
|
|
52412
52307
|
totalSupply,
|
|
52413
52308
|
exchangeRate
|
|
52414
52309
|
};
|
|
@@ -52440,7 +52335,7 @@ var readerKelpRsEth = (entry) => {
|
|
|
52440
52335
|
return {
|
|
52441
52336
|
totalAssets: totalSupply,
|
|
52442
52337
|
totalSupply,
|
|
52443
|
-
exchangeRate:
|
|
52338
|
+
exchangeRate: ONE_E189
|
|
52444
52339
|
};
|
|
52445
52340
|
}
|
|
52446
52341
|
};
|
|
@@ -52458,7 +52353,7 @@ var readerKelpRsEth = (entry) => {
|
|
|
52458
52353
|
return void 0;
|
|
52459
52354
|
}
|
|
52460
52355
|
return {
|
|
52461
|
-
totalAssets: totalSupply * exchangeRate /
|
|
52356
|
+
totalAssets: totalSupply * exchangeRate / ONE_E189,
|
|
52462
52357
|
totalSupply,
|
|
52463
52358
|
exchangeRate
|
|
52464
52359
|
};
|
|
@@ -52490,7 +52385,7 @@ var readerKinetiqKHype = (entry) => {
|
|
|
52490
52385
|
return {
|
|
52491
52386
|
totalAssets: totalSupply,
|
|
52492
52387
|
totalSupply,
|
|
52493
|
-
exchangeRate:
|
|
52388
|
+
exchangeRate: ONE_E189
|
|
52494
52389
|
};
|
|
52495
52390
|
}
|
|
52496
52391
|
};
|
|
@@ -52498,7 +52393,7 @@ var readerKinetiqKHype = (entry) => {
|
|
|
52498
52393
|
return {
|
|
52499
52394
|
calls: [
|
|
52500
52395
|
{ address: entry.address, name: "totalSupply", params: [] },
|
|
52501
|
-
{ address: accountant, name: "kHYPEToHYPE", params: [
|
|
52396
|
+
{ address: accountant, name: "kHYPEToHYPE", params: [ONE_E189] }
|
|
52502
52397
|
],
|
|
52503
52398
|
abis: [TotalSupplyAbi, KinetiqStakingAccountantAbi],
|
|
52504
52399
|
parse: ([supply, rate]) => {
|
|
@@ -52508,7 +52403,7 @@ var readerKinetiqKHype = (entry) => {
|
|
|
52508
52403
|
return void 0;
|
|
52509
52404
|
}
|
|
52510
52405
|
return {
|
|
52511
|
-
totalAssets: totalSupply * exchangeRate /
|
|
52406
|
+
totalAssets: totalSupply * exchangeRate / ONE_E189,
|
|
52512
52407
|
totalSupply,
|
|
52513
52408
|
exchangeRate
|
|
52514
52409
|
};
|
|
@@ -52548,7 +52443,7 @@ var readerLairStKaia = (entry) => ({
|
|
|
52548
52443
|
if (totalSupply === void 0 || exchangeRate === void 0) {
|
|
52549
52444
|
return void 0;
|
|
52550
52445
|
}
|
|
52551
|
-
const totalAssets = toBigInt13(totalStaking) ?? totalSupply * exchangeRate /
|
|
52446
|
+
const totalAssets = toBigInt13(totalStaking) ?? totalSupply * exchangeRate / ONE_E189;
|
|
52552
52447
|
return {
|
|
52553
52448
|
totalAssets,
|
|
52554
52449
|
totalSupply,
|
|
@@ -52582,7 +52477,7 @@ var readerLidoWstEth = (entry) => ({
|
|
|
52582
52477
|
return void 0;
|
|
52583
52478
|
}
|
|
52584
52479
|
return {
|
|
52585
|
-
totalAssets: totalSupply * exchangeRate /
|
|
52480
|
+
totalAssets: totalSupply * exchangeRate / ONE_E189,
|
|
52586
52481
|
totalSupply,
|
|
52587
52482
|
exchangeRate
|
|
52588
52483
|
};
|
|
@@ -52620,7 +52515,7 @@ var readerListaSlisBnb = (entry) => {
|
|
|
52620
52515
|
return {
|
|
52621
52516
|
totalAssets: totalSupply,
|
|
52622
52517
|
totalSupply,
|
|
52623
|
-
exchangeRate:
|
|
52518
|
+
exchangeRate: ONE_E189
|
|
52624
52519
|
};
|
|
52625
52520
|
}
|
|
52626
52521
|
};
|
|
@@ -52628,7 +52523,7 @@ var readerListaSlisBnb = (entry) => {
|
|
|
52628
52523
|
return {
|
|
52629
52524
|
calls: [
|
|
52630
52525
|
{ address: entry.address, name: "totalSupply", params: [] },
|
|
52631
|
-
{ address: manager, name: "convertSnBnbToBnb", params: [
|
|
52526
|
+
{ address: manager, name: "convertSnBnbToBnb", params: [ONE_E189] },
|
|
52632
52527
|
{ address: manager, name: "getTotalPooledBnb", params: [] }
|
|
52633
52528
|
],
|
|
52634
52529
|
abis: [TotalSupplyAbi, ListaStakeManagerReadAbi, ListaStakeManagerReadAbi],
|
|
@@ -52639,7 +52534,7 @@ var readerListaSlisBnb = (entry) => {
|
|
|
52639
52534
|
return void 0;
|
|
52640
52535
|
}
|
|
52641
52536
|
const pooledBnb = toBigInt13(pooled);
|
|
52642
|
-
const totalAssets = pooledBnb ?? totalSupply * exchangeRate /
|
|
52537
|
+
const totalAssets = pooledBnb ?? totalSupply * exchangeRate / ONE_E189;
|
|
52643
52538
|
return { totalAssets, totalSupply, exchangeRate };
|
|
52644
52539
|
}
|
|
52645
52540
|
};
|
|
@@ -52669,7 +52564,7 @@ var readerMantleMEth = (entry) => {
|
|
|
52669
52564
|
return {
|
|
52670
52565
|
totalAssets: totalSupply,
|
|
52671
52566
|
totalSupply,
|
|
52672
|
-
exchangeRate:
|
|
52567
|
+
exchangeRate: ONE_E189
|
|
52673
52568
|
};
|
|
52674
52569
|
}
|
|
52675
52570
|
};
|
|
@@ -52677,7 +52572,7 @@ var readerMantleMEth = (entry) => {
|
|
|
52677
52572
|
return {
|
|
52678
52573
|
calls: [
|
|
52679
52574
|
{ address: entry.address, name: "totalSupply", params: [] },
|
|
52680
|
-
{ address: staking, name: "mETHToETH", params: [
|
|
52575
|
+
{ address: staking, name: "mETHToETH", params: [ONE_E189] }
|
|
52681
52576
|
],
|
|
52682
52577
|
abis: [TotalSupplyAbi, MantleStakingAbi],
|
|
52683
52578
|
parse: ([supply, rate]) => {
|
|
@@ -52687,7 +52582,7 @@ var readerMantleMEth = (entry) => {
|
|
|
52687
52582
|
return void 0;
|
|
52688
52583
|
}
|
|
52689
52584
|
return {
|
|
52690
|
-
totalAssets: totalSupply * exchangeRate /
|
|
52585
|
+
totalAssets: totalSupply * exchangeRate / ONE_E189,
|
|
52691
52586
|
totalSupply,
|
|
52692
52587
|
exchangeRate
|
|
52693
52588
|
};
|
|
@@ -52708,7 +52603,7 @@ var readerOffChain = (entry) => {
|
|
|
52708
52603
|
return {
|
|
52709
52604
|
totalAssets: rescaleDecimals(totalSupply, shareDec, underlyingDec),
|
|
52710
52605
|
totalSupply,
|
|
52711
|
-
exchangeRate:
|
|
52606
|
+
exchangeRate: ONE_E189
|
|
52712
52607
|
};
|
|
52713
52608
|
}
|
|
52714
52609
|
};
|
|
@@ -52742,7 +52637,7 @@ var readerRenzoEzEth = (entry) => {
|
|
|
52742
52637
|
return {
|
|
52743
52638
|
totalAssets: totalSupply,
|
|
52744
52639
|
totalSupply,
|
|
52745
|
-
exchangeRate:
|
|
52640
|
+
exchangeRate: ONE_E189
|
|
52746
52641
|
};
|
|
52747
52642
|
}
|
|
52748
52643
|
};
|
|
@@ -52761,7 +52656,7 @@ var readerRenzoEzEth = (entry) => {
|
|
|
52761
52656
|
return {
|
|
52762
52657
|
totalAssets: totalTvl,
|
|
52763
52658
|
totalSupply,
|
|
52764
|
-
exchangeRate: totalTvl *
|
|
52659
|
+
exchangeRate: totalTvl * ONE_E189 / totalSupply
|
|
52765
52660
|
};
|
|
52766
52661
|
}
|
|
52767
52662
|
};
|
|
@@ -52817,7 +52712,7 @@ var readerRocketReth = (entry) => {
|
|
|
52817
52712
|
}
|
|
52818
52713
|
const liquidity = depositPool ? toBigInt13(slice2[2]) : void 0;
|
|
52819
52714
|
return {
|
|
52820
|
-
totalAssets: totalSupply * exchangeRate /
|
|
52715
|
+
totalAssets: totalSupply * exchangeRate / ONE_E189,
|
|
52821
52716
|
totalSupply,
|
|
52822
52717
|
exchangeRate,
|
|
52823
52718
|
liquidity
|
|
@@ -52859,7 +52754,7 @@ var readerStaderEthx = (entry) => {
|
|
|
52859
52754
|
return {
|
|
52860
52755
|
totalAssets: totalSupply,
|
|
52861
52756
|
totalSupply,
|
|
52862
|
-
exchangeRate:
|
|
52757
|
+
exchangeRate: ONE_E189
|
|
52863
52758
|
};
|
|
52864
52759
|
}
|
|
52865
52760
|
};
|
|
@@ -52877,7 +52772,7 @@ var readerStaderEthx = (entry) => {
|
|
|
52877
52772
|
return void 0;
|
|
52878
52773
|
}
|
|
52879
52774
|
return {
|
|
52880
|
-
totalAssets: totalSupply * exchangeRate /
|
|
52775
|
+
totalAssets: totalSupply * exchangeRate / ONE_E189,
|
|
52881
52776
|
totalSupply,
|
|
52882
52777
|
exchangeRate
|
|
52883
52778
|
};
|
|
@@ -52894,7 +52789,7 @@ var readerStaderMaticX = (entry) => {
|
|
|
52894
52789
|
{
|
|
52895
52790
|
address: rateAddress,
|
|
52896
52791
|
name: "convertMaticXToMatic",
|
|
52897
|
-
params: [
|
|
52792
|
+
params: [ONE_E189],
|
|
52898
52793
|
chainId: homeChainId
|
|
52899
52794
|
}
|
|
52900
52795
|
],
|
|
@@ -52909,7 +52804,7 @@ var readerStaderMaticX = (entry) => {
|
|
|
52909
52804
|
}
|
|
52910
52805
|
const isCrossChain = homeContract !== void 0;
|
|
52911
52806
|
return {
|
|
52912
|
-
totalAssets: isCrossChain ? totalSupply * amountInMatic /
|
|
52807
|
+
totalAssets: isCrossChain ? totalSupply * amountInMatic / ONE_E189 : totalPooledMatic ?? totalSupply * amountInMatic / ONE_E189,
|
|
52913
52808
|
totalSupply,
|
|
52914
52809
|
exchangeRate: amountInMatic
|
|
52915
52810
|
};
|
|
@@ -52941,7 +52836,7 @@ var readerStakeWiseOsEth = (entry) => {
|
|
|
52941
52836
|
return {
|
|
52942
52837
|
totalAssets: totalSupply,
|
|
52943
52838
|
totalSupply,
|
|
52944
|
-
exchangeRate:
|
|
52839
|
+
exchangeRate: ONE_E189
|
|
52945
52840
|
};
|
|
52946
52841
|
}
|
|
52947
52842
|
};
|
|
@@ -52949,7 +52844,7 @@ var readerStakeWiseOsEth = (entry) => {
|
|
|
52949
52844
|
return {
|
|
52950
52845
|
calls: [
|
|
52951
52846
|
{ address: entry.address, name: "totalSupply", params: [] },
|
|
52952
|
-
{ address: controller, name: "convertToAssets", params: [
|
|
52847
|
+
{ address: controller, name: "convertToAssets", params: [ONE_E189] }
|
|
52953
52848
|
],
|
|
52954
52849
|
abis: [TotalSupplyAbi, StakeWiseOsTokenAbi],
|
|
52955
52850
|
parse: ([supply, rate]) => {
|
|
@@ -52959,7 +52854,7 @@ var readerStakeWiseOsEth = (entry) => {
|
|
|
52959
52854
|
return void 0;
|
|
52960
52855
|
}
|
|
52961
52856
|
return {
|
|
52962
|
-
totalAssets: totalSupply * exchangeRate /
|
|
52857
|
+
totalAssets: totalSupply * exchangeRate / ONE_E189,
|
|
52963
52858
|
totalSupply,
|
|
52964
52859
|
exchangeRate
|
|
52965
52860
|
};
|
|
@@ -52991,7 +52886,7 @@ var readerStCelo = (entry) => {
|
|
|
52991
52886
|
return {
|
|
52992
52887
|
totalAssets: totalSupply,
|
|
52993
52888
|
totalSupply,
|
|
52994
|
-
exchangeRate:
|
|
52889
|
+
exchangeRate: ONE_E189
|
|
52995
52890
|
};
|
|
52996
52891
|
}
|
|
52997
52892
|
};
|
|
@@ -52999,7 +52894,7 @@ var readerStCelo = (entry) => {
|
|
|
52999
52894
|
return {
|
|
53000
52895
|
calls: [
|
|
53001
52896
|
{ address: entry.address, name: "totalSupply", params: [] },
|
|
53002
|
-
{ address: manager, name: "toCelo", params: [
|
|
52897
|
+
{ address: manager, name: "toCelo", params: [ONE_E189] }
|
|
53003
52898
|
],
|
|
53004
52899
|
abis: [TotalSupplyAbi, StCeloManagerAbi],
|
|
53005
52900
|
parse: ([supply, rate]) => {
|
|
@@ -53009,7 +52904,7 @@ var readerStCelo = (entry) => {
|
|
|
53009
52904
|
return void 0;
|
|
53010
52905
|
}
|
|
53011
52906
|
return {
|
|
53012
|
-
totalAssets: totalSupply * exchangeRate /
|
|
52907
|
+
totalAssets: totalSupply * exchangeRate / ONE_E189,
|
|
53013
52908
|
totalSupply,
|
|
53014
52909
|
exchangeRate
|
|
53015
52910
|
};
|
|
@@ -53042,7 +52937,7 @@ var readerSwellGetRate = (entry) => ({
|
|
|
53042
52937
|
return void 0;
|
|
53043
52938
|
}
|
|
53044
52939
|
return {
|
|
53045
|
-
totalAssets: totalSupply * exchangeRate /
|
|
52940
|
+
totalAssets: totalSupply * exchangeRate / ONE_E189,
|
|
53046
52941
|
totalSupply,
|
|
53047
52942
|
exchangeRate
|
|
53048
52943
|
};
|
|
@@ -53073,7 +52968,7 @@ var readerValantisWstHype = (entry) => {
|
|
|
53073
52968
|
return {
|
|
53074
52969
|
totalAssets: totalSupply,
|
|
53075
52970
|
totalSupply,
|
|
53076
|
-
exchangeRate:
|
|
52971
|
+
exchangeRate: ONE_E189
|
|
53077
52972
|
};
|
|
53078
52973
|
}
|
|
53079
52974
|
};
|
|
@@ -53091,7 +52986,7 @@ var readerValantisWstHype = (entry) => {
|
|
|
53091
52986
|
return void 0;
|
|
53092
52987
|
}
|
|
53093
52988
|
return {
|
|
53094
|
-
totalAssets: totalSupply * exchangeRate /
|
|
52989
|
+
totalAssets: totalSupply * exchangeRate / ONE_E189,
|
|
53095
52990
|
totalSupply,
|
|
53096
52991
|
exchangeRate
|
|
53097
52992
|
};
|
|
@@ -53125,7 +53020,7 @@ var readerVedaAccountant = (entry) => {
|
|
|
53125
53020
|
return {
|
|
53126
53021
|
totalAssets: rescaleDecimals(totalSupply, shareDec, underlyingDec),
|
|
53127
53022
|
totalSupply,
|
|
53128
|
-
exchangeRate:
|
|
53023
|
+
exchangeRate: ONE_E189
|
|
53129
53024
|
};
|
|
53130
53025
|
}
|
|
53131
53026
|
};
|
|
@@ -53144,7 +53039,7 @@ var readerVedaAccountant = (entry) => {
|
|
|
53144
53039
|
const exchangeRate = rawRate * scale;
|
|
53145
53040
|
return {
|
|
53146
53041
|
totalAssets: rescaleDecimals(
|
|
53147
|
-
totalSupply * exchangeRate /
|
|
53042
|
+
totalSupply * exchangeRate / ONE_E189,
|
|
53148
53043
|
shareDec,
|
|
53149
53044
|
underlyingDec
|
|
53150
53045
|
),
|
|
@@ -53180,9 +53075,9 @@ var readerAnkrRatio = (entry) => ({
|
|
|
53180
53075
|
return void 0;
|
|
53181
53076
|
}
|
|
53182
53077
|
return {
|
|
53183
|
-
totalAssets: totalSupply *
|
|
53078
|
+
totalAssets: totalSupply * ONE_E189 / r,
|
|
53184
53079
|
totalSupply,
|
|
53185
|
-
exchangeRate:
|
|
53080
|
+
exchangeRate: ONE_E189 * ONE_E189 / r
|
|
53186
53081
|
};
|
|
53187
53082
|
}
|
|
53188
53083
|
});
|
|
@@ -53226,7 +53121,7 @@ var readerCoreEarnRate = (entry) => {
|
|
|
53226
53121
|
return {
|
|
53227
53122
|
totalAssets: totalSupply * r / CORE_RATE_DENOM,
|
|
53228
53123
|
totalSupply,
|
|
53229
|
-
exchangeRate: r *
|
|
53124
|
+
exchangeRate: r * ONE_E189 / CORE_RATE_DENOM
|
|
53230
53125
|
};
|
|
53231
53126
|
}
|
|
53232
53127
|
};
|
|
@@ -53248,57 +53143,12 @@ var readerCoreStakedRatio = (entry) => {
|
|
|
53248
53143
|
return {
|
|
53249
53144
|
totalAssets: totalStaked,
|
|
53250
53145
|
totalSupply,
|
|
53251
|
-
exchangeRate: totalStaked *
|
|
53146
|
+
exchangeRate: totalStaked * ONE_E189 / totalSupply
|
|
53252
53147
|
};
|
|
53253
53148
|
}
|
|
53254
53149
|
};
|
|
53255
53150
|
};
|
|
53256
53151
|
|
|
53257
|
-
// src/vaults/lst/abis/stella.ts
|
|
53258
|
-
var StellaStDotAbi = [
|
|
53259
|
-
{
|
|
53260
|
-
name: "getPooledTokenByShares",
|
|
53261
|
-
type: "function",
|
|
53262
|
-
stateMutability: "view",
|
|
53263
|
-
inputs: [{ type: "uint256", name: "_sharesAmount" }],
|
|
53264
|
-
outputs: [{ type: "uint256" }]
|
|
53265
|
-
},
|
|
53266
|
-
{
|
|
53267
|
-
name: "getTotalPooledToken",
|
|
53268
|
-
type: "function",
|
|
53269
|
-
stateMutability: "view",
|
|
53270
|
-
inputs: [],
|
|
53271
|
-
outputs: [{ type: "uint256" }]
|
|
53272
|
-
}
|
|
53273
|
-
];
|
|
53274
|
-
|
|
53275
|
-
// src/vaults/lst/readers/stella.ts
|
|
53276
|
-
var readerStellaStDot = (entry) => ({
|
|
53277
|
-
calls: [
|
|
53278
|
-
{ address: entry.address, name: "totalSupply", params: [] },
|
|
53279
|
-
{
|
|
53280
|
-
address: entry.address,
|
|
53281
|
-
name: "getPooledTokenByShares",
|
|
53282
|
-
params: [ONE_E1810]
|
|
53283
|
-
},
|
|
53284
|
-
{ address: entry.address, name: "getTotalPooledToken", params: [] }
|
|
53285
|
-
],
|
|
53286
|
-
abis: [TotalSupplyAbi, StellaStDotAbi, StellaStDotAbi],
|
|
53287
|
-
parse: ([supply, rate, pooled]) => {
|
|
53288
|
-
const totalSupply = toBigInt13(supply);
|
|
53289
|
-
const exchangeRate = toBigInt13(rate);
|
|
53290
|
-
if (totalSupply === void 0 || exchangeRate === void 0) {
|
|
53291
|
-
return void 0;
|
|
53292
|
-
}
|
|
53293
|
-
const totalAssets = toBigInt13(pooled) ?? totalSupply * exchangeRate / ONE_E1810;
|
|
53294
|
-
return {
|
|
53295
|
-
totalAssets,
|
|
53296
|
-
totalSupply,
|
|
53297
|
-
exchangeRate
|
|
53298
|
-
};
|
|
53299
|
-
}
|
|
53300
|
-
});
|
|
53301
|
-
|
|
53302
53152
|
// src/vaults/lst/abis/kintsu.ts
|
|
53303
53153
|
var KintsuSMonAbi = [
|
|
53304
53154
|
{
|
|
@@ -53328,7 +53178,7 @@ var readerKintsuSMon = (entry) => ({
|
|
|
53328
53178
|
const totalAssets = toBigInt13(pooled);
|
|
53329
53179
|
const totalSupply = toBigInt13(shares);
|
|
53330
53180
|
if (totalAssets === void 0 || totalSupply === void 0) return void 0;
|
|
53331
|
-
const exchangeRate = totalSupply > 0n ? totalAssets *
|
|
53181
|
+
const exchangeRate = totalSupply > 0n ? totalAssets * ONE_E189 / totalSupply : ONE_E189;
|
|
53332
53182
|
return { totalAssets, totalSupply, exchangeRate };
|
|
53333
53183
|
}
|
|
53334
53184
|
});
|
|
@@ -53390,8 +53240,6 @@ var buildReader = (entry) => {
|
|
|
53390
53240
|
return readerCoreEarnRate(entry);
|
|
53391
53241
|
case "coreStakedRatio":
|
|
53392
53242
|
return readerCoreStakedRatio(entry);
|
|
53393
|
-
case "stellaStDot":
|
|
53394
|
-
return readerStellaStDot(entry);
|
|
53395
53243
|
case "kintsuSMon":
|
|
53396
53244
|
return readerKintsuSMon(entry);
|
|
53397
53245
|
}
|
|
@@ -53764,7 +53612,7 @@ var getLstValidators = async (chainId, shareToken) => {
|
|
|
53764
53612
|
};
|
|
53765
53613
|
|
|
53766
53614
|
// src/vaults/lst/fetchPublic.ts
|
|
53767
|
-
var
|
|
53615
|
+
var ONE_E1810 = 10n ** 18n;
|
|
53768
53616
|
var ERC20_BALANCE_ABI = parseAbi([
|
|
53769
53617
|
"function balanceOf(address) view returns (uint256)"
|
|
53770
53618
|
]);
|
|
@@ -53879,8 +53727,8 @@ var fetchLstShareTokens = async (chainId, multicallRetry, prices = {}, tokenList
|
|
|
53879
53727
|
const underlyingUnit = 10n ** BigInt(underlyingDec);
|
|
53880
53728
|
const totalAssetsFormatted = Number(state.totalAssets) / 10 ** underlyingDec;
|
|
53881
53729
|
const totalAssetsUsd = priceUsd !== void 0 ? totalAssetsFormatted * priceUsd : 0;
|
|
53882
|
-
const convertToAssets = state.exchangeRate * underlyingUnit /
|
|
53883
|
-
const convertToShares = state.exchangeRate > 0n ?
|
|
53730
|
+
const convertToAssets = state.exchangeRate * underlyingUnit / ONE_E1810;
|
|
53731
|
+
const convertToShares = state.exchangeRate > 0n ? ONE_E1810 * shareUnit / state.exchangeRate : 0n;
|
|
53884
53732
|
let liquidityRaw;
|
|
53885
53733
|
if (state.liquidity !== void 0) {
|
|
53886
53734
|
liquidityRaw = state.liquidity;
|
|
@@ -56011,65 +55859,6 @@ var readerStCelo2 = {
|
|
|
56011
55859
|
}
|
|
56012
55860
|
};
|
|
56013
55861
|
|
|
56014
|
-
// src/vaults/lst/withdrawals/abis/stella.ts
|
|
56015
|
-
var StellaGetUnbondedAbi = [
|
|
56016
|
-
{
|
|
56017
|
-
name: "getUnbonded",
|
|
56018
|
-
type: "function",
|
|
56019
|
-
stateMutability: "view",
|
|
56020
|
-
inputs: [{ type: "address", name: "_holder" }],
|
|
56021
|
-
outputs: [
|
|
56022
|
-
{ type: "uint256", name: "waiting" },
|
|
56023
|
-
{ type: "uint256", name: "unbonded" }
|
|
56024
|
-
]
|
|
56025
|
-
}
|
|
56026
|
-
];
|
|
56027
|
-
|
|
56028
|
-
// src/vaults/lst/withdrawals/readers/stella.ts
|
|
56029
|
-
var readerStellaUnbond = {
|
|
56030
|
-
fetch: async (user, multicallRetry, chainId, entry) => {
|
|
56031
|
-
const res = await multicallRetry({
|
|
56032
|
-
chain: chainId,
|
|
56033
|
-
calls: [
|
|
56034
|
-
{ address: entry.lst, name: "getUnbonded", params: [user] }
|
|
56035
|
-
],
|
|
56036
|
-
abi: [StellaGetUnbondedAbi]
|
|
56037
|
-
});
|
|
56038
|
-
const cell = res[0];
|
|
56039
|
-
let waiting;
|
|
56040
|
-
let unbonded;
|
|
56041
|
-
if (Array.isArray(cell)) {
|
|
56042
|
-
waiting = toBigInt14(cell[0]);
|
|
56043
|
-
unbonded = toBigInt14(cell[1]);
|
|
56044
|
-
} else if (cell && typeof cell === "object") {
|
|
56045
|
-
waiting = toBigInt14(cell.waiting);
|
|
56046
|
-
unbonded = toBigInt14(cell.unbonded);
|
|
56047
|
-
}
|
|
56048
|
-
const out = [];
|
|
56049
|
-
if (unbonded && unbonded > 0n) {
|
|
56050
|
-
out.push({
|
|
56051
|
-
lst: entry.lst,
|
|
56052
|
-
brand: entry.brand,
|
|
56053
|
-
symbol: entry.symbol,
|
|
56054
|
-
requestId: "unbonded",
|
|
56055
|
-
amountUnderlying: unbonded.toString(),
|
|
56056
|
-
status: "claimable"
|
|
56057
|
-
});
|
|
56058
|
-
}
|
|
56059
|
-
if (waiting && waiting > 0n) {
|
|
56060
|
-
out.push({
|
|
56061
|
-
lst: entry.lst,
|
|
56062
|
-
brand: entry.brand,
|
|
56063
|
-
symbol: entry.symbol,
|
|
56064
|
-
requestId: "waiting",
|
|
56065
|
-
amountUnderlying: waiting.toString(),
|
|
56066
|
-
status: "pending"
|
|
56067
|
-
});
|
|
56068
|
-
}
|
|
56069
|
-
return out;
|
|
56070
|
-
}
|
|
56071
|
-
};
|
|
56072
|
-
|
|
56073
55862
|
// src/vaults/lst/withdrawals/abis/swell.ts
|
|
56074
55863
|
var SwellRswExitAbi = [
|
|
56075
55864
|
{
|
|
@@ -56508,8 +56297,6 @@ var buildWithdrawalReader = (entry) => {
|
|
|
56508
56297
|
return readerPrimeStaking;
|
|
56509
56298
|
case "berapawRedeemQueue":
|
|
56510
56299
|
return readerBeraPaw;
|
|
56511
|
-
case "stellaUnbondQueue":
|
|
56512
|
-
return readerStellaUnbond;
|
|
56513
56300
|
case "eventsOnly":
|
|
56514
56301
|
case "noQueue":
|
|
56515
56302
|
case "unverified":
|
|
@@ -57150,21 +56937,6 @@ var LST_WITHDRAWAL_REGISTRY = {
|
|
|
57150
56937
|
withdrawalContract: "0x98d916f5773ac0482b49856f2659d6c32114c4ba"
|
|
57151
56938
|
}
|
|
57152
56939
|
],
|
|
57153
|
-
"1284": [
|
|
57154
|
-
{
|
|
57155
|
-
// StellaSwap stDOT (lido-dot-ksm). After `redeem(amount)` the
|
|
57156
|
-
// position enters Polkadot's ~28-day unbond; `getUnbonded(holder)`
|
|
57157
|
-
// returns the per-user aggregate as `(waiting, unbonded)` — no
|
|
57158
|
-
// per-request IDs. The reader emits up to two synthetic requests
|
|
57159
|
-
// (waiting→pending, unbonded→claimable via `claimUnbonded()`). The
|
|
57160
|
-
// stDOT token is its own withdrawal contract.
|
|
57161
|
-
lst: "0xbc7e02c4178a7df7d3e564323a5c359dc96c4db4",
|
|
57162
|
-
brand: "StellaSwap",
|
|
57163
|
-
symbol: "stDOT",
|
|
57164
|
-
reader: "stellaUnbondQueue",
|
|
57165
|
-
withdrawalContract: "0xbc7e02c4178a7df7d3e564323a5c359dc96c4db4"
|
|
57166
|
-
}
|
|
57167
|
-
],
|
|
57168
56940
|
"1116": [
|
|
57169
56941
|
// Core DAO LSTs — CoreDAO stakers unbond via the Earn / staking
|
|
57170
56942
|
// contracts; per-protocol queue readers not yet implemented.
|
|
@@ -57285,7 +57057,7 @@ var NavOracleReadAbi = [
|
|
|
57285
57057
|
];
|
|
57286
57058
|
|
|
57287
57059
|
// src/vaults/savings/readers/shared.ts
|
|
57288
|
-
var
|
|
57060
|
+
var ONE_E1811 = 10n ** 18n;
|
|
57289
57061
|
var toBigInt15 = (v) => {
|
|
57290
57062
|
if (v === void 0 || v === null) return void 0;
|
|
57291
57063
|
if (typeof v === "bigint") return v;
|
|
@@ -57326,7 +57098,7 @@ var readerErc46262 = (entry) => {
|
|
|
57326
57098
|
return {
|
|
57327
57099
|
totalAssets,
|
|
57328
57100
|
totalSupply,
|
|
57329
|
-
exchangeRate: convertToAssetsRaw *
|
|
57101
|
+
exchangeRate: convertToAssetsRaw * ONE_E1811 / underlyingUnit
|
|
57330
57102
|
};
|
|
57331
57103
|
}
|
|
57332
57104
|
};
|
|
@@ -57448,7 +57220,7 @@ var readerErc4626Idle = (entry) => {
|
|
|
57448
57220
|
return {
|
|
57449
57221
|
totalAssets,
|
|
57450
57222
|
totalSupply,
|
|
57451
|
-
exchangeRate: convertToAssetsRaw *
|
|
57223
|
+
exchangeRate: convertToAssetsRaw * ONE_E1811 / underlyingUnit,
|
|
57452
57224
|
...capacity !== void 0 ? {
|
|
57453
57225
|
instantRedeemCapacity: capacity,
|
|
57454
57226
|
instantRedeemEnabled: true,
|
|
@@ -57497,7 +57269,7 @@ var readerErc4626WithdrawLimit = (entry) => {
|
|
|
57497
57269
|
return {
|
|
57498
57270
|
totalAssets,
|
|
57499
57271
|
totalSupply,
|
|
57500
|
-
exchangeRate: convertToAssetsRaw *
|
|
57272
|
+
exchangeRate: convertToAssetsRaw * ONE_E1811 / underlyingUnit,
|
|
57501
57273
|
...capacity !== void 0 ? {
|
|
57502
57274
|
instantRedeemCapacity: capacity,
|
|
57503
57275
|
instantRedeemEnabled: true,
|
|
@@ -57526,7 +57298,7 @@ var readerFrankencoinSavings = (entry) => ({
|
|
|
57526
57298
|
// `fetchPublic` derives `convertToAssets` / `convertToShares` from
|
|
57527
57299
|
// `exchangeRate`, and 1e18 makes them the identity.
|
|
57528
57300
|
totalSupply: deposits,
|
|
57529
|
-
exchangeRate:
|
|
57301
|
+
exchangeRate: ONE_E1811
|
|
57530
57302
|
};
|
|
57531
57303
|
}
|
|
57532
57304
|
});
|
|
@@ -57552,7 +57324,7 @@ var readerNavOracle = (entry) => {
|
|
|
57552
57324
|
const exchangeRate = toBigInt15(raw);
|
|
57553
57325
|
if (exchangeRate === void 0 || exchangeRate <= 0n) return void 0;
|
|
57554
57326
|
return {
|
|
57555
|
-
totalAssets: totalSupply * exchangeRate * underlyingUnit / (
|
|
57327
|
+
totalAssets: totalSupply * exchangeRate * underlyingUnit / (ONE_E1811 * shareUnit),
|
|
57556
57328
|
totalSupply,
|
|
57557
57329
|
exchangeRate
|
|
57558
57330
|
};
|
|
@@ -57566,7 +57338,7 @@ var readerNativeWnlp = (entry) => {
|
|
|
57566
57338
|
return {
|
|
57567
57339
|
calls: [
|
|
57568
57340
|
{ address, name: "totalSupply", params: [] },
|
|
57569
|
-
{ address, name: "getNlpByWnlp", params: [
|
|
57341
|
+
{ address, name: "getNlpByWnlp", params: [ONE_E1811] },
|
|
57570
57342
|
{ address, name: "instantRedeemFeeBips", params: [] },
|
|
57571
57343
|
{ address, name: "instantRedeemEnabled", params: [] },
|
|
57572
57344
|
// Falls back to the vault itself when no CreditVault is pinned —
|
|
@@ -57600,7 +57372,7 @@ var readerNativeWnlp = (entry) => {
|
|
|
57600
57372
|
const windowSeconds = toBigInt15(window);
|
|
57601
57373
|
const bips = toBigInt15(feeBips);
|
|
57602
57374
|
return {
|
|
57603
|
-
totalAssets: totalSupply * exchangeRate /
|
|
57375
|
+
totalAssets: totalSupply * exchangeRate / ONE_E1811,
|
|
57604
57376
|
totalSupply,
|
|
57605
57377
|
exchangeRate,
|
|
57606
57378
|
// `instantRedeemFeeBips` on-chain is already basis points, so it
|
|
@@ -57640,7 +57412,7 @@ var buildReader2 = (entry) => {
|
|
|
57640
57412
|
var resolveYieldApr2 = async (entries) => (await resolveEntryApr(entries)).apr;
|
|
57641
57413
|
|
|
57642
57414
|
// src/vaults/savings/fetchPublic.ts
|
|
57643
|
-
var
|
|
57415
|
+
var ONE_E1812 = 10n ** 18n;
|
|
57644
57416
|
var fetchSavingsVaults = async (chainId, multicallRetry, prices = {}, tokenList = {}) => {
|
|
57645
57417
|
const entries = getSavingsRegistry(chainId);
|
|
57646
57418
|
if (entries.length === 0) return {};
|
|
@@ -57689,8 +57461,8 @@ var fetchSavingsVaults = async (chainId, multicallRetry, prices = {}, tokenList
|
|
|
57689
57461
|
1,
|
|
57690
57462
|
Number(liquidityAmount * 1000000n / state.totalAssets) / 1e6
|
|
57691
57463
|
) : 1;
|
|
57692
|
-
const convertToAssets = state.exchangeRate * underlyingUnit /
|
|
57693
|
-
const convertToShares = state.exchangeRate > 0n ?
|
|
57464
|
+
const convertToAssets = state.exchangeRate * underlyingUnit / ONE_E1812;
|
|
57465
|
+
const convertToShares = state.exchangeRate > 0n ? ONE_E1812 * shareUnit / state.exchangeRate : 0n;
|
|
57694
57466
|
const displayName = composeVaultDisplayName(
|
|
57695
57467
|
entry.brand,
|
|
57696
57468
|
entry.brand,
|
|
@@ -61581,6 +61353,32 @@ var TERM_PROFILES = [
|
|
|
61581
61353
|
]
|
|
61582
61354
|
}
|
|
61583
61355
|
}),
|
|
61356
|
+
P({
|
|
61357
|
+
id: "frankencoin.challenge@v1",
|
|
61358
|
+
name: "Frankencoin position",
|
|
61359
|
+
family: "frankencoin",
|
|
61360
|
+
borrow: {
|
|
61361
|
+
description: "A per-position CDP minting ZCHF. There is no price oracle: you DECLARE the liquidation price yourself, and anyone may challenge it with a Dutch auction.",
|
|
61362
|
+
implications: [
|
|
61363
|
+
"Liquidation is NOT driven by your health factor. A challenge succeeds when the market price falls below the price YOU declared, regardless of how much you have borrowed \u2014 repaying does not reduce that risk, only re-declaring the price does.",
|
|
61364
|
+
"You owe more than you received: a 10\u201340 % reserve contribution is withheld at mint, plus an upfront fee. The debt is not the amount you got.",
|
|
61365
|
+
"The position EXPIRES on a fixed date; past it the position can be liquidated."
|
|
61366
|
+
]
|
|
61367
|
+
}
|
|
61368
|
+
}),
|
|
61369
|
+
P({
|
|
61370
|
+
id: "resupply.cdp@v1",
|
|
61371
|
+
name: "Resupply pair",
|
|
61372
|
+
family: "resupply",
|
|
61373
|
+
borrow: {
|
|
61374
|
+
description: "A CDP minting reUSD against a supply position in ANOTHER lending market, held as a staked ERC-4626 share.",
|
|
61375
|
+
implications: [
|
|
61376
|
+
"Redemptions are COMMUNAL: collateral is skimmed pro-rata from every borrower in the pair, so being well-collateralised does not exempt you and there is no rate to raise in defence.",
|
|
61377
|
+
"Your collateral is a lending position elsewhere \u2014 bad debt in that market is bad debt here.",
|
|
61378
|
+
"There is a hard minimum position size: a smaller borrow, or a repay that would leave less than it, reverts."
|
|
61379
|
+
]
|
|
61380
|
+
}
|
|
61381
|
+
}),
|
|
61584
61382
|
// ── Vaults ───────────────────────────────────────────────────────────────
|
|
61585
61383
|
P({
|
|
61586
61384
|
id: "vault.lending@v1",
|
|
@@ -61851,7 +61649,9 @@ function resolveMinDebt(input) {
|
|
|
61851
61649
|
// USDD / Maker-fork: `dust` IS the per-vault debt floor.
|
|
61852
61650
|
m.usdd?.dust,
|
|
61853
61651
|
// Gearbox credit facade.
|
|
61854
|
-
m.gearbox?.minDebt
|
|
61652
|
+
m.gearbox?.minDebt,
|
|
61653
|
+
// Resupply — a hard per-position floor that also bounds partial repayment.
|
|
61654
|
+
m.resupply?.minimumBorrowAmount
|
|
61855
61655
|
];
|
|
61856
61656
|
for (const c of candidates) {
|
|
61857
61657
|
if (c == null) continue;
|
|
@@ -61862,6 +61662,14 @@ function resolveMinDebt(input) {
|
|
|
61862
61662
|
}
|
|
61863
61663
|
return void 0;
|
|
61864
61664
|
}
|
|
61665
|
+
function resolveMinCollateral(input) {
|
|
61666
|
+
const m = input.market ?? {};
|
|
61667
|
+
const raw = m.frankencoin?.minimumCollateral;
|
|
61668
|
+
if (raw == null) return void 0;
|
|
61669
|
+
const str3 = String(raw);
|
|
61670
|
+
if (str3 === "0" || str3 === "" || !/^\d+$/.test(str3)) return void 0;
|
|
61671
|
+
return str3;
|
|
61672
|
+
}
|
|
61865
61673
|
function capUtil(total, cap) {
|
|
61866
61674
|
if (!isNum(cap) || cap <= 0 || !isNum(total)) return void 0;
|
|
61867
61675
|
return clamp01(total / cap);
|
|
@@ -61893,7 +61701,7 @@ function buildAvailability(input, side) {
|
|
|
61893
61701
|
gating: "permissionless",
|
|
61894
61702
|
// A borrow below the protocol's floor REVERTS, so gate the CTA on it
|
|
61895
61703
|
// rather than letting the transaction fail.
|
|
61896
|
-
minSize: side === "borrow" ? resolveMinDebt(input) :
|
|
61704
|
+
minSize: side === "borrow" ? resolveMinDebt(input) : resolveMinCollateral(input),
|
|
61897
61705
|
cap: isNum(cap) && cap > 0 ? String(cap) : void 0,
|
|
61898
61706
|
capUtilization,
|
|
61899
61707
|
requires: side === "supply" ? ["token-approval"] : void 0
|
|
@@ -62419,11 +62227,17 @@ function borrowFindings(borrow) {
|
|
|
62419
62227
|
});
|
|
62420
62228
|
}
|
|
62421
62229
|
if (liq.redeemable || liq.trigger === "redemption") {
|
|
62230
|
+
const r = liq.redemption;
|
|
62231
|
+
const who = r?.trigger === "permissionless-arbitrage" ? "Anyone holding the borrowed token can redeem it for collateral at any time" : "Your collateral can be taken while the position is healthy";
|
|
62232
|
+
const why = r?.driver === "below-peg" ? " \u2014 this is the peg-defence mechanism, not a liquidation and not a governance decision, and it only pays them while the token trades below its target" : "";
|
|
62233
|
+
const whom = r?.order === "lowest-rate-first" ? ". Redemptions take the LOWEST-interest-rate positions first, so your rate is your place in the queue" : r?.order === "pro-rata" ? ". Collateral is skimmed pro-rata from EVERY borrower in this market, so there is no queue to out-run" : "";
|
|
62234
|
+
const impact = r?.valueImpact === "usd-neutral" ? ". Your debt is cancelled against the collateral taken, so you end up roughly USD-neutral but lose collateral exposure" : "";
|
|
62235
|
+
const fix = r?.defence ? `. ${r.defence}` : "";
|
|
62422
62236
|
out.push({
|
|
62423
62237
|
severity: "critical",
|
|
62424
62238
|
id: "redeemable",
|
|
62425
62239
|
side: "borrow",
|
|
62426
|
-
message:
|
|
62240
|
+
message: `${who}${why}${whom}${impact}${fix}`.replace(/\.\s*\./g, ".")
|
|
62427
62241
|
});
|
|
62428
62242
|
}
|
|
62429
62243
|
if (borrow.maturity.atMaturity === "physical-delivery") {
|
|
@@ -62874,8 +62688,22 @@ var liquityAdapter = {
|
|
|
62874
62688
|
seizure: "proportional",
|
|
62875
62689
|
penalties: penalties.length ? penalties : void 0,
|
|
62876
62690
|
badDebt: "redistributed",
|
|
62877
|
-
|
|
62878
|
-
|
|
62691
|
+
redeemable: true,
|
|
62692
|
+
redemption: {
|
|
62693
|
+
// Not governance and not a liquidation: any holder of the stable
|
|
62694
|
+
// may redeem it for collateral at any time.
|
|
62695
|
+
trigger: "permissionless-arbitrage",
|
|
62696
|
+
// It only pays while the stable trades under its target — which is
|
|
62697
|
+
// the point: redemptions are what push it back up.
|
|
62698
|
+
driver: "below-peg",
|
|
62699
|
+
// The rate you chose IS your position in the queue.
|
|
62700
|
+
order: "lowest-rate-first",
|
|
62701
|
+
// The redemption fee stays in the position as extra collateral, so
|
|
62702
|
+
// the borrower is ~USD-neutral; what is lost is EXPOSURE.
|
|
62703
|
+
valueImpact: "usd-neutral",
|
|
62704
|
+
// The ordering is already stated by `order`; say only what to DO.
|
|
62705
|
+
defence: "Raising your rate moves you back in that queue."
|
|
62706
|
+
}
|
|
62879
62707
|
},
|
|
62880
62708
|
counterparty: { kind: "cdp", solvency: "overcollateralized" }
|
|
62881
62709
|
},
|
|
@@ -62909,7 +62737,17 @@ var riverAdapter = {
|
|
|
62909
62737
|
liquidation: {
|
|
62910
62738
|
trigger: "price",
|
|
62911
62739
|
seizure: "proportional",
|
|
62912
|
-
redeemable: true
|
|
62740
|
+
redeemable: true,
|
|
62741
|
+
redemption: {
|
|
62742
|
+
// Not governance and not a liquidation: any holder of the stable may
|
|
62743
|
+
// redeem it for collateral at any time.
|
|
62744
|
+
trigger: "permissionless-arbitrage",
|
|
62745
|
+
driver: "below-peg",
|
|
62746
|
+
order: "lowest-rate-first",
|
|
62747
|
+
valueImpact: "usd-neutral",
|
|
62748
|
+
// The ordering is already stated by `order`; say only what to DO.
|
|
62749
|
+
defence: "Raising your rate moves you back in that queue."
|
|
62750
|
+
}
|
|
62913
62751
|
},
|
|
62914
62752
|
counterparty: { kind: "cdp", solvency: "overcollateralized" }
|
|
62915
62753
|
},
|
|
@@ -63060,6 +62898,168 @@ var llamaLendAdapter = {
|
|
|
63060
62898
|
};
|
|
63061
62899
|
}
|
|
63062
62900
|
};
|
|
62901
|
+
var ppmToPercent = (v) => {
|
|
62902
|
+
if (v == null) return void 0;
|
|
62903
|
+
const n = Number(v);
|
|
62904
|
+
return Number.isFinite(n) ? n / 1e4 : void 0;
|
|
62905
|
+
};
|
|
62906
|
+
var frankencoinAdapter = {
|
|
62907
|
+
id: "frankencoin",
|
|
62908
|
+
matches: isFrankencoin,
|
|
62909
|
+
profileId: () => "frankencoin.challenge@v1",
|
|
62910
|
+
build: (input) => {
|
|
62911
|
+
const fc = input.market?.frankencoin ?? {};
|
|
62912
|
+
const reservePct = ppmToPercent(fc.reserveContributionPPM);
|
|
62913
|
+
const upfrontPct = ppmToPercent(fc.upfrontFeePPM);
|
|
62914
|
+
const challengerPct = ppmToPercent(fc.challengerRewardPPM);
|
|
62915
|
+
const expiration = Number(fc.expiration ?? 0);
|
|
62916
|
+
const challengePeriod = Number(fc.challengePeriod ?? 0);
|
|
62917
|
+
const fees = [
|
|
62918
|
+
reservePct != null && reservePct > 0 ? {
|
|
62919
|
+
id: "reserve-contribution",
|
|
62920
|
+
label: "Equity-reserve contribution",
|
|
62921
|
+
when: "entry",
|
|
62922
|
+
unit: "percent",
|
|
62923
|
+
basis: "principal",
|
|
62924
|
+
value: reservePct,
|
|
62925
|
+
payee: "protocol",
|
|
62926
|
+
description: "Withheld at mint into the FPS equity reserve. You owe the full amount but receive this much less, so the debt is NOT what you got."
|
|
62927
|
+
} : null,
|
|
62928
|
+
upfrontPct != null && upfrontPct > 0 ? {
|
|
62929
|
+
id: "origination",
|
|
62930
|
+
label: "Upfront interest",
|
|
62931
|
+
when: "entry",
|
|
62932
|
+
unit: "percent",
|
|
62933
|
+
basis: "principal",
|
|
62934
|
+
value: upfrontPct,
|
|
62935
|
+
payee: "protocol",
|
|
62936
|
+
description: "Charged once at mint, pro-rated over the time to expiry."
|
|
62937
|
+
} : null
|
|
62938
|
+
].filter(Boolean);
|
|
62939
|
+
return {
|
|
62940
|
+
// Not a coverage hole: the protocol has no price feed by design.
|
|
62941
|
+
oracle: { kind: "none" },
|
|
62942
|
+
borrow: {
|
|
62943
|
+
debtShape: "accruing",
|
|
62944
|
+
maturity: expiration > 0 ? {
|
|
62945
|
+
kind: "fixed-date",
|
|
62946
|
+
maturity: expiration,
|
|
62947
|
+
maturityIso: new Date(expiration * 1e3).toISOString(),
|
|
62948
|
+
atMaturity: "liquidatable"
|
|
62949
|
+
} : void 0,
|
|
62950
|
+
exit: {
|
|
62951
|
+
// Repaying is not free here: the reserve haircut means the net cost
|
|
62952
|
+
// is `faceDelta − assignedReserve`, and it is resolved at repay time.
|
|
62953
|
+
earlyRepay: "discount",
|
|
62954
|
+
atMaturityCost: "accrued",
|
|
62955
|
+
lateBehaviour: "liquidatable",
|
|
62956
|
+
partialAllowed: true
|
|
62957
|
+
},
|
|
62958
|
+
liquidation: {
|
|
62959
|
+
// A Dutch-auction challenge, not a repay-and-seize.
|
|
62960
|
+
model: "auction",
|
|
62961
|
+
absorber: "liquidator",
|
|
62962
|
+
// Price-triggered, but against the OWNER-DECLARED price — and with
|
|
62963
|
+
// no health gate whatsoever.
|
|
62964
|
+
trigger: "price",
|
|
62965
|
+
seizure: "proportional",
|
|
62966
|
+
permissioned: false,
|
|
62967
|
+
windowSecs: challengePeriod > 0 ? challengePeriod : void 0,
|
|
62968
|
+
penalty: challengerPct != null ? challengerPct / 100 : 0,
|
|
62969
|
+
penalties: challengerPct != null ? [
|
|
62970
|
+
{
|
|
62971
|
+
id: "challenger-reward",
|
|
62972
|
+
label: "Challenger reward",
|
|
62973
|
+
value: challengerPct / 100,
|
|
62974
|
+
description: "Paid to whoever successfully challenges the declared price."
|
|
62975
|
+
}
|
|
62976
|
+
] : void 0,
|
|
62977
|
+
badDebt: "socialized"
|
|
62978
|
+
},
|
|
62979
|
+
fees,
|
|
62980
|
+
counterparty: { kind: "cdp", solvency: "overcollateralized" }
|
|
62981
|
+
},
|
|
62982
|
+
constraints: {
|
|
62983
|
+
crossMargin: false,
|
|
62984
|
+
// Each position is its own CONTRACT, cloned from an "original".
|
|
62985
|
+
positionModel: "account",
|
|
62986
|
+
positionIdMeaning: "Each position is its own contract, cloned from the market\u2019s original position; you own the clone."
|
|
62987
|
+
}
|
|
62988
|
+
};
|
|
62989
|
+
}
|
|
62990
|
+
};
|
|
62991
|
+
var e5ToFraction = (v) => {
|
|
62992
|
+
if (v == null) return void 0;
|
|
62993
|
+
const n = Number(v);
|
|
62994
|
+
return Number.isFinite(n) ? n / 1e5 : void 0;
|
|
62995
|
+
};
|
|
62996
|
+
var resupplyAdapter = {
|
|
62997
|
+
id: "resupply",
|
|
62998
|
+
matches: isResupply,
|
|
62999
|
+
profileId: () => "resupply.cdp@v1",
|
|
63000
|
+
build: (input) => {
|
|
63001
|
+
const rs = input.market?.resupply ?? {};
|
|
63002
|
+
const liquidationFee = e5ToFraction(rs.liquidationFee);
|
|
63003
|
+
const mintFee = e5ToFraction(rs.mintFee);
|
|
63004
|
+
const minBorrow = rs.minimumBorrowAmount != null && String(rs.minimumBorrowAmount) !== "0" ? String(rs.minimumBorrowAmount) : void 0;
|
|
63005
|
+
return {
|
|
63006
|
+
borrow: {
|
|
63007
|
+
debtShape: "accruing",
|
|
63008
|
+
exit: {
|
|
63009
|
+
earlyRepay: "free",
|
|
63010
|
+
atMaturityCost: "accrued",
|
|
63011
|
+
lateBehaviour: "none",
|
|
63012
|
+
partialAllowed: true,
|
|
63013
|
+
// The floor bounds repayment too: a partial repay may not leave the
|
|
63014
|
+
// position under it.
|
|
63015
|
+
minDebt: minBorrow
|
|
63016
|
+
},
|
|
63017
|
+
liquidation: {
|
|
63018
|
+
model: "repay-seize",
|
|
63019
|
+
absorber: "liquidator",
|
|
63020
|
+
trigger: "price",
|
|
63021
|
+
seizure: "proportional",
|
|
63022
|
+
penalty: liquidationFee ?? 0,
|
|
63023
|
+
// Every borrower in the pair is exposed, not just the marginal one.
|
|
63024
|
+
redeemable: true,
|
|
63025
|
+
redemption: {
|
|
63026
|
+
trigger: "permissionless-arbitrage",
|
|
63027
|
+
driver: "below-peg",
|
|
63028
|
+
// No queue at all: collateral is skimmed from EVERY borrower in
|
|
63029
|
+
// the pair, so unlike Liquity there is nothing to out-run and no
|
|
63030
|
+
// rate to raise. Offering "raise your rate" here would be actively
|
|
63031
|
+
// misleading.
|
|
63032
|
+
order: "pro-rata",
|
|
63033
|
+
valueImpact: "usd-neutral"
|
|
63034
|
+
},
|
|
63035
|
+
badDebt: "socialized"
|
|
63036
|
+
},
|
|
63037
|
+
fees: mintFee != null && mintFee > 0 ? [
|
|
63038
|
+
{
|
|
63039
|
+
id: "origination",
|
|
63040
|
+
label: "Mint fee",
|
|
63041
|
+
when: "entry",
|
|
63042
|
+
unit: "percent",
|
|
63043
|
+
basis: "principal",
|
|
63044
|
+
value: mintFee * 100,
|
|
63045
|
+
payee: "protocol"
|
|
63046
|
+
}
|
|
63047
|
+
] : void 0,
|
|
63048
|
+
availability: minBorrow ? { minSize: minBorrow } : void 0,
|
|
63049
|
+
counterparty: { kind: "cdp", solvency: "overcollateralized" }
|
|
63050
|
+
},
|
|
63051
|
+
supply: {
|
|
63052
|
+
// The collateral is itself a lending position elsewhere.
|
|
63053
|
+
principal: { protected: false, risks: ["bad-debt"] }
|
|
63054
|
+
},
|
|
63055
|
+
constraints: {
|
|
63056
|
+
crossMargin: false,
|
|
63057
|
+
positionModel: "account",
|
|
63058
|
+
positionIdMeaning: "One position per address per pair \u2014 address-keyed, no discovery."
|
|
63059
|
+
}
|
|
63060
|
+
};
|
|
63061
|
+
}
|
|
63062
|
+
};
|
|
63063
63063
|
|
|
63064
63064
|
// src/terms/adapters/index.ts
|
|
63065
63065
|
var TERM_ADAPTERS = [
|
|
@@ -63076,7 +63076,9 @@ var TERM_ADAPTERS = [
|
|
|
63076
63076
|
compoundV3Adapter,
|
|
63077
63077
|
fluidAdapter,
|
|
63078
63078
|
gearboxAdapter,
|
|
63079
|
-
llamaLendAdapter
|
|
63079
|
+
llamaLendAdapter,
|
|
63080
|
+
frankencoinAdapter,
|
|
63081
|
+
resupplyAdapter
|
|
63080
63082
|
];
|
|
63081
63083
|
function resolveAdapter(lender) {
|
|
63082
63084
|
return TERM_ADAPTERS.find((a) => a.matches(lender));
|
|
@@ -63470,11 +63472,15 @@ function validateTermSheet(sheet) {
|
|
|
63470
63472
|
if (o) {
|
|
63471
63473
|
if (o.kind === "none" && o.address)
|
|
63472
63474
|
fail("oracle-none-address", "oracle.kind none must not carry an address");
|
|
63473
|
-
if (o.kind === "none" && sheet.borrow
|
|
63474
|
-
|
|
63475
|
-
|
|
63476
|
-
|
|
63477
|
-
|
|
63475
|
+
if (o.kind === "none" && sheet.borrow) {
|
|
63476
|
+
const t = sheet.borrow.liquidation.trigger;
|
|
63477
|
+
const m = sheet.borrow.liquidation.model;
|
|
63478
|
+
if (t !== "time" && t !== "none" && m !== "auction")
|
|
63479
|
+
fail(
|
|
63480
|
+
"no-oracle-non-time",
|
|
63481
|
+
`oracle.kind none but liquidation.trigger is ${t} with model ${m ?? "unset"}`
|
|
63482
|
+
);
|
|
63483
|
+
}
|
|
63478
63484
|
if (o.address && o.address !== o.address.toLowerCase())
|
|
63479
63485
|
fail("oracle-lowercase", "oracle.address must be lowercased");
|
|
63480
63486
|
}
|