@1delta/margin-fetcher 0.0.333 → 0.0.334
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 +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +779 -51
- package/dist/index.js.map +1 -1
- package/dist/lending/public-data/fetchLenderAll.d.ts.map +1 -1
- package/dist/lending/public-data/fetchLenderExt.d.ts.map +1 -1
- package/dist/lending/public-data/teller/convertPublic.d.ts +32 -0
- package/dist/lending/public-data/teller/convertPublic.d.ts.map +1 -0
- package/dist/lending/public-data/teller/fetchPublic.d.ts +16 -0
- package/dist/lending/public-data/teller/fetchPublic.d.ts.map +1 -0
- package/dist/lending/public-data/teller/index.d.ts +5 -0
- package/dist/lending/public-data/teller/index.d.ts.map +1 -0
- package/dist/lending/public-data/teller/math.d.ts +18 -0
- package/dist/lending/public-data/teller/math.d.ts.map +1 -0
- package/dist/lending/public-data/teller/types.d.ts +33 -0
- package/dist/lending/public-data/teller/types.d.ts.map +1 -0
- package/dist/lending/user-data/abis.d.ts.map +1 -1
- package/dist/lending/user-data/fetch-balances/parse.d.ts.map +1 -1
- package/dist/lending/user-data/fetch-balances/prepare.d.ts.map +1 -1
- package/dist/lending/user-data/teller/index.d.ts +3 -0
- package/dist/lending/user-data/teller/index.d.ts.map +1 -0
- package/dist/lending/user-data/teller/userCallBuild.d.ts +31 -0
- package/dist/lending/user-data/teller/userCallBuild.d.ts.map +1 -0
- package/dist/lending/user-data/teller/userCallParse.d.ts +22 -0
- package/dist/lending/user-data/teller/userCallParse.d.ts.map +1 -0
- package/dist/prices/oracle-prices/fetchOraclePrices.d.ts +2 -2
- package/dist/prices/oracle-prices/fetchOraclePrices.d.ts.map +1 -1
- package/dist/prices/oracle-prices/fetchers/index.d.ts +1 -0
- package/dist/prices/oracle-prices/fetchers/index.d.ts.map +1 -1
- package/dist/prices/oracle-prices/fetchers/teller.d.ts +413 -0
- package/dist/prices/oracle-prices/fetchers/teller.d.ts.map +1 -0
- package/dist/types/lenderTypes.d.ts +1 -1
- package/dist/types/lenderTypes.d.ts.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchLenderAll.d.ts","sourceRoot":"","sources":["../../../src/lending/public-data/fetchLenderAll.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAOtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"fetchLenderAll.d.ts","sourceRoot":"","sources":["../../../src/lending/public-data/fetchLenderAll.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAOtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AA8EtD,eAAO,MAAM,sBAAsB,GACjC,SAAS,MAAM,EACf,SAAS,MAAM,EAAE,EACjB,QAAQ;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,EACnC,kBAAkB,gBAAgB,EAClC,gBAAgB,sBAAsB,EACtC,YAAY,MAAM,OAAO,CAAC,gBAAgB,CAAC,EAC3C,sCAAoC,KACnC,OAAO,CAAC;IAAE,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAgEnC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchLenderExt.d.ts","sourceRoot":"","sources":["../../../src/lending/public-data/fetchLenderExt.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fetchLenderExt.d.ts","sourceRoot":"","sources":["../../../src/lending/public-data/fetchLenderExt.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAsB9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAwGtD,eAAO,MAAM,yBAAyB,GACpC,SAAS,MAAM,EACf,SAAS,MAAM,EAAE,EACjB,QAAQ;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,EACnC,kBAAkB,gBAAgB,EAClC,YAAW,MAAM,OAAO,CAAC,gBAAgB,CAExC,EACD,yBAAuB,KACtB,OAAO,CAAC;IAAE,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAqMnC,CAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { MorphoGeneralPublicResponse } from '../../../types/lender/morpho-types';
|
|
2
|
+
import { AdditionalYields, GenericTokenList } from '../../../types';
|
|
3
|
+
import type { TellerMarketsRaw } from './types';
|
|
4
|
+
/** Synthesized per-pool lender key, e.g. `TELLER_<POOL_ADDRESS_HEX_UPPER>`. */
|
|
5
|
+
export declare function tellerLenderKey(pool: string): string;
|
|
6
|
+
/** Recover the pool address from a `TELLER_<HEX>` lender key (or undefined). */
|
|
7
|
+
export declare function tellerPoolFromLenderKey(lender: string): string | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* Map the on-chain Teller pool batch into the shared `MorphoGeneralPublicResponse`
|
|
10
|
+
* shape (identical to Exactly/Midnight/Term/River), keyed by
|
|
11
|
+
* `TELLER_<POOL_ADDRESS>` — one key per `LenderCommitmentGroup` pool.
|
|
12
|
+
*
|
|
13
|
+
* Per pool (a fixed principal↔collateral pair):
|
|
14
|
+
* - a LOAN entry on the principal token: `borrowLiquidity` =
|
|
15
|
+
* `getPrincipalAmountAvailableToBorrow` (the liquidity gate); the fixed borrow
|
|
16
|
+
* APR sits on `stableBorrowRate` (fixed-rate convention, like Exactly/Term/
|
|
17
|
+
* Lista — `variableBorrowRate` stays 0, Teller has no floating leg);
|
|
18
|
+
* - a COLLATERAL entry on the collateral token with the implied origination LTV
|
|
19
|
+
* and `liquidationPenalty: 0` (Teller liquidation is TIME-based — a missed
|
|
20
|
+
* payment past the market window seizes collateral, there is no price-based
|
|
21
|
+
* penalty parameter);
|
|
22
|
+
* - `params.market.fixedTerm` = `{ model: 'teller', earlyRepay: 'none' (full
|
|
23
|
+
* early repay is pro-rata, penalty-free), provider: { kind: 'pool' } }` — a
|
|
24
|
+
* rolling duration (borrower picks ≤ `maxLoanDuration`), so no market-level
|
|
25
|
+
* calendar maturity.
|
|
26
|
+
*/
|
|
27
|
+
export declare function convertTellerMarketsToResponse(raw: TellerMarketsRaw, chainId: string, prices?: {
|
|
28
|
+
[asset: string]: number;
|
|
29
|
+
}, _additionalYields?: AdditionalYields, tokens?: GenericTokenList): {
|
|
30
|
+
[m: string]: MorphoGeneralPublicResponse;
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=convertPublic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertPublic.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/teller/convertPublic.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAA;AAChF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAKnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAE/C,+EAA+E;AAC/E,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGpD;AAED,gFAAgF;AAChF,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAI1E;AAwBD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,8BAA8B,CAC5C,GAAG,EAAE,gBAAgB,EACrB,OAAO,EAAE,MAAM,EACf,MAAM,GAAE;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAAO,EACxC,iBAAiB,GAAE,gBAIlB,EACD,MAAM,GAAE,gBAAqB,GAC5B;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,2BAA2B,CAAA;CAAE,CA2O9C"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { TellerMarketsRaw } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Fetch all Teller pool data for a chain — FULLY ON-CHAIN (no API/indexer):
|
|
4
|
+
* 1. one retrying multicall reads each curated `LenderCommitmentGroup` pool's
|
|
5
|
+
* live state (borrowable liquidity, committed principal, min borrow rate,
|
|
6
|
+
* collateral requirement, max duration, marketId);
|
|
7
|
+
* 2. a second multicall reads each UNIQUE market's `MarketRegistry`
|
|
8
|
+
* attestation requirement + open flag — so we can surface which pools gate
|
|
9
|
+
* borrowers (a permissionless integration must know).
|
|
10
|
+
*
|
|
11
|
+
* The pool list comes from lender-metadata (`tellerPools`). Returns an empty
|
|
12
|
+
* batch when the chain has no Teller pools or the read fails (the converter then
|
|
13
|
+
* emits nothing).
|
|
14
|
+
*/
|
|
15
|
+
export declare function fetchTellerMarkets(chainId: string): Promise<TellerMarketsRaw>;
|
|
16
|
+
//# sourceMappingURL=fetchPublic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetchPublic.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/teller/fetchPublic.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAiB,MAAM,SAAS,CAAA;AAO9D;;;;;;;;;;;;GAYG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,gBAAgB,CAAC,CAwH3B"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { fetchTellerMarkets } from './fetchPublic';
|
|
2
|
+
export { convertTellerMarketsToResponse, tellerLenderKey, tellerPoolFromLenderKey, } from './convertPublic';
|
|
3
|
+
export { tellerBpsToPercent, tellerImpliedLtv, tellerToHuman } from './math';
|
|
4
|
+
export type { TellerPoolRaw, TellerMarketsRaw } from './types';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/teller/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,EACL,8BAA8B,EAC9B,eAAe,EACf,uBAAuB,GACxB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AAC5E,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Teller rate/scale helpers. Teller expresses APR / interest rates as a `uint16`
|
|
3
|
+
* in BASIS POINTS where 10000 = 100% (NumbersLib `PCT_100 = 1e4`), so the
|
|
4
|
+
* interest on a loan is `principal * apr * duration / (365d * 10000)`.
|
|
5
|
+
*/
|
|
6
|
+
/** uint16 basis points → percent (1000 bps → 10). */
|
|
7
|
+
export declare function tellerBpsToPercent(bps: number | null | undefined): number;
|
|
8
|
+
/** raw base units → human number. */
|
|
9
|
+
export declare function tellerToHuman(raw: bigint | null | undefined, decimals: number): number;
|
|
10
|
+
/**
|
|
11
|
+
* Implied max origination LTV of a pool: value of 1 principal token divided by
|
|
12
|
+
* the value of the collateral the pool requires to back it. Note Teller has NO
|
|
13
|
+
* price liquidation — this is the collateral requirement at ORIGINATION, not an
|
|
14
|
+
* ongoing liquidation threshold. Returns 0 when prices or the collateral read
|
|
15
|
+
* are unavailable (informational only).
|
|
16
|
+
*/
|
|
17
|
+
export declare function tellerImpliedLtv(collateralPerPrincipal: bigint | null | undefined, collateralDecimals: number, principalPrice: number, collateralPrice: number): number;
|
|
18
|
+
//# sourceMappingURL=math.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/teller/math.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,qDAAqD;AACrD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAGzE;AAED,qCAAqC;AACrC,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGtF;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,sBAAsB,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACjD,kBAAkB,EAAE,MAAM,EAC1B,cAAc,EAAE,MAAM,EACtB,eAAe,EAAE,MAAM,GACtB,MAAM,CAOR"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { TellerPoolConfig } from '@1delta/data-sdk';
|
|
2
|
+
/**
|
|
3
|
+
* Raw on-chain read for ONE Teller `LenderCommitmentGroup` pool. All amounts are
|
|
4
|
+
* raw token base units; `minRateBps` is the pool's min borrow APR in BASIS
|
|
5
|
+
* POINTS (10000 = 100%). Failed reads (allowFailure multicall) arrive as null.
|
|
6
|
+
*/
|
|
7
|
+
export interface TellerPoolRaw {
|
|
8
|
+
/** The curated pool config (addresses + token metadata) from data-sdk. */
|
|
9
|
+
config: TellerPoolConfig;
|
|
10
|
+
/** getPrincipalAmountAvailableToBorrow — the live liquidity gate (raw). */
|
|
11
|
+
available: bigint | null;
|
|
12
|
+
/** totalPrincipalTokensCommitted — total supplied principal (raw). */
|
|
13
|
+
committed: bigint | null;
|
|
14
|
+
/** getMinInterestRate(0) — min borrow APR at current utilization (bps). */
|
|
15
|
+
minRateBps: number | null;
|
|
16
|
+
/** getCollateralRequiredForPrincipalAmount(1 principal token) — raw collateral units. */
|
|
17
|
+
collateralPerPrincipal: bigint | null;
|
|
18
|
+
/** getMaxLoanDuration() (seconds) — on-chain, authoritative over config. */
|
|
19
|
+
maxLoanDuration: number | null;
|
|
20
|
+
/** getMarketId() — the MarketRegistry market this pool lends into. */
|
|
21
|
+
marketId: bigint | null;
|
|
22
|
+
/** Market requires borrower attestation (whitelist) to borrow. Undefined when
|
|
23
|
+
* the MarketRegistry read was unavailable. */
|
|
24
|
+
requiresBorrowerAttestation?: boolean;
|
|
25
|
+
/** MarketRegistry.isMarketOpen(marketId). Undefined when the read failed. */
|
|
26
|
+
marketOpen?: boolean;
|
|
27
|
+
}
|
|
28
|
+
/** Raw public-data batch: one multicall over the chain's curated pool list. */
|
|
29
|
+
export interface TellerMarketsRaw {
|
|
30
|
+
chainId: string;
|
|
31
|
+
pools: TellerPoolRaw[];
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/teller/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAExD;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,0EAA0E;IAC1E,MAAM,EAAE,gBAAgB,CAAA;IACxB,2EAA2E;IAC3E,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,sEAAsE;IACtE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,2EAA2E;IAC3E,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,yFAAyF;IACzF,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAA;IACrC,4EAA4E;IAC5E,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,sEAAsE;IACtE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB;mDAC+C;IAC/C,2BAA2B,CAAC,EAAE,OAAO,CAAA;IACrC,6EAA6E;IAC7E,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED,+EAA+E;AAC/E,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,aAAa,EAAE,CAAA;CACvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abis.d.ts","sourceRoot":"","sources":["../../../src/lending/user-data/abis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"abis.d.ts","sourceRoot":"","sources":["../../../src/lending/user-data/abis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAiEhD,eAAO,MAAM,MAAM,GAAI,QAAQ,MAAM,QAmEpC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../../src/lending/user-data/fetch-balances/parse.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../../src/lending/user-data/fetch-balances/parse.ts"],"names":[],"mappings":"AAsBA,OAAO,EACL,eAAe,EAEhB,MAAM,4BAA4B,CAAA;AAsBnC,OAAO,EAAE,2BAA2B,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AA8HtE;;;;;;;GAOG;AACH,eAAO,MAAM,2BAA2B,GACtC,SAAS,MAAM,EACf,YAAY,eAAe,EAAE,EAC7B,YAAY,GAAG,EAAE,EACjB,aAAa,2BAA2B,KACvC;IAAE,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,CAAA;CA4C9B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepare.d.ts","sourceRoot":"","sources":["../../../../src/lending/user-data/fetch-balances/prepare.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"prepare.d.ts","sourceRoot":"","sources":["../../../../src/lending/user-data/fetch-balances/prepare.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AA0C/C,wBAAsB,aAAa,CACjC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,GAAG,EACZ,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,GAAG,GACnD,OAAO,CAAC,IAAI,EAAE,CAAC,CA2CjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lending/user-data/teller/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,KAAK,mBAAmB,EACxB,KAAK,eAAe,GACrB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { TellerPoolConfig } from '@1delta/data-sdk';
|
|
2
|
+
import { Call } from '../../../utils/multicall';
|
|
3
|
+
/**
|
|
4
|
+
* User-data call build for Teller. Borrower loans ("bids") are keyed by a
|
|
5
|
+
* uint256 bidId and a user can hold MANY, so this is a DISCOVERY-first build
|
|
6
|
+
* (async, same pattern as the Liquity family):
|
|
7
|
+
*
|
|
8
|
+
* 1. `TellerV2.getBorrowerActiveLoanIds(account)` → the active bidIds;
|
|
9
|
+
* 2. `TellerV2.getLoanLender(bidId)` per id → attribute each bid to a curated
|
|
10
|
+
* pool (the pool is the lender-of-record after `acceptFundsForAcceptBid`);
|
|
11
|
+
* 3. data phase per kept bid: `bids`, `calculateAmountOwed(now)`,
|
|
12
|
+
* `CollateralManager.getCollateralAmount`, `isLoanDefaulted`.
|
|
13
|
+
*
|
|
14
|
+
* The discovered layout is stashed in a short-lived module cache so the parser
|
|
15
|
+
* (a separate phase fed only the multicall results) can slice it — same trick
|
|
16
|
+
* as Liquity / the Lista broker caches.
|
|
17
|
+
*/
|
|
18
|
+
export declare const TELLER_CALLS_PER_BID = 4;
|
|
19
|
+
export interface TellerDiscoveredBid {
|
|
20
|
+
/** decimal uint256 bidId */
|
|
21
|
+
bidId: string;
|
|
22
|
+
/** the curated pool this bid was funded by */
|
|
23
|
+
pool: TellerPoolConfig;
|
|
24
|
+
}
|
|
25
|
+
export interface TellerDiscovery {
|
|
26
|
+
bids: TellerDiscoveredBid[];
|
|
27
|
+
at: number;
|
|
28
|
+
}
|
|
29
|
+
export declare const getCachedTellerBids: (chainId: string, account: string) => TellerDiscovery | undefined;
|
|
30
|
+
export declare const buildTellerUserCall: (chainId: string, _lender: string, account: string) => Promise<Call[]>;
|
|
31
|
+
//# sourceMappingURL=userCallBuild.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userCallBuild.d.ts","sourceRoot":"","sources":["../../../../src/lending/user-data/teller/userCallBuild.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,gBAAgB,EACjB,MAAM,kBAAkB,CAAA;AAGzB,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AAE/C;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,oBAAoB,IAAI,CAAA;AAGrC,MAAM,WAAW,mBAAmB;IAClC,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,8CAA8C;IAC9C,IAAI,EAAE,gBAAgB,CAAA;CACvB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,mBAAmB,EAAE,CAAA;IAC3B,EAAE,EAAE,MAAM,CAAA;CACX;AAMD,eAAO,MAAM,mBAAmB,GAC9B,SAAS,MAAM,EACf,SAAS,MAAM,KACd,eAAe,GAAG,SAIpB,CAAA;AAeD,eAAO,MAAM,mBAAmB,GAC9B,SAAS,MAAM,EACf,SAAS,MAAM,EACf,SAAS,MAAM,KACd,OAAO,CAAC,IAAI,EAAE,CAoFhB,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { LenderToLenderCrossPoolMeta, UserData } from '../utils/types';
|
|
2
|
+
/**
|
|
3
|
+
* Returns a [converter, expectedCallCount] tuple for Teller user data.
|
|
4
|
+
*
|
|
5
|
+
* Layout mirrors `buildTellerUserCall`: for each discovered bid (in cache
|
|
6
|
+
* order) four results — `bids`, `calculateAmountOwed`, `getCollateralAmount`,
|
|
7
|
+
* `isLoanDefaulted`. Bids are ISOLATED (each is its own collateral + fixed debt)
|
|
8
|
+
* and a user holds many per pool, so each bidId becomes its OWN sub-account
|
|
9
|
+
* under the pool key `TELLER_<POOL_ADDR>` (River-style rows, but keyed by bidId
|
|
10
|
+
* instead of `'0'`):
|
|
11
|
+
*
|
|
12
|
+
* - collateral row: deposits = the bid's escrowed collateral;
|
|
13
|
+
* - loan row: `debtStable` = `calculateAmountOwed` (principal + interest) — a
|
|
14
|
+
* fixed-term debt goes on the stable slot (Exactly/Lista convention). The
|
|
15
|
+
* `term` detail (`ListaTermLoan`) carries `loanId = bidId` (the exact
|
|
16
|
+
* `repayLoanFull` target), the fixed APR, and the maturity
|
|
17
|
+
* (`acceptedTimestamp + loanDuration`).
|
|
18
|
+
*/
|
|
19
|
+
export declare const getTellerUserDataConverter: (_lender: string, chainId: string, account: string, meta?: LenderToLenderCrossPoolMeta) => [(data: any[]) => {
|
|
20
|
+
[lender: string]: UserData;
|
|
21
|
+
} | undefined, number];
|
|
22
|
+
//# sourceMappingURL=userCallParse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userCallParse.d.ts","sourceRoot":"","sources":["../../../../src/lending/user-data/teller/userCallParse.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,2BAA2B,EAC3B,QAAQ,EACT,MAAM,gBAAgB,CAAA;AAkBvB;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,0BAA0B,GACrC,SAAS,MAAM,EACf,SAAS,MAAM,EACf,SAAS,MAAM,EACf,OAAO,2BAA2B,KACjC,CACD,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK;IAAE,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,CAAA;CAAE,GAAG,SAAS,EAC3D,MAAM,CA+JP,CAAA"}
|
|
@@ -40,8 +40,8 @@ export interface FetchOraclePricesOptions {
|
|
|
40
40
|
/**
|
|
41
41
|
* Only run these fetcher groups. Useful for debugging individual protocols.
|
|
42
42
|
* Values: 'aave', 'compoundV2', 'compoundV3', 'lista', 'eulerV2', 'aaveV4',
|
|
43
|
-
* 'morpho', 'midnight', 'exactly', 'term', 'liquity', 'river', '
|
|
44
|
-
* 'siloV3', 'fluid'.
|
|
43
|
+
* 'morpho', 'midnight', 'exactly', 'term', 'liquity', 'river', 'teller',
|
|
44
|
+
* 'siloV2', 'siloV3', 'fluid'.
|
|
45
45
|
* If omitted, all fetchers run.
|
|
46
46
|
*/
|
|
47
47
|
onlyFetchers?: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchOraclePrices.d.ts","sourceRoot":"","sources":["../../../src/prices/oracle-prices/fetchOraclePrices.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,WAAW,EAEX,YAAY,EAKZ,kBAAkB,EAEnB,MAAM,SAAS,CAAA;AAChB,OAAO,
|
|
1
|
+
{"version":3,"file":"fetchOraclePrices.d.ts","sourceRoot":"","sources":["../../../src/prices/oracle-prices/fetchOraclePrices.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,WAAW,EAEX,YAAY,EAKZ,kBAAkB,EAEnB,MAAM,SAAS,CAAA;AAChB,OAAO,EA2BL,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EAC1B,MAAM,YAAY,CAAA;AAiBnB;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,CAAA;CAChC,CAAA;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,2CAA2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getTermCalls, parseTermResults, getTermAbi, } from './term';
|
|
6
6
|
export { liquityFetcher, getLiquityCalls, parseLiquityResults, getLiquityAbi, } from './liquity';
|
|
7
7
|
export { riverFetcher, getRiverCalls, parseRiverResults, getRiverAbi, } from './river';
|
|
8
|
+
export { tellerFetcher, getTellerCalls, parseTellerResults, getTellerAbi, } from './teller';
|
|
8
9
|
export { compoundV2Fetcher, getCompoundV2Calls, parseCompoundV2Results, getCompoundV2Abi, } from './compoundV2';
|
|
9
10
|
export { compoundV3Fetcher, getCompoundV3Calls, parseCompoundV3Results, getCompoundV3Abi, } from './compoundV3';
|
|
10
11
|
export { listaFetcher, getListaCalls, parseListaResults, getListaAbi, type ListaMarketOverrides, type ListaFetcherContext, } from './lista';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/prices/oracle-prices/fetchers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AAChF,OAAO,EACL,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,YAAY,EACZ,wBAAwB,EACxB,kBAAkB,EAClB,mBAAmB,EACnB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,GAC1B,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,GACf,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,aAAa,GACd,MAAM,WAAW,CAAA;AAClB,OAAO,EACL,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,UAAU,GACX,MAAM,QAAQ,CAAA;AACf,OAAO,EACL,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,aAAa,GACd,MAAM,WAAW,CAAA;AAClB,OAAO,EACL,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,WAAW,GACZ,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,GACzB,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,aAAa,GACd,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,YAAY,GACb,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,YAAY,GACb,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,YAAY,GACb,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,KAAK,cAAc,GACpB,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,KAAK,kBAAkB,GACxB,MAAM,WAAW,CAAA;AAClB,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,EACd,KAAK,kBAAkB,GACxB,MAAM,YAAY,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/prices/oracle-prices/fetchers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AAChF,OAAO,EACL,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,YAAY,EACZ,wBAAwB,EAC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