@gearbox-protocol/sdk 13.3.0-next.2 → 13.3.0
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/cjs/common-utils/charts/credit-manager-payload.js +16 -0
- package/dist/cjs/common-utils/charts/credit-manager.js +134 -0
- package/dist/cjs/common-utils/charts/credit-session.js +257 -0
- package/dist/cjs/common-utils/charts/credit-sessions-payload.js +16 -0
- package/dist/cjs/common-utils/charts/graph-payload.js +16 -0
- package/dist/cjs/common-utils/charts/index.js +36 -0
- package/dist/cjs/common-utils/charts/pool-payload.js +16 -0
- package/dist/cjs/common-utils/charts/pool.js +199 -0
- package/dist/cjs/common-utils/charts/token-data.js +91 -0
- package/dist/cjs/common-utils/index.js +4 -0
- package/dist/cjs/common-utils/static/index.js +28 -0
- package/dist/cjs/common-utils/static/migration-config.js +16 -0
- package/dist/cjs/common-utils/static/pool-config.js +16 -0
- package/dist/cjs/common-utils/static/strategy.js +16 -0
- package/dist/cjs/common-utils/static/trading-pair.js +16 -0
- package/dist/cjs/common-utils/utils/{assetsMath.js → assets-math.js} +13 -13
- package/dist/cjs/common-utils/utils/{bigintMath.js → bigint-math.js} +3 -3
- package/dist/cjs/common-utils/utils/creditAccount/{calcHealthFactor.js → calc-health-factor.js} +9 -9
- package/dist/cjs/common-utils/utils/creditAccount/{calcOverallAPY.js → calc-overall-apy.js} +8 -8
- package/dist/cjs/common-utils/utils/creditAccount/{calcQuotaBorrowRate.js → calc-quota-borrow-rate.js} +3 -3
- package/dist/cjs/common-utils/utils/creditAccount/{calcRelativeBaseBorrowRate.js → calc-relative-base-borrow-rate.js} +3 -3
- package/dist/cjs/common-utils/utils/creditAccount/debt.js +4 -4
- package/dist/cjs/common-utils/utils/creditAccount/{getTimeToLiquidation.js → get-time-to-liquidation.js} +3 -3
- package/dist/cjs/common-utils/utils/creditAccount/index.js +16 -16
- package/dist/cjs/common-utils/utils/creditAccount/{liquidationPrice.js → liquidation-price.js} +3 -3
- package/dist/cjs/common-utils/utils/creditAccount/{quotaUtils.js → quota-utils.js} +8 -8
- package/dist/cjs/common-utils/utils/creditAccount/sort.js +3 -3
- package/dist/cjs/common-utils/utils/index.js +6 -8
- package/dist/cjs/common-utils/utils/{priceMath.js → price-math.js} +3 -3
- package/dist/cjs/dev/AccountOpener.js +5 -45
- package/dist/cjs/dev/index.js +0 -2
- package/dist/cjs/plugins/zappers/ZappersPlugin.js +144 -0
- package/dist/cjs/{sdk/market/ZapperRegister.js → plugins/zappers/extraZappers.js} +6 -110
- package/dist/cjs/plugins/zappers/index.js +26 -0
- package/dist/cjs/plugins/zappers/package.json +1 -0
- package/dist/cjs/rewards/apy/index.js +24 -0
- package/dist/cjs/rewards/apy/output-details.js +16 -0
- package/dist/cjs/rewards/apy/output.js +16 -0
- package/dist/cjs/rewards/index.js +24 -0
- package/dist/cjs/rewards/package.json +1 -0
- package/dist/cjs/rewards/rewards/api.js +226 -0
- package/dist/cjs/rewards/rewards/apy.js +177 -0
- package/dist/cjs/rewards/rewards/common.js +16 -0
- package/dist/cjs/rewards/rewards/extra-apy.js +132 -0
- package/dist/cjs/rewards/rewards/index.js +28 -0
- package/dist/cjs/rewards/rewards/merkl-api.js +52 -0
- package/dist/cjs/sdk/accounts/AbstractCreditAccountsService.js +104 -462
- package/dist/cjs/sdk/accounts/CreditAccountsServiceV310.js +5 -16
- package/dist/cjs/sdk/base/ChainContractsRegister.js +1 -1
- package/dist/cjs/sdk/base/TokensMeta.js +32 -255
- package/dist/cjs/sdk/base/index.js +0 -2
- package/dist/cjs/sdk/chain/chains.js +1 -2
- package/dist/cjs/sdk/constants/index.js +2 -0
- package/dist/cjs/sdk/{base/token-types.js → constants/phantom-tokens.js} +3 -9
- package/dist/cjs/sdk/market/MarketRegister.js +2 -2
- package/dist/cjs/sdk/market/MarketSuite.js +0 -6
- package/dist/cjs/sdk/market/index.js +1 -3
- package/dist/cjs/sdk/market/pool/PoolSuite.js +0 -3
- package/dist/cjs/sdk/market/pool/PoolV310Contract.js +2 -17
- package/dist/cjs/sdk/market/pool/index.js +0 -4
- package/dist/cjs/sdk/pools/AbstractPoolService.js +137 -0
- package/dist/cjs/{abi/iStateSerializer.js → sdk/pools/PoolServiceV310.js} +8 -14
- package/dist/cjs/sdk/pools/createPoolService.js +35 -0
- package/dist/cjs/sdk/pools/index.js +4 -2
- package/dist/cjs/sdk/utils/AddressMap.js +1 -1
- package/dist/cjs/sdk/utils/viem/sendRawTx.js +0 -16
- package/dist/esm/common-utils/charts/credit-manager.js +115 -0
- package/dist/esm/common-utils/charts/credit-session.js +233 -0
- package/dist/esm/common-utils/charts/credit-sessions-payload.js +0 -0
- package/dist/esm/common-utils/charts/graph-payload.js +0 -0
- package/dist/esm/common-utils/charts/index.js +8 -0
- package/dist/esm/common-utils/charts/pool-payload.js +0 -0
- package/dist/esm/common-utils/charts/pool.js +179 -0
- package/dist/esm/common-utils/charts/token-data.js +67 -0
- package/dist/esm/common-utils/index.js +2 -0
- package/dist/esm/common-utils/static/index.js +4 -0
- package/dist/esm/common-utils/static/migration-config.js +0 -0
- package/dist/esm/common-utils/static/pool-config.js +0 -0
- package/dist/esm/common-utils/static/strategy.js +0 -0
- package/dist/esm/common-utils/static/trading-pair.js +0 -0
- package/dist/esm/common-utils/utils/{assetsMath.js → assets-math.js} +2 -2
- package/dist/esm/common-utils/utils/creditAccount/{calcHealthFactor.js → calc-health-factor.js} +2 -2
- package/dist/esm/common-utils/utils/creditAccount/{calcOverallAPY.js → calc-overall-apy.js} +1 -1
- package/dist/esm/common-utils/utils/creditAccount/debt.js +2 -2
- package/dist/esm/common-utils/utils/creditAccount/index.js +8 -8
- package/dist/esm/common-utils/utils/creditAccount/{quotaUtils.js → quota-utils.js} +1 -1
- package/dist/esm/common-utils/utils/creditAccount/sort.js +1 -1
- package/dist/esm/common-utils/utils/index.js +3 -4
- package/dist/esm/dev/AccountOpener.js +6 -47
- package/dist/esm/dev/index.js +0 -2
- package/dist/esm/plugins/zappers/ZappersPlugin.js +126 -0
- package/dist/esm/{sdk/market/ZapperRegister.js → plugins/zappers/extraZappers.js} +2 -109
- package/dist/esm/plugins/zappers/index.js +3 -0
- package/dist/esm/plugins/zappers/package.json +1 -0
- package/dist/esm/plugins/zappers/types.js +0 -0
- package/dist/esm/rewards/apy/index.js +2 -0
- package/dist/esm/rewards/apy/output-details.js +0 -0
- package/dist/esm/rewards/apy/output.js +0 -0
- package/dist/esm/rewards/index.js +2 -0
- package/dist/esm/rewards/package.json +1 -0
- package/dist/esm/rewards/rewards/api.js +204 -0
- package/dist/esm/rewards/rewards/apy.js +160 -0
- package/dist/esm/rewards/rewards/common.js +0 -0
- package/dist/esm/rewards/rewards/extra-apy.js +101 -0
- package/dist/esm/rewards/rewards/index.js +4 -0
- package/dist/esm/rewards/rewards/merkl-api.js +18 -0
- package/dist/esm/sdk/accounts/AbstractCreditAccountsService.js +104 -462
- package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +5 -16
- package/dist/esm/sdk/base/ChainContractsRegister.js +1 -1
- package/dist/esm/sdk/base/TokensMeta.js +32 -261
- package/dist/esm/sdk/base/index.js +0 -1
- package/dist/esm/sdk/chain/chains.js +1 -2
- package/dist/esm/sdk/constants/index.js +1 -0
- package/dist/esm/sdk/{base/token-types.js → constants/phantom-tokens.js} +0 -4
- package/dist/esm/sdk/market/MarketRegister.js +2 -2
- package/dist/esm/sdk/market/MarketSuite.js +0 -6
- package/dist/esm/sdk/market/index.js +0 -1
- package/dist/esm/sdk/market/pool/PoolSuite.js +0 -3
- package/dist/esm/sdk/market/pool/PoolV310Contract.js +2 -17
- package/dist/esm/sdk/market/pool/index.js +0 -2
- package/dist/esm/sdk/pools/AbstractPoolService.js +113 -0
- package/dist/esm/sdk/pools/PoolServiceV310.js +6 -0
- package/dist/esm/sdk/pools/createPoolService.js +11 -0
- package/dist/esm/sdk/pools/index.js +2 -1
- package/dist/esm/sdk/utils/AddressMap.js +1 -1
- package/dist/esm/sdk/utils/viem/sendRawTx.js +1 -19
- package/dist/types/common-utils/charts/credit-manager-payload.d.ts +50 -0
- package/dist/types/common-utils/charts/credit-manager.d.ts +48 -0
- package/dist/types/common-utils/charts/credit-session.d.ts +111 -0
- package/dist/types/common-utils/charts/credit-sessions-payload.d.ts +111 -0
- package/dist/types/common-utils/charts/graph-payload.d.ts +10 -0
- package/dist/types/common-utils/charts/index.d.ts +8 -0
- package/dist/types/common-utils/charts/pool-payload.d.ts +111 -0
- package/dist/types/common-utils/charts/pool.d.ts +91 -0
- package/dist/types/common-utils/charts/token-data.d.ts +20 -0
- package/dist/types/common-utils/index.d.ts +2 -0
- package/dist/types/common-utils/static/index.d.ts +4 -0
- package/dist/types/common-utils/static/migration-config.d.ts +10 -0
- package/dist/types/common-utils/static/pool-config.d.ts +11 -0
- package/dist/types/common-utils/static/strategy.d.ts +78 -0
- package/dist/types/common-utils/static/trading-pair.d.ts +15 -0
- package/dist/types/common-utils/utils/creditAccount/index.d.ts +8 -8
- package/dist/types/common-utils/utils/index.d.ts +3 -4
- package/dist/types/dev/index.d.ts +1 -1
- package/dist/types/plugins/zappers/ZappersPlugin.d.ts +18 -0
- package/dist/types/plugins/zappers/extraZappers.d.ts +6 -0
- package/dist/types/plugins/zappers/index.d.ts +3 -0
- package/dist/types/plugins/zappers/types.d.ts +12 -0
- package/dist/types/rewards/apy/index.d.ts +2 -0
- package/dist/types/rewards/apy/output-details.d.ts +97 -0
- package/dist/types/rewards/apy/output.d.ts +22 -0
- package/dist/types/rewards/index.d.ts +2 -0
- package/dist/types/rewards/rewards/api.d.ts +49 -0
- package/dist/types/rewards/rewards/apy.d.ts +41 -0
- package/dist/types/rewards/rewards/common.d.ts +16 -0
- package/dist/types/rewards/rewards/extra-apy.d.ts +30 -0
- package/dist/types/rewards/rewards/index.d.ts +4 -0
- package/dist/types/rewards/rewards/merkl-api.d.ts +45 -0
- package/dist/types/sdk/accounts/AbstractCreditAccountsService.d.ts +27 -123
- package/dist/types/sdk/accounts/CreditAccountsServiceV310.d.ts +1 -1
- package/dist/types/sdk/accounts/types.d.ts +8 -108
- package/dist/types/sdk/base/TokensMeta.d.ts +18 -34
- package/dist/types/sdk/base/index.d.ts +0 -1
- package/dist/types/sdk/base/types.d.ts +1 -0
- package/dist/types/sdk/chain/chains.d.ts +1 -1
- package/dist/types/sdk/constants/index.d.ts +1 -0
- package/dist/types/sdk/constants/phantom-tokens.d.ts +2 -0
- package/dist/types/sdk/market/MarketRegister.d.ts +2 -2
- package/dist/types/sdk/market/MarketSuite.d.ts +0 -3
- package/dist/types/sdk/market/index.d.ts +0 -1
- package/dist/types/sdk/market/pool/PoolSuite.d.ts +0 -2
- package/dist/types/sdk/market/pool/PoolV310Contract.d.ts +2 -6
- package/dist/types/sdk/market/pool/index.d.ts +0 -2
- package/dist/types/sdk/pools/AbstractPoolService.d.ts +9 -0
- package/dist/types/sdk/pools/PoolServiceV310.d.ts +4 -0
- package/dist/types/sdk/pools/createPoolService.d.ts +3 -0
- package/dist/types/sdk/pools/index.d.ts +2 -1
- package/dist/types/sdk/pools/types.d.ts +63 -84
- package/dist/types/sdk/utils/AddressMap.d.ts +1 -1
- package/dist/types/sdk/utils/viem/sendRawTx.d.ts +1 -5
- package/package.json +6 -1
- package/dist/cjs/abi/310/iSecuritizeDegenNFT.js +0 -263
- package/dist/cjs/abi/310/iSecuritizeKYCFactory.js +0 -278
- package/dist/cjs/common-utils/utils/endpoints.js +0 -65
- package/dist/cjs/sdk/market/pool/SecuritizeKYCFactory.js +0 -97
- package/dist/cjs/sdk/pools/PoolService.js +0 -391
- package/dist/esm/abi/310/iSecuritizeDegenNFT.js +0 -239
- package/dist/esm/abi/310/iSecuritizeKYCFactory.js +0 -254
- package/dist/esm/abi/iStateSerializer.js +0 -12
- package/dist/esm/common-utils/utils/endpoints.js +0 -41
- package/dist/esm/sdk/market/pool/SecuritizeKYCFactory.js +0 -73
- package/dist/esm/sdk/pools/PoolService.js +0 -371
- package/dist/types/abi/310/iSecuritizeDegenNFT.d.ts +0 -324
- package/dist/types/abi/310/iSecuritizeKYCFactory.d.ts +0 -322
- package/dist/types/abi/iStateSerializer.d.ts +0 -11
- package/dist/types/common-utils/utils/endpoints.d.ts +0 -27
- package/dist/types/sdk/base/token-types.d.ts +0 -33
- package/dist/types/sdk/market/ZapperRegister.d.ts +0 -17
- package/dist/types/sdk/market/pool/SecuritizeKYCFactory.d.ts +0 -345
- package/dist/types/sdk/market/types.d.ts +0 -10
- package/dist/types/sdk/pools/PoolService.d.ts +0 -14
- /package/dist/cjs/{sdk/market → plugins/zappers}/types.js +0 -0
- /package/dist/esm/{sdk/market/types.js → common-utils/charts/credit-manager-payload.js} +0 -0
- /package/dist/esm/common-utils/utils/{bigintMath.js → bigint-math.js} +0 -0
- /package/dist/esm/common-utils/utils/creditAccount/{calcQuotaBorrowRate.js → calc-quota-borrow-rate.js} +0 -0
- /package/dist/esm/common-utils/utils/creditAccount/{calcRelativeBaseBorrowRate.js → calc-relative-base-borrow-rate.js} +0 -0
- /package/dist/esm/common-utils/utils/creditAccount/{getTimeToLiquidation.js → get-time-to-liquidation.js} +0 -0
- /package/dist/esm/common-utils/utils/creditAccount/{liquidationPrice.js → liquidation-price.js} +0 -0
- /package/dist/esm/common-utils/utils/{priceMath.js → price-math.js} +0 -0
- /package/dist/types/common-utils/utils/{assetsMath.d.ts → assets-math.d.ts} +0 -0
- /package/dist/types/common-utils/utils/{bigintMath.d.ts → bigint-math.d.ts} +0 -0
- /package/dist/types/common-utils/utils/creditAccount/{calcHealthFactor.d.ts → calc-health-factor.d.ts} +0 -0
- /package/dist/types/common-utils/utils/creditAccount/{calcOverallAPY.d.ts → calc-overall-apy.d.ts} +0 -0
- /package/dist/types/common-utils/utils/creditAccount/{calcQuotaBorrowRate.d.ts → calc-quota-borrow-rate.d.ts} +0 -0
- /package/dist/types/common-utils/utils/creditAccount/{calcRelativeBaseBorrowRate.d.ts → calc-relative-base-borrow-rate.d.ts} +0 -0
- /package/dist/types/common-utils/utils/creditAccount/{getTimeToLiquidation.d.ts → get-time-to-liquidation.d.ts} +0 -0
- /package/dist/types/common-utils/utils/creditAccount/{liquidationPrice.d.ts → liquidation-price.d.ts} +0 -0
- /package/dist/types/common-utils/utils/creditAccount/{quotaUtils.d.ts → quota-utils.d.ts} +0 -0
- /package/dist/types/common-utils/utils/{priceMath.d.ts → price-math.d.ts} +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { isV310 } from "../constants/index.js";
|
|
2
|
+
import { PoolServiceV310 } from "./PoolServiceV310.js";
|
|
3
|
+
function createPoolService(sdk, version) {
|
|
4
|
+
if (isV310(version)) {
|
|
5
|
+
return new PoolServiceV310(sdk, version);
|
|
6
|
+
}
|
|
7
|
+
throw new Error(`Unsupported Pool Service version ${version}`);
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
createPoolService
|
|
11
|
+
};
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
estimateGas,
|
|
3
|
-
sendTransaction
|
|
4
|
-
} from "viem/actions";
|
|
1
|
+
import { sendTransaction } from "viem/actions";
|
|
5
2
|
import { getAction } from "viem/utils";
|
|
6
3
|
async function sendRawTx(client, params) {
|
|
7
4
|
const { tx, ...rest } = params;
|
|
@@ -16,21 +13,6 @@ async function sendRawTx(client, params) {
|
|
|
16
13
|
value: BigInt(tx.value)
|
|
17
14
|
});
|
|
18
15
|
}
|
|
19
|
-
async function estimateRawTxGas(client, params) {
|
|
20
|
-
const { tx, ...rest } = params;
|
|
21
|
-
return getAction(
|
|
22
|
-
client,
|
|
23
|
-
estimateGas,
|
|
24
|
-
"estimateGas"
|
|
25
|
-
)({
|
|
26
|
-
...rest,
|
|
27
|
-
account: params.account,
|
|
28
|
-
data: tx.callData,
|
|
29
|
-
to: tx.to,
|
|
30
|
-
value: BigInt(tx.value)
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
16
|
export {
|
|
34
|
-
estimateRawTxGas,
|
|
35
17
|
sendRawTx
|
|
36
18
|
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Address } from "viem";
|
|
2
|
+
export type BigNumberish = bigint | number | string;
|
|
3
|
+
export interface ChartsCreditManagerPayload {
|
|
4
|
+
addr: Address;
|
|
5
|
+
underlyingToken: Address;
|
|
6
|
+
configurator: Address;
|
|
7
|
+
creditFacade: Address;
|
|
8
|
+
isWeth: boolean;
|
|
9
|
+
poolAddress: Address;
|
|
10
|
+
name: string;
|
|
11
|
+
maxAmount: BigNumberish;
|
|
12
|
+
minAmount: BigNumberish;
|
|
13
|
+
maxLeverageFactor: number;
|
|
14
|
+
version: number;
|
|
15
|
+
feeInterest: number;
|
|
16
|
+
feeLiquidation: number;
|
|
17
|
+
feeLiquidationExpired: number;
|
|
18
|
+
liquidationPremium: number;
|
|
19
|
+
liquidationPremiumExpired: number;
|
|
20
|
+
borrowRate: BigNumberish;
|
|
21
|
+
borrowRateOld: BigNumberish;
|
|
22
|
+
borrowRate10kBasis: number;
|
|
23
|
+
availableLiquidity: BigNumberish;
|
|
24
|
+
availableLiquidityInUSD: number;
|
|
25
|
+
totalBorrowed: BigNumberish;
|
|
26
|
+
totalBorrowedInUSD: number;
|
|
27
|
+
totalBorrowedBIOld: BigNumberish;
|
|
28
|
+
totalBorrowedBI10kBasis: number;
|
|
29
|
+
totalProfit: BigNumberish;
|
|
30
|
+
totalProfitInUSD: number;
|
|
31
|
+
totalProfitOld: BigNumberish;
|
|
32
|
+
pnl10kBasis: number;
|
|
33
|
+
totalRepaid: BigNumberish;
|
|
34
|
+
totalRepaidInUSD: number;
|
|
35
|
+
totalLosses: BigNumberish;
|
|
36
|
+
totalLossesOld: BigNumberish;
|
|
37
|
+
totalLossesInUSD: number;
|
|
38
|
+
totalOpenedAccounts: number;
|
|
39
|
+
totalOpenedAccountsChange: number;
|
|
40
|
+
openedAccountsCount: number;
|
|
41
|
+
openedAccountsCountChange: number;
|
|
42
|
+
totalLiquidatedAccounts: number;
|
|
43
|
+
totalLiquidatedAccountsChange: number;
|
|
44
|
+
totalClosedAccounts: number;
|
|
45
|
+
totalClosedAccountsChange: number;
|
|
46
|
+
totalRepaidAccounts: number;
|
|
47
|
+
liquidityThresholds: Record<Address, number>;
|
|
48
|
+
totalDebtLimit: BigNumberish;
|
|
49
|
+
market: Address;
|
|
50
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { Address } from "viem";
|
|
2
|
+
import type { ChartsCreditManagerPayload } from "./credit-manager-payload.js";
|
|
3
|
+
export declare class ChartsCreditManagerData {
|
|
4
|
+
readonly address: Address;
|
|
5
|
+
readonly underlyingToken: Address;
|
|
6
|
+
readonly configurator: Address;
|
|
7
|
+
readonly creditFacade: Address;
|
|
8
|
+
readonly pool: Address;
|
|
9
|
+
readonly version: number;
|
|
10
|
+
readonly name: string;
|
|
11
|
+
readonly marketConfigurator: Address;
|
|
12
|
+
readonly borrowRate: number;
|
|
13
|
+
readonly borrowRateOld: number;
|
|
14
|
+
readonly borrowRateChange: number;
|
|
15
|
+
readonly minAmount: bigint;
|
|
16
|
+
readonly maxAmount: bigint;
|
|
17
|
+
readonly maxLeverageFactor: number;
|
|
18
|
+
readonly availableLiquidity: bigint;
|
|
19
|
+
readonly feeInterest: number;
|
|
20
|
+
readonly feeLiquidation: number;
|
|
21
|
+
readonly feeLiquidationExpired: number;
|
|
22
|
+
readonly openedAccountsCount: number;
|
|
23
|
+
readonly totalOpenedAccounts: number;
|
|
24
|
+
readonly totalClosedAccounts: number;
|
|
25
|
+
readonly totalRepaidAccounts: number;
|
|
26
|
+
readonly totalLiquidatedAccounts: number;
|
|
27
|
+
readonly totalBorrowed: bigint;
|
|
28
|
+
readonly totalBorrowedOld: bigint;
|
|
29
|
+
readonly totalBorrowedChange: number;
|
|
30
|
+
readonly totalDebtLimit: bigint;
|
|
31
|
+
readonly totalRepaid: bigint;
|
|
32
|
+
readonly totalProfit: bigint;
|
|
33
|
+
readonly totalProfitOld: bigint;
|
|
34
|
+
readonly pnlChange: number;
|
|
35
|
+
readonly totalLosses: bigint;
|
|
36
|
+
readonly totalLossesOld: bigint;
|
|
37
|
+
readonly totalBorrowedInUSD: number;
|
|
38
|
+
readonly totalLossesInUSD: number;
|
|
39
|
+
readonly totalProfitInUSD: number;
|
|
40
|
+
readonly totalRepaidInUSD: number;
|
|
41
|
+
readonly availableLiquidityInUSD: number;
|
|
42
|
+
readonly openedAccountsCountChange: number;
|
|
43
|
+
readonly totalOpenedAccountsChange: number;
|
|
44
|
+
readonly totalClosedAccountsChange: number;
|
|
45
|
+
readonly totalLiquidatedAccountsChange: number;
|
|
46
|
+
readonly liquidationThresholds: Record<string, bigint>;
|
|
47
|
+
constructor(payload: ChartsCreditManagerPayload);
|
|
48
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import type { Address } from "viem";
|
|
2
|
+
import type { AssetWithView } from "../utils/assets-math.js";
|
|
3
|
+
import type { CreditSessionFilteredPayload, CreditSessionPayload, CreditSessionsAggregatedStatsPayload, SecondaryStatus, UserCreditSessionsAggregatedStatsPayload } from "./credit-sessions-payload.js";
|
|
4
|
+
export interface CreditSessionAsset extends AssetWithView {
|
|
5
|
+
ind: number;
|
|
6
|
+
isForbidden: boolean;
|
|
7
|
+
isEnabled: boolean;
|
|
8
|
+
quota: bigint;
|
|
9
|
+
quotaIndexLU: bigint;
|
|
10
|
+
isQuoted: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface CreditSessionReward extends AssetWithView {
|
|
13
|
+
pool: Address;
|
|
14
|
+
}
|
|
15
|
+
export type CreditSessionStatus = "active" | "closed" | "repaid" | "liquidated" | "liquidateExpired" | "liquidatePaused";
|
|
16
|
+
export declare const CREDIT_SESSION_STATUS_BY_ID: Record<number, CreditSessionStatus>;
|
|
17
|
+
export declare const CREDIT_SESSION_ID_BY_STATUS: Record<CreditSessionStatus, number>;
|
|
18
|
+
export declare class CreditSession {
|
|
19
|
+
readonly id: string;
|
|
20
|
+
readonly status: CreditSessionStatus;
|
|
21
|
+
readonly borrower: Address;
|
|
22
|
+
readonly creditManager: Address;
|
|
23
|
+
readonly account: Address;
|
|
24
|
+
readonly underlyingToken: Address;
|
|
25
|
+
readonly version: number;
|
|
26
|
+
readonly since: number;
|
|
27
|
+
readonly closedAt: number;
|
|
28
|
+
readonly initialAmount: bigint;
|
|
29
|
+
readonly borrowedAmount: bigint;
|
|
30
|
+
readonly totalValue: bigint;
|
|
31
|
+
readonly healthFactor: number;
|
|
32
|
+
readonly profitInUSD: number;
|
|
33
|
+
readonly profitInUnderlying: number;
|
|
34
|
+
readonly collateralInUSD: number;
|
|
35
|
+
readonly collateralInUnderlying: number;
|
|
36
|
+
readonly roi: number;
|
|
37
|
+
readonly apy: number;
|
|
38
|
+
readonly currentBlock: number;
|
|
39
|
+
readonly currentTimestamp: number;
|
|
40
|
+
readonly baseBorrowAPY7DAverage: number;
|
|
41
|
+
readonly baseBorrowAPY_RAY: bigint;
|
|
42
|
+
readonly baseToken: Address;
|
|
43
|
+
readonly pool: Address;
|
|
44
|
+
readonly entryPrice: number;
|
|
45
|
+
readonly closePrice: number;
|
|
46
|
+
readonly quoteToken: Address;
|
|
47
|
+
readonly tradingToken: Address;
|
|
48
|
+
readonly sinceTimestamp: number;
|
|
49
|
+
readonly closedAtTimestamp: number;
|
|
50
|
+
readonly borrowAPY_RAY: bigint;
|
|
51
|
+
readonly borrowAPY7DAverage: number;
|
|
52
|
+
readonly totalValueUSD: number;
|
|
53
|
+
readonly debt: bigint;
|
|
54
|
+
readonly debtUSD: number;
|
|
55
|
+
readonly leverage: number;
|
|
56
|
+
readonly tfIndex: number;
|
|
57
|
+
readonly spotDebt: bigint;
|
|
58
|
+
readonly spotTotalValue: bigint;
|
|
59
|
+
readonly spotUserFunds: bigint;
|
|
60
|
+
readonly cvxUnclaimedRewards: Array<CreditSessionReward>;
|
|
61
|
+
readonly balances: Array<CreditSessionAsset>;
|
|
62
|
+
readonly forbiddenTokens: Record<string, true>;
|
|
63
|
+
readonly disabledTokens: Record<string, true>;
|
|
64
|
+
readonly teritaryStatus: SecondaryStatus;
|
|
65
|
+
constructor(payload: CreditSessionPayload);
|
|
66
|
+
}
|
|
67
|
+
export declare class CreditSessionFiltered {
|
|
68
|
+
readonly id: string;
|
|
69
|
+
readonly borrower: Address;
|
|
70
|
+
readonly account: Address;
|
|
71
|
+
readonly creditManager: Address;
|
|
72
|
+
readonly underlyingToken: Address;
|
|
73
|
+
readonly status: CreditSessionStatus;
|
|
74
|
+
readonly since: number;
|
|
75
|
+
readonly closedAt: number;
|
|
76
|
+
readonly sinceTimestamp: number;
|
|
77
|
+
readonly closedAtTimestamp: number;
|
|
78
|
+
readonly healthFactor: number;
|
|
79
|
+
readonly leverage: number;
|
|
80
|
+
readonly debt: bigint;
|
|
81
|
+
readonly debtUSD: number;
|
|
82
|
+
readonly totalValue: bigint;
|
|
83
|
+
readonly totalValueUSD: number;
|
|
84
|
+
readonly profitInUSD: number;
|
|
85
|
+
readonly profitInUnderlying: number;
|
|
86
|
+
readonly tfIndex: number;
|
|
87
|
+
readonly balances: Array<AssetWithView>;
|
|
88
|
+
readonly teritaryStatus: SecondaryStatus;
|
|
89
|
+
constructor(payload: CreditSessionFilteredPayload);
|
|
90
|
+
}
|
|
91
|
+
export type CreditSessionSortFields = "type" | "tvl" | "hf" | "debt" | "pnl" | "leverage" | "tfIndex";
|
|
92
|
+
export type CreditSessionSortType = "asc" | "desc";
|
|
93
|
+
export interface UserCreditSessions extends Omit<UserCreditSessionsAggregatedStatsPayload, "accounts" | "totalValue10kBasis"> {
|
|
94
|
+
totalValueChange: number;
|
|
95
|
+
accounts: Array<CreditSession>;
|
|
96
|
+
}
|
|
97
|
+
type AggregatedOmit = "healthFactor10kBasis" | "leverage10kBasis" | "activeAccounts10kBasis" | "openedAccounts10kBasis" | "healthFactor" | "healthFactorOld";
|
|
98
|
+
export type CreditSessionsAggregatedStats = Omit<CreditSessionsAggregatedStatsPayload, AggregatedOmit> & {
|
|
99
|
+
healthFactorChange: number;
|
|
100
|
+
leverageChange: number;
|
|
101
|
+
activeAccountsChange: number;
|
|
102
|
+
openedAccountsChange: number;
|
|
103
|
+
healthFactor: bigint;
|
|
104
|
+
healthFactorOld: bigint;
|
|
105
|
+
};
|
|
106
|
+
export declare class UserCreditSessionsBuilder {
|
|
107
|
+
private constructor();
|
|
108
|
+
static buildUserCreditSessions(payload: UserCreditSessionsAggregatedStatsPayload): UserCreditSessions;
|
|
109
|
+
static buildCreditSessionsAggregatedStats(payload: CreditSessionsAggregatedStatsPayload): CreditSessionsAggregatedStats;
|
|
110
|
+
}
|
|
111
|
+
export {};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import type { Address } from "viem";
|
|
2
|
+
import type { BigNumberish } from "./credit-manager-payload.js";
|
|
3
|
+
export interface CreditSessionBalancePayload {
|
|
4
|
+
BI: string;
|
|
5
|
+
F: number;
|
|
6
|
+
ind: number;
|
|
7
|
+
isForbidden: boolean;
|
|
8
|
+
isEnabled: boolean;
|
|
9
|
+
quota?: BigNumberish;
|
|
10
|
+
quotaIndexLU?: BigNumberish;
|
|
11
|
+
isQuoted?: boolean;
|
|
12
|
+
}
|
|
13
|
+
interface CreditSessionReward {
|
|
14
|
+
bi: BigNumberish;
|
|
15
|
+
f: number;
|
|
16
|
+
pool: Address;
|
|
17
|
+
symbol: string;
|
|
18
|
+
}
|
|
19
|
+
export interface SecondaryStatus {
|
|
20
|
+
secStatus: Array<[block: number, status: number]>;
|
|
21
|
+
}
|
|
22
|
+
export interface CreditSessionPayload {
|
|
23
|
+
id: string;
|
|
24
|
+
status: number;
|
|
25
|
+
borrower: Address;
|
|
26
|
+
account: Address;
|
|
27
|
+
creditManager: Address;
|
|
28
|
+
underlyingToken: Address;
|
|
29
|
+
version: number;
|
|
30
|
+
borrowAPY_RAY: BigNumberish;
|
|
31
|
+
borrowAPY7DAverage: number;
|
|
32
|
+
entryPrice?: number;
|
|
33
|
+
closePrice?: number;
|
|
34
|
+
quoteToken?: Address;
|
|
35
|
+
tradingToken?: Address;
|
|
36
|
+
healthFactor: BigNumberish;
|
|
37
|
+
leverage: number;
|
|
38
|
+
tfIndex: number;
|
|
39
|
+
initialAmount: BigNumberish;
|
|
40
|
+
collateralInUSD: number;
|
|
41
|
+
collateralInUnderlying: number;
|
|
42
|
+
spotUserFunds: BigNumberish;
|
|
43
|
+
debt: BigNumberish;
|
|
44
|
+
debtUSD: number;
|
|
45
|
+
borrowedAmount: BigNumberish;
|
|
46
|
+
spotDebt: BigNumberish;
|
|
47
|
+
totalValue: BigNumberish;
|
|
48
|
+
totalValueUSD: number;
|
|
49
|
+
spotTotalValue: BigNumberish;
|
|
50
|
+
since: number;
|
|
51
|
+
sinceTimestamp: number;
|
|
52
|
+
closedAt: number;
|
|
53
|
+
closedAtTimestamp: number;
|
|
54
|
+
profitInUSD: number;
|
|
55
|
+
profitInUnderlying: number;
|
|
56
|
+
apy: number;
|
|
57
|
+
roi: number;
|
|
58
|
+
currentBlock: number;
|
|
59
|
+
currentTimestamp: number;
|
|
60
|
+
cvxUnclaimedRewards: Record<Address, CreditSessionReward>;
|
|
61
|
+
balances: Record<Address, CreditSessionBalancePayload>;
|
|
62
|
+
baseBorrowAPY7DAverage: number;
|
|
63
|
+
baseBorrowAPY_RAY: string;
|
|
64
|
+
baseToken: Address;
|
|
65
|
+
pool: Address;
|
|
66
|
+
teritaryStatus: null | SecondaryStatus;
|
|
67
|
+
}
|
|
68
|
+
export interface CreditSessionFilteredPayload {
|
|
69
|
+
balances: Record<Address, CreditSessionBalancePayload>;
|
|
70
|
+
id: string;
|
|
71
|
+
borrower: Address;
|
|
72
|
+
account: Address;
|
|
73
|
+
creditManager: Address;
|
|
74
|
+
underlyingToken: Address;
|
|
75
|
+
status: number;
|
|
76
|
+
closedAt: number;
|
|
77
|
+
since: number;
|
|
78
|
+
healthFactor: BigNumberish;
|
|
79
|
+
leverage: number;
|
|
80
|
+
debt: BigNumberish;
|
|
81
|
+
debtUSD: number;
|
|
82
|
+
totalValue: BigNumberish;
|
|
83
|
+
totalValueUSD: number;
|
|
84
|
+
pnl: number;
|
|
85
|
+
pnlUSD: number;
|
|
86
|
+
tfIndex: number;
|
|
87
|
+
closedAtTimestamp: number;
|
|
88
|
+
sinceTimestamp: number;
|
|
89
|
+
teritaryStatus: null | SecondaryStatus;
|
|
90
|
+
}
|
|
91
|
+
export interface CreditSessionsAggregatedStatsPayload {
|
|
92
|
+
healthFactor: BigNumberish;
|
|
93
|
+
healthFactorOld: BigNumberish;
|
|
94
|
+
healthFactor10kBasis: number;
|
|
95
|
+
leverage: number;
|
|
96
|
+
leverageOld: number;
|
|
97
|
+
leverage10kBasis: number;
|
|
98
|
+
activeAccounts: number;
|
|
99
|
+
activeAccountsOld: number;
|
|
100
|
+
activeAccounts10kBasis: number;
|
|
101
|
+
openedAccounts: number;
|
|
102
|
+
openedAccountsOld: number;
|
|
103
|
+
openedAccounts10kBasis: number;
|
|
104
|
+
}
|
|
105
|
+
export interface UserCreditSessionsAggregatedStatsPayload {
|
|
106
|
+
totalValue7DInUSD: number;
|
|
107
|
+
totalValue10kBasis: number;
|
|
108
|
+
totalValueInUSD: number;
|
|
109
|
+
accounts: Array<CreditSessionPayload>;
|
|
110
|
+
}
|
|
111
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./credit-manager.js";
|
|
2
|
+
export * from "./credit-manager-payload.js";
|
|
3
|
+
export * from "./credit-session.js";
|
|
4
|
+
export * from "./credit-sessions-payload.js";
|
|
5
|
+
export * from "./graph-payload.js";
|
|
6
|
+
export * from "./pool.js";
|
|
7
|
+
export * from "./pool-payload.js";
|
|
8
|
+
export * from "./token-data.js";
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import type { Address } from "viem";
|
|
2
|
+
export interface ChartsPoolDataPayload {
|
|
3
|
+
addr: Address;
|
|
4
|
+
dieselToken: Address;
|
|
5
|
+
underlyingToken: Address;
|
|
6
|
+
isWETH: boolean;
|
|
7
|
+
version: number;
|
|
8
|
+
name: string;
|
|
9
|
+
borrowAPY_RAY: string;
|
|
10
|
+
depositAPY_RAY: string;
|
|
11
|
+
dieselRate_RAY: string;
|
|
12
|
+
lmAPY: number;
|
|
13
|
+
lmRewardAll: Array<{
|
|
14
|
+
apy: number;
|
|
15
|
+
token: Address;
|
|
16
|
+
}>;
|
|
17
|
+
earned7D: number;
|
|
18
|
+
earned7DInUSD: number;
|
|
19
|
+
availableLiquidity: string;
|
|
20
|
+
availableLiquidityOld: string;
|
|
21
|
+
availableLiquidity10kBasis: number;
|
|
22
|
+
availableLiquidityInUSD: number;
|
|
23
|
+
expectedLiqWeekAgo: number;
|
|
24
|
+
expectedLiquidity: string;
|
|
25
|
+
expectedLiquidityOld: string;
|
|
26
|
+
expectedLiquidity10kBasis: number;
|
|
27
|
+
expectedLiquidityInUSD: number;
|
|
28
|
+
expectedLiquidityLimit: string;
|
|
29
|
+
expectedLiquidityLimitInUSD: number;
|
|
30
|
+
caLockedValue: number;
|
|
31
|
+
caLockedValueOld: number;
|
|
32
|
+
caLockedValue10kBasis: number;
|
|
33
|
+
caLockedValueUSD: number;
|
|
34
|
+
totalBorrowed: string;
|
|
35
|
+
totalBorrowedOld: string;
|
|
36
|
+
totalBorrowed10kBasis: number;
|
|
37
|
+
totalBorrowedInUSD: number;
|
|
38
|
+
debtWithInterest: string;
|
|
39
|
+
debtWithInterest10kBasis: number;
|
|
40
|
+
debtWithInterestInUSD: number;
|
|
41
|
+
debtWithInterestOld: string;
|
|
42
|
+
withdrawFee: number;
|
|
43
|
+
addLiqCount: number;
|
|
44
|
+
addedLiquidity: number;
|
|
45
|
+
removeLiqCount: number;
|
|
46
|
+
removedLiquidity: number;
|
|
47
|
+
depositAPY1DAverage: number;
|
|
48
|
+
depositAPY1DAverage10kBasis: number;
|
|
49
|
+
depositAPY7DAverage: number;
|
|
50
|
+
depositAPY30DAverage: number;
|
|
51
|
+
uniqueLPsOld: number;
|
|
52
|
+
uniqueLPs: number;
|
|
53
|
+
uniqueLPs10kBasis: number;
|
|
54
|
+
market: Address;
|
|
55
|
+
}
|
|
56
|
+
export interface ChartsAggregatedStats {
|
|
57
|
+
caLockedValue: number;
|
|
58
|
+
caLockedValue10kBasis: number;
|
|
59
|
+
expectedLiquidity: number;
|
|
60
|
+
expectedLiquidity10kBasis: number;
|
|
61
|
+
totalBorrowed: number;
|
|
62
|
+
totalBorrowed10kBasis: number;
|
|
63
|
+
totalValue: number;
|
|
64
|
+
totalValue10kBasis: number;
|
|
65
|
+
debtWithInterest: number;
|
|
66
|
+
debtWithInterest10kBasis: number;
|
|
67
|
+
earned7D: number;
|
|
68
|
+
uniqueLPs: number;
|
|
69
|
+
}
|
|
70
|
+
export interface ChartsAggregatedPoolPayload extends ChartsAggregatedStats {
|
|
71
|
+
pools: Array<ChartsPoolDataPayload>;
|
|
72
|
+
}
|
|
73
|
+
export interface UserPoolPayload {
|
|
74
|
+
pool: Address;
|
|
75
|
+
dieselSym: string;
|
|
76
|
+
dieselToken: Address;
|
|
77
|
+
underlyingToken: Address;
|
|
78
|
+
liqValue: string;
|
|
79
|
+
liqValueInUSD: number;
|
|
80
|
+
dieselBalance: number;
|
|
81
|
+
dieselBalanceBI: string;
|
|
82
|
+
lmRewards: string;
|
|
83
|
+
lmRewardsInUSD: number;
|
|
84
|
+
userRewards: Array<{
|
|
85
|
+
lmRewards: string;
|
|
86
|
+
lmRewardsInUSD: number;
|
|
87
|
+
pool: Address;
|
|
88
|
+
rewardToken: Address;
|
|
89
|
+
}>;
|
|
90
|
+
liqPnlInNativeToken: number;
|
|
91
|
+
liqPnlInUSD: number;
|
|
92
|
+
addedLiq: number;
|
|
93
|
+
addLiqCount: number;
|
|
94
|
+
removeLiqCount: number;
|
|
95
|
+
removedLiq: number;
|
|
96
|
+
depositAPY_RAY: string;
|
|
97
|
+
lmAPY: number;
|
|
98
|
+
lmRewardAll: Array<{
|
|
99
|
+
apy: number;
|
|
100
|
+
token: Address;
|
|
101
|
+
}>;
|
|
102
|
+
market: Address;
|
|
103
|
+
}
|
|
104
|
+
export interface UserPoolAggregatedStatsPayload {
|
|
105
|
+
totalLMRewards: number;
|
|
106
|
+
totalLiqInUSD: number;
|
|
107
|
+
totalLiqt7DInUSD: number;
|
|
108
|
+
totalLiqt10kBasis: number;
|
|
109
|
+
user: Address;
|
|
110
|
+
pools: Array<UserPoolPayload>;
|
|
111
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { Address } from "viem";
|
|
2
|
+
import type { ChartsPoolDataPayload, UserPoolPayload } from "./pool-payload.js";
|
|
3
|
+
export declare class ChartsPoolData {
|
|
4
|
+
readonly address: Address;
|
|
5
|
+
readonly underlyingToken: Address;
|
|
6
|
+
readonly dieselToken: Address;
|
|
7
|
+
readonly version: number;
|
|
8
|
+
readonly name: string;
|
|
9
|
+
readonly marketConfigurator: Address;
|
|
10
|
+
readonly addLiqCount: number;
|
|
11
|
+
readonly addedLiquidity: number;
|
|
12
|
+
readonly removeLiqCount: number;
|
|
13
|
+
readonly removedLiquidity: number;
|
|
14
|
+
readonly earned7D: number;
|
|
15
|
+
readonly earned7DInUSD: number;
|
|
16
|
+
readonly utilization: number;
|
|
17
|
+
readonly dieselRate: number;
|
|
18
|
+
readonly dieselRateRay: bigint;
|
|
19
|
+
readonly depositAPY: number;
|
|
20
|
+
readonly depositAPYRay: bigint;
|
|
21
|
+
readonly borrowAPY: number;
|
|
22
|
+
readonly borrowAPYRay: bigint;
|
|
23
|
+
readonly lmAPY: number;
|
|
24
|
+
readonly lmRewardAll: Array<{
|
|
25
|
+
apy: number;
|
|
26
|
+
token: Address;
|
|
27
|
+
}>;
|
|
28
|
+
readonly availableLiquidity: bigint;
|
|
29
|
+
readonly availableLiquidityChange: number;
|
|
30
|
+
readonly availableLiquidityInUSD: number;
|
|
31
|
+
readonly caLockedValue: number;
|
|
32
|
+
readonly caLockedValueChange: number;
|
|
33
|
+
readonly caLockedValueInUSD: number;
|
|
34
|
+
readonly expectedLiquidity: bigint;
|
|
35
|
+
readonly expectedLiquidityChange: number;
|
|
36
|
+
readonly expectedLiquidityInUSD: number;
|
|
37
|
+
readonly expectedLiqWeekAgo: number;
|
|
38
|
+
readonly expectedLiquidityLimit: bigint;
|
|
39
|
+
readonly expectedLiquidityLimitInUSD: number;
|
|
40
|
+
readonly totalBorrowed: bigint;
|
|
41
|
+
readonly totalBorrowedChange: number;
|
|
42
|
+
readonly totalBorrowedInUSD: number;
|
|
43
|
+
readonly debtWithInterest: bigint;
|
|
44
|
+
readonly debtWithInterestChange: number;
|
|
45
|
+
readonly debtWithInterestInUSD: number;
|
|
46
|
+
readonly debtWithInterestOld: bigint;
|
|
47
|
+
readonly oldAvailableLiquidity: bigint;
|
|
48
|
+
readonly oldCALockedValue: number;
|
|
49
|
+
readonly oldExpectedLiquidity: bigint;
|
|
50
|
+
readonly oldTotalBorrowed: bigint;
|
|
51
|
+
readonly withdrawFee: number;
|
|
52
|
+
readonly depositAPY1DAverage: number;
|
|
53
|
+
readonly depositAPY1DAverageChange: number;
|
|
54
|
+
readonly depositAPY7DAverage: number;
|
|
55
|
+
readonly depositAPY30DAverage: number;
|
|
56
|
+
readonly oldUniqueLPs: number;
|
|
57
|
+
readonly uniqueLPs: number;
|
|
58
|
+
readonly uniqueLPsChange: number;
|
|
59
|
+
constructor(payload: ChartsPoolDataPayload);
|
|
60
|
+
static calculateUtilization(expected: bigint, available: bigint): number;
|
|
61
|
+
}
|
|
62
|
+
export declare class UserPoolData {
|
|
63
|
+
readonly id: string;
|
|
64
|
+
readonly address: Address;
|
|
65
|
+
readonly dieselToken: Address;
|
|
66
|
+
readonly underlyingToken: Address;
|
|
67
|
+
readonly marketConfigurator: Address;
|
|
68
|
+
readonly depositAPY: number;
|
|
69
|
+
readonly depositAPYRay: bigint;
|
|
70
|
+
readonly lmRewardAll: Array<{
|
|
71
|
+
apy: number;
|
|
72
|
+
token: Address;
|
|
73
|
+
}>;
|
|
74
|
+
readonly providedLiquidity: bigint;
|
|
75
|
+
readonly providedLiquidityInUSD: number;
|
|
76
|
+
readonly dieselBalance: bigint;
|
|
77
|
+
readonly dieselBalanceInUSD: number;
|
|
78
|
+
readonly userRewards: Array<{
|
|
79
|
+
token: Address;
|
|
80
|
+
pool: Address;
|
|
81
|
+
lmRewards: bigint;
|
|
82
|
+
lmRewardsInUSD: number;
|
|
83
|
+
}>;
|
|
84
|
+
readonly pnlInNativeToken: number;
|
|
85
|
+
readonly pnlInUSD: number;
|
|
86
|
+
readonly addedLiq: number;
|
|
87
|
+
readonly addLiqCount: number;
|
|
88
|
+
readonly removeLiqCount: number;
|
|
89
|
+
readonly removedLiq: number;
|
|
90
|
+
constructor(payload: UserPoolPayload);
|
|
91
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Address } from "viem";
|
|
2
|
+
export interface TokenDataPayload {
|
|
3
|
+
addr: Address;
|
|
4
|
+
symbol: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
name: string;
|
|
7
|
+
decimals: number;
|
|
8
|
+
isPhantom: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare class TokenData {
|
|
11
|
+
readonly address: Address;
|
|
12
|
+
readonly title: string;
|
|
13
|
+
readonly symbol: string;
|
|
14
|
+
readonly name: string;
|
|
15
|
+
readonly decimals: number;
|
|
16
|
+
readonly icon: string;
|
|
17
|
+
readonly isPhantom: boolean;
|
|
18
|
+
constructor(payload: TokenDataPayload);
|
|
19
|
+
static getTokenIcon(symbol: string): string;
|
|
20
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Address } from "viem";
|
|
2
|
+
export type TokenTypePool = "eth" | "stable" | "btc" | "wbnb" | "s" | "hemiBTC" | "mon" | "somi";
|
|
3
|
+
export interface PoolConfigPayload {
|
|
4
|
+
name: string;
|
|
5
|
+
address: Address;
|
|
6
|
+
chainId: number;
|
|
7
|
+
network: string;
|
|
8
|
+
curator: string;
|
|
9
|
+
poolType: [TokenTypePool];
|
|
10
|
+
isLowInterest?: boolean;
|
|
11
|
+
}
|