@ichidao/ichi-vaults-sdk 0.0.18 → 0.0.20
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/README.md +157 -48
- package/dist/abis/types/AlgebraPool.d.ts +817 -0
- package/dist/abis/types/AlgebraPool.js +3 -0
- package/dist/abis/types/AlgebraPool.js.map +1 -0
- package/dist/abis/types/DepositGuard.d.ts +100 -13
- package/dist/abis/types/UniswapV3Pool.d.ts +771 -0
- package/dist/abis/types/UniswapV3Pool.js +3 -0
- package/dist/abis/types/UniswapV3Pool.js.map +1 -0
- package/dist/abis/types/factories/AlgebraPool__factory.d.ts +821 -0
- package/dist/abis/types/factories/AlgebraPool__factory.js +1062 -0
- package/dist/abis/types/factories/AlgebraPool__factory.js.map +1 -0
- package/dist/abis/types/factories/DepositGuard__factory.d.ts +124 -4
- package/dist/abis/types/factories/DepositGuard__factory.js +160 -5
- package/dist/abis/types/factories/DepositGuard__factory.js.map +1 -1
- package/dist/abis/types/factories/UniswapV3Pool__factory.d.ts +781 -0
- package/dist/abis/types/factories/UniswapV3Pool__factory.js +1009 -0
- package/dist/abis/types/factories/UniswapV3Pool__factory.js.map +1 -0
- package/dist/abis/types/factories/index.d.ts +2 -0
- package/dist/abis/types/factories/index.js +5 -1
- package/dist/abis/types/factories/index.js.map +1 -1
- package/dist/abis/types/index.d.ts +4 -0
- package/dist/abis/types/index.js +5 -1
- package/dist/abis/types/index.js.map +1 -1
- package/dist/src/__tests__/index.test.js +37 -41
- package/dist/src/__tests__/index.test.js.map +1 -1
- package/dist/src/abis/types/AlgebraPool.d.ts +817 -0
- package/dist/src/abis/types/DepositGuard.d.ts +100 -13
- package/dist/src/abis/types/UniswapV3Pool.d.ts +771 -0
- package/dist/src/abis/types/factories/AlgebraPool__factory.d.ts +821 -0
- package/dist/src/abis/types/factories/DepositGuard__factory.d.ts +124 -4
- package/dist/src/abis/types/factories/UniswapV3Pool__factory.d.ts +781 -0
- package/dist/src/abis/types/factories/index.d.ts +2 -0
- package/dist/src/abis/types/index.d.ts +4 -0
- package/dist/src/contracts/index.d.ts +4 -1
- package/dist/src/contracts/index.js +21 -1
- package/dist/src/contracts/index.js.map +1 -1
- package/dist/src/functions/balances.js +4 -4
- package/dist/src/functions/balances.js.map +1 -1
- package/dist/src/functions/{feesCollected.d.ts → calculateFees.d.ts} +2 -1
- package/dist/src/functions/calculateFees.js +315 -0
- package/dist/src/functions/calculateFees.js.map +1 -0
- package/dist/src/functions/deposit.js +8 -8
- package/dist/src/functions/deposit.js.map +1 -1
- package/dist/src/functions/fees.d.ts +4 -0
- package/dist/src/functions/fees.js +189 -0
- package/dist/src/functions/fees.js.map +1 -0
- package/dist/src/functions/vault.js +13 -11
- package/dist/src/functions/vault.js.map +1 -1
- package/dist/src/functions/withdraw.js +1 -1
- package/dist/src/functions/withdraw.js.map +1 -1
- package/dist/src/graphql/constants.d.ts +5 -1
- package/dist/src/graphql/constants.js +78 -24
- package/dist/src/graphql/constants.js.map +1 -1
- package/dist/src/graphql/queries.d.ts +2 -1
- package/dist/src/graphql/queries.js +6 -3
- package/dist/src/graphql/queries.js.map +1 -1
- package/dist/src/index.cjs.js +2 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.esm.js +2 -1
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/src/contracts/index.d.ts +4 -1
- package/dist/src/src/functions/{feesCollected.d.ts → calculateFees.d.ts} +2 -1
- package/dist/src/src/functions/fees.d.ts +4 -0
- package/dist/src/src/graphql/constants.d.ts +5 -1
- package/dist/src/src/graphql/queries.d.ts +2 -1
- package/dist/src/src/index.d.ts +1 -0
- package/dist/src/src/types/index.d.ts +10 -1
- package/dist/src/src/types/vaultQueryData.d.ts +5 -2
- package/dist/src/src/utils/config/addresses.d.ts +5 -1
- package/dist/src/src/utils/getPrice.d.ts +2 -0
- package/dist/src/src/utils/timestamps.d.ts +1 -0
- package/dist/src/types/index.d.ts +10 -1
- package/dist/src/types/index.js +2 -0
- package/dist/src/types/index.js.map +1 -1
- package/dist/src/types/vaultQueryData.d.ts +5 -2
- package/dist/src/utils/config/addresses.d.ts +5 -1
- package/dist/src/utils/config/addresses.js +120 -33
- package/dist/src/utils/config/addresses.js.map +1 -1
- package/dist/src/utils/getPrice.d.ts +2 -0
- package/dist/src/utils/getPrice.js +18 -0
- package/dist/src/utils/getPrice.js.map +1 -0
- package/dist/src/utils/timestamps.d.ts +1 -0
- package/dist/src/utils/timestamps.js +7 -0
- package/dist/src/utils/timestamps.js.map +1 -0
- package/package.json +2 -1
- package/dist/src/functions/feesCollected.js +0 -109
- package/dist/src/functions/feesCollected.js.map +0 -1
- package/dist/src/functions/rebalances.d.ts +0 -4
- package/dist/src/functions/rebalances.js +0 -102
- package/dist/src/functions/rebalances.js.map +0 -1
- package/dist/src/src/functions/rebalances.d.ts +0 -4
@@ -6,6 +6,7 @@ export declare enum SupportedChainId {
|
|
6
6
|
arbitrum = 42161,
|
7
7
|
bsc = 56,
|
8
8
|
eon = 7332,
|
9
|
+
fantom = 250,
|
9
10
|
hedera_testnet = 296,
|
10
11
|
linea = 59144,
|
11
12
|
mainnet = 1,
|
@@ -16,6 +17,7 @@ export declare enum SupportedChainId {
|
|
16
17
|
export declare enum SupportedDex {
|
17
18
|
Ascent = "Ascent",
|
18
19
|
Blueprint = "Blueprint",
|
20
|
+
Equalizer = "Equalizer",
|
19
21
|
Horiza = "Horiza",
|
20
22
|
Lynex = "Lynex",
|
21
23
|
Pancakeswap = "PancakeSwap",
|
@@ -52,9 +54,16 @@ export interface IchiVault {
|
|
52
54
|
allowTokenA: boolean;
|
53
55
|
allowTokenB: boolean;
|
54
56
|
}
|
55
|
-
export interface
|
57
|
+
export interface Fees {
|
56
58
|
feeAmount0: string;
|
57
59
|
feeAmount1: string;
|
58
60
|
createdAtTimestamp: string;
|
59
61
|
vault: string;
|
62
|
+
sqrtPrice: string;
|
60
63
|
}
|
64
|
+
export type FeesInfo = {
|
65
|
+
timePeriod: number;
|
66
|
+
feeAmount0: string;
|
67
|
+
feeAmount1: string;
|
68
|
+
pctAPR: number;
|
69
|
+
};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { IchiVault,
|
1
|
+
import { IchiVault, Fees } from '..';
|
2
2
|
export interface VaultQueryData {
|
3
3
|
ichiVault: IchiVault;
|
4
4
|
}
|
@@ -6,5 +6,8 @@ export interface VaultsByTokensQueryData {
|
|
6
6
|
ichiVaults: IchiVault[];
|
7
7
|
}
|
8
8
|
export interface RebalancesQueryData {
|
9
|
-
vaultRebalances:
|
9
|
+
vaultRebalances: Fees[];
|
10
|
+
}
|
11
|
+
export interface CollectFeesQueryData {
|
12
|
+
vaultCollectFees: Fees[];
|
10
13
|
}
|
@@ -4,8 +4,12 @@ export type AddressConfig = {
|
|
4
4
|
};
|
5
5
|
export type SupportedDexConfig = {
|
6
6
|
factoryAddress: string;
|
7
|
-
|
7
|
+
depositGuard: {
|
8
|
+
address: string;
|
9
|
+
version: number;
|
10
|
+
};
|
8
11
|
vaultDeployerAddress: string;
|
12
|
+
isAlgebra: boolean;
|
9
13
|
};
|
10
14
|
export type Config = {
|
11
15
|
[key in SupportedDex]?: SupportedDexConfig;
|
@@ -0,0 +1 @@
|
|
1
|
+
export default function daysToMilliseconds(days: number): number;
|
@@ -6,6 +6,7 @@ export declare enum SupportedChainId {
|
|
6
6
|
arbitrum = 42161,
|
7
7
|
bsc = 56,
|
8
8
|
eon = 7332,
|
9
|
+
fantom = 250,
|
9
10
|
hedera_testnet = 296,
|
10
11
|
linea = 59144,
|
11
12
|
mainnet = 1,
|
@@ -16,6 +17,7 @@ export declare enum SupportedChainId {
|
|
16
17
|
export declare enum SupportedDex {
|
17
18
|
Ascent = "Ascent",
|
18
19
|
Blueprint = "Blueprint",
|
20
|
+
Equalizer = "Equalizer",
|
19
21
|
Horiza = "Horiza",
|
20
22
|
Lynex = "Lynex",
|
21
23
|
Pancakeswap = "PancakeSwap",
|
@@ -52,9 +54,16 @@ export interface IchiVault {
|
|
52
54
|
allowTokenA: boolean;
|
53
55
|
allowTokenB: boolean;
|
54
56
|
}
|
55
|
-
export interface
|
57
|
+
export interface Fees {
|
56
58
|
feeAmount0: string;
|
57
59
|
feeAmount1: string;
|
58
60
|
createdAtTimestamp: string;
|
59
61
|
vault: string;
|
62
|
+
sqrtPrice: string;
|
60
63
|
}
|
64
|
+
export type FeesInfo = {
|
65
|
+
timePeriod: number;
|
66
|
+
feeAmount0: string;
|
67
|
+
feeAmount1: string;
|
68
|
+
pctAPR: number;
|
69
|
+
};
|
package/dist/src/types/index.js
CHANGED
@@ -6,6 +6,7 @@ var SupportedChainId;
|
|
6
6
|
SupportedChainId[SupportedChainId["arbitrum"] = 42161] = "arbitrum";
|
7
7
|
SupportedChainId[SupportedChainId["bsc"] = 56] = "bsc";
|
8
8
|
SupportedChainId[SupportedChainId["eon"] = 7332] = "eon";
|
9
|
+
SupportedChainId[SupportedChainId["fantom"] = 250] = "fantom";
|
9
10
|
SupportedChainId[SupportedChainId["hedera_testnet"] = 296] = "hedera_testnet";
|
10
11
|
SupportedChainId[SupportedChainId["linea"] = 59144] = "linea";
|
11
12
|
SupportedChainId[SupportedChainId["mainnet"] = 1] = "mainnet";
|
@@ -17,6 +18,7 @@ var SupportedDex;
|
|
17
18
|
(function (SupportedDex) {
|
18
19
|
SupportedDex["Ascent"] = "Ascent";
|
19
20
|
SupportedDex["Blueprint"] = "Blueprint";
|
21
|
+
SupportedDex["Equalizer"] = "Equalizer";
|
20
22
|
SupportedDex["Horiza"] = "Horiza";
|
21
23
|
SupportedDex["Lynex"] = "Lynex";
|
22
24
|
SupportedDex["Pancakeswap"] = "PancakeSwap";
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;AAQA,IAAY,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;AAQA,IAAY,gBAWX;AAXD,WAAY,gBAAgB;IAC1B,mEAAgB,CAAA;IAChB,sDAAQ,CAAA;IACR,wDAAU,CAAA;IACV,6DAAY,CAAA;IACZ,6EAAoB,CAAA;IACpB,6DAAa,CAAA;IACb,6DAAW,CAAA;IACX,+DAAa,CAAA;IACb,qFAAwB,CAAA;IACxB,qEAAgB,CAAA;AAClB,CAAC,EAXW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAW3B;AAED,IAAY,YAeX;AAfD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,uCAAuB,CAAA;IACvB,uCAAuB,CAAA;IACvB,iCAAiB,CAAA;IACjB,+BAAe,CAAA;IACf,2CAA2B,CAAA;IAC3B,uCAAuB,CAAA;IACvB,iCAAiB,CAAA;IACjB,+BAAe,CAAA;IACf,yCAAyB,CAAA;IACzB,uCAAuB,CAAA;IACvB,+BAAe,CAAA;IACf,wCAAwB,CAAA;IACxB,qCAAqB,CAAA;AACvB,CAAC,EAfW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAevB;AAEY,QAAA,iBAAiB,GAAG,EAAE,CAAC"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { IchiVault,
|
1
|
+
import { IchiVault, Fees } from '..';
|
2
2
|
export interface VaultQueryData {
|
3
3
|
ichiVault: IchiVault;
|
4
4
|
}
|
@@ -6,5 +6,8 @@ export interface VaultsByTokensQueryData {
|
|
6
6
|
ichiVaults: IchiVault[];
|
7
7
|
}
|
8
8
|
export interface RebalancesQueryData {
|
9
|
-
vaultRebalances:
|
9
|
+
vaultRebalances: Fees[];
|
10
|
+
}
|
11
|
+
export interface CollectFeesQueryData {
|
12
|
+
vaultCollectFees: Fees[];
|
10
13
|
}
|
@@ -4,8 +4,12 @@ export type AddressConfig = {
|
|
4
4
|
};
|
5
5
|
export type SupportedDexConfig = {
|
6
6
|
factoryAddress: string;
|
7
|
-
|
7
|
+
depositGuard: {
|
8
|
+
address: string;
|
9
|
+
version: number;
|
10
|
+
};
|
8
11
|
vaultDeployerAddress: string;
|
12
|
+
isAlgebra: boolean;
|
9
13
|
};
|
10
14
|
export type Config = {
|
11
15
|
[key in SupportedDex]?: SupportedDexConfig;
|
@@ -1,121 +1,208 @@
|
|
1
1
|
"use strict";
|
2
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
2
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
4
4
|
var types_1 = require("../../types");
|
5
5
|
var addressConfig = (_a = {},
|
6
6
|
_a[types_1.SupportedChainId.arbitrum] = (_b = {},
|
7
7
|
_b[types_1.SupportedDex.UniswapV3] = {
|
8
8
|
factoryAddress: '0xfBf38920cCbCFF7268Ad714ae5F9Fad6dF607065',
|
9
|
-
|
9
|
+
depositGuard: {
|
10
|
+
address: '0x932E1908461De58b0891E5022431dc995Cb95C5E',
|
11
|
+
version: 1,
|
12
|
+
},
|
10
13
|
vaultDeployerAddress: '0x508C3daa571854247726ba26949f182086Ff89B0',
|
14
|
+
isAlgebra: false,
|
11
15
|
},
|
12
16
|
_b[types_1.SupportedDex.Ramses] = {
|
13
17
|
factoryAddress: '0xedAc86bc526557c422AB1F6BF848bF0da9fB44A6',
|
14
|
-
|
18
|
+
depositGuard: {
|
19
|
+
address: '0x2472cA62c19ab99AB9947A7754fc38945b68Fb68',
|
20
|
+
version: 1,
|
21
|
+
},
|
15
22
|
vaultDeployerAddress: '0x508C3daa571854247726ba26949f182086Ff89B0',
|
23
|
+
isAlgebra: false,
|
16
24
|
},
|
17
25
|
_b[types_1.SupportedDex.Horiza] = {
|
18
26
|
factoryAddress: '0x1Cc05B01f2e52ae3bb29F7A0059Fe112C60aA3f4',
|
19
|
-
|
27
|
+
depositGuard: {
|
28
|
+
address: '0x067ec6134e6ec277c7d9589889c85b94a293bf04',
|
29
|
+
version: 1,
|
30
|
+
},
|
20
31
|
vaultDeployerAddress: '0x508C3daa571854247726ba26949f182086Ff89B0',
|
32
|
+
isAlgebra: false,
|
21
33
|
},
|
22
34
|
_b[types_1.SupportedDex.Sushiswap] = {
|
23
35
|
factoryAddress: '0xbA4c7b5eFD44Aa60da0440D0427555bdBE50e6BC',
|
24
|
-
|
36
|
+
depositGuard: {
|
37
|
+
address: '0xB77463Eba7f1bD5F37FCA35fdF9306B09bAa7379',
|
38
|
+
version: 1,
|
39
|
+
},
|
40
|
+
isAlgebra: false,
|
25
41
|
vaultDeployerAddress: '0x508C3daa571854247726ba26949f182086Ff89B0',
|
26
42
|
},
|
27
43
|
_b),
|
28
44
|
_a[types_1.SupportedChainId.polygon] = (_c = {},
|
29
45
|
_c[types_1.SupportedDex.UniswapV3] = {
|
30
46
|
factoryAddress: '0x2d2c72C4dC71AA32D64e5142e336741131A73fc0',
|
31
|
-
|
47
|
+
depositGuard: {
|
48
|
+
address: '0xA5cE107711789b350e04063D4EffBe6aB6eB05a4',
|
49
|
+
version: 1,
|
50
|
+
},
|
32
51
|
vaultDeployerAddress: '0x0768A75F616B98ee0937673bD83B7aBF142236Ea',
|
52
|
+
isAlgebra: false,
|
33
53
|
},
|
34
54
|
_c[types_1.SupportedDex.Retro] = {
|
35
55
|
factoryAddress: '0xb2f44D8545315cDd0bAaB4AC7233218b932a5dA7',
|
36
|
-
|
56
|
+
depositGuard: {
|
57
|
+
address: '0x9B3Ea1A39576925fA94c4BCC7eECFA0d95D331E1',
|
58
|
+
version: 1,
|
59
|
+
},
|
37
60
|
vaultDeployerAddress: '0x0768A75F616B98ee0937673bD83B7aBF142236Ea',
|
61
|
+
isAlgebra: false,
|
38
62
|
},
|
39
63
|
_c[types_1.SupportedDex.Quickswap] = {
|
40
64
|
factoryAddress: '0x11700544C577Cb543a498B27B4F0f7018BDb6E8a',
|
41
|
-
|
65
|
+
depositGuard: {
|
66
|
+
address: '0xDB8E25D78483D13781622A40e69a9E39A4b590B6',
|
67
|
+
version: 1,
|
68
|
+
},
|
42
69
|
vaultDeployerAddress: '0x0768A75F616B98ee0937673bD83B7aBF142236Ea',
|
70
|
+
isAlgebra: true,
|
43
71
|
},
|
44
72
|
_c),
|
45
73
|
_a[types_1.SupportedChainId.mainnet] = (_d = {},
|
46
74
|
_d[types_1.SupportedDex.UniswapV3] = {
|
47
75
|
factoryAddress: '0x5a40DFaF8C1115196A1CDF529F97122030F26112',
|
48
|
-
|
76
|
+
depositGuard: {
|
77
|
+
address: '0xe6e32D20258f475BaA8d0B39d4C391B96f0ef70A',
|
78
|
+
version: 1,
|
79
|
+
},
|
49
80
|
vaultDeployerAddress: '0xfF7B5E167c9877f2b9f65D19d9c8c9aa651Fe19F',
|
81
|
+
isAlgebra: false,
|
50
82
|
},
|
51
83
|
_d[types_1.SupportedDex.Blueprint] = {
|
52
84
|
factoryAddress: '0xEAeC81F0eD4F622D4b389672d9859166C0832b3E',
|
53
|
-
|
85
|
+
depositGuard: {
|
86
|
+
address: '0xC3822b5e61d6702315EFD86573978a8a3f3Acb83',
|
87
|
+
version: 1,
|
88
|
+
},
|
54
89
|
vaultDeployerAddress: '0xfF7B5E167c9877f2b9f65D19d9c8c9aa651Fe19F',
|
90
|
+
isAlgebra: false,
|
55
91
|
},
|
56
92
|
_d[types_1.SupportedDex.Pancakeswap] = {
|
57
93
|
factoryAddress: '0x8Dd50926e12BD71904bCCc6D86DFA55D42715094',
|
58
|
-
|
94
|
+
depositGuard: {
|
95
|
+
address: '0x81B2F475e1ca7AB6b2720AdFa2fA6D4c52C4F49d',
|
96
|
+
version: 1,
|
97
|
+
},
|
59
98
|
vaultDeployerAddress: '0xfF7B5E167c9877f2b9f65D19d9c8c9aa651Fe19F',
|
99
|
+
isAlgebra: false,
|
60
100
|
},
|
61
101
|
_d),
|
62
102
|
_a[types_1.SupportedChainId.bsc] = (_e = {},
|
63
103
|
_e[types_1.SupportedDex.UniswapV3] = {
|
64
104
|
factoryAddress: '0x065356d9f628cDd1bb9F2384E2972CdAC50f51b7',
|
65
|
-
|
105
|
+
depositGuard: {
|
106
|
+
address: '0xE7914034D4D39087bFF0Aed442a652F5945E914b',
|
107
|
+
version: 1,
|
108
|
+
},
|
66
109
|
vaultDeployerAddress: '0x05cC3CA6E768a68A7f86b09e3ceE754437bd5f12',
|
110
|
+
isAlgebra: false,
|
67
111
|
},
|
68
112
|
_e[types_1.SupportedDex.Pancakeswap] = {
|
69
113
|
factoryAddress: '0x131c03ca881B7cC66d7a5120A9273ebf675C241D',
|
70
|
-
|
114
|
+
depositGuard: {
|
115
|
+
address: '0x454130394B8013D4a7288fe9Db570A0a24C606c2',
|
116
|
+
version: 1,
|
117
|
+
},
|
71
118
|
vaultDeployerAddress: '0x05cC3CA6E768a68A7f86b09e3ceE754437bd5f12',
|
119
|
+
isAlgebra: false,
|
72
120
|
},
|
73
121
|
_e[types_1.SupportedDex.Thena] = {
|
74
122
|
factoryAddress: '0xAc93148e93d1C49D89b1166BFd74942E80F5D501',
|
75
|
-
|
123
|
+
depositGuard: {
|
124
|
+
address: '0xd9272a45BbF488816C6A5351894bCE7b04a66eE1',
|
125
|
+
version: 1,
|
126
|
+
},
|
76
127
|
vaultDeployerAddress: '0x05cC3CA6E768a68A7f86b09e3ceE754437bd5f12',
|
128
|
+
isAlgebra: true,
|
77
129
|
},
|
78
130
|
_e),
|
79
131
|
_a[types_1.SupportedChainId.eon] = (_f = {},
|
80
132
|
_f[types_1.SupportedDex.Ascent] = {
|
81
133
|
factoryAddress: '0x242cd12579467983dc521D8aC46EB13936ab65De',
|
82
|
-
|
134
|
+
depositGuard: {
|
135
|
+
address: '0xaBe5B5AC472Ead17B4B4CaC7fAF42430748ab3b3',
|
136
|
+
version: 1,
|
137
|
+
},
|
83
138
|
vaultDeployerAddress: '0xB9200A707f11357D3B1cBDEbd51c8dDA84960Bde',
|
139
|
+
isAlgebra: false,
|
84
140
|
},
|
85
141
|
_f),
|
86
|
-
_a[types_1.SupportedChainId.
|
87
|
-
_g[types_1.SupportedDex.
|
142
|
+
_a[types_1.SupportedChainId.fantom] = (_g = {},
|
143
|
+
_g[types_1.SupportedDex.Equalizer] = {
|
144
|
+
factoryAddress: '0x932E1908461De58b0891E5022431dc995Cb95C5E',
|
145
|
+
depositGuard: {
|
146
|
+
address: '0xb62399d23d1c81f08eA445A42d7F15cC12090A71',
|
147
|
+
version: 2,
|
148
|
+
},
|
149
|
+
vaultDeployerAddress: '0xE495eFdf1d19668a27042D30ee22AC3C58b6fB6c',
|
150
|
+
isAlgebra: false,
|
151
|
+
},
|
152
|
+
_g),
|
153
|
+
_a[types_1.SupportedChainId.hedera_testnet] = (_h = {},
|
154
|
+
_h[types_1.SupportedDex.SaucerSwap] = {
|
88
155
|
factoryAddress: '0x1F91CE23502473C501EA498DbC7CA1Eef9Bbc4B6',
|
89
|
-
|
156
|
+
depositGuard: {
|
157
|
+
address: '0x16Dd62dB239DF67786F0AB7596C445aCDe81a16F',
|
158
|
+
version: 2,
|
159
|
+
},
|
90
160
|
vaultDeployerAddress: '0xEc7428cB95cD92e7556172FfBe735c6D48f6DEB7',
|
161
|
+
isAlgebra: false,
|
91
162
|
},
|
92
|
-
|
93
|
-
_a[types_1.SupportedChainId.linea] = (
|
94
|
-
|
163
|
+
_h),
|
164
|
+
_a[types_1.SupportedChainId.linea] = (_j = {},
|
165
|
+
_j[types_1.SupportedDex.Lynex] = {
|
95
166
|
factoryAddress: '0x0248b992ac2a75294b05286E9DD3A2bD3C9CFE4B',
|
96
|
-
|
167
|
+
depositGuard: {
|
168
|
+
address: '0x6337625bF843911Da1e1eeFaEaFb5599C876469c',
|
169
|
+
version: 2,
|
170
|
+
},
|
97
171
|
vaultDeployerAddress: '0x75178e0a2829B73E3AE4C21eE64F4B684085392a',
|
172
|
+
isAlgebra: true,
|
98
173
|
},
|
99
|
-
|
100
|
-
_a[types_1.SupportedChainId.zksync_era] = (
|
101
|
-
|
174
|
+
_j),
|
175
|
+
_a[types_1.SupportedChainId.zksync_era] = (_k = {},
|
176
|
+
_k[types_1.SupportedDex.Pancakeswap] = {
|
102
177
|
factoryAddress: '0x8a76c26E0089111989C14EF56b9733aa38B94148',
|
103
|
-
|
178
|
+
depositGuard: {
|
179
|
+
address: '0x5997487384CDae95E1AED6eAab1bb827180E1154',
|
180
|
+
version: 1,
|
181
|
+
},
|
182
|
+
isAlgebra: false,
|
104
183
|
vaultDeployerAddress: '0x12C1F03a443A5B893870ea6cBDb2362f666275Da',
|
105
184
|
},
|
106
|
-
|
185
|
+
_k[types_1.SupportedDex.Velocore] = {
|
107
186
|
factoryAddress: '0x1Cd7f4a2E9e7EFb23E27CFB9eF3a2F3CFAf27675',
|
108
|
-
|
187
|
+
depositGuard: {
|
188
|
+
address: '0x01292A32a0b8F8f56fBb8DB90d3756a0EF06C666',
|
189
|
+
version: 2,
|
190
|
+
},
|
109
191
|
vaultDeployerAddress: '0x12C1F03a443A5B893870ea6cBDb2362f666275Da',
|
192
|
+
isAlgebra: true,
|
110
193
|
},
|
111
|
-
|
112
|
-
_a[types_1.SupportedChainId.zksync_era_testnet] = (
|
113
|
-
|
194
|
+
_k),
|
195
|
+
_a[types_1.SupportedChainId.zksync_era_testnet] = (_l = {},
|
196
|
+
_l[types_1.SupportedDex.Velocore] = {
|
114
197
|
factoryAddress: '0x0227f2b783b610107349da9b9DF516b8d476aB4F',
|
115
|
-
|
198
|
+
depositGuard: {
|
199
|
+
address: '0x7570c7b58c68d95F0663f89C228B7b13d05c15e6',
|
200
|
+
version: 1,
|
201
|
+
},
|
116
202
|
vaultDeployerAddress: '0x451Efff92a3a1471b7af9DDc1369D9D157E6475A',
|
203
|
+
isAlgebra: true,
|
117
204
|
},
|
118
|
-
|
205
|
+
_l),
|
119
206
|
_a);
|
120
207
|
exports.default = addressConfig;
|
121
208
|
//# sourceMappingURL=addresses.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"addresses.js","sourceRoot":"","sources":["../../../../src/utils/config/addresses.ts"],"names":[],"mappings":";;;AAAA,qCAA6D;
|
1
|
+
{"version":3,"file":"addresses.js","sourceRoot":"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CAA4C;YAClE,SAAS,EAAE,IAAI;SAChB;WACF;IACD,GAAC,wBAAgB,CAAC,UAAU;QAC1B,GAAC,oBAAY,CAAC,WAAW,IAAG;YAC1B,cAAc,EAAE,4CAA4C;YAC5D,YAAY,EAAE;gBACZ,OAAO,EAAE,4CAA4C;gBACrD,OAAO,EAAE,CAAC;aACX;YACD,SAAS,EAAE,KAAK;YAChB,oBAAoB,EAAE,4CAA4C;SACnE;QACD,GAAC,oBAAY,CAAC,QAAQ,IAAG;YACvB,cAAc,EAAE,4CAA4C;YAC5D,YAAY,EAAE;gBACZ,OAAO,EAAE,4CAA4C;gBACrD,OAAO,EAAE,CAAC;aACX;YACD,oBAAoB,EAAE,4CAA4C;YAClE,SAAS,EAAE,IAAI;SAChB;WACF;IACD,GAAC,wBAAgB,CAAC,kBAAkB;QAClC,GAAC,oBAAY,CAAC,QAAQ,IAAG;YACvB,cAAc,EAAE,4CAA4C;YAC5D,YAAY,EAAE;gBACZ,OAAO,EAAE,4CAA4C;gBACrD,OAAO,EAAE,CAAC;aACX;YACD,oBAAoB,EAAE,4CAA4C;YAClE,SAAS,EAAE,IAAI;SAChB;WACF;OACF,CAAC;AAEF,kBAAe,aAAa,CAAC"}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
var univ3prices = require('@thanpolas/univ3prices');
|
4
|
+
// calculate price/ratio in the pool
|
5
|
+
function getPrice(isInverted, sqrtPrice, decimals0, decimals1, decimalPlaces) {
|
6
|
+
if (decimalPlaces === void 0) { decimalPlaces = 3; }
|
7
|
+
var decimalArray = [decimals0, decimals1];
|
8
|
+
if (isInverted) {
|
9
|
+
decimalArray = [decimals1, decimals0];
|
10
|
+
}
|
11
|
+
var price = univ3prices(decimalArray, sqrtPrice).toSignificant({
|
12
|
+
reverse: isInverted,
|
13
|
+
decimalPlaces: decimalPlaces,
|
14
|
+
});
|
15
|
+
return price;
|
16
|
+
}
|
17
|
+
exports.default = getPrice;
|
18
|
+
//# sourceMappingURL=getPrice.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getPrice.js","sourceRoot":"","sources":["../../../src/utils/getPrice.ts"],"names":[],"mappings":";;AAEA,IAAM,WAAW,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;AAEtD,oCAAoC;AACpC,SAAwB,QAAQ,CAC9B,UAAmB,EACnB,SAAoB,EACpB,SAAiB,EACjB,SAAiB,EACjB,aAAiB;IAAjB,8BAAA,EAAA,iBAAiB;IAEjB,IAAI,YAAY,GAAG,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAC1C,IAAI,UAAU,EAAE;QACd,YAAY,GAAG,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;KACvC;IACD,IAAM,KAAK,GAAG,WAAW,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC,aAAa,CAAC;QAC/D,OAAO,EAAE,UAAU;QACnB,aAAa,eAAA;KACd,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC;AACf,CAAC;AAjBD,2BAiBC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export default function daysToMilliseconds(days: number): number;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"timestamps.js","sourceRoot":"","sources":["../../../src/utils/timestamps.ts"],"names":[],"mappings":";;AAAA,SAAwB,kBAAkB,CAAC,IAAY;IACrD,OAAO,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AACpC,CAAC;AAFD,qCAEC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ichidao/ichi-vaults-sdk",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.20",
|
4
4
|
"description": "The ICHI Vaults SDK",
|
5
5
|
"main": "dist/src/index.cjs.js",
|
6
6
|
"module": "dist/src/index.esm.js",
|
@@ -53,6 +53,7 @@
|
|
53
53
|
"@ethersproject/providers": "^5.6.5",
|
54
54
|
"@ethersproject/units": "^5.6.1",
|
55
55
|
"@ethersproject/wallet": "^5.6.2",
|
56
|
+
"@thanpolas/univ3prices": "^3.0.2",
|
56
57
|
"@typechain/ethers-v5": "^10.0.0",
|
57
58
|
"bignumber.js": "^9.0.1",
|
58
59
|
"ethereumjs-util": "^7.1.4",
|
@@ -1,109 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
/* eslint-disable no-redeclare */
|
3
|
-
/* eslint-disable import/prefer-default-export */
|
4
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
5
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
6
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
7
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
8
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
9
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
10
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
11
|
-
});
|
12
|
-
};
|
13
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
14
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
15
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
16
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
17
|
-
function step(op) {
|
18
|
-
if (f) throw new TypeError("Generator is already executing.");
|
19
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
20
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
21
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
22
|
-
switch (op[0]) {
|
23
|
-
case 0: case 1: t = op; break;
|
24
|
-
case 4: _.label++; return { value: op[1], done: false };
|
25
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
26
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
27
|
-
default:
|
28
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
29
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
30
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
31
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
32
|
-
if (t[2]) _.ops.pop();
|
33
|
-
_.trys.pop(); continue;
|
34
|
-
}
|
35
|
-
op = body.call(thisArg, _);
|
36
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
37
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
38
|
-
}
|
39
|
-
};
|
40
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
41
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
42
|
-
};
|
43
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
44
|
-
exports.getFeesCollected = void 0;
|
45
|
-
var bignumber_1 = require("@ethersproject/bignumber");
|
46
|
-
var types_1 = require("../types");
|
47
|
-
// eslint-disable-next-line import/no-cycle
|
48
|
-
var vault_1 = require("./vault");
|
49
|
-
var rebalances_1 = require("./rebalances");
|
50
|
-
var balances_1 = require("./balances");
|
51
|
-
var formatBigInt_1 = __importDefault(require("../utils/formatBigInt"));
|
52
|
-
function getFeesCollected(vaultAddress, jsonProvider, dex, rawOrDays, days) {
|
53
|
-
return __awaiter(this, void 0, void 0, function () {
|
54
|
-
var chainId, vault, token0Decimals, token1Decimals, numOfDays, rebalances, amount0BN, amount1BN, feeAmountsBN, feeAmounts;
|
55
|
-
return __generator(this, function (_a) {
|
56
|
-
switch (_a.label) {
|
57
|
-
case 0: return [4 /*yield*/, jsonProvider.getNetwork()];
|
58
|
-
case 1:
|
59
|
-
chainId = (_a.sent()).chainId;
|
60
|
-
if (!Object.values(types_1.SupportedChainId).includes(chainId)) {
|
61
|
-
throw new Error("Unsupported chainId: ".concat(chainId !== null && chainId !== void 0 ? chainId : 'undefined'));
|
62
|
-
}
|
63
|
-
return [4 /*yield*/, (0, vault_1.getIchiVaultInfo)(chainId, dex, vaultAddress, jsonProvider)];
|
64
|
-
case 2:
|
65
|
-
vault = _a.sent();
|
66
|
-
if (!vault)
|
67
|
-
throw new Error("Vault not found on ".concat(chainId, ": ").concat(vaultAddress));
|
68
|
-
return [4 /*yield*/, (0, balances_1.getTokenDecimals)(vault.tokenA, jsonProvider)];
|
69
|
-
case 3:
|
70
|
-
token0Decimals = _a.sent();
|
71
|
-
return [4 /*yield*/, (0, balances_1.getTokenDecimals)(vault.tokenB, jsonProvider)];
|
72
|
-
case 4:
|
73
|
-
token1Decimals = _a.sent();
|
74
|
-
numOfDays = typeof rawOrDays === 'boolean' ? days : rawOrDays;
|
75
|
-
return [4 /*yield*/, (0, rebalances_1.getRebalances)(vaultAddress, jsonProvider, dex, numOfDays)];
|
76
|
-
case 5:
|
77
|
-
rebalances = _a.sent();
|
78
|
-
if (!rebalances)
|
79
|
-
throw new Error("Error getting vault rebalances on ".concat(chainId, " for ").concat(vaultAddress));
|
80
|
-
console.log({ rebalances: rebalances });
|
81
|
-
amount0BN = rebalances
|
82
|
-
.map(function (r) { return bignumber_1.BigNumber.from(r.feeAmount0); })
|
83
|
-
.reduce(function (total, curr) { return total.add(curr); }, bignumber_1.BigNumber.from(0));
|
84
|
-
amount1BN = rebalances
|
85
|
-
.map(function (r) { return bignumber_1.BigNumber.from(r.feeAmount1); })
|
86
|
-
.reduce(function (total, curr) { return total.add(curr); }, bignumber_1.BigNumber.from(0));
|
87
|
-
feeAmountsBN = {
|
88
|
-
total0: amount0BN,
|
89
|
-
total1: amount1BN,
|
90
|
-
0: amount0BN,
|
91
|
-
1: amount1BN,
|
92
|
-
};
|
93
|
-
if (typeof rawOrDays !== 'boolean') {
|
94
|
-
feeAmounts = {
|
95
|
-
total0: (0, formatBigInt_1.default)(feeAmountsBN.total0, token0Decimals),
|
96
|
-
total1: (0, formatBigInt_1.default)(feeAmountsBN.total1, token1Decimals),
|
97
|
-
0: (0, formatBigInt_1.default)(feeAmountsBN.total0, token0Decimals),
|
98
|
-
1: (0, formatBigInt_1.default)(feeAmountsBN.total1, token1Decimals),
|
99
|
-
};
|
100
|
-
console.log({ feeAmounts: feeAmounts });
|
101
|
-
return [2 /*return*/, feeAmounts];
|
102
|
-
}
|
103
|
-
return [2 /*return*/, feeAmountsBN];
|
104
|
-
}
|
105
|
-
});
|
106
|
-
});
|
107
|
-
}
|
108
|
-
exports.getFeesCollected = getFeesCollected;
|
109
|
-
//# sourceMappingURL=feesCollected.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"feesCollected.js","sourceRoot":"","sources":["../../../src/functions/feesCollected.ts"],"names":[],"mappings":";AAAA,iCAAiC;AACjC,iDAAiD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGjD,sDAAqD;AACrD,kCAAwF;AACxF,2CAA2C;AAC3C,iCAA2C;AAC3C,2CAA6C;AAC7C,uCAA8C;AAC9C,uEAAiD;AAiBjD,SAAsB,gBAAgB,CACpC,YAAoB,EACpB,YAA6B,EAC7B,GAAiB,EACjB,SAAyB,EACzB,IAAa;;;;;wBAEO,qBAAM,YAAY,CAAC,UAAU,EAAE,EAAA;;oBAA3C,OAAO,GAAK,CAAA,SAA+B,CAAA,QAApC;oBAEf,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,wBAAgB,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;wBACtD,MAAM,IAAI,KAAK,CAAC,+BAAwB,OAAO,aAAP,OAAO,cAAP,OAAO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AAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,EAA5B,CAA4B,CAAC;yBACxC,MAAM,CAAC,UAAC,KAAK,EAAE,IAAI,IAAK,OAAA,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAf,CAAe,EAAE,qBAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;oBAEzD,YAAY,GAAG;wBACnB,MAAM,EAAE,SAAS;wBACjB,MAAM,EAAE,SAAS;wBACjB,CAAC,EAAE,SAAS;wBACZ,CAAC,EAAE,SAAS;qBACK,CAAC;oBAEpB,IAAI,OAAO,SAAS,KAAK,SAAS,EAAE;wBAC5B,UAAU,GAAG;4BACjB,MAAM,EAAE,IAAA,sBAAY,EAAC,YAAY,CAAC,MAAM,EAAE,cAAc,CAAC;4BACzD,MAAM,EAAE,IAAA,sBAAY,EAAC,YAAY,CAAC,MAAM,EAAE,cAAc,CAAC;4BACzD,CAAC,EAAE,IAAA,sBAAY,EAAC,YAAY,CAAC,MAAM,EAAE,cAAc,CAAC;4BACpD,CAAC,EAAE,IAAA,sBAAY,EAAC,YAAY,CAAC,MAAM,EAAE,cAAc,CAAC;yBACrC,CAAC;wBAClB,OAAO,CAAC,GAAG,CAAC,EAAE,UAAU,YAAA,EAAE,CAAC,CAAC;wBAC5B,sBAAO,UAAU,EAAC;qBACnB;oBAED,sBAAO,YAAY,EAAC;;;;CACrB;AAjDD,4CAiDC"}
|
@@ -1,4 +0,0 @@
|
|
1
|
-
import { JsonRpcProvider } from '@ethersproject/providers';
|
2
|
-
import { SupportedDex } from '../types';
|
3
|
-
import { RebalancesQueryData } from '../types/vaultQueryData';
|
4
|
-
export declare function getRebalances(vaultAddress: string, jsonProvider: JsonRpcProvider, dex: SupportedDex, days?: number): Promise<RebalancesQueryData['vaultRebalances']>;
|