impermax-sdk 1.0.4 → 1.0.5

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.
Files changed (34) hide show
  1. package/lib/config/amms.d.ts +20 -1
  2. package/lib/config/amms.js +117 -97
  3. package/lib/config/general.d.ts +2 -0
  4. package/lib/config/general.js +3 -3
  5. package/lib/config/types.d.ts +1 -19
  6. package/lib/config/types.js +1 -21
  7. package/lib/impermax-router/Account.d.ts +1 -1
  8. package/lib/impermax-router/AccountBorrowable.js +4 -4
  9. package/lib/impermax-router/AccountCollateral.js +2 -2
  10. package/lib/impermax-router/AccountLendingPool.d.ts +1 -1
  11. package/lib/impermax-router/AccountLendingPool.js +12 -12
  12. package/lib/impermax-router/Borrowable.d.ts +1 -1
  13. package/lib/impermax-router/Collateral.d.ts +1 -1
  14. package/lib/impermax-router/ContractsHelper.d.ts +1 -1
  15. package/lib/impermax-router/Interactions.d.ts +1 -1
  16. package/lib/impermax-router/InteractionsLendingPool.d.ts +1 -1
  17. package/lib/impermax-router/InteractionsPoolToken.d.ts +1 -1
  18. package/lib/impermax-router/InteractionsPoolToken.js +13 -13
  19. package/lib/impermax-router/LendingPool.d.ts +2 -2
  20. package/lib/impermax-router/PoolToken.d.ts +2 -2
  21. package/lib/impermax-router/index.d.ts +1 -1
  22. package/lib/impermax-router/types.d.ts +45 -0
  23. package/lib/impermax-router/{interfaces.js → types.js} +0 -1
  24. package/lib/index.d.ts +40 -1
  25. package/lib/index.js +105 -1
  26. package/lib/subgraph/Account.d.ts +1 -1
  27. package/lib/subgraph/AccountLendingPool.d.ts +1 -1
  28. package/lib/subgraph/LendingPool.d.ts +3 -2
  29. package/lib/subgraph/PoolToken.d.ts +1 -1
  30. package/lib/subgraph/index.d.ts +1 -1
  31. package/lib/subgraph/initializer.d.ts +3 -2
  32. package/lib/{impermax-router/interfaces.d.ts → subgraph/types.d.ts} +1 -74
  33. package/lib/subgraph/types.js +3 -0
  34. package/package.json +1 -1
