@sonarwatch/portfolio-plugins 0.11.157 → 0.11.158
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +1359 -1355
- package/README.md +3 -3
- package/package.json +2 -2
- package/src/plugins/balancer/helpers/pools.js +21 -21
- package/src/plugins/bskt/vestingFetcher.js +4 -24
- package/src/plugins/bskt/vestingFetcher.js.map +1 -1
- package/src/plugins/navi/collateralFetcher.js +5 -1
- package/src/plugins/navi/collateralFetcher.js.map +1 -1
- package/src/plugins/raydium/lpTokensJob.js +2 -6
- package/src/plugins/raydium/lpTokensJob.js.map +1 -1
- package/src/plugins/raydium/structs/amms.d.ts +5 -2
- package/src/plugins/raydium/structs/amms.js +6 -3
- package/src/plugins/raydium/structs/amms.js.map +1 -1
- package/src/plugins/sushiswap/helpers.js +24 -24
- package/src/plugins/uniswap-v2/helpers.js +22 -22
- package/src/utils/sei/constants.js +8 -8
- package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
package/README.md
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
# @sonarwatch/portfolio-plugins
|
2
|
-
|
3
|
-
This library is @sonarwatch/portfolio-plugins
|
1
|
+
# @sonarwatch/portfolio-plugins
|
2
|
+
|
3
|
+
This library is @sonarwatch/portfolio-plugins
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sonarwatch/portfolio-plugins",
|
3
|
-
"version": "0.11.
|
3
|
+
"version": "0.11.158",
|
4
4
|
"type": "commonjs",
|
5
5
|
"generators": "./generators.json",
|
6
6
|
"dependencies": {
|
@@ -41,7 +41,7 @@
|
|
41
41
|
"web3-v1": "npm:web3@^1.5.0"
|
42
42
|
},
|
43
43
|
"peerDependencies": {
|
44
|
-
"@sonarwatch/portfolio-core": "0.11.
|
44
|
+
"@sonarwatch/portfolio-core": "0.11.158"
|
45
45
|
},
|
46
46
|
"main": "./src/index.js",
|
47
47
|
"types": "./src/index.d.ts"
|
@@ -36,27 +36,27 @@ exports.getBalancerPoolsV2 = void 0;
|
|
36
36
|
const graphql_request_1 = __importStar(require("graphql-request"));
|
37
37
|
function getBalancerPoolsV2(url) {
|
38
38
|
return __awaiter(this, void 0, void 0, function* () {
|
39
|
-
const query = (0, graphql_request_1.gql) `
|
40
|
-
query pools {
|
41
|
-
pools(
|
42
|
-
first: 1000
|
43
|
-
orderBy: totalLiquidity
|
44
|
-
orderDirection: desc
|
45
|
-
where: { totalLiquidity_gt: "500" }
|
46
|
-
) {
|
47
|
-
id
|
48
|
-
address
|
49
|
-
symbol
|
50
|
-
totalLiquidity
|
51
|
-
totalShares
|
52
|
-
tokens {
|
53
|
-
balance
|
54
|
-
decimals
|
55
|
-
symbol
|
56
|
-
address
|
57
|
-
}
|
58
|
-
}
|
59
|
-
}
|
39
|
+
const query = (0, graphql_request_1.gql) `
|
40
|
+
query pools {
|
41
|
+
pools(
|
42
|
+
first: 1000
|
43
|
+
orderBy: totalLiquidity
|
44
|
+
orderDirection: desc
|
45
|
+
where: { totalLiquidity_gt: "500" }
|
46
|
+
) {
|
47
|
+
id
|
48
|
+
address
|
49
|
+
symbol
|
50
|
+
totalLiquidity
|
51
|
+
totalShares
|
52
|
+
tokens {
|
53
|
+
balance
|
54
|
+
decimals
|
55
|
+
symbol
|
56
|
+
address
|
57
|
+
}
|
58
|
+
}
|
59
|
+
}
|
60
60
|
`;
|
61
61
|
const res = yield (0, graphql_request_1.default)(url, query);
|
62
62
|
const pools = res.pools;
|
@@ -36,7 +36,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
36
36
|
const assets = [];
|
37
37
|
const totalAmount = new bignumber_js_1.default(res.data.amount);
|
38
38
|
const amountPerUnlock = new bignumber_js_1.default(totalAmount).dividedBy(30);
|
39
|
-
const daysSinceLaunch = new bignumber_js_1.default(
|
39
|
+
const daysSinceLaunch = new bignumber_js_1.default(endDate.getTime())
|
40
40
|
.minus(startDate.getTime())
|
41
41
|
.dividedBy(oneDay)
|
42
42
|
.decimalPlaces(0, bignumber_js_1.default.ROUND_DOWN);
|
@@ -67,29 +67,9 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
67
67
|
for (const vesting of vestingAccounts) {
|
68
68
|
if (vesting.totalAmount.isEqualTo(vesting.amountClaimed))
|
69
69
|
continue;
|
70
|
-
const
|
71
|
-
|
72
|
-
|
73
|
-
.decimalPlaces(0, bignumber_js_1.default.ROUND_DOWN)
|
74
|
-
.toNumber();
|
75
|
-
const amountAvailable = amountPerUnlock.times(daysSinceClaim);
|
76
|
-
const unlockedSince = new Date(lastClaimedTm + daysSinceClaim * oneDay);
|
77
|
-
if (!amountAvailable.isZero() && unlockedSince < endDate) {
|
78
|
-
assets.push(Object.assign(Object.assign({}, (0, tokenPriceToAssetToken_1.default)(constants_1.bsktMint, amountAvailable.dividedBy(Math.pow(10, constants_1.bsktDecimals)).toNumber(), portfolio_core_1.NetworkId.solana, bsktTokenPrice)), { attributes: {
|
79
|
-
lockedUntil: unlockedSince.getTime(),
|
80
|
-
} }));
|
81
|
-
}
|
82
|
-
const nextUnlock = new Date(lastClaimedTm + (daysSinceClaim + 1) * oneDay);
|
83
|
-
if (nextUnlock < endDate) {
|
84
|
-
assets.push(Object.assign(Object.assign({}, (0, tokenPriceToAssetToken_1.default)(constants_1.bsktMint, amountPerUnlock.dividedBy(Math.pow(10, constants_1.bsktDecimals)).toNumber(), portfolio_core_1.NetworkId.solana, bsktTokenPrice)), { attributes: {
|
85
|
-
lockedUntil: nextUnlock.getTime(),
|
86
|
-
} }));
|
87
|
-
}
|
88
|
-
const amountLockedLeft = vesting.totalAmount
|
89
|
-
.minus(vesting.amountClaimed)
|
90
|
-
.minus(amountAvailable);
|
91
|
-
if (!amountLockedLeft.isZero()) {
|
92
|
-
assets.push(Object.assign(Object.assign({}, (0, tokenPriceToAssetToken_1.default)(constants_1.bsktMint, amountLockedLeft.dividedBy(Math.pow(10, constants_1.bsktDecimals)).toNumber(), portfolio_core_1.NetworkId.solana, bsktTokenPrice)), { attributes: {
|
70
|
+
const amountLeft = vesting.totalAmount.minus(vesting.amountClaimed);
|
71
|
+
if (!amountLeft.isZero()) {
|
72
|
+
assets.push(Object.assign(Object.assign({}, (0, tokenPriceToAssetToken_1.default)(constants_1.bsktMint, amountLeft.dividedBy(Math.pow(10, constants_1.bsktDecimals)).toNumber(), portfolio_core_1.NetworkId.solana, bsktTokenPrice)), { attributes: {
|
93
73
|
lockedUntil: endDate.getTime(),
|
94
74
|
} }));
|
95
75
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"vestingFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/bskt/vestingFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AACpC,kDAA6C;AAC7C,gEAAqC;AAGrC,2CAA0E;AAC1E,+CAA8D;AAC9D,uCAAiD;AACjD,uCAAiD;AACjD,iDAAsD;AACtD,qGAA6E;AAG7E,MAAM,MAAM,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AACnC,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,aAAa,CAAC,CAAC;AAC1C,MAAM,OAAO,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,MAAM,CAAC,CAAC;AAE5D,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,eAAe,GAAG,MAAM,IAAA,iCAAwB,EACpD,MAAM,EACN,8BAAoB,EACpB,mBAAO,EACP,IAAA,8BAAoB,EAAC,KAAK,CAAC,CAC5B,CAAC;IACF,MAAM,cAAc,GAAG,MAAM,KAAK,CAAC,aAAa,CAAC,oBAAQ,EAAE,0BAAS,CAAC,MAAM,CAAC,CAAC;IAE7E,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACjC,MAAM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ACL,CAAC;IACH,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEnC,OAAO;QACL;YACE,IAAI,EAAE,qCAAoB,CAAC,QAAQ;YACnC,KAAK,EAAE,SAAS;YAChB,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,IAAI,EAAE,mBAAmB;YACzB,UAAU,EAAV,sBAAU;YACV,IAAI,EAAE,EAAE,MAAM,EAAE;YAChB,KAAK,EAAE,IAAA,+BAAc,EAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SAC1D;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -27,6 +27,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
27
27
|
const suppliedAssets = [];
|
28
28
|
const suppliedYields = [];
|
29
29
|
const rewardAssets = [];
|
30
|
+
const suppliedLtvs = [];
|
30
31
|
const reservesData = yield cache.getItem(constants_1.reservesKey, {
|
31
32
|
prefix: constants_1.reservesPrefix,
|
32
33
|
networkId: portfolio_core_1.NetworkId.sui,
|
@@ -85,12 +86,15 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
85
86
|
apy,
|
86
87
|
},
|
87
88
|
]);
|
89
|
+
suppliedLtvs.push(new bignumber_js_1.default(rData.value.fields.liquidation_factors.fields.threshold)
|
90
|
+
.div(Math.pow(10, 27))
|
91
|
+
.toNumber());
|
88
92
|
}
|
89
93
|
}
|
90
94
|
}
|
91
95
|
if (suppliedAssets.length === 0 && borrowedAssets.length === 0)
|
92
96
|
return [];
|
93
|
-
const { borrowedValue, suppliedValue, value, healthRatio, rewardValue } = (0, portfolio_core_1.getElementLendingValues)(suppliedAssets, borrowedAssets, rewardAssets);
|
97
|
+
const { borrowedValue, suppliedValue, value, healthRatio, rewardValue } = (0, portfolio_core_1.getElementLendingValues)(suppliedAssets, borrowedAssets, rewardAssets, suppliedLtvs);
|
94
98
|
const element = {
|
95
99
|
type: portfolio_core_1.PortfolioElementType.borrowlend,
|
96
100
|
networkId: portfolio_core_1.NetworkId.sui,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"collateralFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/navi/collateralFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DASoC;AACpC,gEAAqC;AAGrC,2CAKqB;AACrB,iDAAmD;AACnD,qGAA6E;AAE7E,iFAA8E;AAE9E,MAAM,YAAY,GAAG,IAAI,sBAAS,CAAC,SAAA,EAAE,EAAI,EAAE,CAAA,CAAC,CAAC;AAE7C,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,MAAM,cAAc,GAAqB,EAAE,CAAC;IAC5C,MAAM,cAAc,GAAc,EAAE,CAAC;IACrC,MAAM,cAAc,GAAqB,EAAE,CAAC;IAC5C,MAAM,cAAc,GAAc,EAAE,CAAC;IACrC,MAAM,YAAY,GAAqB,EAAE,CAAC;
|
1
|
+
{"version":3,"file":"collateralFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/navi/collateralFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DASoC;AACpC,gEAAqC;AAGrC,2CAKqB;AACrB,iDAAmD;AACnD,qGAA6E;AAE7E,iFAA8E;AAE9E,MAAM,YAAY,GAAG,IAAI,sBAAS,CAAC,SAAA,EAAE,EAAI,EAAE,CAAA,CAAC,CAAC;AAE7C,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,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AM,KAAK,CAAC,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAE1E,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,GACrE,IAAA,wCAAuB,EACrB,cAAc,EACd,cAAc,EACd,YAAY,EACZ,YAAY,CACb,CAAC;IACJ,MAAM,OAAO,GAAqB;QAChC,IAAI,EAAE,qCAAoB,CAAC,UAAU;QACrC,SAAS,EAAE,0BAAS,CAAC,GAAG;QACxB,UAAU,EAAV,sBAAU;QACV,KAAK,EAAE,SAAS;QAChB,KAAK;QACL,IAAI,EAAE;YACJ,cAAc;YACd,aAAa;YACb,cAAc;YACd,cAAc;YACd,aAAa;YACb,cAAc;YACd,eAAe,EAAE,IAAI;YACrB,WAAW;YACX,YAAY;YACZ,WAAW;YACX,KAAK;SACN;KACF,CAAC;IACF,OAAO,CAAC,OAAO,CAAC,CAAC;AACnB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,aAAa;IAC9B,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -13,7 +13,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
13
13
|
};
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
15
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
16
|
-
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
17
16
|
const clients_1 = require("../../utils/clients");
|
18
17
|
const constants_1 = require("./constants");
|
19
18
|
const amms_1 = require("./structs/amms");
|
@@ -25,7 +24,6 @@ const getMultipleAccountsInfoSafe_1 = require("../../utils/solana/getMultipleAcc
|
|
25
24
|
const getLpUnderlyingTokenSource_1 = __importDefault(require("../../utils/misc/getLpUnderlyingTokenSource"));
|
26
25
|
const getLpTokenSourceRaw_1 = __importDefault(require("../../utils/misc/getLpTokenSourceRaw"));
|
27
26
|
const constants_2 = require("../orders/clobs-solana/constants");
|
28
|
-
const getTokensPricesMap_1 = __importDefault(require("../../utils/misc/getTokensPricesMap"));
|
29
27
|
const ammsDetails = [
|
30
28
|
{
|
31
29
|
versionId: 4,
|
@@ -107,7 +105,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
107
105
|
ammsOpenOrdersMap.set(addresses[i + 2].toString(), orderStruct.deserialize(ammOpenOrdersInfo.data)[0]);
|
108
106
|
mintAccountsMap.set(addresses[i + 3].toString(), solana_1.mintAccountStruct.deserialize(lpMintAddressInfo.data)[0]);
|
109
107
|
}
|
110
|
-
const tokenPrices = yield
|
108
|
+
const tokenPrices = yield cache.getTokenPricesAsMap([...mints], portfolio_core_1.NetworkId.solana);
|
111
109
|
for (let i = 0; i < ammsAccounts.length; i += 1) {
|
112
110
|
const amm = ammsAccounts[i];
|
113
111
|
const mintA = amm.coinMintAddress.toString();
|
@@ -156,9 +154,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
156
154
|
if (!lpMintAccount)
|
157
155
|
continue;
|
158
156
|
const lpDecimals = lpMintAccount.decimals;
|
159
|
-
const lpSupply =
|
160
|
-
? new bignumber_js_1.default('3381427.37').times(Math.pow(10, lpDecimals)) // Temporary fix for SOL-WIF lp
|
161
|
-
: lpMintAccount.supply;
|
157
|
+
const lpSupply = amm.lpAmount;
|
162
158
|
if (lpSupply.isZero())
|
163
159
|
continue;
|
164
160
|
tokenPriceSources.push((0, getLpTokenSourceRaw_1.default)(portfolio_core_1.NetworkId.solana, lpMint.toString(), constants_1.platformId, {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"lpTokensJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/lpTokensJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAuD;
|
1
|
+
{"version":3,"file":"lpTokensJob.js","sourceRoot":"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AAE,WAAW,CAAC,OAAO;wBAC5B,QAAQ,EAAE,WAAW,CAAC,QAAQ;wBAC9B,KAAK,EAAE,WAAW,CAAC,KAAK;wBACxB,gBAAgB,EAAE,YAAY;qBAC/B;iBACF,EACD,GAAG,CAAC,OAAO,CACZ,CACF,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAED,MAAM,IAAA,oBAAU,EACd,iBAAiB,CAAC,GAAG,CACnB,CAAC,gBAAgB,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CACxE,CACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,YAAY;IAC7B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -50,7 +50,9 @@ export type AmmInfoV4 = {
|
|
50
50
|
poolWithdrawQueue: PublicKey;
|
51
51
|
poolTempLpTokenAccount: PublicKey;
|
52
52
|
ammOwner: PublicKey;
|
53
|
-
|
53
|
+
lpAmount: BigNumber;
|
54
|
+
clientOrderId: BigNumber;
|
55
|
+
padding: BigNumber[];
|
54
56
|
};
|
55
57
|
export declare const ammInfoV4Struct: BeetStruct<AmmInfoV4, Partial<AmmInfoV4>>;
|
56
58
|
export type AmmInfoV5 = {
|
@@ -106,8 +108,9 @@ export type AmmInfoV5 = {
|
|
106
108
|
serumMarket: PublicKey;
|
107
109
|
serumProgramId: PublicKey;
|
108
110
|
ammTargetOrders: PublicKey;
|
109
|
-
ammOwner: PublicKey;
|
110
111
|
padding: BigNumber[];
|
112
|
+
lpAmount: BigNumber;
|
113
|
+
padding2: BigNumber[];
|
111
114
|
};
|
112
115
|
export declare const ammInfoV5Struct: BeetStruct<AmmInfoV5, Partial<AmmInfoV5>>;
|
113
116
|
export type UserFarmInfoV5 = {
|
@@ -55,7 +55,9 @@ exports.ammInfoV4Struct = new beet_1.BeetStruct([
|
|
55
55
|
['poolWithdrawQueue', beet_solana_1.publicKey],
|
56
56
|
['poolTempLpTokenAccount', beet_solana_1.publicKey],
|
57
57
|
['ammOwner', beet_solana_1.publicKey],
|
58
|
-
['
|
58
|
+
['lpAmount', solana_1.u64],
|
59
|
+
['clientOrderId', solana_1.u64],
|
60
|
+
['padding', (0, beet_1.uniformFixedSizeArray)(solana_1.u64, 2)],
|
59
61
|
], (args) => args);
|
60
62
|
exports.ammInfoV5Struct = new beet_1.BeetStruct([
|
61
63
|
['accountType', solana_1.u64],
|
@@ -112,8 +114,9 @@ exports.ammInfoV5Struct = new beet_1.BeetStruct([
|
|
112
114
|
['serumMarket', beet_solana_1.publicKey],
|
113
115
|
['serumProgramId', beet_solana_1.publicKey],
|
114
116
|
['ammTargetOrders', beet_solana_1.publicKey],
|
115
|
-
['
|
116
|
-
['
|
117
|
+
['padding', (0, beet_1.uniformFixedSizeArray)(solana_1.u64, 5)],
|
118
|
+
['lpAmount', solana_1.u64],
|
119
|
+
['padding2', (0, beet_1.uniformFixedSizeArray)(solana_1.u64, 62)],
|
117
120
|
], (args) => args);
|
118
121
|
exports.userFarmInfoV5Struct = new beet_1.FixableBeetStruct([
|
119
122
|
['state', solana_1.u64],
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"amms.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/raydium/structs/amms.ts"],"names":[],"mappings":";;;AAAA,oDAImC;AAEnC,kEAA6D;AAE7D,kDAAkD;
|
1
|
+
{"version":3,"file":"amms.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/raydium/structs/amms.ts"],"names":[],"mappings":";;;AAAA,oDAImC;AAEnC,kEAA6D;AAE7D,kDAAkD;AA2DrC,QAAA,eAAe,GAAG,IAAI,iBAAU,CAC3C;IACE,CAAC,QAAQ,EAAE,YAAG,CAAC;IACf,CAAC,OAAO,EAAE,YAAG,CAAC;IACd,CAAC,UAAU,EAAE,YAAG,C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ACjC,CAAC,iBAAiB,EAAE,uBAAS,CAAC;IAC9B,CAAC,eAAe,EAAE,uBAAS,CAAC;IAC5B,CAAC,eAAe,EAAE,uBAAS,CAAC;IAC5B,CAAC,kBAAkB,EAAE,uBAAS,CAAC;IAC/B,CAAC,eAAe,EAAE,uBAAS,CAAC;IAC5B,CAAC,aAAa,EAAE,uBAAS,CAAC;IAC1B,CAAC,gBAAgB,EAAE,uBAAS,CAAC;IAC7B,CAAC,iBAAiB,EAAE,uBAAS,CAAC;IAC9B,CAAC,SAAS,EAAE,IAAA,4BAAqB,EAAC,YAAG,EAAE,CAAC,CAAC,CAAC;IAC1C,CAAC,UAAU,EAAE,YAAG,CAAC;IACjB,CAAC,UAAU,EAAE,IAAA,4BAAqB,EAAC,YAAG,EAAE,EAAE,CAAC,CAAC;CAC7C,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAiB,CAC5B,CAAC;AAYW,QAAA,oBAAoB,GAAG,IAAI,wBAAiB,CACvD;IACE,CAAC,OAAO,EAAE,YAAG,CAAC;IACd,CAAC,QAAQ,EAAE,uBAAS,CAAC;IACrB,CAAC,aAAa,EAAE,uBAAS,CAAC;IAC1B,CAAC,gBAAgB,EAAE,YAAG,CAAC;IACvB,CAAC,YAAY,EAAE,aAAI,CAAC;IACpB,CAAC,aAAa,EAAE,aAAI,CAAC;IACrB,CAAC,SAAS,EAAE,IAAA,4BAAqB,EAAC,YAAG,EAAE,EAAE,CAAC,CAAC;CAC5C,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAsB,CACjC,CAAC"}
|
@@ -54,30 +54,30 @@ function sushiV3PairToUniV2(pair) {
|
|
54
54
|
}
|
55
55
|
function getV3PairsAddresses(url, length = 300) {
|
56
56
|
return __awaiter(this, void 0, void 0, function* () {
|
57
|
-
const query = (0, graphql_request_1.gql) `
|
58
|
-
{
|
59
|
-
pools(
|
60
|
-
orderBy: totalValueLockedUSD
|
61
|
-
first: ${length}
|
62
|
-
orderDirection: desc
|
63
|
-
where: { volumeUSD_not: "0", liquidity_not: "0" }
|
64
|
-
) {
|
65
|
-
id
|
66
|
-
token0Price
|
67
|
-
token1Price
|
68
|
-
liquidity
|
69
|
-
token0 {
|
70
|
-
id
|
71
|
-
totalSupply
|
72
|
-
decimals
|
73
|
-
}
|
74
|
-
token1 {
|
75
|
-
id
|
76
|
-
totalSupply
|
77
|
-
decimals
|
78
|
-
}
|
79
|
-
}
|
80
|
-
}
|
57
|
+
const query = (0, graphql_request_1.gql) `
|
58
|
+
{
|
59
|
+
pools(
|
60
|
+
orderBy: totalValueLockedUSD
|
61
|
+
first: ${length}
|
62
|
+
orderDirection: desc
|
63
|
+
where: { volumeUSD_not: "0", liquidity_not: "0" }
|
64
|
+
) {
|
65
|
+
id
|
66
|
+
token0Price
|
67
|
+
token1Price
|
68
|
+
liquidity
|
69
|
+
token0 {
|
70
|
+
id
|
71
|
+
totalSupply
|
72
|
+
decimals
|
73
|
+
}
|
74
|
+
token1 {
|
75
|
+
id
|
76
|
+
totalSupply
|
77
|
+
decimals
|
78
|
+
}
|
79
|
+
}
|
80
|
+
}
|
81
81
|
`;
|
82
82
|
const res = yield (0, graphql_request_1.default)(url, query);
|
83
83
|
const pools = res.pools;
|
@@ -40,28 +40,28 @@ function getPairKey(version) {
|
|
40
40
|
exports.getPairKey = getPairKey;
|
41
41
|
function getPairsV2FromTheGraph(url, length = 300) {
|
42
42
|
return __awaiter(this, void 0, void 0, function* () {
|
43
|
-
const query = (0, graphql_request_1.gql) `
|
44
|
-
{
|
45
|
-
pairs(
|
46
|
-
orderBy: reserveUSD
|
47
|
-
first: ${length}
|
48
|
-
orderDirection: desc
|
49
|
-
where: { trackedReserveETH_not: "0" }
|
50
|
-
) {
|
51
|
-
id
|
52
|
-
reserve0
|
53
|
-
reserve1
|
54
|
-
totalSupply
|
55
|
-
token0 {
|
56
|
-
id
|
57
|
-
decimals
|
58
|
-
}
|
59
|
-
token1 {
|
60
|
-
id
|
61
|
-
decimals
|
62
|
-
}
|
63
|
-
}
|
64
|
-
}
|
43
|
+
const query = (0, graphql_request_1.gql) `
|
44
|
+
{
|
45
|
+
pairs(
|
46
|
+
orderBy: reserveUSD
|
47
|
+
first: ${length}
|
48
|
+
orderDirection: desc
|
49
|
+
where: { trackedReserveETH_not: "0" }
|
50
|
+
) {
|
51
|
+
id
|
52
|
+
reserve0
|
53
|
+
reserve1
|
54
|
+
totalSupply
|
55
|
+
token0 {
|
56
|
+
id
|
57
|
+
decimals
|
58
|
+
}
|
59
|
+
token1 {
|
60
|
+
id
|
61
|
+
decimals
|
62
|
+
}
|
63
|
+
}
|
64
|
+
}
|
65
65
|
`;
|
66
66
|
const res = yield (0, graphql_request_1.default)(url, query);
|
67
67
|
const pairs = res.pairs;
|
@@ -1,16 +1,16 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.poolQueryMsg = exports.minterQueryMsg = exports.tokenInfoQueryMsg = exports.infoQueryMsg = void 0;
|
4
|
-
exports.infoQueryMsg = JSON.parse(`{
|
5
|
-
"info": {}
|
4
|
+
exports.infoQueryMsg = JSON.parse(`{
|
5
|
+
"info": {}
|
6
6
|
}`);
|
7
|
-
exports.tokenInfoQueryMsg = JSON.parse(`{
|
8
|
-
"token_info": {}
|
7
|
+
exports.tokenInfoQueryMsg = JSON.parse(`{
|
8
|
+
"token_info": {}
|
9
9
|
}`);
|
10
|
-
exports.minterQueryMsg = JSON.parse(`{
|
11
|
-
"minter": {}
|
10
|
+
exports.minterQueryMsg = JSON.parse(`{
|
11
|
+
"minter": {}
|
12
12
|
}`);
|
13
|
-
exports.poolQueryMsg = JSON.parse(`{
|
14
|
-
"pool": {}
|
13
|
+
exports.poolQueryMsg = JSON.parse(`{
|
14
|
+
"pool": {}
|
15
15
|
}`);
|
16
16
|
//# sourceMappingURL=constants.js.map
|
@@ -1,10 +1,10 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
function getQueryBalanceByOwner(owner) {
|
4
|
-
return JSON.parse(`{
|
5
|
-
"balance": {
|
6
|
-
"address": "${owner}"
|
7
|
-
}
|
4
|
+
return JSON.parse(`{
|
5
|
+
"balance": {
|
6
|
+
"address": "${owner}"
|
7
|
+
}
|
8
8
|
}`);
|
9
9
|
}
|
10
10
|
exports.default = getQueryBalanceByOwner;
|