impermax-sdk 2.1.164 → 2.1.166
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/lib/offchain/queries/apis/ponder/index.d.ts +1 -0
- package/lib/offchain/queries/apis/ponder/index.js +31 -0
- package/lib/offchain/queries/apis/thegraph/index.d.ts +1 -0
- package/lib/offchain/queries/apis/thegraph/index.js +5 -2
- package/lib/offchain/queries/interfaces/query-builder.d.ts +1 -0
- package/lib/onchain/interactions/lendingPool/nftlp/onchainInteractionsNftlpUniswapV3.js +1 -1
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ export declare class PonderQueryBuilder implements IQueryBuilder {
|
|
|
5
5
|
getBlockNumber(response: any, network: Networks): number;
|
|
6
6
|
lendingPoolsV3Query(factory: Factory, addressesFilter: Address[], network: Networks): import("graphql").DocumentNode;
|
|
7
7
|
userQueryV3(account: Address, network: Networks, factory: Factory): import("graphql").DocumentNode;
|
|
8
|
+
allPositionsV3Query(): import("graphql").DocumentNode;
|
|
8
9
|
lendingPoolsQuery(factory: Factory, addressesFilter: Address[], network: Networks): import("graphql").DocumentNode;
|
|
9
10
|
userQuery(account: Address, network: Networks, factory: Factory): import("graphql").DocumentNode;
|
|
10
11
|
tvlQuery(): import("graphql").DocumentNode;
|
|
@@ -134,6 +134,37 @@ class PonderQueryBuilder {
|
|
|
134
134
|
}
|
|
135
135
|
}`;
|
|
136
136
|
}
|
|
137
|
+
allPositionsV3Query() {
|
|
138
|
+
return (0, graphql_tag_1.default) `{
|
|
139
|
+
positions(limit: 1000) {
|
|
140
|
+
items {
|
|
141
|
+
id
|
|
142
|
+
userId
|
|
143
|
+
tokenId
|
|
144
|
+
lendingPool {
|
|
145
|
+
id
|
|
146
|
+
nftlp {
|
|
147
|
+
factory
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
borrowPositions {
|
|
151
|
+
items {
|
|
152
|
+
id
|
|
153
|
+
borrowBalance
|
|
154
|
+
borrowable {
|
|
155
|
+
underlying {
|
|
156
|
+
id
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
_meta {
|
|
164
|
+
status
|
|
165
|
+
}
|
|
166
|
+
}`;
|
|
167
|
+
}
|
|
137
168
|
/*-----------------------------*
|
|
138
169
|
* 2. Lending pools
|
|
139
170
|
*-----------------------------*/
|
|
@@ -6,6 +6,7 @@ export declare class TheGraphQueryBuilder implements IQueryBuilder {
|
|
|
6
6
|
lendingPoolsV3Query(factory: Factory, addressesFilter: Address[]): import("graphql").DocumentNode;
|
|
7
7
|
userQueryV3(account: Address, network: Networks, factory: Factory): import("graphql").DocumentNode;
|
|
8
8
|
nftlpPositionQuery(lendingPoolId: string, tokenId: string): import("graphql").DocumentNode;
|
|
9
|
+
allPositionsV3Query(): import("graphql").DocumentNode;
|
|
9
10
|
lendingPoolsQuery(factory: Factory, addressesFilter: Address[]): import("graphql").DocumentNode;
|
|
10
11
|
userQuery(account: Address, network: Networks, factory: Factory): import("graphql").DocumentNode;
|
|
11
12
|
tvlQuery(): import("graphql").DocumentNode;
|
|
@@ -42,6 +42,9 @@ class TheGraphQueryBuilder {
|
|
|
42
42
|
nftlpPositionQuery(lendingPoolId, tokenId) {
|
|
43
43
|
return (0, graphql_tag_1.default) `{}`;
|
|
44
44
|
}
|
|
45
|
+
allPositionsV3Query() {
|
|
46
|
+
return (0, graphql_tag_1.default) `{}`;
|
|
47
|
+
}
|
|
45
48
|
/*-----------------------------*
|
|
46
49
|
* 2. Lending pools
|
|
47
50
|
*-----------------------------*/
|
|
@@ -142,7 +145,6 @@ class TheGraphQueryBuilder {
|
|
|
142
145
|
// Shh
|
|
143
146
|
network;
|
|
144
147
|
factory;
|
|
145
|
-
const earnings = network === types_1.Networks.Blast && factory === types_1.Factory.SOLV2 ? "cumulativeEarnings lastExchangeRate" : "";
|
|
146
148
|
return (0, graphql_tag_1.default) `{
|
|
147
149
|
user(id: "${account.toLowerCase()}") {
|
|
148
150
|
collateralPositions(first:1000) {
|
|
@@ -155,7 +157,8 @@ class TheGraphQueryBuilder {
|
|
|
155
157
|
}
|
|
156
158
|
supplyPositions(first:1000) {
|
|
157
159
|
balance
|
|
158
|
-
|
|
160
|
+
lastExchangeRate
|
|
161
|
+
cumulativeEarnings
|
|
159
162
|
borrowable {
|
|
160
163
|
underlying {
|
|
161
164
|
id
|
|
@@ -6,6 +6,7 @@ export interface IQueryBuilder {
|
|
|
6
6
|
lendingPoolsV3Query(factory: Factory, addressesFilter: Address[], network: Networks): DocumentNode;
|
|
7
7
|
userQueryV3(account: Address, network: Networks, factory: Factory): DocumentNode;
|
|
8
8
|
nftlpPositionQuery(lendingPoolId: string, tokenId: string): DocumentNode;
|
|
9
|
+
allPositionsV3Query(): DocumentNode;
|
|
9
10
|
lendingPoolsQuery(factory: Factory, addressesFilter: Address[] | undefined, network: Networks): DocumentNode;
|
|
10
11
|
userQuery(account: Address, network: Networks, factory: Factory): DocumentNode;
|
|
11
12
|
tvlQuery(): DocumentNode;
|
|
@@ -76,7 +76,7 @@ class OnchainInteractionsNftlpUniswapV3 extends onchainInteractionsNftlp_1.defau
|
|
|
76
76
|
const isEthA = await borrowableA.isETH();
|
|
77
77
|
const isEthB = await borrowableB.isETH();
|
|
78
78
|
// Borrow and mint
|
|
79
|
-
if ((borrowADelta > 0
|
|
79
|
+
if ((borrowADelta > 0 && depositADelta > 0) || (borrowBDelta > 0 && depositBDelta > 0)) {
|
|
80
80
|
// slightly increase borrowDelta in order to avoid amountUser to be dust
|
|
81
81
|
const actualBorrowADelta = Math.max(borrowADelta * this.getDust(), 0);
|
|
82
82
|
const actualBorrowBDelta = Math.max(borrowBDelta * this.getDust(), 0);
|