@1delta/margin-fetcher 0.0.163 → 0.0.165
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/abis/compound-v2/BenqiLens.d.ts +253 -0
- package/dist/abis/compound-v2/BenqiLens.d.ts.map +1 -0
- package/dist/abis/compound-v2/TectonicLens.d.ts +125 -0
- package/dist/abis/compound-v2/TectonicLens.d.ts.map +1 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9312 -8131
- package/dist/index.js.map +1 -1
- package/dist/lending/index.d.ts +1 -1
- package/dist/lending/index.d.ts.map +1 -1
- package/dist/lending/margin/base/borrow.d.ts +18 -4
- package/dist/lending/margin/base/borrow.d.ts.map +1 -1
- package/dist/lending/margin/base/deposit.d.ts +18 -4
- package/dist/lending/margin/base/deposit.d.ts.map +1 -1
- package/dist/lending/margin/base/index.d.ts +3 -0
- package/dist/lending/margin/base/index.d.ts.map +1 -1
- package/dist/lending/margin/base/repay.d.ts +18 -4
- package/dist/lending/margin/base/repay.d.ts.map +1 -1
- package/dist/lending/margin/base/standard/borrow.d.ts +10 -0
- package/dist/lending/margin/base/standard/borrow.d.ts.map +1 -0
- package/dist/lending/margin/base/standard/deposit.d.ts +10 -0
- package/dist/lending/margin/base/standard/deposit.d.ts.map +1 -0
- package/dist/lending/margin/base/standard/repay.d.ts +10 -0
- package/dist/lending/margin/base/standard/repay.d.ts.map +1 -0
- package/dist/lending/margin/base/standard/withdraw.d.ts +10 -0
- package/dist/lending/margin/base/standard/withdraw.d.ts.map +1 -0
- package/dist/lending/margin/{sumer → base/sumer}/borrow.d.ts +2 -2
- package/dist/lending/margin/base/sumer/borrow.d.ts.map +1 -0
- package/dist/lending/margin/{sumer → base/sumer}/deposit.d.ts +2 -2
- package/dist/lending/margin/base/sumer/deposit.d.ts.map +1 -0
- package/dist/lending/margin/base/sumer/index.d.ts.map +1 -0
- package/dist/lending/margin/{sumer → base/sumer}/repay.d.ts +2 -2
- package/dist/lending/margin/base/sumer/repay.d.ts.map +1 -0
- package/dist/lending/margin/{sumer → base/sumer}/types.d.ts +1 -1
- package/dist/lending/margin/base/sumer/types.d.ts.map +1 -0
- package/dist/lending/margin/{sumer → base/sumer}/waterfall.d.ts +1 -2
- package/dist/lending/margin/base/sumer/waterfall.d.ts.map +1 -0
- package/dist/lending/margin/{sumer → base/sumer}/withdraw.d.ts +2 -2
- package/dist/lending/margin/base/sumer/withdraw.d.ts.map +1 -0
- package/dist/lending/margin/base/utils.d.ts +11 -7
- package/dist/lending/margin/base/utils.d.ts.map +1 -1
- package/dist/lending/margin/base/withdraw.d.ts +17 -4
- package/dist/lending/margin/base/withdraw.d.ts.map +1 -1
- package/dist/lending/margin/e-mode/index.d.ts.map +1 -1
- package/dist/lending/margin/loop/types.d.ts +11 -7
- package/dist/lending/margin/loop/types.d.ts.map +1 -1
- package/dist/lending/margin/loop/utils.d.ts.map +1 -1
- package/dist/lending/public-data/addresses/compoundV2.d.ts.map +1 -1
- package/dist/lending/public-data/compound-v2/convert/benqi.d.ts +47 -0
- package/dist/lending/public-data/compound-v2/convert/benqi.d.ts.map +1 -0
- package/dist/lending/public-data/compound-v2/convert/tectonic.d.ts +45 -0
- package/dist/lending/public-data/compound-v2/convert/tectonic.d.ts.map +1 -0
- package/dist/lending/public-data/compound-v2/getters/benqi.d.ts +62 -0
- package/dist/lending/public-data/compound-v2/getters/benqi.d.ts.map +1 -0
- package/dist/lending/public-data/compound-v2/getters/tectonic.d.ts +42 -0
- package/dist/lending/public-data/compound-v2/getters/tectonic.d.ts.map +1 -0
- package/dist/lending/public-data/compound-v2/publicCallBuild.d.ts +383 -0
- package/dist/lending/public-data/compound-v2/publicCallBuild.d.ts.map +1 -1
- package/dist/lending/public-data/compound-v2/publicCallParse.d.ts.map +1 -1
- package/dist/lending/user-data/aave-v2-type/userCallParse.d.ts.map +1 -1
- package/dist/lending/user-data/aave-v3-type/userCallParse.d.ts.map +1 -1
- package/dist/lending/user-data/aave-v3-type/userCallParseYldr.d.ts.map +1 -1
- package/dist/lending/user-data/abis.d.ts +3558 -3558
- package/dist/lending/user-data/compound-v2/userCallBuild.d.ts.map +1 -1
- package/dist/lending/user-data/compound-v2/userCallParse.d.ts.map +1 -1
- package/dist/lending/user-data/compound-v3/userCallParse.d.ts.map +1 -1
- package/dist/lending/user-data/fetch-balances/e2e.d.ts +44 -0
- package/dist/lending/user-data/fetch-balances/e2e.d.ts.map +1 -0
- package/dist/lending/user-data/fetch-balances/index.d.ts +5 -0
- package/dist/lending/user-data/fetch-balances/index.d.ts.map +1 -0
- package/dist/lending/user-data/fetch-balances/parse.d.ts +14 -0
- package/dist/lending/user-data/fetch-balances/parse.d.ts.map +1 -0
- package/dist/lending/user-data/fetch-balances/prepare.d.ts +2 -0
- package/dist/lending/user-data/fetch-balances/prepare.d.ts.map +1 -0
- package/dist/lending/user-data/fetch-balances/types.d.ts +91 -0
- package/dist/lending/user-data/fetch-balances/types.d.ts.map +1 -0
- package/dist/lending/user-data/fetchUserData.d.ts.map +1 -1
- package/dist/lending/user-data/index.d.ts +2 -1
- package/dist/lending/user-data/index.d.ts.map +1 -1
- package/dist/lending/user-data/init/userCallParse.d.ts.map +1 -1
- package/dist/lending/user-data/morpho/userCallParse.d.ts.map +1 -1
- package/dist/lending/user-data/summary/types.d.ts +1 -1
- package/dist/lending/user-data/summary/types.d.ts.map +1 -1
- package/dist/lending/user-data/summary/utils.d.ts +1 -1
- package/dist/lending/user-data/summary/utils.d.ts.map +1 -1
- package/dist/lending/user-data/utils/createGeneralUserState.d.ts.map +1 -1
- package/dist/lending/user-data/utils/createMultiAccountStyleUserState.d.ts.map +1 -1
- package/dist/lending/user-data/utils/createSumerUserState.d.ts.map +1 -1
- package/dist/lending/user-data/utils/index.d.ts +1 -0
- package/dist/lending/user-data/utils/index.d.ts.map +1 -1
- package/dist/lending/user-data/utils/oraclePrice.d.ts +11 -0
- package/dist/lending/user-data/utils/oraclePrice.d.ts.map +1 -0
- package/dist/lending/user-data/utils/types.d.ts +6 -1
- package/dist/lending/user-data/utils/types.d.ts.map +1 -1
- package/dist/lending/user-data/with-permissions/e2e.d.ts +10 -0
- package/dist/lending/user-data/with-permissions/e2e.d.ts.map +1 -0
- package/dist/lending/user-data/with-permissions/evaluate.d.ts +29 -0
- package/dist/lending/user-data/with-permissions/evaluate.d.ts.map +1 -0
- package/dist/lending/user-data/with-permissions/index.d.ts +6 -0
- package/dist/lending/user-data/with-permissions/index.d.ts.map +1 -0
- package/dist/lending/user-data/with-permissions/parse.d.ts +9 -0
- package/dist/lending/user-data/with-permissions/parse.d.ts.map +1 -0
- package/dist/lending/user-data/with-permissions/prepare.d.ts +14 -0
- package/dist/lending/user-data/with-permissions/prepare.d.ts.map +1 -0
- package/dist/lending/user-data/with-permissions/types.d.ts +71 -0
- package/dist/lending/user-data/with-permissions/types.d.ts.map +1 -0
- package/dist/types/lenderTypes.d.ts +3 -0
- package/dist/types/lenderTypes.d.ts.map +1 -1
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/parsing.d.ts.map +1 -1
- package/dist/yields/fetchGeneralYields.d.ts.map +1 -1
- package/dist/yields/fetchers/maple.d.ts +3 -0
- package/dist/yields/fetchers/maple.d.ts.map +1 -0
- package/package.json +6 -6
- package/dist/lending/margin/sumer/borrow.d.ts.map +0 -1
- package/dist/lending/margin/sumer/deposit.d.ts.map +0 -1
- package/dist/lending/margin/sumer/index.d.ts.map +0 -1
- package/dist/lending/margin/sumer/repay.d.ts.map +0 -1
- package/dist/lending/margin/sumer/types.d.ts.map +0 -1
- package/dist/lending/margin/sumer/waterfall.d.ts.map +0 -1
- package/dist/lending/margin/sumer/withdraw.d.ts.map +0 -1
- /package/dist/lending/margin/{sumer → base/sumer}/index.d.ts +0 -0
package/dist/lending/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { getLenderPublicData, getMorphoTypeMarketConverter, } from './public-data/fetchLender';
|
|
2
2
|
export { getLenderPublicDataViaApi } from './public-data/fetchLenderExt';
|
|
3
3
|
export { getLenderPublicDataAll } from './public-data/fetchLenderAll';
|
|
4
|
-
export { getLenderUserDataResult, convertLenderUserDataResult, prepareLenderUserDataRpcCalls, type PreparedUserDataRpcCalls, getLenderUserDataMulti, type ChainQuery, type ProviderOptions, type BaseLendingPosition, type BasicReserveResponse, type AprData, type BalanceData, type UserConfig, type UserData, MORPHO_LENS, buildMorphoTypeUserCallWithLens, decodePackedMorphoUserDataset, decodePackedListaUserDataset, buildSummaries, buildPortfolioTotals, fuseLenderData, filterActiveLenders, type PortfolioTotals, type PortfolioSummary, type LenderSummary, type LenderDataEntry, type ChainSummary, type SubAccountSummary, type UserDataResult, calculateWeightedAverage, calculateNetApr, calculateLeverage, calculateOverallNetApr, } from './user-data';
|
|
4
|
+
export { getLenderUserDataResult, convertLenderUserDataResult, prepareLenderUserDataRpcCalls, type PreparedUserDataRpcCalls, prepareMergedRpcCalls, parseMergedResult, type PreparedMergedRpcCalls, type MergedUserData, type PermissionParams, prepareMergedMulticallParams, type PreparedMergedMulticallParams, getMergedUserData, needsLenderApproval, needsTokenApproval, type TokenApprovalParams, type TokenApprovalMeta, getLenderUserDataMulti, type ChainQuery, type ProviderOptions, type BaseLendingPosition, type BasicReserveResponse, type AprData, type BalanceData, type UserConfig, type UserData, MORPHO_LENS, buildMorphoTypeUserCallWithLens, decodePackedMorphoUserDataset, decodePackedListaUserDataset, buildSummaries, buildPortfolioTotals, fuseLenderData, filterActiveLenders, type PortfolioTotals, type PortfolioSummary, type LenderSummary, type LenderDataEntry, type ChainSummary, type SubAccountSummary, type UserDataResult, calculateWeightedAverage, calculateNetApr, calculateLeverage, calculateOverallNetApr, } from './user-data';
|
|
5
5
|
export { decodeMarkets, decodeListaMarkets, normalizeToBytes, buildMorphoTypeCall, } from './public-data/morpho';
|
|
6
6
|
export * from './margin/base';
|
|
7
7
|
export * from './margin/loop';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lending/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,4BAA4B,GAC7B,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAA;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AACrE,OAAO,EACL,uBAAuB,EACvB,2BAA2B,EAC3B,6BAA6B,EAC7B,KAAK,wBAAwB,EAC7B,sBAAsB,EACtB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,WAAW,EACX,+BAA+B,EAC/B,6BAA6B,EAC7B,4BAA4B,EAE5B,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,mBAAmB,EAEnB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EAEnB,wBAAwB,EACxB,eAAe,EACf,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,sBAAsB,CAAA;AAC7B,cAAc,eAAe,CAAA;AAC7B,cAAc,eAAe,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lending/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,4BAA4B,GAC7B,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAA;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AACrE,OAAO,EACL,uBAAuB,EACvB,2BAA2B,EAC3B,6BAA6B,EAC7B,KAAK,wBAAwB,EAC7B,qBAAqB,EACrB,iBAAiB,EACjB,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,4BAA4B,EAC5B,KAAK,6BAA6B,EAClC,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,sBAAsB,EACtB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,WAAW,EACX,+BAA+B,EAC/B,6BAA6B,EAC7B,4BAA4B,EAE5B,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,mBAAmB,EAEnB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EAEnB,wBAAwB,EACxB,eAAe,EACf,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,sBAAsB,CAAA;AAC7B,cAAc,eAAe,CAAA;AAC7B,cAAc,eAAe,CAAA"}
|
|
@@ -1,10 +1,24 @@
|
|
|
1
1
|
import type { BalanceData, AprData, LenderConfigMap, PostTradeMetrics } from './utils';
|
|
2
2
|
import type { LenderYields } from '../../../types/lenderTypes';
|
|
3
|
+
import type { SumerPositionInput } from './sumer/types';
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
+
* Unified borrow operation for all lending protocols.
|
|
5
6
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
7
|
+
* Routes to the appropriate implementation based on the lender type:
|
|
8
|
+
* - Sumer: Uses waterfall absorption model
|
|
9
|
+
* - Standard: Uses standard collateral factor model (Aave, Compound, Venus, etc.)
|
|
10
|
+
*
|
|
11
|
+
* @param lender - The lender protocol identifier (e.g., 'AAVE_V3', 'SUMER')
|
|
12
|
+
* @param amount - The token amount to borrow
|
|
13
|
+
* @param price - The USD price of the token
|
|
14
|
+
* @param balanceData - Current balance state
|
|
15
|
+
* @param config - (Standard only) Lender configuration map
|
|
16
|
+
* @param modeId - (Standard only) Mode/category ID
|
|
17
|
+
* @param targetMarketUid - (Sumer only) Target market UID
|
|
18
|
+
* @param positions - (Sumer only) Array of all Sumer positions
|
|
19
|
+
* @param apr - Optional current APR data
|
|
20
|
+
* @param yieldParams - Optional yield parameters for APR calculation
|
|
21
|
+
* @param irMode - Interest rate mode (1=stable, 2=variable)
|
|
8
22
|
*/
|
|
9
|
-
export declare function computeBorrowDelta(amount: number, price: number, balanceData: BalanceData, config
|
|
23
|
+
export declare function computeBorrowDelta(lender: string, amount: number, price: number, balanceData: BalanceData, config?: LenderConfigMap, modeId?: number, apr?: AprData, yieldParams?: LenderYields, irMode?: number, targetMarketUid?: string, positions?: SumerPositionInput[]): PostTradeMetrics;
|
|
10
24
|
//# sourceMappingURL=borrow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"borrow.d.ts","sourceRoot":"","sources":["../../../../src/lending/margin/base/borrow.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"borrow.d.ts","sourceRoot":"","sources":["../../../../src/lending/margin/base/borrow.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AACtF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAIvD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,WAAW,EACxB,MAAM,CAAC,EAAE,eAAe,EACxB,MAAM,CAAC,EAAE,MAAM,EACf,GAAG,CAAC,EAAE,OAAO,EACb,WAAW,CAAC,EAAE,YAAY,EAC1B,MAAM,CAAC,EAAE,MAAM,EAEf,eAAe,CAAC,EAAE,MAAM,EACxB,SAAS,CAAC,EAAE,kBAAkB,EAAE,GAC/B,gBAAgB,CA+BlB"}
|
|
@@ -1,10 +1,24 @@
|
|
|
1
1
|
import type { BalanceData, AprData, LenderConfigMap, PostTradeMetrics } from './utils';
|
|
2
2
|
import type { LenderYields } from '../../../types/lenderTypes';
|
|
3
|
+
import type { SumerPositionInput } from './sumer/types';
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
+
* Unified deposit operation for all lending protocols.
|
|
5
6
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
7
|
+
* Routes to the appropriate implementation based on the lender type:
|
|
8
|
+
* - Sumer: Uses waterfall absorption model
|
|
9
|
+
* - Standard: Uses standard collateral factor model (Aave, Compound, Venus, etc.)
|
|
10
|
+
*
|
|
11
|
+
* @param lender - The lender protocol identifier (e.g., 'AAVE_V3', 'SUMER')
|
|
12
|
+
* @param amount - The token amount to deposit
|
|
13
|
+
* @param price - The USD price of the token
|
|
14
|
+
* @param balanceData - Current balance state
|
|
15
|
+
* @param config - (Standard only) Lender configuration map
|
|
16
|
+
* @param modeId - (Standard only) Mode/category ID
|
|
17
|
+
* @param targetMarketUid - (Sumer only) Target market UID
|
|
18
|
+
* @param positions - (Sumer only) Array of all Sumer positions
|
|
19
|
+
* @param createNewSubAccount - Whether to create a new sub-account
|
|
20
|
+
* @param apr - Optional current APR data
|
|
21
|
+
* @param yieldParams - Optional yield parameters for APR calculation
|
|
8
22
|
*/
|
|
9
|
-
export declare function computeDepositDelta(amount: number, price: number, balanceData: BalanceData, config
|
|
23
|
+
export declare function computeDepositDelta(lender: string, amount: number, price: number, balanceData: BalanceData, config?: LenderConfigMap, modeId?: number, createNewSubAccount?: boolean, apr?: AprData, yieldParams?: LenderYields, targetMarketUid?: string, positions?: SumerPositionInput[]): PostTradeMetrics;
|
|
10
24
|
//# sourceMappingURL=deposit.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deposit.d.ts","sourceRoot":"","sources":["../../../../src/lending/margin/base/deposit.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deposit.d.ts","sourceRoot":"","sources":["../../../../src/lending/margin/base/deposit.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AACtF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAIvD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,WAAW,EACxB,MAAM,CAAC,EAAE,eAAe,EACxB,MAAM,CAAC,EAAE,MAAM,EACf,mBAAmB,CAAC,EAAE,OAAO,EAC7B,GAAG,CAAC,EAAE,OAAO,EACb,WAAW,CAAC,EAAE,YAAY,EAE1B,eAAe,CAAC,EAAE,MAAM,EACxB,SAAS,CAAC,EAAE,kBAAkB,EAAE,GAC/B,gBAAgB,CA+BlB"}
|
|
@@ -3,5 +3,8 @@ export { computeWithdrawDelta } from './withdraw';
|
|
|
3
3
|
export { computeBorrowDelta } from './borrow';
|
|
4
4
|
export { computeRepayDelta } from './repay';
|
|
5
5
|
export { getHealthFactor, getBorrowCapacity, getAssetConfig, computePostTradeMetrics, EMPTY_BALANCE, } from './utils';
|
|
6
|
+
export * as StandardMargin from './standard/deposit';
|
|
7
|
+
export * as SumerMargin from './sumer/deposit';
|
|
6
8
|
export type { BalanceData, AprData, LenderConfigData, LenderConfigMap, PostTradeMetrics } from './utils';
|
|
9
|
+
export type { SumerPositionInput, GroupAccumulator } from './sumer/types';
|
|
7
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lending/margin/base/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lending/margin/base/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAA;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAG3C,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,uBAAuB,EACvB,aAAa,GACd,MAAM,SAAS,CAAA;AAGhB,OAAO,KAAK,cAAc,MAAM,oBAAoB,CAAA;AACpD,OAAO,KAAK,WAAW,MAAM,iBAAiB,CAAA;AAG9C,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AACxG,YAAY,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -1,10 +1,24 @@
|
|
|
1
1
|
import type { BalanceData, AprData, LenderConfigMap, PostTradeMetrics } from './utils';
|
|
2
2
|
import type { LenderYields } from '../../../types/lenderTypes';
|
|
3
|
+
import type { SumerPositionInput } from './sumer/types';
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
+
* Unified repay operation for all lending protocols.
|
|
5
6
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
7
|
+
* Routes to the appropriate implementation based on the lender type:
|
|
8
|
+
* - Sumer: Uses waterfall absorption model
|
|
9
|
+
* - Standard: Uses standard collateral factor model (Aave, Compound, Venus, etc.)
|
|
10
|
+
*
|
|
11
|
+
* @param lender - The lender protocol identifier (e.g., 'AAVE_V3', 'SUMER')
|
|
12
|
+
* @param amount - The token amount to repay
|
|
13
|
+
* @param price - The USD price of the token
|
|
14
|
+
* @param balanceData - Current balance state
|
|
15
|
+
* @param config - (Standard only) Lender configuration map
|
|
16
|
+
* @param modeId - (Standard only) Mode/category ID
|
|
17
|
+
* @param targetMarketUid - (Sumer only) Target market UID
|
|
18
|
+
* @param positions - (Sumer only) Array of all Sumer positions
|
|
19
|
+
* @param apr - Optional current APR data
|
|
20
|
+
* @param yieldParams - Optional yield parameters for APR calculation
|
|
21
|
+
* @param irMode - Interest rate mode (1=stable, 2=variable)
|
|
8
22
|
*/
|
|
9
|
-
export declare function computeRepayDelta(amount: number, price: number, balanceData: BalanceData, config
|
|
23
|
+
export declare function computeRepayDelta(lender: string, amount: number, price: number, balanceData: BalanceData, config?: LenderConfigMap, modeId?: number, apr?: AprData, yieldParams?: LenderYields, irMode?: number, targetMarketUid?: string, positions?: SumerPositionInput[]): PostTradeMetrics;
|
|
10
24
|
//# sourceMappingURL=repay.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repay.d.ts","sourceRoot":"","sources":["../../../../src/lending/margin/base/repay.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"repay.d.ts","sourceRoot":"","sources":["../../../../src/lending/margin/base/repay.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AACtF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAIvD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,WAAW,EACxB,MAAM,CAAC,EAAE,eAAe,EACxB,MAAM,CAAC,EAAE,MAAM,EACf,GAAG,CAAC,EAAE,OAAO,EACb,WAAW,CAAC,EAAE,YAAY,EAC1B,MAAM,CAAC,EAAE,MAAM,EAEf,eAAe,CAAC,EAAE,MAAM,EACxB,SAAS,CAAC,EAAE,kBAAkB,EAAE,GAC/B,gBAAgB,CA+BlB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BalanceData, AprData, LenderConfigMap, PostTradeMetrics } from '../utils';
|
|
2
|
+
import type { LenderYields } from '../../../../types/lenderTypes';
|
|
3
|
+
/**
|
|
4
|
+
* Compute the post-trade balance metrics for a borrow operation.
|
|
5
|
+
*
|
|
6
|
+
* A borrow increases debt, adjustedDebt, and decreases nav.
|
|
7
|
+
* When `apr` and `yieldParams` are provided, also computes `aprDataPost`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function computeBorrowDelta(amount: number, price: number, balanceData: BalanceData, config: LenderConfigMap, modeId: number, apr?: AprData, yieldParams?: LenderYields, irMode?: number): PostTradeMetrics;
|
|
10
|
+
//# sourceMappingURL=borrow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"borrow.d.ts","sourceRoot":"","sources":["../../../../../src/lending/margin/base/standard/borrow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAEvF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAGjE;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,MAAM,EACd,GAAG,CAAC,EAAE,OAAO,EACb,WAAW,CAAC,EAAE,YAAY,EAC1B,MAAM,CAAC,EAAE,MAAM,GACd,gBAAgB,CAqClB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BalanceData, AprData, LenderConfigMap, PostTradeMetrics } from '../utils';
|
|
2
|
+
import type { LenderYields } from '../../../../types/lenderTypes';
|
|
3
|
+
/**
|
|
4
|
+
* Compute the post-trade balance metrics for a deposit operation.
|
|
5
|
+
*
|
|
6
|
+
* A deposit increases collateral, borrowDiscountedCollateral, deposits, and nav.
|
|
7
|
+
* When `apr` and `yieldParams` are provided, also computes `aprDataPost`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function computeDepositDelta(amount: number, price: number, balanceData: BalanceData, config: LenderConfigMap, modeId: number, createNewSubAccount?: boolean, apr?: AprData, yieldParams?: LenderYields): PostTradeMetrics;
|
|
10
|
+
//# sourceMappingURL=deposit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deposit.d.ts","sourceRoot":"","sources":["../../../../../src/lending/margin/base/standard/deposit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAEvF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAGjE;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,MAAM,EACd,mBAAmB,UAAQ,EAC3B,GAAG,CAAC,EAAE,OAAO,EACb,WAAW,CAAC,EAAE,YAAY,GACzB,gBAAgB,CAuClB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BalanceData, AprData, LenderConfigMap, PostTradeMetrics } from '../utils';
|
|
2
|
+
import type { LenderYields } from '../../../../types/lenderTypes';
|
|
3
|
+
/**
|
|
4
|
+
* Compute the post-trade balance metrics for a repay operation.
|
|
5
|
+
*
|
|
6
|
+
* A repay decreases debt and adjustedDebt, and increases nav.
|
|
7
|
+
* When `apr` and `yieldParams` are provided, also computes `aprDataPost`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function computeRepayDelta(amount: number, price: number, balanceData: BalanceData, config: LenderConfigMap, modeId: number, apr?: AprData, yieldParams?: LenderYields, irMode?: number): PostTradeMetrics;
|
|
10
|
+
//# sourceMappingURL=repay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repay.d.ts","sourceRoot":"","sources":["../../../../../src/lending/margin/base/standard/repay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAEvF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAGjE;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,MAAM,EACd,GAAG,CAAC,EAAE,OAAO,EACb,WAAW,CAAC,EAAE,YAAY,EAC1B,MAAM,CAAC,EAAE,MAAM,GACd,gBAAgB,CAqClB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BalanceData, AprData, LenderConfigMap, PostTradeMetrics } from '../utils';
|
|
2
|
+
import type { LenderYields } from '../../../../types/lenderTypes';
|
|
3
|
+
/**
|
|
4
|
+
* Compute the post-trade balance metrics for a withdraw operation.
|
|
5
|
+
*
|
|
6
|
+
* A withdrawal decreases collateral, borrowDiscountedCollateral, deposits, and nav.
|
|
7
|
+
* When `apr` and `yieldParams` are provided, also computes `aprDataPost`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function computeWithdrawDelta(amount: number, price: number, balanceData: BalanceData, config: LenderConfigMap, modeId: number, apr?: AprData, yieldParams?: LenderYields): PostTradeMetrics;
|
|
10
|
+
//# sourceMappingURL=withdraw.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withdraw.d.ts","sourceRoot":"","sources":["../../../../../src/lending/margin/base/standard/withdraw.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAEvF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAGjE;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,MAAM,EACd,GAAG,CAAC,EAAE,OAAO,EACb,WAAW,CAAC,EAAE,YAAY,GACzB,gBAAgB,CAsClB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { BalanceData, AprData, PostTradeMetrics } from '../
|
|
2
|
-
import type { LenderYields } from '
|
|
1
|
+
import type { BalanceData, AprData, PostTradeMetrics } from '../utils';
|
|
2
|
+
import type { LenderYields } from '../../../../types/lenderTypes';
|
|
3
3
|
import type { SumerPositionInput } from './types';
|
|
4
4
|
/**
|
|
5
5
|
* Compute post-trade balance metrics for a Sumer borrow operation.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"borrow.d.ts","sourceRoot":"","sources":["../../../../../src/lending/margin/base/sumer/borrow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAajD;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,eAAe,EAAE,MAAM,EACvB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,kBAAkB,EAAE,EAC/B,GAAG,CAAC,EAAE,OAAO,EACb,WAAW,CAAC,EAAE,YAAY,EAC1B,MAAM,CAAC,EAAE,MAAM,GACd,gBAAgB,CA6ElB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { BalanceData, AprData, PostTradeMetrics } from '../
|
|
2
|
-
import type { LenderYields } from '
|
|
1
|
+
import type { BalanceData, AprData, PostTradeMetrics } from '../utils';
|
|
2
|
+
import type { LenderYields } from '../../../../types/lenderTypes';
|
|
3
3
|
import type { SumerPositionInput } from './types';
|
|
4
4
|
/**
|
|
5
5
|
* Compute post-trade balance metrics for a Sumer deposit operation.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deposit.d.ts","sourceRoot":"","sources":["../../../../../src/lending/margin/base/sumer/deposit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAajD;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,eAAe,EAAE,MAAM,EACvB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,kBAAkB,EAAE,EAC/B,mBAAmB,UAAQ,EAC3B,GAAG,CAAC,EAAE,OAAO,EACb,WAAW,CAAC,EAAE,YAAY,GACzB,gBAAgB,CA0ElB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lending/margin/base/sumer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AACpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAA;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAChD,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,aAAa,CAAA;AACpB,YAAY,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { BalanceData, AprData, PostTradeMetrics } from '../
|
|
2
|
-
import type { LenderYields } from '
|
|
1
|
+
import type { BalanceData, AprData, PostTradeMetrics } from '../utils';
|
|
2
|
+
import type { LenderYields } from '../../../../types/lenderTypes';
|
|
3
3
|
import type { SumerPositionInput } from './types';
|
|
4
4
|
/**
|
|
5
5
|
* Compute post-trade balance metrics for a Sumer repay operation.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repay.d.ts","sourceRoot":"","sources":["../../../../../src/lending/margin/base/sumer/repay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAajD;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,eAAe,EAAE,MAAM,EACvB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,kBAAkB,EAAE,EAC/B,GAAG,CAAC,EAAE,OAAO,EACb,WAAW,CAAC,EAAE,YAAY,EAC1B,MAAM,CAAC,EAAE,MAAM,GACd,gBAAgB,CA6ElB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lending/margin/base/sumer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAErE,YAAY,EAAE,eAAe,EAAE,CAAA;AAE/B;;;;;;;;GAQG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,aAAa,EAAE,MAAM,CAAA;IACrB,iBAAiB,EAAE,OAAO,CAAA;IAC1B,SAAS,EAAE,eAAe,CAAA;IAC1B,gBAAgB,EAAE,OAAO,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG,MAAM,CACnC,MAAM,EACN;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAC7D,CAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { SumerMarketMeta } from '
|
|
2
|
-
import type { SumerPositionInput, GroupAccumulator } from './types';
|
|
1
|
+
import type { SumerPositionInput, GroupAccumulator, SumerMarketMeta } from './types';
|
|
3
2
|
/**
|
|
4
3
|
* Sumer absorption waterfall: computes total effective collateral in USD.
|
|
5
4
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"waterfall.d.ts","sourceRoot":"","sources":["../../../../../src/lending/margin/base/sumer/waterfall.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EAChB,MAAM,SAAS,CAAA;AAEhB;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,eAAe,EAAE,EACzB,KAAK,EAAE,gBAAgB,GACtB,MAAM,CAiDR;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,kBAAkB,EAAE,GAAG;IACvE,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;IAC9C,MAAM,EAAE,gBAAgB,CAAA;IACxB,SAAS,EAAE,gBAAgB,CAAA;CAC5B,CAgCA;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,kBAAkB,EAAE,EAC/B,eAAe,EAAE,MAAM,EACvB,gBAAgB,EAAE,MAAM,EACxB,YAAY,EAAE,MAAM,EACpB,kBAAkB,EAAE,MAAM,GACzB,kBAAkB,EAAE,CAUtB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { BalanceData, AprData, PostTradeMetrics } from '../
|
|
2
|
-
import type { LenderYields } from '
|
|
1
|
+
import type { BalanceData, AprData, PostTradeMetrics } from '../utils';
|
|
2
|
+
import type { LenderYields } from '../../../../types/lenderTypes';
|
|
3
3
|
import type { SumerPositionInput } from './types';
|
|
4
4
|
/**
|
|
5
5
|
* Compute post-trade balance metrics for a Sumer withdraw operation.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withdraw.d.ts","sourceRoot":"","sources":["../../../../../src/lending/margin/base/sumer/withdraw.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAajD;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,eAAe,EAAE,MAAM,EACvB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,kBAAkB,EAAE,EAC/B,GAAG,CAAC,EAAE,OAAO,EACb,WAAW,CAAC,EAAE,YAAY,GACzB,gBAAgB,CAyElB"}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import type { LenderConfigData, LenderConfigMap } from '../../../types/lenderTypes';
|
|
2
|
-
import type { BalanceData, AprData } from '../../user-data/
|
|
2
|
+
import type { BalanceData, AprData } from '../../user-data/fetch-balances/types';
|
|
3
3
|
export type { BalanceData, AprData, LenderConfigData, LenderConfigMap };
|
|
4
4
|
export interface PostTradeMetrics {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
pre: {
|
|
6
|
+
healthFactor: number;
|
|
7
|
+
borrowCapacity: number;
|
|
8
|
+
};
|
|
9
|
+
post: {
|
|
10
|
+
healthFactor: number;
|
|
11
|
+
borrowCapacity: number;
|
|
12
|
+
balanceData: BalanceData;
|
|
13
|
+
aprData?: AprData;
|
|
14
|
+
};
|
|
11
15
|
}
|
|
12
16
|
export declare const EMPTY_BALANCE: BalanceData;
|
|
13
17
|
export declare function getHealthFactor(collateral: number, adjustedDebt: number): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/lending/margin/base/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AACnF,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/lending/margin/base/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AACnF,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAA;AAEhF,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,CAAA;AAEvE,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE;QACH,YAAY,EAAE,MAAM,CAAA;QACpB,cAAc,EAAE,MAAM,CAAA;KACvB,CAAA;IACD,IAAI,EAAE;QACJ,YAAY,EAAE,MAAM,CAAA;QACpB,cAAc,EAAE,MAAM,CAAA;QACtB,WAAW,EAAE,WAAW,CAAA;QACxB,OAAO,CAAC,EAAE,OAAO,CAAA;KAClB,CAAA;CACF;AAED,eAAO,MAAM,aAAa,EAAE,WAa3B,CAAA;AAID,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAIhF;AAED,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,WAAW,GAAG,MAAM,CAEzD;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,GAAG,gBAAgB,CAMxF;AAED,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,WAAW,GACrB,gBAAgB,CAkBlB"}
|
|
@@ -1,10 +1,23 @@
|
|
|
1
1
|
import type { BalanceData, AprData, LenderConfigMap, PostTradeMetrics } from './utils';
|
|
2
2
|
import type { LenderYields } from '../../../types/lenderTypes';
|
|
3
|
+
import type { SumerPositionInput } from './sumer/types';
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
+
* Unified withdraw operation for all lending protocols.
|
|
5
6
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
7
|
+
* Routes to the appropriate implementation based on the lender type:
|
|
8
|
+
* - Sumer: Uses waterfall absorption model
|
|
9
|
+
* - Standard: Uses standard collateral factor model (Aave, Compound, Venus, etc.)
|
|
10
|
+
*
|
|
11
|
+
* @param lender - The lender protocol identifier (e.g., 'AAVE_V3', 'SUMER')
|
|
12
|
+
* @param amount - The token amount to withdraw
|
|
13
|
+
* @param price - The USD price of the token
|
|
14
|
+
* @param balanceData - Current balance state
|
|
15
|
+
* @param config - (Standard only) Lender configuration map
|
|
16
|
+
* @param modeId - (Standard only) Mode/category ID
|
|
17
|
+
* @param targetMarketUid - (Sumer only) Target market UID
|
|
18
|
+
* @param positions - (Sumer only) Array of all Sumer positions
|
|
19
|
+
* @param apr - Optional current APR data
|
|
20
|
+
* @param yieldParams - Optional yield parameters for APR calculation
|
|
8
21
|
*/
|
|
9
|
-
export declare function computeWithdrawDelta(amount: number, price: number, balanceData: BalanceData, config
|
|
22
|
+
export declare function computeWithdrawDelta(lender: string, amount: number, price: number, balanceData: BalanceData, config?: LenderConfigMap, modeId?: number, apr?: AprData, yieldParams?: LenderYields, targetMarketUid?: string, positions?: SumerPositionInput[]): PostTradeMetrics;
|
|
10
23
|
//# sourceMappingURL=withdraw.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withdraw.d.ts","sourceRoot":"","sources":["../../../../src/lending/margin/base/withdraw.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"withdraw.d.ts","sourceRoot":"","sources":["../../../../src/lending/margin/base/withdraw.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AACtF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAIvD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,WAAW,EACxB,MAAM,CAAC,EAAE,eAAe,EACxB,MAAM,CAAC,EAAE,MAAM,EACf,GAAG,CAAC,EAAE,OAAO,EACb,WAAW,CAAC,EAAE,YAAY,EAE1B,eAAe,CAAC,EAAE,MAAM,EACxB,SAAS,CAAC,EAAE,kBAAkB,EAAE,GAC/B,gBAAgB,CA6BlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lending/margin/e-mode/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC/D,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,6BAA6B,CAAA;AAEpC,MAAM,WAAW,WAAW;IAC1B,qDAAqD;IACrD,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,qDAAqD;IACrD,MAAM,EAAE,MAAM,EAAE,CAAA;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,8CAA8C;IAC9C,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,eAAe,EAAE,WAAW,CAAA;IAC5B,oEAAoE;IACpE,SAAS,EAAE,OAAO,CAAA;CACnB;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lending/margin/e-mode/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC/D,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,6BAA6B,CAAA;AAEpC,MAAM,WAAW,WAAW;IAC1B,qDAAqD;IACrD,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,qDAAqD;IACrD,MAAM,EAAE,MAAM,EAAE,CAAA;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,8CAA8C;IAC9C,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,eAAe,EAAE,WAAW,CAAA;IAC5B,oEAAoE;IACpE,SAAS,EAAE,OAAO,CAAA;CACnB;AAqGD;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,qBAAqB,EACjC,UAAU,EAAE,mBAAmB,EAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,GAC/B,WAAW,EAAE,CA+Bf;AAED,eAAO,MAAM,OAAO,GAAI,IAAI,MAAM,WAKjC,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BalanceData, AprData } from '../../user-data/
|
|
1
|
+
import type { BalanceData, AprData } from '../../user-data/fetch-balances/types';
|
|
2
2
|
import type { BaseYields, RewardsMap } from '../../../types/apiReturnType';
|
|
3
3
|
export type { BalanceData, AprData, BaseYields, RewardsMap };
|
|
4
4
|
/**
|
|
@@ -18,11 +18,15 @@ export interface LenderYields extends BaseYields {
|
|
|
18
18
|
rewards?: RewardsMap;
|
|
19
19
|
}
|
|
20
20
|
export interface LoopPostTradeMetrics {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
pre: {
|
|
22
|
+
healthFactor: number;
|
|
23
|
+
borrowCapacity: number;
|
|
24
|
+
};
|
|
25
|
+
post: {
|
|
26
|
+
healthFactor: number;
|
|
27
|
+
borrowCapacity: number;
|
|
28
|
+
balanceData: BalanceData;
|
|
29
|
+
aprData: AprData;
|
|
30
|
+
};
|
|
27
31
|
}
|
|
28
32
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lending/margin/loop/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lending/margin/loop/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAA;AAChF,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AAE1E,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,CAAA;AAE5D;;GAEG;AACH,oBAAY,WAAW;IACrB,IAAI,IAAI;IACR,MAAM,IAAI;IACV,QAAQ,IAAI;CACb;AAED;;;GAGG;AACH,MAAM,WAAW,YAAa,SAAQ,UAAU;IAC9C,cAAc,EAAE,MAAM,CAAA;IACtB,OAAO,CAAC,EAAE,UAAU,CAAA;CACrB;AAED,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE;QACH,YAAY,EAAE,MAAM,CAAA;QACpB,cAAc,EAAE,MAAM,CAAA;KACvB,CAAA;IACD,IAAI,EAAE;QACJ,YAAY,EAAE,MAAM,CAAA;QACpB,cAAc,EAAE,MAAM,CAAA;QACtB,WAAW,EAAE,WAAW,CAAA;QACxB,OAAO,EAAE,OAAO,CAAA;KACjB,CAAA;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/lending/margin/loop/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAEzE,eAAO,MAAM,YAAY,GAAI,GAAG,MAAM,WAAoB,CAAA;AAE1D,wBAAgB,KAAK,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,SAAW,UAEhE;AAED,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAIhF;AAED,4CAA4C;AAC5C,wBAAgB,YAAY,CAAC,CAAC,EAC5B,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,SAAS,EAChC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,SAAS,GAC/B,MAAM,EAAE,CAKV;AAED,gDAAgD;AAChD,wBAAgB,UAAU,CACxB,OAAO,EAAE,WAAW,EACpB,GAAG,EAAE,OAAO,GACX,oBAAoB,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/lending/margin/loop/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAEzE,eAAO,MAAM,YAAY,GAAI,GAAG,MAAM,WAAoB,CAAA;AAE1D,wBAAgB,KAAK,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,SAAW,UAEhE;AAED,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAIhF;AAED,4CAA4C;AAC5C,wBAAgB,YAAY,CAAC,CAAC,EAC5B,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,SAAS,EAChC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,SAAS,GAC/B,MAAM,EAAE,CAKV;AAED,gDAAgD;AAChD,wBAAgB,UAAU,CACxB,OAAO,EAAE,WAAW,EACpB,GAAG,EAAE,OAAO,GACX,oBAAoB,CAOtB;AAED,sEAAsE;AACtE,wBAAgB,eAAe,CAC7B,OAAO,EAAE,WAAW,EACpB,UAAU,EAAE,WAAW,EACvB,GAAG,EAAE,OAAO,EACZ,MAAM,EAAE,OAAO,EACf,YAAY,UAAQ,GACnB,oBAAoB,CAoBtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compoundV2.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/addresses/compoundV2.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,eAAe,+CAA+C,CAAA;
|
|
1
|
+
{"version":3,"file":"compoundV2.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/addresses/compoundV2.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,eAAe,+CAA+C,CAAA;AAiD3E,eAAO,MAAM,gBAAgB,EAAE;IAC7B,CAAC,IAAI,EAAE,MAAM,GAAG;QAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;CAc5C,CAAA;AAED,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,MAAM,EACf,MAAM,GAAE,MAAqB,GAC5B,MAAM,GAAG,SAAS,CAEpB;AAED,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,MAAM,EACf,MAAM,GAAE,MAAqB,GAC5B;IAAE,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAE/B;AAED,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,MAAM,EACf,MAAM,GAAE,MAAqB,GAC5B,MAAM,EAAE,CAEV;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,UAGhE;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EACf,MAAM,GAAE,MAAqB,GAC5B;IACD,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;CACnB,EAAE,CAEF"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { BenqiMarketMetadata } from '../getters/benqi';
|
|
2
|
+
import { ConvertEntryOpts } from './types';
|
|
3
|
+
export declare function convertBenqiEntry(opts: ConvertEntryOpts & {
|
|
4
|
+
chainId: string;
|
|
5
|
+
parsed: BenqiMarketMetadata;
|
|
6
|
+
}): {
|
|
7
|
+
marketUid: string;
|
|
8
|
+
poolId: any;
|
|
9
|
+
asset: any;
|
|
10
|
+
depositRate: number;
|
|
11
|
+
variableBorrowRate: number;
|
|
12
|
+
stableBorrowRate: number;
|
|
13
|
+
totalLiquidity: number;
|
|
14
|
+
totalLiquidityUSD: number;
|
|
15
|
+
totalDebt: number;
|
|
16
|
+
totalDebtUSD: number;
|
|
17
|
+
totalDeposits: number;
|
|
18
|
+
totalDepositsUSD: number;
|
|
19
|
+
totalDebtStable: number;
|
|
20
|
+
totalDebtStableUSD: number;
|
|
21
|
+
intrinsicYield: number;
|
|
22
|
+
config: {
|
|
23
|
+
0: {
|
|
24
|
+
category: number;
|
|
25
|
+
borrowCollateralFactor: number;
|
|
26
|
+
collateralFactor: number;
|
|
27
|
+
borrowFactor: number;
|
|
28
|
+
collateralDisabled: boolean;
|
|
29
|
+
debtDisabled: boolean;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
hasStable: boolean;
|
|
33
|
+
underlying: any;
|
|
34
|
+
isActive: boolean;
|
|
35
|
+
isFrozen: boolean;
|
|
36
|
+
rewards: {};
|
|
37
|
+
collateralActive: boolean;
|
|
38
|
+
borrowingEnabled: boolean;
|
|
39
|
+
params: {
|
|
40
|
+
metadata: {
|
|
41
|
+
cToken: string;
|
|
42
|
+
exchangeRate: string;
|
|
43
|
+
cTokenDecimals: number;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=benqi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"benqi.d.ts","sourceRoot":"","sources":["../../../../../src/lending/public-data/compound-v2/convert/benqi.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAiB,MAAM,kBAAkB,CAAA;AACrE,OAAO,EAA6B,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAKrE,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,gBAAgB,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,mBAAmB,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwE1E"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ConvertEntryOpts } from './types';
|
|
2
|
+
export declare function convertTectonicEntry(opts: ConvertEntryOpts & {
|
|
3
|
+
chainId: string;
|
|
4
|
+
}): {
|
|
5
|
+
marketUid: string;
|
|
6
|
+
poolId: any;
|
|
7
|
+
asset: any;
|
|
8
|
+
depositRate: number;
|
|
9
|
+
variableBorrowRate: number;
|
|
10
|
+
stableBorrowRate: number;
|
|
11
|
+
totalLiquidity: number;
|
|
12
|
+
totalLiquidityUSD: number;
|
|
13
|
+
totalDebt: number;
|
|
14
|
+
totalDebtUSD: number;
|
|
15
|
+
totalDeposits: number;
|
|
16
|
+
totalDepositsUSD: number;
|
|
17
|
+
totalDebtStable: number;
|
|
18
|
+
totalDebtStableUSD: number;
|
|
19
|
+
intrinsicYield: number;
|
|
20
|
+
config: {
|
|
21
|
+
0: {
|
|
22
|
+
category: number;
|
|
23
|
+
borrowCollateralFactor: number;
|
|
24
|
+
collateralFactor: number;
|
|
25
|
+
borrowFactor: number;
|
|
26
|
+
collateralDisabled: boolean;
|
|
27
|
+
debtDisabled: boolean;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
hasStable: boolean;
|
|
31
|
+
underlying: any;
|
|
32
|
+
isActive: boolean;
|
|
33
|
+
isFrozen: boolean;
|
|
34
|
+
rewards: {};
|
|
35
|
+
collateralActive: boolean;
|
|
36
|
+
borrowingEnabled: boolean;
|
|
37
|
+
params: {
|
|
38
|
+
metadata: {
|
|
39
|
+
cToken: string;
|
|
40
|
+
exchangeRate: string;
|
|
41
|
+
cTokenDecimals: number;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=tectonic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tectonic.d.ts","sourceRoot":"","sources":["../../../../../src/lending/public-data/compound-v2/convert/tectonic.ts"],"names":[],"mappings":"AAOA,OAAO,EAGL,gBAAgB,EACjB,MAAM,SAAS,CAAA;AAKhB,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,gBAAgB,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4E7C"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/** Parsed underlying Token sub-struct */
|
|
2
|
+
export interface BenqiToken {
|
|
3
|
+
token: string;
|
|
4
|
+
decimals: number;
|
|
5
|
+
symbol: string;
|
|
6
|
+
name: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Shared parsed shape for both regular BENQI and ecosystem MarketMetadata.
|
|
10
|
+
* Fields that only exist on one variant are optional.
|
|
11
|
+
*/
|
|
12
|
+
export interface BenqiMarketMetadata {
|
|
13
|
+
market: string;
|
|
14
|
+
supplyRate: bigint;
|
|
15
|
+
borrowRate: bigint;
|
|
16
|
+
price: bigint;
|
|
17
|
+
exchangeRate: bigint;
|
|
18
|
+
reserveFactor: bigint;
|
|
19
|
+
borrowCap: bigint;
|
|
20
|
+
supplyCap: bigint;
|
|
21
|
+
totalSupply: bigint;
|
|
22
|
+
totalUnderlyingSupply: bigint;
|
|
23
|
+
totalBorrows: bigint;
|
|
24
|
+
collateralFactor: bigint;
|
|
25
|
+
underlying: BenqiToken;
|
|
26
|
+
qiTokenDecimals: number;
|
|
27
|
+
totalReserves: bigint;
|
|
28
|
+
cash: bigint;
|
|
29
|
+
mintPaused: boolean;
|
|
30
|
+
borrowPaused: boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Parse regular BENQI MarketMetadata struct.
|
|
34
|
+
*
|
|
35
|
+
* Struct order: market(0), supplyRate(1), borrowRate(2), price(3),
|
|
36
|
+
* exchangeRate(4), reserveFactor(5), borrowCap(6), totalSupply(7),
|
|
37
|
+
* totalUnderlyingSupply(8), totalBorrows(9), collateralFactor(10),
|
|
38
|
+
* underlying(11), qiTokenDecimals(12), avaxSupplyRewardSpeed(13),
|
|
39
|
+
* avaxBorrowRewardSpeed(14), qiSupplyRewardSpeed(15), qiBorrowRewardSpeed(16),
|
|
40
|
+
* totalReserves(17), cash(18), mintPaused(19), borrowPaused(20)
|
|
41
|
+
*/
|
|
42
|
+
export declare function parseBenqiMarketMetadata(input: any): BenqiMarketMetadata;
|
|
43
|
+
/**
|
|
44
|
+
* Parse ecosystem BENQI MarketMetadata struct.
|
|
45
|
+
*
|
|
46
|
+
* Struct order: market(0), supplyRate(1), borrowRate(2), price(3),
|
|
47
|
+
* exchangeRate(4), reserveFactor(5), borrowCap(6), supplyCap(7),
|
|
48
|
+
* totalSupply(8), totalUnderlyingSupply(9), totalBorrows(10),
|
|
49
|
+
* collateralFactor(11), underlying(12), qiTokenDecimals(13),
|
|
50
|
+
* totalReserves(14), cash(15), mintPaused(16), borrowPaused(17),
|
|
51
|
+
* rewards(18)
|
|
52
|
+
*/
|
|
53
|
+
export declare function parseBenqiEcoMarketMetadata(input: any): BenqiMarketMetadata;
|
|
54
|
+
/**
|
|
55
|
+
* Returns deposit APR and borrow APR (percentages) for one BENQI market.
|
|
56
|
+
* Rates are per-block; uses chain block time via TimeScale.BLOCK (same as Venus).
|
|
57
|
+
*/
|
|
58
|
+
export declare function getBenqiRates(info: BenqiMarketMetadata, chainId: string): {
|
|
59
|
+
depositRate: number;
|
|
60
|
+
variableBorrowRate: number;
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=benqi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"benqi.d.ts","sourceRoot":"","sources":["../../../../../src/lending/public-data/compound-v2/getters/benqi.ts"],"names":[],"mappings":"AAMA,yCAAyC;AACzC,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;IACrB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,qBAAqB,EAAE,MAAM,CAAA;IAC7B,YAAY,EAAE,MAAM,CAAA;IACpB,gBAAgB,EAAE,MAAM,CAAA;IACxB,UAAU,EAAE,UAAU,CAAA;IACtB,eAAe,EAAE,MAAM,CAAA;IACvB,aAAa,EAAE,MAAM,CAAA;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,OAAO,CAAA;IACnB,YAAY,EAAE,OAAO,CAAA;CACtB;AAqCD;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,GAAG,GAAG,mBAAmB,CAqBxE;AAED;;;;;;;;;GASG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,GAAG,GAAG,mBAAmB,CAuB3E;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM;;;EAevE"}
|