@sonarwatch/portfolio-plugins 0.11.223 → 0.11.225
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +1646 -1638
- package/README.md +3 -3
- package/package.json +2 -2
- package/src/plugins/balancer/helpers/pools.js +21 -21
- package/src/plugins/jupiter/launchpad/allocationsFetcher.js +2 -2
- package/src/plugins/jupiter/launchpad/allocationsFetcher.js.map +1 -1
- package/src/plugins/jupiter/launchpad/constants.d.ts +1 -0
- package/src/plugins/jupiter/launchpad/constants.js +7 -0
- package/src/plugins/jupiter/launchpad/constants.js.map +1 -1
- package/src/plugins/sushiswap/helpers.js +24 -24
- package/src/plugins/turbos/clmmVaultFetcher.d.ts +3 -0
- package/src/plugins/turbos/clmmVaultFetcher.js +181 -0
- package/src/plugins/turbos/clmmVaultFetcher.js.map +1 -0
- package/src/plugins/turbos/clmmsPositionsFetcher.js +1 -1
- package/src/plugins/turbos/clmmsPositionsFetcher.js.map +1 -1
- package/src/plugins/turbos/constants.d.ts +1 -0
- package/src/plugins/turbos/constants.js +2 -1
- package/src/plugins/turbos/constants.js.map +1 -1
- package/src/plugins/turbos/helper.d.ts +2 -2
- package/src/plugins/turbos/helper.js +1 -1
- package/src/plugins/turbos/helper.js.map +1 -1
- package/src/plugins/turbos/index.js +2 -1
- package/src/plugins/turbos/index.js.map +1 -1
- package/src/plugins/turbos/types.d.ts +133 -0
- 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.225",
|
4
4
|
"type": "commonjs",
|
5
5
|
"generators": "./generators.json",
|
6
6
|
"dependencies": {
|
@@ -42,7 +42,7 @@
|
|
42
42
|
"web3-v1": "npm:web3@^1.5.0"
|
43
43
|
},
|
44
44
|
"peerDependencies": {
|
45
|
-
"@sonarwatch/portfolio-core": "0.11.
|
45
|
+
"@sonarwatch/portfolio-core": "0.11.225"
|
46
46
|
},
|
47
47
|
"main": "./src/index.js",
|
48
48
|
"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;
|
@@ -52,12 +52,12 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
52
52
|
if (claimStatus)
|
53
53
|
continue;
|
54
54
|
const proof = proofs[j];
|
55
|
-
const { decimals, mint } = eligibleAirdrops[j];
|
55
|
+
const { decimals, mint, claimStarts } = eligibleAirdrops[j];
|
56
56
|
const tokenPrice = tokenPriceById.get(mint);
|
57
57
|
const amount = new bignumber_js_1.default(proof.amount)
|
58
58
|
.dividedBy(Math.pow(10, decimals))
|
59
59
|
.toNumber();
|
60
|
-
const asset = (0, tokenPriceToAssetToken_1.default)(mint, amount, portfolio_core_1.NetworkId.solana, tokenPrice, undefined, {
|
60
|
+
const asset = (0, tokenPriceToAssetToken_1.default)(mint, amount, portfolio_core_1.NetworkId.solana, tokenPrice, undefined, { lockedUntil: claimStarts });
|
61
61
|
assets.push(asset);
|
62
62
|
}
|
63
63
|
if (assets.length === 0)
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"allocationsFetcher.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/launchpad/allocationsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AACpC,kDAA6C;AAE7C,gEAAqC;AAGrC,oDAAyD;AAEzD,wCAA+C;AAC/C,wGAAgF;AAChF,uCAA8C;AAC9C,2CAA+E;AAC/E,kDAAsE;AAEtE,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,WAAW,GACf,MAAM,OAAO,CAAC,GAAG,CACf,wBAAY,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACxB,IAAI,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;YACnC,OAAO,eAAK;iBACT,GAAG,CAAC,GAAG,qBAAS,IAAI,IAAI,CAAC,IAAI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E,CAAC,GAAG,mBAAmB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACpD,MAAM,WAAW,GAAG,mBAAmB,CAAC,CAAC,CAAC,CAAC;QAC3C,IAAI,WAAW;YAAE,SAAS;QAE1B,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QACxB,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;
|
1
|
+
{"version":3,"file":"allocationsFetcher.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/launchpad/allocationsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AACpC,kDAA6C;AAE7C,gEAAqC;AAGrC,oDAAyD;AAEzD,wCAA+C;AAC/C,wGAAgF;AAChF,uCAA8C;AAC9C,2CAA+E;AAC/E,kDAAsE;AAEtE,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,WAAW,GACf,MAAM,OAAO,CAAC,GAAG,CACf,wBAAY,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACxB,IAAI,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;YACnC,OAAO,eAAK;iBACT,GAAG,CAAC,GAAG,qBAAS,IAAI,IAAI,CAAC,IAAI,IAAI,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iBAC5D,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;QACvB,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CACH,CAAC;IAEJ,MAAM,gBAAgB,GAAkB,EAAE,CAAC;IAC3C,MAAM,MAAM,GAAyB,EAAE,CAAC;IACxC,MAAM,aAAa,GAAgB,EAAE,CAAC;IACtC,KAAK,IAA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xtWQG',
|
45
|
+
decimals: 9,
|
46
|
+
claimUntilTs: 1719878400000,
|
47
|
+
claimStarts: 1717077600000,
|
48
|
+
distributorProgram: 'DiSLRwcSFvtwvMWSs7ubBMvYRaYNYupa76ZSuYLe6D7j',
|
49
|
+
},
|
43
50
|
];
|
44
51
|
//# sourceMappingURL=constants.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/launchpad/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,mBAAmB,CAAC;AACjC,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,mBAAmB;IACzB,KAAK,EAAE,+CAA+C;IACtD,OAAO,EAAE,qBAAqB;IAC9B,OAAO,EAAE,qCAAqC;CAC/C,CAAC;AAEW,QAAA,aAAa,GAAG,IAAI,mBAAS,CACxC,6CAA6C,CAC9C,CAAC;AACW,QAAA,YAAY,GAAG,IAAI,mBAAS,CACvC,8CAA8C,CAC/C,CAAC;AACW,QAAA,OAAO,GAAG,6CAA6C,CAAC;AACxD,QAAA,WAAW,GAAG,CAAC,CAAC;AAEhB,QAAA,SAAS,GAAG,uCAAuC,CAAC;
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/launchpad/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,mBAAmB,CAAC;AACjC,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,mBAAmB;IACzB,KAAK,EAAE,+CAA+C;IACtD,OAAO,EAAE,qBAAqB;IAC9B,OAAO,EAAE,qCAAqC;CAC/C,CAAC;AAEW,QAAA,aAAa,GAAG,IAAI,mBAAS,CACxC,6CAA6C,CAC9C,CAAC;AACW,QAAA,YAAY,GAAG,IAAI,mBAAS,CACvC,8CAA8C,CAC/C,CAAC;AACW,QAAA,OAAO,GAAG,6CAA6C,CAAC;AACxD,QAAA,WAAW,GAAG,CAAC,CAAC;AAEhB,QAAA,SAAS,GAAG,uCAAuC,CAAC;AASpD,QAAA,YAAY,GAAkB;IACzC;QACE,IAAI,EAAE,6CAA6C;QACnD,QAAQ,EAAE,CAAC;QACX,YAAY,EAAE,aAAa;QAC3B,kBAAkB,EAAE,6CAA6C;KAClE;IACD;QACE,IAAI,EAAE,6CAA6C;QACnD,QAAQ,EAAE,CAAC;QACX,YAAY,EAAE,aAAa;QAC3B,kBAAkB,EAAE,8CAA8C;KACnE;IACD;QACE,IAAI,EAAE,6CAA6C;QACnD,QAAQ,EAAE,CAAC;QACX,YAAY,EAAE,aAAa;QAC3B,kBAAkB,EAAE,8CAA8C;KACnE;IACD;QACE,IAAI,EAAE,6CAA6C;QACnD,QAAQ,EAAE,CAAC;QACX,YAAY,EAAE,aAAa;QAC3B,kBAAkB,EAAE,8CAA8C;KACnE;IACD;QACE,IAAI,EAAE,6CAA6C;QACnD,QAAQ,EAAE,CAAC;QACX,YAAY,EAAE,aAAa;QAC3B,WAAW,EAAE,aAAa;QAC1B,kBAAkB,EAAE,8CAA8C;KACnE;CACF,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;
|
@@ -0,0 +1,181 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
|
+
};
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
16
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
17
|
+
const constants_1 = require("./constants");
|
18
|
+
const getOwnedObjects_1 = require("../../utils/sui/getOwnedObjects");
|
19
|
+
const clients_1 = require("../../utils/clients");
|
20
|
+
const multiGetObjects_1 = require("../../utils/sui/multiGetObjects");
|
21
|
+
const helper_1 = require("./helper");
|
22
|
+
const tokenAmountFromLiquidity_1 = require("../../utils/clmm/tokenAmountFromLiquidity");
|
23
|
+
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
24
|
+
const multiDynamicFieldObjects_1 = require("../../utils/sui/multiDynamicFieldObjects");
|
25
|
+
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
26
|
+
var _a;
|
27
|
+
const client = (0, clients_1.getClientSui)();
|
28
|
+
const vaultNftPositionObjects = yield (0, getOwnedObjects_1.getOwnedObjects)(client, owner, {
|
29
|
+
filter: {
|
30
|
+
Package: constants_1.vaultPackageId,
|
31
|
+
},
|
32
|
+
options: {
|
33
|
+
showContent: true,
|
34
|
+
showType: true,
|
35
|
+
},
|
36
|
+
});
|
37
|
+
const vaultsStrat = new Set();
|
38
|
+
const vaultsInfoByStrat = new Map();
|
39
|
+
vaultNftPositionObjects.forEach((pos) => {
|
40
|
+
var _a;
|
41
|
+
if ((_a = pos.data) === null || _a === void 0 ? void 0 : _a.content) {
|
42
|
+
vaultsStrat.add(pos.data.content.fields.strategy_id);
|
43
|
+
const vaultsInfo = vaultsInfoByStrat.get(pos.data.content.fields.strategy_id);
|
44
|
+
if (vaultsInfo) {
|
45
|
+
vaultsInfo.push(pos.data.content.fields.id.id);
|
46
|
+
}
|
47
|
+
else {
|
48
|
+
vaultsInfoByStrat.set(pos.data.content.fields.strategy_id, [
|
49
|
+
pos.data.content.fields.id.id,
|
50
|
+
]);
|
51
|
+
}
|
52
|
+
}
|
53
|
+
});
|
54
|
+
const vaultStratObjects = yield (0, multiGetObjects_1.multiGetObjects)(client, Array.from(vaultsStrat), {
|
55
|
+
showContent: true,
|
56
|
+
});
|
57
|
+
const vaultStratById = new Map();
|
58
|
+
const vaultsStratIds = [];
|
59
|
+
const poolIds = [];
|
60
|
+
vaultStratObjects.forEach((vault) => {
|
61
|
+
var _a;
|
62
|
+
if ((_a = vault.data) === null || _a === void 0 ? void 0 : _a.content) {
|
63
|
+
const vaultsInfo = vaultsInfoByStrat.get(vault.data.objectId);
|
64
|
+
if (vaultsInfo) {
|
65
|
+
vaultsInfoByStrat.set(vault.data.content.fields.vaults.fields.id.id, vaultsInfo);
|
66
|
+
vaultsInfoByStrat.delete(vault.data.objectId);
|
67
|
+
}
|
68
|
+
vaultStratById.set(vault.data.objectId, vault.data.content.fields);
|
69
|
+
vaultsStratIds.push(vault.data.content.fields.vaults.fields.id.id);
|
70
|
+
poolIds.push(vault.data.content.fields.clmm_pool_id);
|
71
|
+
}
|
72
|
+
});
|
73
|
+
const pools = yield cache.getItems(poolIds, {
|
74
|
+
prefix: constants_1.clmmPoolsPrefix,
|
75
|
+
networkId: portfolio_core_1.NetworkId.sui,
|
76
|
+
});
|
77
|
+
const poolsById = new Map();
|
78
|
+
pools.forEach((pool) => {
|
79
|
+
if (pool) {
|
80
|
+
poolsById.set(pool.objectId, pool);
|
81
|
+
}
|
82
|
+
});
|
83
|
+
const promises = [];
|
84
|
+
for (const strat of vaultsInfoByStrat.keys()) {
|
85
|
+
const vaultsInfo = vaultsInfoByStrat.get(strat);
|
86
|
+
if (!vaultsInfo)
|
87
|
+
continue;
|
88
|
+
promises.push((0, multiDynamicFieldObjects_1.multiDynamicFieldObjects)(client, {
|
89
|
+
parentId: strat,
|
90
|
+
type: '0x2::object::ID',
|
91
|
+
values: vaultsInfo,
|
92
|
+
}));
|
93
|
+
}
|
94
|
+
const vaultsInfoObj = (yield Promise.all(promises)).flat();
|
95
|
+
const vaultInfoById = new Map();
|
96
|
+
const coins = new Set();
|
97
|
+
vaultsInfoObj.forEach((vault) => {
|
98
|
+
var _a;
|
99
|
+
if ((_a = vault.data) === null || _a === void 0 ? void 0 : _a.content) {
|
100
|
+
vaultInfoById.set(vault.data.objectId, vault.data.content.fields);
|
101
|
+
coins.add((0, portfolio_core_1.formatMoveTokenAddress)(vault.data.content.fields.value.fields.value.fields.coin_a_type_name
|
102
|
+
.fields.name));
|
103
|
+
coins.add((0, portfolio_core_1.formatMoveTokenAddress)(vault.data.content.fields.value.fields.value.fields.coin_b_type_name
|
104
|
+
.fields.name));
|
105
|
+
}
|
106
|
+
});
|
107
|
+
const tokenPriceById = yield cache.getTokenPricesAsMap(Array.from(coins), portfolio_core_1.NetworkId.sui);
|
108
|
+
const clmmPositions = vaultsInfoObj
|
109
|
+
.map((vault) => {
|
110
|
+
var _a, _b;
|
111
|
+
return ((_b = (_a = vault.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields.value.fields.value.fields.base_clmm_position_id) || [];
|
112
|
+
})
|
113
|
+
.flat();
|
114
|
+
const clmmPositionsObjects = yield (0, multiGetObjects_1.multiGetObjects)(client, clmmPositions, {
|
115
|
+
showContent: true,
|
116
|
+
});
|
117
|
+
const clmmPositionById = new Map();
|
118
|
+
clmmPositionsObjects.forEach((vault) => {
|
119
|
+
var _a, _b;
|
120
|
+
if (!((_a = vault.data) === null || _a === void 0 ? void 0 : _a.content))
|
121
|
+
return;
|
122
|
+
clmmPositionById.set((_b = vault.data) === null || _b === void 0 ? void 0 : _b.objectId, vault.data.content.fields);
|
123
|
+
});
|
124
|
+
const assets = [];
|
125
|
+
let totalLiquidityValue = 0;
|
126
|
+
for (const vaultInfoObject of vaultsInfoObj) {
|
127
|
+
if (!((_a = vaultInfoObject.data) === null || _a === void 0 ? void 0 : _a.content))
|
128
|
+
continue;
|
129
|
+
const vaultInfo = vaultInfoObject.data.content.fields.value.fields.value.fields;
|
130
|
+
const pool = vaultStratById.get(vaultInfo.strategy_id);
|
131
|
+
const clmmPosition = clmmPositionById.get(vaultInfo.base_clmm_position_id);
|
132
|
+
if (!pool || !clmmPosition)
|
133
|
+
continue;
|
134
|
+
const { tokenAmountA, tokenAmountB } = (0, tokenAmountFromLiquidity_1.getTokenAmountsFromLiquidity)(new bignumber_js_1.default(clmmPosition.liquidity), (0, helper_1.bitsToNumber)(vaultInfo.base_last_tick_index.fields.bits), (0, helper_1.bitsToNumber)(clmmPosition.tick_lower_index.fields.bits), (0, helper_1.bitsToNumber)(clmmPosition.tick_upper_index.fields.bits), false);
|
135
|
+
const coinA = (0, portfolio_core_1.formatMoveTokenAddress)(vaultInfo.coin_a_type_name.fields.name);
|
136
|
+
const coinB = (0, portfolio_core_1.formatMoveTokenAddress)(vaultInfo.coin_b_type_name.fields.name);
|
137
|
+
const tokenPriceA = tokenPriceById.get(coinA);
|
138
|
+
const tokenPriceB = tokenPriceById.get(coinB);
|
139
|
+
if (!tokenPriceA || !tokenPriceB)
|
140
|
+
continue;
|
141
|
+
const assetTokenA = (0, tokenPriceToAssetToken_1.default)(coinA, tokenAmountA.dividedBy(Math.pow(10, tokenPriceA.decimals)).toNumber(), portfolio_core_1.NetworkId.sui, tokenPriceA);
|
142
|
+
const assetTokenB = (0, tokenPriceToAssetToken_1.default)(coinB, tokenAmountB.dividedBy(Math.pow(10, tokenPriceB.decimals)).toNumber(), portfolio_core_1.NetworkId.sui, tokenPriceB);
|
143
|
+
if (!assetTokenA ||
|
144
|
+
!assetTokenB ||
|
145
|
+
assetTokenA.value === null ||
|
146
|
+
assetTokenB.value === null)
|
147
|
+
continue;
|
148
|
+
const value = assetTokenA.value + assetTokenB.value;
|
149
|
+
assets.push({
|
150
|
+
assets: [assetTokenA, assetTokenB],
|
151
|
+
assetsValue: value,
|
152
|
+
rewardAssets: [],
|
153
|
+
rewardAssetsValue: 0,
|
154
|
+
value,
|
155
|
+
yields: [],
|
156
|
+
});
|
157
|
+
totalLiquidityValue += value;
|
158
|
+
}
|
159
|
+
if (assets.length === 0)
|
160
|
+
return [];
|
161
|
+
return [
|
162
|
+
{
|
163
|
+
type: portfolio_core_1.PortfolioElementType.liquidity,
|
164
|
+
networkId: portfolio_core_1.NetworkId.sui,
|
165
|
+
platformId: constants_1.platformId,
|
166
|
+
label: 'LiquidityPool',
|
167
|
+
name: 'Vault',
|
168
|
+
value: totalLiquidityValue,
|
169
|
+
data: {
|
170
|
+
liquidities: assets,
|
171
|
+
},
|
172
|
+
},
|
173
|
+
];
|
174
|
+
});
|
175
|
+
const fetcher = {
|
176
|
+
id: `${constants_1.platformId}-clmm-vault`,
|
177
|
+
networkId: portfolio_core_1.NetworkId.sui,
|
178
|
+
executor,
|
179
|
+
};
|
180
|
+
exports.default = fetcher;
|
181
|
+
//# sourceMappingURL=clmmVaultFetcher.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"clmmVaultFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/turbos/clmmVaultFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AACpC,gEAAqC;AAGrC,2CAA0E;AAC1E,qEAAkE;AAClE,iDAAmD;AAQnD,qEAAkE;AAClE,qCAAwC;AACxC,wFAAyF;AACzF,qGAA6E;AAC7E,uFAAoF;AAEpF,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,MAAM,uBAAuB,GAAG,MAAM,IAAA,iCAAe,EACnD,MAAM,EACN,KAAK,EACL;QACE,MAAM,EAAE;YACN,OAAO,EAAE,0BAAc;SACxB;QACD,OAAO,EAAE;YACP,WAAW,EAAE,IAAI;YACjB,QAAQ,EAAE,IAAI;SACf;KACF,CACF,CAAC;IAEF,MAAM,WAAW,GAAgB,IAAI,GAAG,EAAE,CAAC;IAC3C,MAAM,iBAAiB,GAA0B,IAAI,GAAG,EAAE,CAAC;IAC3D,uBAAuB,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;;QACtC,IAAI,MAAA,GAAG,CAAC,IAAI,0CAAE,OAAO,EAAE,CAAC;YACtB,WAAW,CA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WAAW,CAAC;YAClC,WAAW,EAAE,KAAK;YAClB,YAAY,EAAE,EAAE;YAChB,iBAAiB,EAAE,CAAC;YACpB,KAAK;YACL,MAAM,EAAE,EAAE;SACX,CAAC,CAAC;QACH,mBAAmB,IAAI,KAAK,CAAC;IAC/B,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEnC,OAAO;QACL;YACE,IAAI,EAAE,qCAAoB,CAAC,SAAS;YACpC,SAAS,EAAE,0BAAS,CAAC,GAAG;YACxB,UAAU,EAAV,sBAAU;YACV,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,mBAAmB;YAC1B,IAAI,EAAE;gBACJ,WAAW,EAAE,MAAM;aACpB;SACF;KACF,CAAC;AACJ,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"}
|
@@ -81,7 +81,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
81
81
|
const pool = poolsById.get(nftPosition.pool_id);
|
82
82
|
if (!pool)
|
83
83
|
continue;
|
84
|
-
const { tokenAmountA, tokenAmountB } = (0, tokenAmountFromLiquidity_1.getTokenAmountsFromLiquidity)(new bignumber_js_1.default(clmmPosition.liquidity), (0, helper_1.bitsToNumber)(pool.tick_current_index), (0, helper_1.bitsToNumber)(clmmPosition.tick_lower_index), (0, helper_1.bitsToNumber)(clmmPosition.tick_upper_index), false);
|
84
|
+
const { tokenAmountA, tokenAmountB } = (0, tokenAmountFromLiquidity_1.getTokenAmountsFromLiquidity)(new bignumber_js_1.default(clmmPosition.liquidity), (0, helper_1.bitsToNumber)(pool.tick_current_index.fields.bits), (0, helper_1.bitsToNumber)(clmmPosition.tick_lower_index.fields.bits), (0, helper_1.bitsToNumber)(clmmPosition.tick_upper_index.fields.bits), false);
|
85
85
|
// TODO : améliorer le problème du 0x000002::sui::SUI + manque de 0x
|
86
86
|
const coinA = (0, helper_1.formatForNative)(`0x${nftPosition.coin_type_a.fields.name}`);
|
87
87
|
const coinB = (0, helper_1.formatForNative)(`0x${nftPosition.coin_type_b.fields.name}`);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"clmmsPositionsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/turbos/clmmsPositionsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AACpC,gEAAqC;AAGrC,2CAKqB;AACrB,iDAAmD;AAEnD,wFAAyF;AACzF,qGAA6E;AAC7E,qCAAyD;AACzD,qEAAkE;AAClE,qEAAkE;AAElE,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAC9B,MAAM,gBAAgB,GAAG,MAAM,IAAA,iCAAe,EAAC,MAAM,EAAE,KAAK,EAAE;QAC5D,OAAO,EAAE;YACP,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,IAAI;YACjB,WAAW,EAAE,IAAI;YACjB,SAAS,EAAE,IAAI;SAChB;QACD,MAAM,EAAE,EAAE,OAAO,EAAE,6BAAiB,EAAE;KACvC,CAAC,CAAC;IACH,IAAI,gBAAgB,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAE7C,MAAM,YAAY,GAAa,EAAE,CAAC;IAClC,MAAM,gBAAgB,GAAa,EAAE,CAAC;IACtC,MAAM,uBAAuB,GAA2B,IAAI,GAAG,EAAE,CAAC;IAClE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,gBAAgB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACjD,MAAM,OAAO,GAAG,gBAAgB,CAAC,CAAC,CAAC,CA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CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACjD,MAAM,YAAY,GAAG,MAAA,MAAA,gBAAgB,CAAC,CAAC,CAAC,CAAC,IAAI,0CAAE,OAAO,0CAAE,MAAM,CAAC;QAC/D,IAAI,CAAC,YAAY;YAAE,SAAS;QAC5B,MAAM,WAAW,GAAG,uBAAuB,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QACpE,IAAI,CAAC,WAAW;YAAE,SAAS;QAE3B,MAAM,IAAI,GAAG,SAAS,CAAC,GAAG,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAChD,IAAI,CAAC,IAAI;YAAE,SAAS;QAEpB,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,GAAG,IAAA,uDAA4B,EACjE,IAAI,sBAAS,CAAC,YAAY,CAAC,SAAS,CAAC,EACrC,IAAA,qBAAY,EAAC,IAAI,CAAC,kBAAkB,CAAC,
|
1
|
+
{"version":3,"file":"clmmsPositionsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/turbos/clmmsPositionsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AACpC,gEAAqC;AAGrC,2CAKqB;AACrB,iDAAmD;AAEnD,wFAAyF;AACzF,qGAA6E;AAC7E,qCAAyD;AACzD,qEAAkE;AAClE,qEAAkE;AAElE,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAC9B,MAAM,gBAAgB,GAAG,MAAM,IAAA,iCAAe,EAAC,MAAM,EAAE,KAAK,EAAE;QAC5D,OAAO,EAAE;YACP,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,IAAI;YACjB,WAAW,EAAE,IAAI;YACjB,SAAS,EAAE,IAAI;SAChB;QACD,MAAM,EAAE,EAAE,OAAO,EAAE,6BAAiB,EAAE;KACvC,CA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BAAmB,IAAI,KAAK,CAAC;IAC/B,CAAC;IACD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEnC,OAAO;QACL;YACE,IAAI,EAAE,qCAAoB,CAAC,SAAS;YACpC,SAAS,EAAE,0BAAS,CAAC,GAAG;YACxB,UAAU,EAAV,sBAAU;YACV,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,CAAC,cAAc,CAAC;YACtB,KAAK,EAAE,mBAAmB;YAC1B,IAAI,EAAE;gBACJ,WAAW,EAAE,MAAM;aACpB;SACF;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,kBAAkB;IACnC,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -5,3 +5,4 @@ export declare const clmmPoolsPrefix = "turbos-clmmPools";
|
|
5
5
|
export declare const poolTableId = "0x08984ed8705f44b6403705dc248896e56ab7961447820ae29be935ce0d32198b";
|
6
6
|
export declare const packageIdOriginal = "0x91bfbc386a41afcfd9b2533058d7e915a1d3829089cc268ff4333d54d6339ca1";
|
7
7
|
export declare const clmmNftType = "0x91bfbc386a41afcfd9b2533058d7e915a1d3829089cc268ff4333d54d6339ca1::position_nft::TurbosPositionNFT";
|
8
|
+
export declare const vaultPackageId = "0x0a0d6e83196f523bb0623187d789ce602d1f63b3e7baa02b580df7ff0ccd17e0";
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.clmmNftType = exports.packageIdOriginal = exports.poolTableId = exports.clmmPoolsPrefix = exports.platform = exports.platformId = void 0;
|
3
|
+
exports.vaultPackageId = exports.clmmNftType = exports.packageIdOriginal = exports.poolTableId = exports.clmmPoolsPrefix = exports.platform = exports.platformId = void 0;
|
4
4
|
exports.platformId = 'turbos';
|
5
5
|
exports.platform = {
|
6
6
|
id: exports.platformId,
|
@@ -13,4 +13,5 @@ exports.clmmPoolsPrefix = `${exports.platformId}-clmmPools`;
|
|
13
13
|
exports.poolTableId = '0x08984ed8705f44b6403705dc248896e56ab7961447820ae29be935ce0d32198b';
|
14
14
|
exports.packageIdOriginal = '0x91bfbc386a41afcfd9b2533058d7e915a1d3829089cc268ff4333d54d6339ca1';
|
15
15
|
exports.clmmNftType = `${exports.packageIdOriginal}::position_nft::TurbosPositionNFT`;
|
16
|
+
exports.vaultPackageId = '0x0a0d6e83196f523bb0623187d789ce602d1f63b3e7baa02b580df7ff0ccd17e0';
|
16
17
|
//# sourceMappingURL=constants.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/turbos/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,QAAQ,CAAC;AACtB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,8CAA8C;IACrD,WAAW,EAAE,QAAQ;IACrB,OAAO,EAAE,6BAA6B;CACvC,CAAC;AACW,QAAA,eAAe,GAAG,GAAG,kBAAU,YAAY,CAAC;AAE5C,QAAA,WAAW,GACtB,oEAAoE,CAAC;AAE1D,QAAA,iBAAiB,GAC5B,oEAAoE,CAAC;AAE1D,QAAA,WAAW,GAAG,GAAG,yBAAiB,mCAAmC,CAAC"}
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/turbos/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,QAAQ,CAAC;AACtB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,8CAA8C;IACrD,WAAW,EAAE,QAAQ;IACrB,OAAO,EAAE,6BAA6B;CACvC,CAAC;AACW,QAAA,eAAe,GAAG,GAAG,kBAAU,YAAY,CAAC;AAE5C,QAAA,WAAW,GACtB,oEAAoE,CAAC;AAE1D,QAAA,iBAAiB,GAC5B,oEAAoE,CAAC;AAE1D,QAAA,WAAW,GAAG,GAAG,yBAAiB,mCAAmC,CAAC;AAEtE,QAAA,cAAc,GACzB,oEAAoE,CAAC"}
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import {
|
1
|
+
import { Pool, PoolFields, Types } from './types';
|
2
2
|
import { ObjectResponse } from '../../utils/sui/types';
|
3
3
|
export declare function parsePoolType(type: string, length: 2): [string, string];
|
4
4
|
export declare function parsePoolType(type: string, length: 3): Types;
|
5
5
|
export declare function parsePoolType(type: string): string[];
|
6
6
|
export declare function parsePool(pool: ObjectResponse<PoolFields>): Pool;
|
7
7
|
export declare function formatForNative(coin: string): string;
|
8
|
-
export declare function bitsToNumber(bits:
|
8
|
+
export declare function bitsToNumber(bits: number): number;
|
@@ -30,7 +30,7 @@ function formatForNative(coin) {
|
|
30
30
|
}
|
31
31
|
exports.formatForNative = formatForNative;
|
32
32
|
function bitsToNumber(bits) {
|
33
|
-
return (0, helpers_1.asIntN)(BigInt(bits
|
33
|
+
return (0, helpers_1.asIntN)(BigInt(bits));
|
34
34
|
}
|
35
35
|
exports.bitsToNumber = bitsToNumber;
|
36
36
|
//# sourceMappingURL=helper.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/turbos/helper.ts"],"names":[],"mappings":";;;AACA,8CAA0C;AAM1C,SAAgB,aAAa,CAAC,IAAY,EAAE,MAAe;;IACzD,MAAM,KAAK,GAAG,CAAA,MAAA,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,0CAAE,KAAK,CAAC,MAAM,CAAC,KAAI,EAAE,CAAC;IAEvE,IAAI,MAAM,KAAK,SA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,EAAE,CAAC;QACpD,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACvC,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AARD,sCAQC;AACD,SAAgB,SAAS,CAAC,IAAgC;;IACxD,IAAI,CAAC,CAAA,MAAA,IAAI,CAAC,IAAI,0CAAE,OAAO,CAAA;QAAE,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;IACnE,MAAM,MAAM,GAAG,MAAA,MAAA,IAAI,CAAC,IAAI,0CAAE,OAAO,0CAAE,MAAM,CAAC;IAC1C,MAAM,QAAQ,GAAG,MAAA,IAAI,CAAC,IAAI,0CAAE,QAAQ,CAAC;IACrC,MAAM,IAAI,GAAG,MAAA,IAAI,CAAC,IAAI,0CAAE,IAAI,CAAC;IAC7B,uCACK,MAAM,KACT,QAAQ;QACR,IAAI,EACJ,KAAK,EAAE,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC,IAC7B;AACJ,CAAC;AAXD,8BAWC;AAED,SAAgB,eAAe,CAAC,IAAY;IAC1C,OAAO,IAAI;QACT,8EAA8E;QAC9E,CAAC,CAAC,eAAe;QACjB,CAAC,CAAC,IAAI,CAAC;AACX,CAAC;AALD,0CAKC;AAED,SAAgB,YAAY,CAAC,IAAY;IACvC,OAAO,IAAA,gBAAM,EAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AAC9B,CAAC;AAFD,oCAEC"}
|
@@ -6,8 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.fetchers = exports.jobs = exports.platforms = void 0;
|
7
7
|
const poolsJob_1 = __importDefault(require("./poolsJob"));
|
8
8
|
const clmmsPositionsFetcher_1 = __importDefault(require("./clmmsPositionsFetcher"));
|
9
|
+
const clmmVaultFetcher_1 = __importDefault(require("./clmmVaultFetcher"));
|
9
10
|
const constants_1 = require("./constants");
|
10
11
|
exports.platforms = [constants_1.platform];
|
11
12
|
exports.jobs = [poolsJob_1.default];
|
12
|
-
exports.fetchers = [clmmsPositionsFetcher_1.default];
|
13
|
+
exports.fetchers = [clmmsPositionsFetcher_1.default, clmmVaultFetcher_1.default];
|
13
14
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/turbos/index.ts"],"names":[],"mappings":";;;;;;AAGA,0DAAkC;AAClC,oFAA0D;AAC1D,2CAAuC;AAE1B,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,kBAAQ,CAAC,CAAC;AACzB,QAAA,QAAQ,GAAc,CAAC,+BAAmB,CAAC,CAAC"}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/turbos/index.ts"],"names":[],"mappings":";;;;;;AAGA,0DAAkC;AAClC,oFAA0D;AAC1D,0EAAkD;AAClD,2CAAuC;AAE1B,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,kBAAQ,CAAC,CAAC;AACzB,QAAA,QAAQ,GAAc,CAAC,+BAAmB,EAAE,0BAAgB,CAAC,CAAC"}
|
@@ -101,3 +101,136 @@ export type PositionTick = {
|
|
101
101
|
feeGrowthOutsideB: BigNumber;
|
102
102
|
rewardGrowthsOutside: [BigNumber, BigNumber, BigNumber];
|
103
103
|
};
|
104
|
+
export type VaultPositionNFT = {
|
105
|
+
coin_a_type_name: CoinTypeName;
|
106
|
+
coin_b_type_name: CoinTypeName;
|
107
|
+
description: string;
|
108
|
+
id: ID;
|
109
|
+
index: string;
|
110
|
+
name: string;
|
111
|
+
strategy_id: string;
|
112
|
+
url: string;
|
113
|
+
};
|
114
|
+
export type CoinTypeName = {
|
115
|
+
fields: Fields;
|
116
|
+
type: string;
|
117
|
+
};
|
118
|
+
export type Fields = {
|
119
|
+
name: string;
|
120
|
+
};
|
121
|
+
export type ID = {
|
122
|
+
id: string;
|
123
|
+
};
|
124
|
+
export type VaultStrategy = {
|
125
|
+
accounts: Accounts;
|
126
|
+
base_tick_step_minimum: number;
|
127
|
+
clmm_pool_id: string;
|
128
|
+
coin_a_type_name: TypeName;
|
129
|
+
coin_b_type_name: TypeName;
|
130
|
+
default_base_rebalance_percentage: number;
|
131
|
+
default_limit_rebalance_percentage: number;
|
132
|
+
effective_tick_lower: EffectiveTick;
|
133
|
+
effective_tick_upper: EffectiveTick;
|
134
|
+
fee_type_name: TypeName;
|
135
|
+
id: ID;
|
136
|
+
image_url: string;
|
137
|
+
limit_tick_step_minimum: number;
|
138
|
+
management_fee_rate: string;
|
139
|
+
performance_fee_rate: string;
|
140
|
+
protocol_fees: Accounts;
|
141
|
+
rewarders: any[];
|
142
|
+
status: number;
|
143
|
+
tick_spacing: number;
|
144
|
+
total_share: string;
|
145
|
+
vault_index: string;
|
146
|
+
vaults: Vaults;
|
147
|
+
};
|
148
|
+
export type Accounts = {
|
149
|
+
fields: AccountsFields;
|
150
|
+
type: string;
|
151
|
+
};
|
152
|
+
export type AccountsFields = {
|
153
|
+
id: ID;
|
154
|
+
size: string;
|
155
|
+
};
|
156
|
+
export type TypeName = {
|
157
|
+
fields: CoinATypeNameFields;
|
158
|
+
type: string;
|
159
|
+
};
|
160
|
+
export type CoinATypeNameFields = {
|
161
|
+
name: string;
|
162
|
+
};
|
163
|
+
export type EffectiveTick = {
|
164
|
+
fields: EffectiveTickLowerFields;
|
165
|
+
type: string;
|
166
|
+
};
|
167
|
+
export type EffectiveTickLowerFields = {
|
168
|
+
bits: number;
|
169
|
+
};
|
170
|
+
export type Vaults = {
|
171
|
+
fields: VaultsFields;
|
172
|
+
type: string;
|
173
|
+
};
|
174
|
+
export type VaultsFields = {
|
175
|
+
head: string;
|
176
|
+
id: ID;
|
177
|
+
size: string;
|
178
|
+
tail: string;
|
179
|
+
};
|
180
|
+
export type VaultInfo = {
|
181
|
+
id: ID;
|
182
|
+
name: string;
|
183
|
+
value: UsersInfo;
|
184
|
+
};
|
185
|
+
export type UsersInfo = {
|
186
|
+
fields: UsersInfoPagination;
|
187
|
+
type: string;
|
188
|
+
};
|
189
|
+
export type UsersInfoPagination = {
|
190
|
+
next: null;
|
191
|
+
prev: string;
|
192
|
+
value: UserInfo;
|
193
|
+
};
|
194
|
+
export type UserInfo = {
|
195
|
+
fields: UserPositionFields;
|
196
|
+
type: string;
|
197
|
+
};
|
198
|
+
export type UserPositionFields = {
|
199
|
+
base_clmm_position_id: string;
|
200
|
+
base_last_tick_index: Index;
|
201
|
+
base_liquidity: string;
|
202
|
+
base_lower_index: Index;
|
203
|
+
base_rebalance_threshold: number;
|
204
|
+
base_tick_step: number;
|
205
|
+
base_upper_index: Index;
|
206
|
+
coin_a_type_name: CoinTypeName;
|
207
|
+
coin_b_type_name: CoinTypeName;
|
208
|
+
limit_clmm_position_id: string;
|
209
|
+
limit_last_tick_index: Index;
|
210
|
+
limit_liquidity: string;
|
211
|
+
limit_lower_index: Index;
|
212
|
+
limit_rebalance_threshold: number;
|
213
|
+
limit_tick_step: number;
|
214
|
+
limit_upper_index: Index;
|
215
|
+
management_fee_rate: null;
|
216
|
+
performance_fee_rate: null;
|
217
|
+
rewards: Rewards;
|
218
|
+
share: string;
|
219
|
+
sqrt_price: string;
|
220
|
+
strategy_id: string;
|
221
|
+
vault_id: string;
|
222
|
+
};
|
223
|
+
export type Index = {
|
224
|
+
fields: BaseLastTickIndexFields;
|
225
|
+
type: string;
|
226
|
+
};
|
227
|
+
export type BaseLastTickIndexFields = {
|
228
|
+
bits: number;
|
229
|
+
};
|
230
|
+
export type Rewards = {
|
231
|
+
fields: RewardsFields;
|
232
|
+
type: string;
|
233
|
+
};
|
234
|
+
export type RewardsFields = {
|
235
|
+
contents: any[];
|
236
|
+
};
|