@@ -1,4 +1,23 @@
1
- import { Address, AmmIndex, Amms, Networks } from './types';
1
+ import { Address, AmmIndex, Networks } from './types';
2
+ export declare enum Amms {
3
+ uniswap = "uniswap",
4
+ quickswap = "quickswap",
5
+ sushiswap = "sushiswap",
6
+ swapr = "swapr",
7
+ swapfish = "swapfish",
8
+ zyberswap = "zyberswap",
9
+ pangolin = "pangolin",
10
+ traderJoe = "traderJoe",
11
+ solarbeam = "solarbeam",
12
+ thorus = "thorus",
13
+ tetuswap = "tetuswap",
14
+ solidly = "solidly",
15
+ solidlyB = "solidlyB",
16
+ solidlyUSDC = "solidlyUSDC",
17
+ solidlyUSDCB = "solidlyUSDCB",
18
+ solidly091 = "solidly091",
19
+ solidlyOxd = "solidlyOxd"
20
+ }
2
21
  export declare const hrAmms: {
3
22
  uniswap: string;
4
23
  quickswap: string;
@@ -1,62 +1,82 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AMM_LP_FEE = exports.ADD_LIQUIDITY_URLS = exports.AMM_SUBGRAPH_URLS = exports.getAmmByFactory = exports.AMM_FACTORY = exports.hrAmms = void 0;
3
+ exports.AMM_LP_FEE = exports.ADD_LIQUIDITY_URLS = exports.AMM_SUBGRAPH_URLS = exports.getAmmByFactory = exports.AMM_FACTORY = exports.hrAmms = exports.Amms = void 0;
4
4
  const types_1 = require("./types");
5
+ var Amms;
6
+ (function (Amms) {
7
+ Amms["uniswap"] = "uniswap";
8
+ Amms["quickswap"] = "quickswap";
9
+ Amms["sushiswap"] = "sushiswap";
10
+ Amms["swapr"] = "swapr";
11
+ Amms["swapfish"] = "swapfish";
12
+ Amms["zyberswap"] = "zyberswap";
13
+ Amms["pangolin"] = "pangolin";
14
+ Amms["traderJoe"] = "traderJoe";
15
+ Amms["solarbeam"] = "solarbeam";
16
+ Amms["thorus"] = "thorus";
17
+ Amms["tetuswap"] = "tetuswap";
18
+ Amms["solidly"] = "solidly";
19
+ Amms["solidlyB"] = "solidlyB";
20
+ Amms["solidlyUSDC"] = "solidlyUSDC";
21
+ Amms["solidlyUSDCB"] = "solidlyUSDCB";
22
+ Amms["solidly091"] = "solidly091";
23
+ Amms["solidlyOxd"] = "solidlyOxd";
24
+ })(Amms = exports.Amms || (exports.Amms = {}));
5
25
  exports.hrAmms = {
6
- [types_1.Amms.uniswap]: 'Uniswap',
7
- [types_1.Amms.quickswap]: 'QuickSwap',
8
- [types_1.Amms.sushiswap]: 'SushiSwap',
9
- [types_1.Amms.swapr]: 'Swapr',
10
- [types_1.Amms.swapfish]: 'SwapFish',
11
- [types_1.Amms.zyberswap]: 'ZyberSwap',
12
- [types_1.Amms.pangolin]: 'Pangolin',
13
- [types_1.Amms.traderJoe]: 'TraderJoe',
14
- [types_1.Amms.solarbeam]: 'Solarbeam',
15
- [types_1.Amms.thorus]: 'Thorus',
16
- [types_1.Amms.tetuswap]: 'TetuSwap',
17
- [types_1.Amms.solidly]: 'Solidly',
18
- [types_1.Amms.solidlyB]: 'Solidly',
19
- [types_1.Amms.solidlyUSDC]: 'Solidly',
20
- [types_1.Amms.solidlyUSDCB]: 'Solidly',
21
- [types_1.Amms.solidly091]: 'Solidly',
22
- [types_1.Amms.solidlyOxd]: 'Solidly',
26
+ [Amms.uniswap]: 'Uniswap',
27
+ [Amms.quickswap]: 'QuickSwap',
28
+ [Amms.sushiswap]: 'SushiSwap',
29
+ [Amms.swapr]: 'Swapr',
30
+ [Amms.swapfish]: 'SwapFish',
31
+ [Amms.zyberswap]: 'ZyberSwap',
32
+ [Amms.pangolin]: 'Pangolin',
33
+ [Amms.traderJoe]: 'TraderJoe',
34
+ [Amms.solarbeam]: 'Solarbeam',
35
+ [Amms.thorus]: 'Thorus',
36
+ [Amms.tetuswap]: 'TetuSwap',
37
+ [Amms.solidly]: 'Solidly',
38
+ [Amms.solidlyB]: 'Solidly',
39
+ [Amms.solidlyUSDC]: 'Solidly',
40
+ [Amms.solidlyUSDCB]: 'Solidly',
41
+ [Amms.solidly091]: 'Solidly',
42
+ [Amms.solidlyOxd]: 'Solidly',
23
43
  };
24
44
  exports.AMM_FACTORY = {
25
45
  [types_1.Networks.Ropsten]: {
26
- [types_1.Amms.uniswap]: '0x5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f',
46
+ [Amms.uniswap]: '0x5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f',
27
47
  },
28
48
  [types_1.Networks.Mainnet]: {
29
- [types_1.Amms.uniswap]: '0x5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f',
49
+ [Amms.uniswap]: '0x5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f',
30
50
  },
31
51
  [types_1.Networks.Polygon]: {
32
- [types_1.Amms.quickswap]: '0x5757371414417b8C6CAad45bAeF941aBc7d3Ab32',
33
- [types_1.Amms.sushiswap]: '0xc35dadb65012ec5796536bd9864ed8773abc74c4',
34
- [types_1.Amms.tetuswap]: '0x684d8c187be836171a1Af8D533e4724893031828',
52
+ [Amms.quickswap]: '0x5757371414417b8C6CAad45bAeF941aBc7d3Ab32',
53
+ [Amms.sushiswap]: '0xc35dadb65012ec5796536bd9864ed8773abc74c4',
54
+ [Amms.tetuswap]: '0x684d8c187be836171a1Af8D533e4724893031828',
35
55
  },
36
56
  [types_1.Networks.Arbitrum]: {
37
- [types_1.Amms.sushiswap]: '0xc35DADB65012eC5796536bD9864eD8773aBc74C4',
38
- [types_1.Amms.swapr]: '0x359F20Ad0F42D75a5077e65F30274cABe6f4F01a',
39
- [types_1.Amms.swapfish]: '0x71539D09D3890195dDa87A6198B98B75211b72F3',
40
- [types_1.Amms.zyberswap]: '0xac2ee06a14c52570ef3b9812ed240bce359772e7',
57
+ [Amms.sushiswap]: '0xc35DADB65012eC5796536bD9864eD8773aBc74C4',
58
+ [Amms.swapr]: '0x359F20Ad0F42D75a5077e65F30274cABe6f4F01a',
59
+ [Amms.swapfish]: '0x71539D09D3890195dDa87A6198B98B75211b72F3',
60
+ [Amms.zyberswap]: '0xac2ee06a14c52570ef3b9812ed240bce359772e7',
41
61
  },
42
62
  [types_1.Networks.Avalanche]: {
43
- [types_1.Amms.pangolin]: '0xefa94DE7a4656D787667C749f7E1223D71E9FD88',
44
- [types_1.Amms.traderJoe]: '0x9Ad6C38BE94206cA50bb0d90783181662f0Cfa10',
45
- [types_1.Amms.thorus]: '0xa98ea6356A316b44Bf710D5f9b6b4eA0081409Ef',
63
+ [Amms.pangolin]: '0xefa94DE7a4656D787667C749f7E1223D71E9FD88',
64
+ [Amms.traderJoe]: '0x9Ad6C38BE94206cA50bb0d90783181662f0Cfa10',
65
+ [Amms.thorus]: '0xa98ea6356A316b44Bf710D5f9b6b4eA0081409Ef',
46
66
  },
47
67
  [types_1.Networks.Moonriver]: {
48
- [types_1.Amms.sushiswap]: '0xc35DADB65012eC5796536bD9864eD8773aBc74C4',
49
- [types_1.Amms.solarbeam]: '0x049581aEB6Fe262727f290165C29BDAB065a1B68',
68
+ [Amms.sushiswap]: '0xc35DADB65012eC5796536bD9864eD8773aBc74C4',
69
+ [Amms.solarbeam]: '0x049581aEB6Fe262727f290165C29BDAB065a1B68',
50
70
  },
51
71
  [types_1.Networks.Aurora]: {},
52
72
  [types_1.Networks.Cronos]: {},
53
73
  [types_1.Networks.Fantom]: {
54
- [types_1.Amms.solidly]: '0x95887654d8646c26fab33f344576e2e74b211256',
55
- [types_1.Amms.solidlyB]: '0x8610Dc1912a55761a713D827a1a1ad131bE8f579',
56
- [types_1.Amms.solidlyUSDC]: '0xF14f98E6F34C12Bd74fcEAC1668aF749fc269cFf',
57
- [types_1.Amms.solidlyUSDCB]: '0x9B1434a02Ee86302d463bB6B365EbdFAc56e067A',
58
- [types_1.Amms.solidly091]: '0xdc4baf3b4b1df79083eedf3e46ec2c4ec1296f60',
59
- [types_1.Amms.solidlyOxd]: '0xB83D21F60B73B21506c69DEcdBcF7Ab5AB737eB2', //NOTICE: this is actually the staked LP factory
74
+ [Amms.solidly]: '0x95887654d8646c26fab33f344576e2e74b211256',
75
+ [Amms.solidlyB]: '0x8610Dc1912a55761a713D827a1a1ad131bE8f579',
76
+ [Amms.solidlyUSDC]: '0xF14f98E6F34C12Bd74fcEAC1668aF749fc269cFf',
77
+ [Amms.solidlyUSDCB]: '0x9B1434a02Ee86302d463bB6B365EbdFAc56e067A',
78
+ [Amms.solidly091]: '0xdc4baf3b4b1df79083eedf3e46ec2c4ec1296f60',
79
+ [Amms.solidlyOxd]: '0xB83D21F60B73B21506c69DEcdBcF7Ab5AB737eB2', //NOTICE: this is actually the staked LP factory
60
80
  },
61
81
  [types_1.Networks.Harmony]: {},
62
82
  [types_1.Networks.Moonbeam]: {},
@@ -65,7 +85,7 @@ exports.AMM_FACTORY = {
65
85
  function getAmmByFactory(network, address) {
66
86
  if (!address)
67
87
  return null;
68
- for (const amm of Object.keys(types_1.Amms)) {
88
+ for (const amm of Object.keys(Amms)) {
69
89
  if (exports.AMM_FACTORY[network][amm] &&
70
90
  address.toLowerCase() == exports.AMM_FACTORY[network][amm].toLowerCase())
71
91
  return amm;
@@ -76,37 +96,37 @@ exports.getAmmByFactory = getAmmByFactory;
76
96
  exports.AMM_SUBGRAPH_URLS = {
77
97
  [types_1.Networks.Ropsten]: {},
78
98
  [types_1.Networks.Mainnet]: {
79
- [types_1.Amms.uniswap]: 'https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2',
99
+ [Amms.uniswap]: 'https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2',
80
100
  },
81
101
  [types_1.Networks.Polygon]: {
82
- [types_1.Amms.quickswap]: 'https://api.fura.org/subgraphs/name/quickswap',
83
- [types_1.Amms.sushiswap]: 'https://api.thegraph.com/subgraphs/name/sushiswap/matic-exchange',
84
- [types_1.Amms.tetuswap]: 'https://api.thegraph.com/subgraphs/name/tetu-io/tetu-swap',
102
+ [Amms.quickswap]: 'https://api.fura.org/subgraphs/name/quickswap',
103
+ [Amms.sushiswap]: 'https://api.thegraph.com/subgraphs/name/sushiswap/matic-exchange',
104
+ [Amms.tetuswap]: 'https://api.thegraph.com/subgraphs/name/tetu-io/tetu-swap',
85
105
  },
86
106
  [types_1.Networks.Arbitrum]: {
87
- [types_1.Amms.sushiswap]: 'https://api.thegraph.com/subgraphs/name/sushiswap/arbitrum-exchange',
88
- [types_1.Amms.swapr]: 'https://api.thegraph.com/subgraphs/name/luzzif/swapr-arbitrum-one-v2',
89
- [types_1.Amms.zyberswap]: 'https://api.thegraph.com/subgraphs/name/zyberswap-arbitrum/zyber-amm',
107
+ [Amms.sushiswap]: 'https://api.thegraph.com/subgraphs/name/sushiswap/arbitrum-exchange',
108
+ [Amms.swapr]: 'https://api.thegraph.com/subgraphs/name/luzzif/swapr-arbitrum-one-v2',
109
+ [Amms.zyberswap]: 'https://api.thegraph.com/subgraphs/name/zyberswap-arbitrum/zyber-amm',
90
110
  //[Amms.swapfish]: 'https://bsc.streamingfast.io/subgraphs/name/pancakeswap/exchange-v2',
91
111
  },
92
112
  [types_1.Networks.Avalanche]: {
93
- [types_1.Amms.pangolin]: 'https://api.thegraph.com/subgraphs/name/dasconnor/pangolin-dex',
94
- [types_1.Amms.traderJoe]: 'https://api.thegraph.com/subgraphs/name/traderjoe-xyz/exchange',
95
- [types_1.Amms.thorus]: '',
113
+ [Amms.pangolin]: 'https://api.thegraph.com/subgraphs/name/dasconnor/pangolin-dex',
114
+ [Amms.traderJoe]: 'https://api.thegraph.com/subgraphs/name/traderjoe-xyz/exchange',
115
+ [Amms.thorus]: '',
96
116
  },
97
117
  [types_1.Networks.Moonriver]: {
98
- [types_1.Amms.sushiswap]: 'https://api.thegraph.com/subgraphs/name/sushiswap/moonriver-exchange',
99
- [types_1.Amms.solarbeam]: 'https://analytics.solarbeam.io/api/subgraph',
118
+ [Amms.sushiswap]: 'https://api.thegraph.com/subgraphs/name/sushiswap/moonriver-exchange',
119
+ [Amms.solarbeam]: 'https://analytics.solarbeam.io/api/subgraph',
100
120
  },
101
121
  [types_1.Networks.Aurora]: {},
102
122
  [types_1.Networks.Cronos]: {},
103
123
  [types_1.Networks.Fantom]: {
104
- [types_1.Amms.solidly]: 'https://api.thegraph.com/subgraphs/name/spartacus-finance/solidly',
105
- [types_1.Amms.solidlyB]: 'https://api.thegraph.com/subgraphs/name/spartacus-finance/solidly',
106
- [types_1.Amms.solidlyUSDC]: 'https://api.thegraph.com/subgraphs/name/spartacus-finance/solidly',
107
- [types_1.Amms.solidlyUSDCB]: 'https://api.thegraph.com/subgraphs/name/spartacus-finance/solidly',
108
- [types_1.Amms.solidly091]: 'https://api.thegraph.com/subgraphs/name/spartacus-finance/solidly',
109
- [types_1.Amms.solidlyOxd]: 'https://api.thegraph.com/subgraphs/name/spartacus-finance/solidly',
124
+ [Amms.solidly]: 'https://api.thegraph.com/subgraphs/name/spartacus-finance/solidly',
125
+ [Amms.solidlyB]: 'https://api.thegraph.com/subgraphs/name/spartacus-finance/solidly',
126
+ [Amms.solidlyUSDC]: 'https://api.thegraph.com/subgraphs/name/spartacus-finance/solidly',
127
+ [Amms.solidlyUSDCB]: 'https://api.thegraph.com/subgraphs/name/spartacus-finance/solidly',
128
+ [Amms.solidly091]: 'https://api.thegraph.com/subgraphs/name/spartacus-finance/solidly',
129
+ [Amms.solidlyOxd]: 'https://api.thegraph.com/subgraphs/name/spartacus-finance/solidly',
110
130
  },
111
131
  [types_1.Networks.Harmony]: {},
112
132
  [types_1.Networks.Moonbeam]: {},
@@ -114,40 +134,40 @@ exports.AMM_SUBGRAPH_URLS = {
114
134
  };
115
135
  exports.ADD_LIQUIDITY_URLS = {
116
136
  [types_1.Networks.Ropsten]: {
117
- [types_1.Amms.uniswap]: 'https://app.uniswap.org/#/add/V2/',
137
+ [Amms.uniswap]: 'https://app.uniswap.org/#/add/V2/',
118
138
  },
119
139
  [types_1.Networks.Mainnet]: {
120
- [types_1.Amms.uniswap]: 'https://app.uniswap.org/#/add/V2/',
140
+ [Amms.uniswap]: 'https://app.uniswap.org/#/add/V2/',
121
141
  },
122
142
  [types_1.Networks.Polygon]: {
123
- [types_1.Amms.quickswap]: 'https://quickswap.exchange/#/add/',
124
- [types_1.Amms.sushiswap]: 'https://app.sushi.com/legacy/add/',
125
- [types_1.Amms.tetuswap]: 'https://swap.tetu.io/#/add/',
143
+ [Amms.quickswap]: 'https://quickswap.exchange/#/add/',
144
+ [Amms.sushiswap]: 'https://app.sushi.com/legacy/add/',
145
+ [Amms.tetuswap]: 'https://swap.tetu.io/#/add/',
126
146
  },
127
147
  [types_1.Networks.Arbitrum]: {
128
- [types_1.Amms.sushiswap]: 'https://app.sushi.com/legacy/add/',
129
- [types_1.Amms.swapr]: 'https://swapr.eth.link/#/add/',
130
- [types_1.Amms.swapfish]: 'https://swapfish.fi/add/',
131
- [types_1.Amms.zyberswap]: 'https://app.zyberswap.io/exchange/add/',
148
+ [Amms.sushiswap]: 'https://app.sushi.com/legacy/add/',
149
+ [Amms.swapr]: 'https://swapr.eth.link/#/add/',
150
+ [Amms.swapfish]: 'https://swapfish.fi/add/',
151
+ [Amms.zyberswap]: 'https://app.zyberswap.io/exchange/add/',
132
152
  },
133
153
  [types_1.Networks.Avalanche]: {
134
- [types_1.Amms.pangolin]: 'https://app.pangolin.exchange/#/add/',
135
- [types_1.Amms.traderJoe]: 'https://www.traderjoexyz.com/#/pool/',
136
- [types_1.Amms.thorus]: 'https://app.thorus.fi/add/',
154
+ [Amms.pangolin]: 'https://app.pangolin.exchange/#/add/',
155
+ [Amms.traderJoe]: 'https://www.traderjoexyz.com/#/pool/',
156
+ [Amms.thorus]: 'https://app.thorus.fi/add/',
137
157
  },
138
158
  [types_1.Networks.Moonriver]: {
139
- [types_1.Amms.sushiswap]: 'https://app.sushi.com/legacy/add/',
140
- [types_1.Amms.solarbeam]: 'https://app.solarbeam.io/exchange/add/',
159
+ [Amms.sushiswap]: 'https://app.sushi.com/legacy/add/',
160
+ [Amms.solarbeam]: 'https://app.solarbeam.io/exchange/add/',
141
161
  },
142
162
  [types_1.Networks.Aurora]: {},
143
163
  [types_1.Networks.Cronos]: {},
144
164
  [types_1.Networks.Fantom]: {
145
- [types_1.Amms.solidly]: 'https://solidly.exchange/liquidity/create',
146
- [types_1.Amms.solidlyB]: 'https://solidly.exchange/liquidity/create',
147
- [types_1.Amms.solidlyUSDC]: 'https://solidly.exchange/liquidity/create',
148
- [types_1.Amms.solidlyUSDCB]: 'https://solidly.exchange/liquidity/create',
149
- [types_1.Amms.solidly091]: 'https://solidly.exchange/liquidity/create',
150
- [types_1.Amms.solidlyOxd]: 'https://solidly.exchange/liquidity/create',
165
+ [Amms.solidly]: 'https://solidly.exchange/liquidity/create',
166
+ [Amms.solidlyB]: 'https://solidly.exchange/liquidity/create',
167
+ [Amms.solidlyUSDC]: 'https://solidly.exchange/liquidity/create',
168
+ [Amms.solidlyUSDCB]: 'https://solidly.exchange/liquidity/create',
169
+ [Amms.solidly091]: 'https://solidly.exchange/liquidity/create',
170
+ [Amms.solidlyOxd]: 'https://solidly.exchange/liquidity/create',
151
171
  },
152
172
  [types_1.Networks.Harmony]: {},
153
173
  [types_1.Networks.Moonbeam]: {},
@@ -155,40 +175,40 @@ exports.ADD_LIQUIDITY_URLS = {
155
175
  };
156
176
  exports.AMM_LP_FEE = {
157
177
  [types_1.Networks.Ropsten]: {
158
- [types_1.Amms.uniswap]: 0.003,
178
+ [Amms.uniswap]: 0.003,
159
179
  },
160
180
  [types_1.Networks.Mainnet]: {
161
- [types_1.Amms.uniswap]: 0.003,
181
+ [Amms.uniswap]: 0.003,
162
182
  },
163
183
  [types_1.Networks.Polygon]: {
164
- [types_1.Amms.quickswap]: 0.0025,
165
- [types_1.Amms.sushiswap]: 0.0025,
166
- [types_1.Amms.tetuswap]: 0,
184
+ [Amms.quickswap]: 0.0025,
185
+ [Amms.sushiswap]: 0.0025,
186
+ [Amms.tetuswap]: 0,
167
187
  },
168
188
  [types_1.Networks.Arbitrum]: {
169
- [types_1.Amms.sushiswap]: 0.0025,
170
- [types_1.Amms.swapr]: 0.00225,
171
- [types_1.Amms.swapfish]: 0.0017,
172
- [types_1.Amms.zyberswap]: 0.0015,
189
+ [Amms.sushiswap]: 0.0025,
190
+ [Amms.swapr]: 0.00225,
191
+ [Amms.swapfish]: 0.0017,
192
+ [Amms.zyberswap]: 0.0015,
173
193
  },
174
194
  [types_1.Networks.Avalanche]: {
175
- [types_1.Amms.pangolin]: 0.0025,
176
- [types_1.Amms.traderJoe]: 0.0025,
177
- [types_1.Amms.thorus]: 0,
195
+ [Amms.pangolin]: 0.0025,
196
+ [Amms.traderJoe]: 0.0025,
197
+ [Amms.thorus]: 0,
178
198
  },
179
199
  [types_1.Networks.Moonriver]: {
180
- [types_1.Amms.sushiswap]: 0.0025,
181
- [types_1.Amms.solarbeam]: 0.002,
200
+ [Amms.sushiswap]: 0.0025,
201
+ [Amms.solarbeam]: 0.002,
182
202
  },
183
203
  [types_1.Networks.Aurora]: {},
184
204
  [types_1.Networks.Cronos]: {},
185
205
  [types_1.Networks.Fantom]: {
186
- [types_1.Amms.solidly]: 0,
187
- [types_1.Amms.solidlyB]: 0,
188
- [types_1.Amms.solidlyUSDC]: 0,
189
- [types_1.Amms.solidlyUSDCB]: 0,
190
- [types_1.Amms.solidly091]: 0,
191
- [types_1.Amms.solidlyOxd]: 0,
206
+ [Amms.solidly]: 0,
207
+ [Amms.solidlyB]: 0,
208
+ [Amms.solidlyUSDC]: 0,
209
+ [Amms.solidlyUSDCB]: 0,
210
+ [Amms.solidly091]: 0,
211
+ [Amms.solidlyOxd]: 0,
192
212
  },
193
213
  [types_1.Networks.Harmony]: {},
194
214
  [types_1.Networks.Moonbeam]: {},
@@ -1,3 +1,5 @@
1
1
  import { BigNumber } from 'ethers';
2
2
  export declare const NOT_SYNCED = false;
3
3
  export declare const DEADLINE: BigNumber;
4
+ export declare const ZERO: BigNumber;
5
+ export declare const APPROVE_AMOUNT: BigNumber;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DEADLINE = exports.NOT_SYNCED = void 0;
3
+ exports.APPROVE_AMOUNT = exports.ZERO = exports.DEADLINE = exports.NOT_SYNCED = void 0;
4
4
  const ethers_1 = require("ethers");
5
5
  exports.NOT_SYNCED = false;
6
6
  exports.DEADLINE = ethers_1.BigNumber.from(Math.floor(Date.now() / 1000) + 3600 * 24 * 365); //1 year deadline
7
- const ZERO = ethers_1.ethers.constants.Zero;
8
- const APPROVE_AMOUNT = ethers_1.ethers.constants.MaxUint256;
7
+ exports.ZERO = ethers_1.ethers.constants.Zero;
8
+ exports.APPROVE_AMOUNT = ethers_1.ethers.constants.MaxUint256;
@@ -1,3 +1,4 @@
1
+ import { Amms } from './amms';
1
2
  export declare enum Networks {
2
3
  Ropsten = "ropsten",
3
4
  Mainnet = "mainnet",
@@ -25,25 +26,6 @@ export declare enum PoolTokenType {
25
26
  BorrowableA = "borrowable0",
26
27
  BorrowableB = "borrowable1"
27
28
  }
28
- export declare enum Amms {
29
- uniswap = "uniswap",
30
- quickswap = "quickswap",
31
- sushiswap = "sushiswap",
32
- swapr = "swapr",
33
- swapfish = "swapfish",
34
- zyberswap = "zyberswap",
35
- pangolin = "pangolin",
36
- traderJoe = "traderJoe",
37
- solarbeam = "solarbeam",
38
- thorus = "thorus",
39
- tetuswap = "tetuswap",
40
- solidly = "solidly",
41
- solidlyB = "solidlyB",
42
- solidlyUSDC = "solidlyUSDC",
43
- solidlyUSDCB = "solidlyUSDCB",
44
- solidly091 = "solidly091",
45
- solidlyOxd = "solidlyOxd"
46
- }
47
29
  export type Address = string;
48
30
  export type NetworkIndex<Type> = {
49
31
  [key in Networks]?: Type;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Amms = exports.PoolTokenType = exports.Factory = exports.Networks = void 0;
3
+ exports.PoolTokenType = exports.Factory = exports.Networks = void 0;
4
4
  var Networks;
5
5
  (function (Networks) {
6
6
  Networks["Ropsten"] = "ropsten";
@@ -32,23 +32,3 @@ var PoolTokenType;
32
32
  PoolTokenType["BorrowableA"] = "borrowable0";
33
33
  PoolTokenType["BorrowableB"] = "borrowable1";
34
34
  })(PoolTokenType = exports.PoolTokenType || (exports.PoolTokenType = {}));
35
- var Amms;
36
- (function (Amms) {
37
- Amms["uniswap"] = "uniswap";
38
- Amms["quickswap"] = "quickswap";
39
- Amms["sushiswap"] = "sushiswap";
40
- Amms["swapr"] = "swapr";
41
- Amms["swapfish"] = "swapfish";
42
- Amms["zyberswap"] = "zyberswap";
43
- Amms["pangolin"] = "pangolin";
44
- Amms["traderJoe"] = "traderJoe";
45
- Amms["solarbeam"] = "solarbeam";
46
- Amms["thorus"] = "thorus";
47
- Amms["tetuswap"] = "tetuswap";
48
- Amms["solidly"] = "solidly";
49
- Amms["solidlyB"] = "solidlyB";
50
- Amms["solidlyUSDC"] = "solidlyUSDC";
51
- Amms["solidlyUSDCB"] = "solidlyUSDCB";
52
- Amms["solidly091"] = "solidly091";
53
- Amms["solidlyOxd"] = "solidlyOxd";
54
- })(Amms = exports.Amms || (exports.Amms = {}));
@@ -1,4 +1,4 @@
1
- import { AirdropData, PendingRewardUI } from "./interfaces";
1
+ import { AirdropData, PendingRewardUI } from "./types";
2
2
  import ImpermaxRouter from "./index";
3
3
  import AccountLendingPool from "./AccountLendingPool";
4
4
  import { Address, Factory, FactoryIndex, LendingPoolIndex } from '../config/types';
@@ -12,9 +12,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- const interfaces_1 = require("./interfaces");
15
+ const types_1 = require("./types");
16
16
  const AccountPoolToken_1 = __importDefault(require("./AccountPoolToken"));
17
- const types_1 = require("../config/types");
17
+ const types_2 = require("../config/types");
18
18
  class AccountBorrowable extends AccountPoolToken_1.default {
19
19
  constructor() {
20
20
  super(...arguments);
@@ -53,8 +53,8 @@ class AccountBorrowable extends AccountPoolToken_1.default {
53
53
  getMaxBorrowable() {
54
54
  return __awaiter(this, void 0, void 0, function* () {
55
55
  const availableCash = yield this.poolToken.getTotalBalance();
56
- const { valueCollateral, valueA, valueB } = yield this.accountLendingPool.getValues(interfaces_1.NO_CHANGES);
57
- const [valueBorrowed, valueOther] = this.poolToken.poolTokenType == types_1.PoolTokenType.BorrowableA ? [valueA, valueB] : [valueB, valueA];
56
+ const { valueCollateral, valueA, valueB } = yield this.accountLendingPool.getValues(types_1.NO_CHANGES);
57
+ const [valueBorrowed, valueOther] = this.poolToken.poolTokenType == types_2.PoolTokenType.BorrowableA ? [valueA, valueB] : [valueB, valueA];
58
58
  const safetyMargin = (yield this.accountLendingPool.getSafetyMargin()) * this.getUiMargin();
59
59
  const liquidationPenalty = yield this.accountLendingPool.getLiquidationPenalty();
60
60
  const actualCollateral = valueCollateral / liquidationPenalty;
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- const interfaces_1 = require("./interfaces");
15
+ const types_1 = require("./types");
16
16
  const AccountPoolToken_1 = __importDefault(require("./AccountPoolToken"));
17
17
  class AccountCollateral extends AccountPoolToken_1.default {
18
18
  constructor() {
@@ -50,7 +50,7 @@ class AccountCollateral extends AccountPoolToken_1.default {
50
50
  return __awaiter(this, void 0, void 0, function* () {
51
51
  const deposited = yield this.getDeposited();
52
52
  const availableCash = yield this.poolToken.getTotalBalance();
53
- const { valueCollateral, valueA, valueB } = yield this.accountLendingPool.getValues(interfaces_1.NO_CHANGES);
53
+ const { valueCollateral, valueA, valueB } = yield this.accountLendingPool.getValues(types_1.NO_CHANGES);
54
54
  const safetyMargin = (yield this.accountLendingPool.getSafetyMargin()) * this.getUiMargin();
55
55
  const liquidationPenalty = yield this.accountLendingPool.getLiquidationPenalty();
56
56
  const actualCollateral = valueCollateral / liquidationPenalty;
@@ -1,4 +1,4 @@
1
- import { Changes, PendingRewardUI, Values } from "./interfaces";
1
+ import { Changes, PendingRewardUI, Values } from "./types";
2
2
  import Account from "./Account";
3
3
  import AccountBorrowable from "./AccountBorrowable";
4
4
  import AccountCollateral from "./AccountCollateral";
@@ -12,26 +12,26 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- const interfaces_1 = require("./interfaces");
15
+ const types_1 = require("./types");
16
16
  const AccountBorrowable_1 = __importDefault(require("./AccountBorrowable"));
17
17
  const AccountCollateral_1 = __importDefault(require("./AccountCollateral"));
18
- const types_1 = require("../config/types");
18
+ const types_2 = require("../config/types");
19
19
  class AccountLendingPool {
20
20
  constructor(account, lendingPool) {
21
21
  this.cache = {};
22
22
  // Shortcuts
23
- this.pta = () => this.accountPoolTokens[types_1.PoolTokenType.BorrowableA];
24
- this.ptb = () => this.accountPoolTokens[types_1.PoolTokenType.BorrowableB];
25
- this.ptc = () => this.accountPoolTokens[types_1.PoolTokenType.Collateral];
23
+ this.pta = () => this.accountPoolTokens[types_2.PoolTokenType.BorrowableA];
24
+ this.ptb = () => this.accountPoolTokens[types_2.PoolTokenType.BorrowableB];
25
+ this.ptc = () => this.accountPoolTokens[types_2.PoolTokenType.Collateral];
26
26
  this.getSafetyMargin = () => __awaiter(this, void 0, void 0, function* () { return (yield this.lendingPool.getSubgraphLendingPool()).getSafetyMargin(); });
27
27
  this.getLiquidationPenalty = () => __awaiter(this, void 0, void 0, function* () { return (yield this.lendingPool.getSubgraphLendingPool()).getLiquidationPenalty(); });
28
28
  this.getUiMargin = () => this.account.router.uiMargin;
29
29
  this.account = account;
30
30
  this.lendingPool = lendingPool;
31
31
  this.accountPoolTokens = {
32
- [types_1.PoolTokenType.Collateral]: new AccountCollateral_1.default(this, types_1.PoolTokenType.Collateral),
33
- [types_1.PoolTokenType.BorrowableA]: new AccountBorrowable_1.default(this, types_1.PoolTokenType.BorrowableA),
34
- [types_1.PoolTokenType.BorrowableB]: new AccountBorrowable_1.default(this, types_1.PoolTokenType.BorrowableB),
32
+ [types_2.PoolTokenType.Collateral]: new AccountCollateral_1.default(this, types_2.PoolTokenType.Collateral),
33
+ [types_2.PoolTokenType.BorrowableA]: new AccountBorrowable_1.default(this, types_2.PoolTokenType.BorrowableA),
34
+ [types_2.PoolTokenType.BorrowableB]: new AccountBorrowable_1.default(this, types_2.PoolTokenType.BorrowableB),
35
35
  };
36
36
  }
37
37
  cleanCache() {
@@ -130,7 +130,7 @@ class AccountLendingPool {
130
130
  getLeverage(changes) {
131
131
  return __awaiter(this, void 0, void 0, function* () {
132
132
  if (!changes)
133
- changes = interfaces_1.NO_CHANGES;
133
+ changes = types_1.NO_CHANGES;
134
134
  const { valueCollateral, valueA, valueB } = yield this.getValues(changes);
135
135
  const valueDebt = valueA + valueB;
136
136
  if (valueDebt == 0)
@@ -177,7 +177,7 @@ class AccountLendingPool {
177
177
  getLiquidationPrices(changes) {
178
178
  return __awaiter(this, void 0, void 0, function* () {
179
179
  if (!changes)
180
- changes = interfaces_1.NO_CHANGES;
180
+ changes = types_1.NO_CHANGES;
181
181
  const values = yield this.getValues(changes);
182
182
  return this.getLiquidationPricesGivenValues(values);
183
183
  });
@@ -193,7 +193,7 @@ class AccountLendingPool {
193
193
  const adjustFactor = 1 / diff;
194
194
  const availableCashValue1 = availableCashA * priceA;
195
195
  const availableCashValue2 = availableCashB * priceB;
196
- const { valueCollateral, valueA, valueB } = yield this.getValues(interfaces_1.NO_CHANGES);
196
+ const { valueCollateral, valueA, valueB } = yield this.getValues(types_1.NO_CHANGES);
197
197
  const safetyMargin = (yield this.getSafetyMargin()) * this.getUiMargin();
198
198
  const liquidationPenalty = yield this.getLiquidationPenalty();
199
199
  const actualCollateral = valueCollateral / liquidationPenalty;
@@ -211,7 +211,7 @@ class AccountLendingPool {
211
211
  // Max Deleverage
212
212
  getMaxDeleverage(slippage) {
213
213
  return __awaiter(this, void 0, void 0, function* () {
214
- const { valueCollateral, valueA, valueB } = yield this.getMarketValues(interfaces_1.NO_CHANGES);
214
+ const { valueCollateral, valueA, valueB } = yield this.getMarketValues(types_1.NO_CHANGES);
215
215
  const minRepayPerSide = valueCollateral / 2 / Math.sqrt(slippage);
216
216
  if (minRepayPerSide >= valueA && minRepayPerSide >= valueB) {
217
217
  return this.ptc().getDeposited();
@@ -1,4 +1,4 @@
1
- import { Contract } from "./interfaces";
1
+ import { Contract } from "./types";
2
2
  import PoolToken from "./PoolToken";
3
3
  import { Address } from '../config/types';
4
4
  export default class Borrowable extends PoolToken {
@@ -1,4 +1,4 @@
1
- import { Contract } from "./interfaces";
1
+ import { Contract } from "./types";
2
2
  import PoolToken from "./PoolToken";
3
3
  export default class Collateral extends PoolToken {
4
4
  collateralCache: {};
@@ -1,4 +1,4 @@
1
- import { Contract } from "./interfaces";
1
+ import { Contract } from "./types";
2
2
  import ImpermaxRouter from "./index";
3
3
  import { Address } from '../config/types';
4
4
  export default class ContractsHelper {
@@ -1,7 +1,7 @@
1
1
  import { BigNumber } from "ethers";
2
2
  import Account from "./Account";
3
3
  import InteractionsLendingPool from "./InteractionsLendingPool";
4
- import { AirdropData, Contract } from "./interfaces";
4
+ import { AirdropData, Contract } from "./types";
5
5
  import { Address, Factory, FactoryIndex, LendingPoolIndex } from '../config/types';
6
6
  export default class Interactions {
7
7
  account: Account;
@@ -3,7 +3,7 @@ import AccountLendingPool from "./AccountLendingPool";
3
3
  import InteractionsPoolToken from "./InteractionsPoolToken";
4
4
  import { BigNumber } from "ethers";
5
5
  import { PoolTokenType } from '../config/types';
6
- import { PermitData } from './interfaces';
6
+ import { PermitData } from './types';
7
7
  export default class InteractionsLendingPool {
8
8
  interactions: Interactions;
9
9
  accountLendingPool: AccountLendingPool;
@@ -1,7 +1,7 @@
1
1
  import { ethers, BigNumber } from "ethers";
2
2
  import AccountPoolToken from "./AccountPoolToken";
3
3
  import InteractionsLendingPool from "./InteractionsLendingPool";
4
- import { ApprovalType, PermitData } from "./interfaces";
4
+ import { ApprovalType, PermitData } from "./types";
5
5
  import { PoolTokenType } from '../config/types';
6
6
  export default class InteractionsPoolToken {
7
7
  interactionsLendingPool: InteractionsLendingPool;
@@ -10,8 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  const ethers_1 = require("ethers");
13
- const interfaces_1 = require("./interfaces");
14
- const types_1 = require("../config/types");
13
+ const types_1 = require("./types");
14
+ const types_2 = require("../config/types");
15
15
  const weths_1 = require("../config/contracts/weths");
16
16
  const general_1 = require("../config/general");
17
17
  const MAX_UINT256 = ethers_1.ethers.constants.MaxUint256;
@@ -50,18 +50,18 @@ class InteractionsPoolToken {
50
50
  });
51
51
  }
52
52
  isCollateral() {
53
- return this.getPoolToken().poolTokenType == types_1.PoolTokenType.Collateral;
53
+ return this.getPoolToken().poolTokenType == types_2.PoolTokenType.Collateral;
54
54
  }
55
55
  getAllowance(approvalType) {
56
56
  return __awaiter(this, void 0, void 0, function* () {
57
57
  const poolToken = yield this.getPoolToken().getPoolToken();
58
58
  const token = yield this.getPoolToken().getToken();
59
- if ((yield this.isWETH()) && approvalType == interfaces_1.ApprovalType.UNDERLYING)
59
+ if ((yield this.isWETH()) && approvalType == types_1.ApprovalType.UNDERLYING)
60
60
  return MAX_UINT256;
61
61
  const { owner, spender } = this.interactionsLendingPool.getOwnerSpender();
62
- const allowance = (approvalType == interfaces_1.ApprovalType.POOL_TOKEN) ? yield poolToken.methods.allowance(owner, spender).call() :
63
- (approvalType == interfaces_1.ApprovalType.UNDERLYING) ? yield token.methods.allowance(owner, spender).call() :
64
- (approvalType == interfaces_1.ApprovalType.BORROW) ? yield poolToken.methods.borrowAllowance(owner, spender).call() : 0;
62
+ const allowance = (approvalType == types_1.ApprovalType.POOL_TOKEN) ? yield poolToken.methods.allowance(owner, spender).call() :
63
+ (approvalType == types_1.ApprovalType.UNDERLYING) ? yield token.methods.allowance(owner, spender).call() :
64
+ (approvalType == types_1.ApprovalType.BORROW) ? yield poolToken.methods.borrowAllowance(owner, spender).call() : 0;
65
65
  return ethers_1.BigNumber.from(allowance);
66
66
  });
67
67
  }
@@ -71,23 +71,23 @@ class InteractionsPoolToken {
71
71
  const poolToken = yield this.getPoolToken().getPoolToken();
72
72
  const token = yield this.getPoolToken().getToken();
73
73
  let method;
74
- if (approvalType == interfaces_1.ApprovalType.POOL_TOKEN)
74
+ if (approvalType == types_1.ApprovalType.POOL_TOKEN)
75
75
  method = poolToken.methods.approve(spender, amount);
76
- if (approvalType == interfaces_1.ApprovalType.UNDERLYING)
76
+ if (approvalType == types_1.ApprovalType.UNDERLYING)
77
77
  method = token.methods.approve(spender, amount);
78
- if (approvalType == interfaces_1.ApprovalType.BORROW)
78
+ if (approvalType == types_1.ApprovalType.BORROW)
79
79
  method = poolToken.methods.borrowApprove(spender, amount);
80
80
  return this.send(method, onTransactionHash);
81
81
  });
82
82
  }
83
83
  getPermitData(approvalType, amount, deadlineArg, callBack) {
84
84
  return __awaiter(this, void 0, void 0, function* () {
85
- if (approvalType === interfaces_1.ApprovalType.UNDERLYING && this.getPoolToken().poolTokenType != types_1.PoolTokenType.Collateral)
85
+ if (approvalType === types_1.ApprovalType.UNDERLYING && this.getPoolToken().poolTokenType != types_2.PoolTokenType.Collateral)
86
86
  return callBack(null);
87
87
  const { owner, spender } = this.interactionsLendingPool.getOwnerSpender();
88
88
  const poolToken = yield this.getPoolToken().getPoolToken();
89
89
  const token = yield this.getPoolToken().getToken();
90
- const contract = approvalType == interfaces_1.ApprovalType.UNDERLYING ? token : poolToken;
90
+ const contract = approvalType == types_1.ApprovalType.UNDERLYING ? token : poolToken;
91
91
  const nonce = yield contract.methods.nonces(owner).call();
92
92
  const name = yield contract.methods.name().call();
93
93
  const deadline = deadlineArg ? deadlineArg : general_1.DEADLINE;
@@ -99,7 +99,7 @@ class InteractionsPoolToken {
99
99
  chainId: this.getImpermaxRouter().chainId,
100
100
  verifyingContract: contract._address,
101
101
  },
102
- primaryType: approvalType == interfaces_1.ApprovalType.BORROW ? "BorrowPermit" : "Permit",
102
+ primaryType: approvalType == types_1.ApprovalType.BORROW ? "BorrowPermit" : "Permit",
103
103
  message: {
104
104
  owner: owner,
105
105
  spender: spender,
@@ -1,4 +1,4 @@
1
- import { PendingRewardUI } from "./interfaces";
1
+ import { PendingRewardUI } from "./types";
2
2
  import PoolToken from "./PoolToken";
3
3
  import ImpermaxFactory from "./ImpermaxFactory";
4
4
  import { Contract } from "ethers";
@@ -35,7 +35,7 @@ export default class LendingPool {
35
35
  ptb: () => Borrowable;
36
36
  ptc: () => Collateral;
37
37
  getPoolToken(poolTokenType: PoolTokenType): PoolToken;
38
- getSubgraphLendingPool(): Promise<import("../subgraph/LendingPool").default>;
38
+ getSubgraphLendingPool(): Promise<import("..").SubgraphLendingPool>;
39
39
  private initializePoolTokenAddresses;
40
40
  getPoolTokenAddresses(): Promise<{
41
41
  collateral: string;
@@ -1,5 +1,5 @@
1
1
  import { BigNumber } from "ethers";
2
- import { Contract } from "./interfaces";
2
+ import { Contract } from "./types";
3
3
  import LendingPool from "./LendingPool";
4
4
  import { Address, PoolTokenType } from '../config/types';
5
5
  export default abstract class PoolToken {
@@ -14,7 +14,7 @@ export default abstract class PoolToken {
14
14
  constructor(lendingPool: LendingPool, poolTokenType: PoolTokenType);
15
15
  cleanCache(): void;
16
16
  getContractHelper: () => import("./ContractsHelper").default;
17
- getSubgraphPoolToken(): Promise<import("../subgraph/PoolToken").default>;
17
+ getSubgraphPoolToken(): Promise<import("..").SubgraphPoolToken>;
18
18
  protected getPoolTokenAddressFromLendingPool(): Promise<string>;
19
19
  abstract initializePoolToken(): Promise<Contract>;
20
20
  getPoolToken(): Promise<any>;
@@ -1,4 +1,4 @@
1
- import { ImpermaxRouterCfg } from "./interfaces";
1
+ import { ImpermaxRouterCfg } from "./types";
2
2
  import Subgraph from "../subgraph";
3
3
  import ContractsHelper from "./ContractsHelper";
4
4
  import ImpermaxFactory from "./ImpermaxFactory";
@@ -0,0 +1,45 @@
1
+ import { BigNumber } from "ethers";
2
+ import Subgraph from "../subgraph";
3
+ import { Networks } from '../config/types';
4
+ export type Contract = any;
5
+ export declare enum ApprovalType {
6
+ POOL_TOKEN = 0,
7
+ UNDERLYING = 1,
8
+ BORROW = 2
9
+ }
10
+ export interface PermitData {
11
+ permitData: string;
12
+ amount: BigNumber;
13
+ deadline: BigNumber;
14
+ }
15
+ export interface ImpermaxRouterCfg {
16
+ network: Networks;
17
+ subgraph: Subgraph;
18
+ web3: any;
19
+ chainId: number;
20
+ priceInverted: boolean;
21
+ }
22
+ export interface Changes {
23
+ changeBorrowedA: number;
24
+ changeBorrowedB: number;
25
+ changeCollateral: number;
26
+ }
27
+ export declare const NO_CHANGES: {
28
+ changeBorrowedA: number;
29
+ changeBorrowedB: number;
30
+ changeCollateral: number;
31
+ };
32
+ export interface Values {
33
+ valueCollateral: number;
34
+ valueA: number;
35
+ valueB: number;
36
+ }
37
+ export interface AirdropData {
38
+ index: number;
39
+ amount: BigNumber;
40
+ proof: Array<string>;
41
+ }
42
+ export interface PendingRewardUI {
43
+ symbol: string;
44
+ amount: number;
45
+ }
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NO_CHANGES = exports.ApprovalType = void 0;
4
- const types_1 = require("../config/types");
5
4
  var ApprovalType;
6
5
  (function (ApprovalType) {
7
6
  ApprovalType[ApprovalType["POOL_TOKEN"] = 0] = "POOL_TOKEN";
package/lib/index.d.ts CHANGED
@@ -1,3 +1,42 @@
1
1
  import Subgraph from './subgraph';
2
2
  import ImpermaxRouter from './impermax-router';
3
- export { Subgraph, ImpermaxRouter, };
3
+ import { CLAIM_AGGREGATOR } from './config/contracts/claim-aggregators';
4
+ import { IMPERMAX_CHEF } from './config/contracts/impermax-chef';
5
+ import { IMX } from './config/contracts/imxes';
6
+ import { MERKLE_DISTRIBUTOR_ETH, MERKLE_DISTRIBUTOR_IBEX, MERKLE_DISTRIBUTOR_IBEX_2 } from './config/contracts/merkle-distributors';
7
+ import { MERKLE_URL_ETH, MERKLE_URL_IBEX, MERKLE_URL_IBEX_2 } from './config/endpoints/merkle-distributors';
8
+ import { ROUTER } from './config/contracts/routers';
9
+ import { SIMPLE_UNISWAP_ORACLE } from './config/contracts/simple-uniswap-oracles';
10
+ import { WETH } from './config/contracts/weths';
11
+ import { ADD_LIQUIDITY_URLS, Amms, AMM_FACTORY, AMM_LP_FEE, AMM_SUBGRAPH_URLS, getAmmByFactory, hrAmms } from './config/amms';
12
+ import { DEBANK_IDS } from './config/debank-ids';
13
+ import { ETH_NAME, ETH_SYMBOL } from './config/eth';
14
+ import { BORROW_FEE_FACTORIES, LIQUIDATION_FEE_FACTORIES, OLD_KINK_MULTIPLIER_FACTORIES, SOLIDEX_FACTORIES, V2_FACTORIES } from './config/factories';
15
+ import { FarmIndex, Farms, getFarmByStakedLPFactory, hrFarms, STAKED_LP_FACTORY } from './config/farms';
16
+ import { APPROVE_AMOUNT, DEADLINE, NOT_SYNCED, ZERO } from './config/general';
17
+ import { BLOCKS_SUBGRAPH_URL, IMPERMAX_CHEF_SUBGRAPH_URL, IMPERMAX_SUBGRAPH_URL, XIMX_SUBGRAPH_URL } from './config/subgraphs';
18
+ import { Address, AddressIndex, AmmIndex, DistributorDetails, Factory, FactoryIndex, LendingPoolIndex, NetworkFactoryIndex, NetworkIndex, Networks, PoolTokenType } from './config/types';
19
+ import SubgraphAccount from './subgraph/Account';
20
+ import SubgraphAccountLendingPool from './subgraph/AccountLendingPool';
21
+ import SubgraphAccountPoolToken from './subgraph/AccountPoolToken';
22
+ import SubgraphLendingPool from './subgraph/LendingPool';
23
+ import SubgraphPoolToken from './subgraph/PoolToken';
24
+ import PriceHelper from './subgraph/PriceHelper';
25
+ import SolidexHelper from './subgraph/SolidexHelper';
26
+ import ImpermaxRouterAccount from './impermax-router/Account';
27
+ import ImpermaxRouterAccountPoolToken from './impermax-router/AccountPoolToken';
28
+ import ImpermaxRouterAccountLendingPool from './impermax-router/AccountLendingPool';
29
+ import AccountBorrowable from './impermax-router/AccountBorrowable';
30
+ import AccountCollateral from './impermax-router/AccountCollateral';
31
+ import Borrowable from './impermax-router/Borrowable';
32
+ import Collateral from './impermax-router/Collateral';
33
+ import ContractsHelper from './impermax-router/ContractsHelper';
34
+ import ImpermaxFactory from './impermax-router/ImpermaxFactory';
35
+ import Interactions from './impermax-router/Interactions';
36
+ import InteractionsLendingPool from './impermax-router/InteractionsLendingPool';
37
+ import InteractionsPoolToken from './impermax-router/InteractionsPoolToken';
38
+ import ImpermaxRouterLendingPool from './impermax-router/LendingPool';
39
+ import ImpermaxRouterPoolToken from './impermax-router/PoolToken';
40
+ import { AirdropData, ApprovalType, Changes, Contract, ImpermaxRouterCfg, NO_CHANGES, PendingRewardUI, PermitData, Values } from './impermax-router/types';
41
+ import { BorrowableData, BorrowablePastData, BorrowPosition, CollateralData, CollateralPosition, FarmingPoolData, LendingPoolData, LendingPoolPastData, PairData, PoolTokenData, RewardData, SupplyPosition, TokenData, TvlData, UserData, XimxData } from './subgraph/types';
42
+ export { CLAIM_AGGREGATOR, IMPERMAX_CHEF, IMX, MERKLE_DISTRIBUTOR_IBEX, MERKLE_DISTRIBUTOR_IBEX_2, MERKLE_DISTRIBUTOR_ETH, ROUTER, SIMPLE_UNISWAP_ORACLE, WETH, MERKLE_URL_ETH, MERKLE_URL_IBEX, MERKLE_URL_IBEX_2, hrAmms, AMM_FACTORY, getAmmByFactory, AMM_SUBGRAPH_URLS, ADD_LIQUIDITY_URLS, AMM_LP_FEE, DEBANK_IDS, ETH_SYMBOL, ETH_NAME, SOLIDEX_FACTORIES, BORROW_FEE_FACTORIES, OLD_KINK_MULTIPLIER_FACTORIES, LIQUIDATION_FEE_FACTORIES, V2_FACTORIES, Farms, hrFarms, FarmIndex, STAKED_LP_FACTORY, getFarmByStakedLPFactory, NOT_SYNCED, DEADLINE, ZERO, APPROVE_AMOUNT, IMPERMAX_SUBGRAPH_URL, IMPERMAX_CHEF_SUBGRAPH_URL, BLOCKS_SUBGRAPH_URL, XIMX_SUBGRAPH_URL, Networks, Factory, PoolTokenType, Amms, Address, NetworkIndex, FactoryIndex, AddressIndex, NetworkFactoryIndex, LendingPoolIndex, AmmIndex, DistributorDetails, Subgraph, SubgraphAccount, SubgraphAccountLendingPool, SubgraphAccountPoolToken, SubgraphLendingPool, SubgraphPoolToken, PriceHelper, SolidexHelper, PoolTokenData, BorrowableData, CollateralData, BorrowablePastData, TokenData, RewardData, PairData, FarmingPoolData, LendingPoolPastData, LendingPoolData, CollateralPosition, SupplyPosition, BorrowPosition, UserData, TvlData, XimxData, ImpermaxRouter, ImpermaxRouterAccount, ImpermaxRouterAccountPoolToken, ImpermaxRouterAccountLendingPool, AccountBorrowable, AccountCollateral, Borrowable, Collateral, ContractsHelper, ImpermaxFactory, Interactions, InteractionsLendingPool, InteractionsPoolToken, ImpermaxRouterLendingPool, ImpermaxRouterPoolToken, Contract, ApprovalType, PermitData, ImpermaxRouterCfg, Changes, NO_CHANGES, Values, AirdropData, PendingRewardUI, };
package/lib/index.js CHANGED
@@ -3,8 +3,112 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ImpermaxRouter = exports.Subgraph = void 0;
6
+ exports.SolidexHelper = exports.PriceHelper = exports.SubgraphPoolToken = exports.SubgraphLendingPool = exports.SubgraphAccountPoolToken = exports.SubgraphAccountLendingPool = exports.SubgraphAccount = exports.Subgraph = exports.Amms = exports.PoolTokenType = exports.Factory = exports.Networks = exports.XIMX_SUBGRAPH_URL = exports.BLOCKS_SUBGRAPH_URL = exports.IMPERMAX_CHEF_SUBGRAPH_URL = exports.IMPERMAX_SUBGRAPH_URL = exports.APPROVE_AMOUNT = exports.ZERO = exports.DEADLINE = exports.NOT_SYNCED = exports.getFarmByStakedLPFactory = exports.STAKED_LP_FACTORY = exports.hrFarms = exports.Farms = exports.V2_FACTORIES = exports.LIQUIDATION_FEE_FACTORIES = exports.OLD_KINK_MULTIPLIER_FACTORIES = exports.BORROW_FEE_FACTORIES = exports.SOLIDEX_FACTORIES = exports.ETH_NAME = exports.ETH_SYMBOL = exports.DEBANK_IDS = exports.AMM_LP_FEE = exports.ADD_LIQUIDITY_URLS = exports.AMM_SUBGRAPH_URLS = exports.getAmmByFactory = exports.AMM_FACTORY = exports.hrAmms = exports.MERKLE_URL_IBEX_2 = exports.MERKLE_URL_IBEX = exports.MERKLE_URL_ETH = exports.WETH = exports.SIMPLE_UNISWAP_ORACLE = exports.ROUTER = exports.MERKLE_DISTRIBUTOR_ETH = exports.MERKLE_DISTRIBUTOR_IBEX_2 = exports.MERKLE_DISTRIBUTOR_IBEX = exports.IMX = exports.IMPERMAX_CHEF = exports.CLAIM_AGGREGATOR = void 0;
7
+ exports.NO_CHANGES = exports.ApprovalType = exports.ImpermaxRouterPoolToken = exports.ImpermaxRouterLendingPool = exports.InteractionsPoolToken = exports.InteractionsLendingPool = exports.Interactions = exports.ImpermaxFactory = exports.ContractsHelper = exports.Collateral = exports.Borrowable = exports.AccountCollateral = exports.AccountBorrowable = exports.ImpermaxRouterAccountLendingPool = exports.ImpermaxRouterAccountPoolToken = exports.ImpermaxRouterAccount = exports.ImpermaxRouter = void 0;
7
8
  const subgraph_1 = __importDefault(require("./subgraph"));
8
9
  exports.Subgraph = subgraph_1.default;
9
10
  const impermax_router_1 = __importDefault(require("./impermax-router"));
10
11
  exports.ImpermaxRouter = impermax_router_1.default;
12
+ const claim_aggregators_1 = require("./config/contracts/claim-aggregators");
13
+ Object.defineProperty(exports, "CLAIM_AGGREGATOR", { enumerable: true, get: function () { return claim_aggregators_1.CLAIM_AGGREGATOR; } });
14
+ const impermax_chef_1 = require("./config/contracts/impermax-chef");
15
+ Object.defineProperty(exports, "IMPERMAX_CHEF", { enumerable: true, get: function () { return impermax_chef_1.IMPERMAX_CHEF; } });
16
+ const imxes_1 = require("./config/contracts/imxes");
17
+ Object.defineProperty(exports, "IMX", { enumerable: true, get: function () { return imxes_1.IMX; } });
18
+ const merkle_distributors_1 = require("./config/contracts/merkle-distributors");
19
+ Object.defineProperty(exports, "MERKLE_DISTRIBUTOR_ETH", { enumerable: true, get: function () { return merkle_distributors_1.MERKLE_DISTRIBUTOR_ETH; } });
20
+ Object.defineProperty(exports, "MERKLE_DISTRIBUTOR_IBEX", { enumerable: true, get: function () { return merkle_distributors_1.MERKLE_DISTRIBUTOR_IBEX; } });
21
+ Object.defineProperty(exports, "MERKLE_DISTRIBUTOR_IBEX_2", { enumerable: true, get: function () { return merkle_distributors_1.MERKLE_DISTRIBUTOR_IBEX_2; } });
22
+ const merkle_distributors_2 = require("./config/endpoints/merkle-distributors");
23
+ Object.defineProperty(exports, "MERKLE_URL_ETH", { enumerable: true, get: function () { return merkle_distributors_2.MERKLE_URL_ETH; } });
24
+ Object.defineProperty(exports, "MERKLE_URL_IBEX", { enumerable: true, get: function () { return merkle_distributors_2.MERKLE_URL_IBEX; } });
25
+ Object.defineProperty(exports, "MERKLE_URL_IBEX_2", { enumerable: true, get: function () { return merkle_distributors_2.MERKLE_URL_IBEX_2; } });
26
+ const routers_1 = require("./config/contracts/routers");
27
+ Object.defineProperty(exports, "ROUTER", { enumerable: true, get: function () { return routers_1.ROUTER; } });
28
+ const simple_uniswap_oracles_1 = require("./config/contracts/simple-uniswap-oracles");
29
+ Object.defineProperty(exports, "SIMPLE_UNISWAP_ORACLE", { enumerable: true, get: function () { return simple_uniswap_oracles_1.SIMPLE_UNISWAP_ORACLE; } });
30
+ const weths_1 = require("./config/contracts/weths");
31
+ Object.defineProperty(exports, "WETH", { enumerable: true, get: function () { return weths_1.WETH; } });
32
+ const amms_1 = require("./config/amms");
33
+ Object.defineProperty(exports, "ADD_LIQUIDITY_URLS", { enumerable: true, get: function () { return amms_1.ADD_LIQUIDITY_URLS; } });
34
+ Object.defineProperty(exports, "Amms", { enumerable: true, get: function () { return amms_1.Amms; } });
35
+ Object.defineProperty(exports, "AMM_FACTORY", { enumerable: true, get: function () { return amms_1.AMM_FACTORY; } });
36
+ Object.defineProperty(exports, "AMM_LP_FEE", { enumerable: true, get: function () { return amms_1.AMM_LP_FEE; } });
37
+ Object.defineProperty(exports, "AMM_SUBGRAPH_URLS", { enumerable: true, get: function () { return amms_1.AMM_SUBGRAPH_URLS; } });
38
+ Object.defineProperty(exports, "getAmmByFactory", { enumerable: true, get: function () { return amms_1.getAmmByFactory; } });
39
+ Object.defineProperty(exports, "hrAmms", { enumerable: true, get: function () { return amms_1.hrAmms; } });
40
+ const debank_ids_1 = require("./config/debank-ids");
41
+ Object.defineProperty(exports, "DEBANK_IDS", { enumerable: true, get: function () { return debank_ids_1.DEBANK_IDS; } });
42
+ const eth_1 = require("./config/eth");
43
+ Object.defineProperty(exports, "ETH_NAME", { enumerable: true, get: function () { return eth_1.ETH_NAME; } });
44
+ Object.defineProperty(exports, "ETH_SYMBOL", { enumerable: true, get: function () { return eth_1.ETH_SYMBOL; } });
45
+ const factories_1 = require("./config/factories");
46
+ Object.defineProperty(exports, "BORROW_FEE_FACTORIES", { enumerable: true, get: function () { return factories_1.BORROW_FEE_FACTORIES; } });
47
+ Object.defineProperty(exports, "LIQUIDATION_FEE_FACTORIES", { enumerable: true, get: function () { return factories_1.LIQUIDATION_FEE_FACTORIES; } });
48
+ Object.defineProperty(exports, "OLD_KINK_MULTIPLIER_FACTORIES", { enumerable: true, get: function () { return factories_1.OLD_KINK_MULTIPLIER_FACTORIES; } });
49
+ Object.defineProperty(exports, "SOLIDEX_FACTORIES", { enumerable: true, get: function () { return factories_1.SOLIDEX_FACTORIES; } });
50
+ Object.defineProperty(exports, "V2_FACTORIES", { enumerable: true, get: function () { return factories_1.V2_FACTORIES; } });
51
+ const farms_1 = require("./config/farms");
52
+ Object.defineProperty(exports, "Farms", { enumerable: true, get: function () { return farms_1.Farms; } });
53
+ Object.defineProperty(exports, "getFarmByStakedLPFactory", { enumerable: true, get: function () { return farms_1.getFarmByStakedLPFactory; } });
54
+ Object.defineProperty(exports, "hrFarms", { enumerable: true, get: function () { return farms_1.hrFarms; } });
55
+ Object.defineProperty(exports, "STAKED_LP_FACTORY", { enumerable: true, get: function () { return farms_1.STAKED_LP_FACTORY; } });
56
+ const general_1 = require("./config/general");
57
+ Object.defineProperty(exports, "APPROVE_AMOUNT", { enumerable: true, get: function () { return general_1.APPROVE_AMOUNT; } });
58
+ Object.defineProperty(exports, "DEADLINE", { enumerable: true, get: function () { return general_1.DEADLINE; } });
59
+ Object.defineProperty(exports, "NOT_SYNCED", { enumerable: true, get: function () { return general_1.NOT_SYNCED; } });
60
+ Object.defineProperty(exports, "ZERO", { enumerable: true, get: function () { return general_1.ZERO; } });
61
+ const subgraphs_1 = require("./config/subgraphs");
62
+ Object.defineProperty(exports, "BLOCKS_SUBGRAPH_URL", { enumerable: true, get: function () { return subgraphs_1.BLOCKS_SUBGRAPH_URL; } });
63
+ Object.defineProperty(exports, "IMPERMAX_CHEF_SUBGRAPH_URL", { enumerable: true, get: function () { return subgraphs_1.IMPERMAX_CHEF_SUBGRAPH_URL; } });
64
+ Object.defineProperty(exports, "IMPERMAX_SUBGRAPH_URL", { enumerable: true, get: function () { return subgraphs_1.IMPERMAX_SUBGRAPH_URL; } });
65
+ Object.defineProperty(exports, "XIMX_SUBGRAPH_URL", { enumerable: true, get: function () { return subgraphs_1.XIMX_SUBGRAPH_URL; } });
66
+ const types_1 = require("./config/types");
67
+ Object.defineProperty(exports, "Factory", { enumerable: true, get: function () { return types_1.Factory; } });
68
+ Object.defineProperty(exports, "Networks", { enumerable: true, get: function () { return types_1.Networks; } });
69
+ Object.defineProperty(exports, "PoolTokenType", { enumerable: true, get: function () { return types_1.PoolTokenType; } });
70
+ const Account_1 = __importDefault(require("./subgraph/Account"));
71
+ exports.SubgraphAccount = Account_1.default;
72
+ const AccountLendingPool_1 = __importDefault(require("./subgraph/AccountLendingPool"));
73
+ exports.SubgraphAccountLendingPool = AccountLendingPool_1.default;
74
+ const AccountPoolToken_1 = __importDefault(require("./subgraph/AccountPoolToken"));
75
+ exports.SubgraphAccountPoolToken = AccountPoolToken_1.default;
76
+ const LendingPool_1 = __importDefault(require("./subgraph/LendingPool"));
77
+ exports.SubgraphLendingPool = LendingPool_1.default;
78
+ const PoolToken_1 = __importDefault(require("./subgraph/PoolToken"));
79
+ exports.SubgraphPoolToken = PoolToken_1.default;
80
+ const PriceHelper_1 = __importDefault(require("./subgraph/PriceHelper"));
81
+ exports.PriceHelper = PriceHelper_1.default;
82
+ const SolidexHelper_1 = __importDefault(require("./subgraph/SolidexHelper"));
83
+ exports.SolidexHelper = SolidexHelper_1.default;
84
+ const Account_2 = __importDefault(require("./impermax-router/Account"));
85
+ exports.ImpermaxRouterAccount = Account_2.default;
86
+ const AccountPoolToken_2 = __importDefault(require("./impermax-router/AccountPoolToken"));
87
+ exports.ImpermaxRouterAccountPoolToken = AccountPoolToken_2.default;
88
+ const AccountLendingPool_2 = __importDefault(require("./impermax-router/AccountLendingPool"));
89
+ exports.ImpermaxRouterAccountLendingPool = AccountLendingPool_2.default;
90
+ const AccountBorrowable_1 = __importDefault(require("./impermax-router/AccountBorrowable"));
91
+ exports.AccountBorrowable = AccountBorrowable_1.default;
92
+ const AccountCollateral_1 = __importDefault(require("./impermax-router/AccountCollateral"));
93
+ exports.AccountCollateral = AccountCollateral_1.default;
94
+ const Borrowable_1 = __importDefault(require("./impermax-router/Borrowable"));
95
+ exports.Borrowable = Borrowable_1.default;
96
+ const Collateral_1 = __importDefault(require("./impermax-router/Collateral"));
97
+ exports.Collateral = Collateral_1.default;
98
+ const ContractsHelper_1 = __importDefault(require("./impermax-router/ContractsHelper"));
99
+ exports.ContractsHelper = ContractsHelper_1.default;
100
+ const ImpermaxFactory_1 = __importDefault(require("./impermax-router/ImpermaxFactory"));
101
+ exports.ImpermaxFactory = ImpermaxFactory_1.default;
102
+ const Interactions_1 = __importDefault(require("./impermax-router/Interactions"));
103
+ exports.Interactions = Interactions_1.default;
104
+ const InteractionsLendingPool_1 = __importDefault(require("./impermax-router/InteractionsLendingPool"));
105
+ exports.InteractionsLendingPool = InteractionsLendingPool_1.default;
106
+ const InteractionsPoolToken_1 = __importDefault(require("./impermax-router/InteractionsPoolToken"));
107
+ exports.InteractionsPoolToken = InteractionsPoolToken_1.default;
108
+ const LendingPool_2 = __importDefault(require("./impermax-router/LendingPool"));
109
+ exports.ImpermaxRouterLendingPool = LendingPool_2.default;
110
+ const PoolToken_2 = __importDefault(require("./impermax-router/PoolToken"));
111
+ exports.ImpermaxRouterPoolToken = PoolToken_2.default;
112
+ const types_2 = require("./impermax-router/types");
113
+ Object.defineProperty(exports, "ApprovalType", { enumerable: true, get: function () { return types_2.ApprovalType; } });
114
+ Object.defineProperty(exports, "NO_CHANGES", { enumerable: true, get: function () { return types_2.NO_CHANGES; } });
@@ -1,7 +1,7 @@
1
- import { UserData } from "../impermax-router/interfaces";
2
1
  import Subgraph from "./index";
3
2
  import AccountLendingPool from "./AccountLendingPool";
4
3
  import { Address, Factory, FactoryIndex, LendingPoolIndex } from '../config/types';
4
+ import { UserData } from './types';
5
5
  export default class Account {
6
6
  subgraph: Subgraph;
7
7
  account: Address;
@@ -1,8 +1,8 @@
1
- import { CollateralPosition, UserData } from "../impermax-router/interfaces";
2
1
  import Account from "./Account";
3
2
  import AccountPoolToken from "./AccountPoolToken";
4
3
  import LendingPool from "./LendingPool";
5
4
  import { PoolTokenType } from '../config/types';
5
+ import { CollateralPosition, UserData } from './types';
6
6
  export default class AccountLendingPool {
7
7
  account: Account;
8
8
  lendingPool: LendingPool;
@@ -1,8 +1,9 @@
1
- import { LendingPoolData, LendingPoolPastData } from "../impermax-router/interfaces";
2
1
  import Subgraph from "./index";
3
2
  import PoolToken from "./PoolToken";
4
- import { Address, Amms, Factory, PoolTokenType } from '../config/types';
3
+ import { Address, Factory, PoolTokenType } from '../config/types';
4
+ import { Amms } from '../config/amms';
5
5
  import { Farms } from '../config/farms';
6
+ import { LendingPoolData, LendingPoolPastData } from './types';
6
7
  export default class LendingPool {
7
8
  subgraph: Subgraph;
8
9
  factory: Factory;
@@ -1,6 +1,6 @@
1
- import { PoolTokenData, BorrowablePastData } from "../impermax-router/interfaces";
2
1
  import LendingPool from "./LendingPool";
3
2
  import { Address, PoolTokenType } from '../config/types';
3
+ import { BorrowablePastData, PoolTokenData } from './types';
4
4
  export default class PoolToken {
5
5
  lendingPool: LendingPool;
6
6
  poolTokenType: PoolTokenType;
@@ -1,10 +1,10 @@
1
- import { LendingPoolData, TvlData, UserData, XimxData } from "../impermax-router/interfaces";
2
1
  import * as initializer from "./initializer";
3
2
  import LendingPool from "./LendingPool";
4
3
  import PriceHelper from "./PriceHelper";
5
4
  import SolidexHelper from "./SolidexHelper";
6
5
  import Account from "./Account";
7
6
  import { Address, Factory, FactoryIndex, LendingPoolIndex, Networks } from '../config/types';
7
+ import { LendingPoolData, TvlData, UserData, XimxData } from './types';
8
8
  export interface SubgraphCfg {
9
9
  network: Networks;
10
10
  chainId: number;
@@ -1,7 +1,8 @@
1
- import { LendingPoolData, TvlData, UserData, CollateralPosition, SupplyPosition, BorrowPosition, XimxData } from "../impermax-router/interfaces";
2
1
  import Subgraph from "./index";
3
2
  import { DocumentNode } from "graphql";
4
- import { Address, AddressIndex, Amms, Factory, FactoryIndex, LendingPoolIndex } from '../config/types';
3
+ import { Address, AddressIndex, Factory, FactoryIndex, LendingPoolIndex } from '../config/types';
4
+ import { Amms } from '../config/amms';
5
+ import { BorrowPosition, CollateralPosition, LendingPoolData, SupplyPosition, TvlData, UserData, XimxData } from './types';
5
6
  export declare function apolloFetcher(subgraphUrl: string, query: DocumentNode): Promise<import("apollo-client").ApolloQueryResult<any>>;
6
7
  export declare function fetchBlockByTimestamp(this: Subgraph, timestamp: number): Promise<number>;
7
8
  export declare function fetchLendingPools(this: Subgraph): Promise<FactoryIndex<LendingPoolData[]>>;
@@ -1,64 +1,4 @@
1
- import { BigNumber } from "ethers";
2
- import Subgraph from "../subgraph";
3
- import { Address, Networks, PoolTokenType } from '../config/types';
4
- export type Contract = any;
5
- export type RouterContract = Contract;
6
- export type FactoryContract = Contract;
7
- export type SimpleUniswapOracleContract = Contract;
8
- export type ERC20Contract = Contract;
9
- export type UniswapV2PairContract = Contract;
10
- export type UniswapV2FactoryContract = Contract;
11
- export type BorrowableContract = Contract;
12
- export type CollateralContract = Contract;
13
- export type MerkleDistributorContract = Contract;
14
- export type FarmingPoolContract = Contract;
15
- export type ClaimAggregatorContract = Contract;
16
- export type ClaimableContract = Contract;
17
- export type StakedLPTokenContract = Contract;
18
- export type ImpermaxChefContract = Contract;
19
- export type LendingPool = {
20
- uniswapV2Pair: UniswapV2PairContract;
21
- tokenA: ERC20Contract;
22
- tokenB: ERC20Contract;
23
- collateral: CollateralContract;
24
- borrowableA: BorrowableContract;
25
- borrowableB: BorrowableContract;
26
- farmingPoolA: FarmingPoolContract;
27
- farmingPoolB: FarmingPoolContract;
28
- stakedLPToken: StakedLPTokenContract;
29
- };
30
- export declare enum ApprovalType {
31
- POOL_TOKEN = 0,
32
- UNDERLYING = 1,
33
- BORROW = 2
34
- }
35
- export interface PermitData {
36
- permitData: string;
37
- amount: BigNumber;
38
- deadline: BigNumber;
39
- }
40
- export interface Changes {
41
- changeBorrowedA: number;
42
- changeBorrowedB: number;
43
- changeCollateral: number;
44
- }
45
- export declare const NO_CHANGES: {
46
- changeBorrowedA: number;
47
- changeBorrowedB: number;
48
- changeCollateral: number;
49
- };
50
- export interface Values {
51
- valueCollateral: number;
52
- valueA: number;
53
- valueB: number;
54
- }
55
- export interface ImpermaxRouterCfg {
56
- network: Networks;
57
- subgraph: Subgraph;
58
- web3: any;
59
- chainId: number;
60
- priceInverted: boolean;
61
- }
1
+ import { Address, PoolTokenType } from '../config/types';
62
2
  export interface PoolTokenData {
63
3
  id: Address;
64
4
  totalBalance: string;
@@ -197,22 +137,9 @@ export interface TvlData {
197
137
  totalBorrowsUSD: number;
198
138
  totalSupplyUSD: number;
199
139
  }
200
- export interface AirdropData {
201
- index: number;
202
- amount: BigNumber;
203
- proof: Array<string>;
204
- }
205
- export interface ClaimEvent {
206
- amount: number;
207
- transactionHash: string;
208
- }
209
140
  export interface XimxData {
210
141
  totalSupply: string;
211
142
  totalBalance: string;
212
143
  exchangeRate: string;
213
144
  dailyAPR: string;
214
145
  }
215
- export interface PendingRewardUI {
216
- symbol: string;
217
- amount: number;
218
- }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const types_1 = require("../config/types");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impermax-sdk",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",