@sonarwatch/portfolio-plugins 0.14.31 → 0.14.32
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +1716 -1712
- package/README.md +3 -3
- package/package.json +1 -1
- package/src/plugins/balancer/helpers/pools.js +21 -21
- package/src/plugins/banx/loansFetcher.js +2 -1
- package/src/plugins/banx/loansFetcher.js.map +1 -1
- package/src/plugins/cetus/clmmsFetcher.js +5 -7
- package/src/plugins/cetus/clmmsFetcher.js.map +1 -1
- package/src/plugins/cetus/constants.d.ts +1 -0
- package/src/plugins/cetus/constants.js +17 -1
- package/src/plugins/cetus/constants.js.map +1 -1
- package/src/plugins/cetus/farmsFetcher.js +3 -7
- package/src/plugins/cetus/farmsFetcher.js.map +1 -1
- package/src/plugins/cetus/getPools.d.ts +3 -0
- package/src/plugins/cetus/getPools.js +50 -0
- package/src/plugins/cetus/getPools.js.map +1 -0
- package/src/plugins/cetus/poolsJob.js +4 -3
- package/src/plugins/cetus/poolsJob.js.map +1 -1
- package/src/plugins/cetus/types.d.ts +32 -31
- package/src/plugins/kai/constants.d.ts +9 -0
- package/src/plugins/kai/constants.js +37 -2
- package/src/plugins/kai/constants.js.map +1 -1
- package/src/plugins/kai/helpers.d.ts +8 -0
- package/src/plugins/kai/helpers.js +49 -0
- package/src/plugins/kai/helpers.js.map +1 -0
- package/src/plugins/kai/index.js +4 -2
- package/src/plugins/kai/index.js.map +1 -1
- package/src/plugins/kai/lpVaultsFetcher.js +112 -0
- package/src/plugins/kai/lpVaultsFetcher.js.map +1 -0
- package/src/plugins/kai/supplyPoolsJob.d.ts +3 -0
- package/src/plugins/kai/supplyPoolsJob.js +35 -0
- package/src/plugins/kai/supplyPoolsJob.js.map +1 -0
- package/src/plugins/kai/types.d.ts +107 -0
- package/src/plugins/kai/vaultsJob.js +19 -12
- package/src/plugins/kai/vaultsJob.js.map +1 -1
- package/src/plugins/metaplex/index.js +2 -2
- package/src/plugins/metaplex/index.js.map +1 -1
- package/src/plugins/metaplex/resizableNftFetcher.d.ts +3 -0
- package/src/plugins/metaplex/{positionsSolanaFetcher.js → resizableNftFetcher.js} +1 -1
- package/src/plugins/metaplex/resizableNftFetcher.js.map +1 -0
- package/src/plugins/sushiswap/helpers.js +24 -24
- package/src/plugins/uniswap-v2/helpers.js +22 -22
- package/src/plugins/zeta/airdropFetcher.js +14 -14
- package/src/utils/sei/constants.js +8 -8
- package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
- package/src/plugins/metaplex/positionsSolanaFetcher.js.map +0 -1
- /package/src/plugins/{metaplex/positionsSolanaFetcher.d.ts → kai/lpVaultsFetcher.d.ts} +0 -0
@@ -0,0 +1,112 @@
|
|
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 clients_1 = require("../../utils/clients");
|
19
|
+
const getOwnedObjects_1 = require("../../utils/sui/getOwnedObjects");
|
20
|
+
const ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
|
21
|
+
const multiGetObjects_1 = require("../../utils/sui/multiGetObjects");
|
22
|
+
const constants_2 = require("../cetus/constants");
|
23
|
+
const tokenAmountFromLiquidity_1 = require("../../utils/clmm/tokenAmountFromLiquidity");
|
24
|
+
const bitsToNumber_1 = require("../../utils/sui/bitsToNumber");
|
25
|
+
const helpers_1 = require("./helpers");
|
26
|
+
const getPools_1 = require("../cetus/getPools");
|
27
|
+
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
28
|
+
var _a, _b, _c, _d, _e, _f;
|
29
|
+
const client = (0, clients_1.getClientSui)();
|
30
|
+
const positionCaps = yield (0, getOwnedObjects_1.getOwnedObjects)(client, owner, {
|
31
|
+
filter: {
|
32
|
+
StructType: '0x51e0ccce48f0763f98f1cb4856847c2e1531adacada99cdd7626ab999db57523::position_core_clmm::PositionCap',
|
33
|
+
},
|
34
|
+
});
|
35
|
+
if (positionCaps.length === 0)
|
36
|
+
return [];
|
37
|
+
const positions = yield (0, multiGetObjects_1.multiGetObjects)(client, positionCaps
|
38
|
+
.map((p) => { var _a, _b; return (_b = (_a = p.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields.position_id; })
|
39
|
+
.filter((s) => s !== undefined));
|
40
|
+
if (positionCaps.length === 0)
|
41
|
+
return [];
|
42
|
+
const [pools, configs, supplyPools] = yield Promise.all([
|
43
|
+
(0, getPools_1.getPools)(positions
|
44
|
+
.map((position) => { var _a, _b; return (_b = (_a = position.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields.lp_position.fields.pool; })
|
45
|
+
.filter((s) => s !== null), cache).then((res) => res.filter((p) => p !== null)),
|
46
|
+
(0, multiGetObjects_1.multiGetObjects)(client, positions
|
47
|
+
.map((p) => { var _a, _b; return (_b = (_a = p.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields.config_id; })
|
48
|
+
.filter((s) => s !== null)),
|
49
|
+
cache.getItem(constants_1.supplyPoolsCacheKey, {
|
50
|
+
prefix: constants_1.platformId,
|
51
|
+
networkId: portfolio_core_1.NetworkId.sui,
|
52
|
+
}),
|
53
|
+
]);
|
54
|
+
if (!supplyPools)
|
55
|
+
return [];
|
56
|
+
const elementRegistry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.sui, constants_1.platformId);
|
57
|
+
for (const position of positions) {
|
58
|
+
const i = positions.indexOf(position);
|
59
|
+
if (!((_a = position.data) === null || _a === void 0 ? void 0 : _a.content))
|
60
|
+
continue;
|
61
|
+
const parsedTypeString = (0, portfolio_core_1.parseTypeString)(position.data.type);
|
62
|
+
const isCetus = parsedTypeString.keys && parsedTypeString.keys[2].type === constants_2.clmmType;
|
63
|
+
if (!isCetus)
|
64
|
+
continue;
|
65
|
+
const pool = pools[i];
|
66
|
+
if (!pool)
|
67
|
+
continue;
|
68
|
+
const config = configs[i];
|
69
|
+
if (!((_b = config === null || config === void 0 ? void 0 : config.data) === null || _b === void 0 ? void 0 : _b.content))
|
70
|
+
continue;
|
71
|
+
const vaultInfo = constants_1.vaults.find((v) => { var _a, _b; return v.poolObjectId === ((_b = (_a = config.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields.pool_object_id); });
|
72
|
+
if (!vaultInfo)
|
73
|
+
continue;
|
74
|
+
const supplyPoolX = supplyPools.find((s) => { var _a, _b; return ((_b = (_a = s.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields.id.id) === vaultInfo.supplyPoolXInfo; });
|
75
|
+
const supplyPoolY = supplyPools.find((s) => { var _a, _b; return ((_b = (_a = s.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields.id.id) === vaultInfo.supplyPoolYInfo; });
|
76
|
+
if (!supplyPoolX || !supplyPoolY)
|
77
|
+
continue;
|
78
|
+
const element = elementRegistry.addElementLiquidity({
|
79
|
+
label: 'Leverage',
|
80
|
+
name: vaultInfo.name,
|
81
|
+
});
|
82
|
+
const liquidity = element.addLiquidity();
|
83
|
+
const tickLowerIndex = (0, bitsToNumber_1.bitsToNumber)(position.data.content.fields.lp_position.fields.tick_lower_index.fields
|
84
|
+
.bits);
|
85
|
+
const tickUpperIndex = (0, bitsToNumber_1.bitsToNumber)(position.data.content.fields.lp_position.fields.tick_upper_index.fields
|
86
|
+
.bits);
|
87
|
+
const { tokenAmountA, tokenAmountB } = (0, tokenAmountFromLiquidity_1.getTokenAmountsFromLiquidity)(new bignumber_js_1.default(position.data.content.fields.lp_position.fields.liquidity), pool.current_tick_index, tickLowerIndex, tickUpperIndex, false);
|
88
|
+
const debtX = new bignumber_js_1.default((0, helpers_1.calcDebtByShares)(config.data.content.fields.lend_facil_cap.fields.id.id, supplyPoolX, Number(((_d = (_c = position.data.content) === null || _c === void 0 ? void 0 : _c.fields.debt_bag.fields.inner.fields.infos.find((db) => `0x${db.fields.asset_type.fields.name}` === pool.coinTypeA)) === null || _d === void 0 ? void 0 : _d.fields.amount) || 0)));
|
89
|
+
const debtY = new bignumber_js_1.default((0, helpers_1.calcDebtByShares)(config.data.content.fields.lend_facil_cap.fields.id.id, supplyPoolY, Number(((_f = (_e = position.data.content) === null || _e === void 0 ? void 0 : _e.fields.debt_bag.fields.inner.fields.infos.find((db) => `0x${db.fields.asset_type.fields.name}` === pool.coinTypeB)) === null || _f === void 0 ? void 0 : _f.fields.amount) || 0)));
|
90
|
+
const { x, y } = (0, helpers_1.calcEquityValues)(debtX, debtY, tokenAmountA.plus(position.data.content.fields.col_x), tokenAmountB.plus(position.data.content.fields.col_y), new bignumber_js_1.default(pool.current_sqrt_price)
|
91
|
+
.pow(2)
|
92
|
+
.div(new bignumber_js_1.default(2).pow(128)));
|
93
|
+
liquidity.addAsset({
|
94
|
+
address: pool.coinTypeA,
|
95
|
+
amount: x,
|
96
|
+
});
|
97
|
+
liquidity.addAsset({
|
98
|
+
address: pool.coinTypeB,
|
99
|
+
amount: y,
|
100
|
+
});
|
101
|
+
if (tokenAmountA.isZero() || tokenAmountB.isZero())
|
102
|
+
element.addTag('Out Of Range');
|
103
|
+
}
|
104
|
+
return elementRegistry.getElements(cache);
|
105
|
+
});
|
106
|
+
const fetcher = {
|
107
|
+
id: `${constants_1.platformId}-lpvaults`,
|
108
|
+
networkId: portfolio_core_1.NetworkId.sui,
|
109
|
+
executor,
|
110
|
+
};
|
111
|
+
exports.default = fetcher;
|
112
|
+
//# sourceMappingURL=lpVaultsFetcher.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"lpVaultsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/kai/lpVaultsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAwE;AACxE,gEAAqC;AAGrC,2CAAsE;AACtE,iDAAmD;AACnD,qEAAkE;AAClE,gFAA6E;AAC7E,qEAAkE;AAElE,kDAA8C;AAE9C,wFAAyF;AACzF,+DAA4D;AAC5D,uCAA+D;AAE/D,gDAA6C;AAE7C,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,MAAM,YAAY,GAAG,MAAM,IAAA,iCAAe,EAAc,MAAM,EAAE,KAAK,EAAE;QACrE,MAAM,EAAE;YACN,UAAU,EACR,qGAAqG;SACxG;KACF,CAAC,CAAC;IACH,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEzC,MAAM,SAAS,GAAG,MAAM,IAAA,iCAAe,EACrC,MAAM,EACN,YAAY;SACT,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,eAAC,OAAA,MAAA,MAAA,CAAC,CAAC,IAAI,0CAAE,OAAO,0CAAE,MAAM,CAAC,WAAW,CAAA,EAAA,CAAC;SAC/C,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,CAAa,CAC9C,CAAC;IAEF,IAAI,YAAY,CAAC,MAAM,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AAC,CAAC;QAEH,IAAI,YAAY,CAAC,MAAM,EAAE,IAAI,YAAY,CAAC,MAAM,EAAE;YAChD,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;IACnC,CAAC;IAED,OAAO,eAAe,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -0,0 +1,35 @@
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
13
|
+
const constants_1 = require("./constants");
|
14
|
+
const clients_1 = require("../../utils/clients");
|
15
|
+
const multiGetObjects_1 = require("../../utils/sui/multiGetObjects");
|
16
|
+
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
17
|
+
const client = (0, clients_1.getClientSui)();
|
18
|
+
const supplyPools = new Set();
|
19
|
+
constants_1.vaults.forEach((v) => {
|
20
|
+
supplyPools.add(v.supplyPoolXInfo);
|
21
|
+
supplyPools.add(v.supplyPoolYInfo);
|
22
|
+
});
|
23
|
+
const objects = yield (0, multiGetObjects_1.multiGetObjects)(client, [...supplyPools]);
|
24
|
+
yield cache.setItem(constants_1.supplyPoolsCacheKey, objects, {
|
25
|
+
networkId: portfolio_core_1.NetworkId.sui,
|
26
|
+
prefix: constants_1.platformId,
|
27
|
+
});
|
28
|
+
});
|
29
|
+
const job = {
|
30
|
+
id: `${constants_1.platformId}-supply-pools`,
|
31
|
+
executor,
|
32
|
+
label: 'normal',
|
33
|
+
};
|
34
|
+
exports.default = job;
|
35
|
+
//# sourceMappingURL=supplyPoolsJob.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"supplyPoolsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/kai/supplyPoolsJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAGvD,2CAAsE;AACtE,iDAAmD;AACnD,qEAAkE;AAGlE,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,MAAM,WAAW,GAAgB,IAAI,GAAG,EAAE,CAAC;IAC3C,kBAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;QACnB,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC;QACnC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,MAAM,IAAA,iCAAe,EAAa,MAAM,EAAE,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC;IAE5E,MAAM,KAAK,CAAC,OAAO,CAAC,+BAAmB,EAAE,OAAO,EAAE;QAChD,SAAS,EAAE,0BAAS,CAAC,GAAG;QACxB,MAAM,EAAE,sBAAU;KACnB,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AACF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,eAAe;IAChC,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { ID } from '../../utils/sui/structs/id';
|
2
|
+
import { LpPosition } from '../cetus/types';
|
2
3
|
export interface Vault {
|
3
4
|
free_balance: string;
|
4
5
|
id: ID;
|
@@ -52,3 +53,109 @@ export interface Vault {
|
|
52
53
|
version: string;
|
53
54
|
withdraw_ticket_issued: boolean;
|
54
55
|
}
|
56
|
+
export type PositionCap = {
|
57
|
+
id: ID;
|
58
|
+
position_id: string;
|
59
|
+
};
|
60
|
+
export type Position = {
|
61
|
+
id: ID;
|
62
|
+
col_x: string;
|
63
|
+
col_y: string;
|
64
|
+
config_id: string;
|
65
|
+
debt_bag: {
|
66
|
+
type: string;
|
67
|
+
fields: {
|
68
|
+
facil_id: string;
|
69
|
+
id: ID;
|
70
|
+
inner: {
|
71
|
+
type: string;
|
72
|
+
fields: {
|
73
|
+
id: ID;
|
74
|
+
bag: {
|
75
|
+
fields: {
|
76
|
+
id: ID;
|
77
|
+
size: string;
|
78
|
+
};
|
79
|
+
type: string;
|
80
|
+
};
|
81
|
+
infos: {
|
82
|
+
type: string;
|
83
|
+
fields: {
|
84
|
+
amount: string;
|
85
|
+
asset_type: {
|
86
|
+
type: string;
|
87
|
+
fields: {
|
88
|
+
name: string;
|
89
|
+
};
|
90
|
+
};
|
91
|
+
share_type: {
|
92
|
+
type: string;
|
93
|
+
fields: {
|
94
|
+
name: string;
|
95
|
+
};
|
96
|
+
};
|
97
|
+
};
|
98
|
+
}[];
|
99
|
+
};
|
100
|
+
};
|
101
|
+
};
|
102
|
+
};
|
103
|
+
lp_position: LpPosition;
|
104
|
+
ticket_active: boolean;
|
105
|
+
version: number;
|
106
|
+
};
|
107
|
+
export type PositionConfig = {
|
108
|
+
allow_new_positions: boolean;
|
109
|
+
base_deleverage_factor_bps: number;
|
110
|
+
base_liq_factor_bps: number;
|
111
|
+
current_global_l: string;
|
112
|
+
deleverage_margin_bps: number;
|
113
|
+
id: ID;
|
114
|
+
lend_facil_cap: {
|
115
|
+
type: string;
|
116
|
+
fields: {
|
117
|
+
id: ID;
|
118
|
+
};
|
119
|
+
};
|
120
|
+
liq_bonus_bps: number;
|
121
|
+
liq_fee_bps: number;
|
122
|
+
liq_margin_bps: number;
|
123
|
+
max_global_l: string;
|
124
|
+
max_position_l: string;
|
125
|
+
min_init_margin_bps: number;
|
126
|
+
min_liq_start_price_delta_bps: number;
|
127
|
+
pool_object_id: string;
|
128
|
+
position_creation_fee_sui: string;
|
129
|
+
rebalance_fee_bps: number;
|
130
|
+
version: number;
|
131
|
+
};
|
132
|
+
export type SupplyPool = {
|
133
|
+
available_balance: string;
|
134
|
+
id: ID;
|
135
|
+
debt_info: {
|
136
|
+
type: string;
|
137
|
+
fields: {
|
138
|
+
contents: {
|
139
|
+
fields: {
|
140
|
+
key: string;
|
141
|
+
value: {
|
142
|
+
type: string;
|
143
|
+
fields: {
|
144
|
+
debt_registry: {
|
145
|
+
type: string;
|
146
|
+
fields: {
|
147
|
+
liability_value_x64: string;
|
148
|
+
supply_x64: string;
|
149
|
+
};
|
150
|
+
};
|
151
|
+
max_liability_outstanding: string;
|
152
|
+
max_utilization_bps: string;
|
153
|
+
};
|
154
|
+
};
|
155
|
+
};
|
156
|
+
type: string;
|
157
|
+
}[];
|
158
|
+
};
|
159
|
+
};
|
160
|
+
last_update_ts_sec: string;
|
161
|
+
};
|
@@ -17,7 +17,7 @@ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
|
17
17
|
const constants_1 = require("./constants");
|
18
18
|
const clients_1 = require("../../utils/clients");
|
19
19
|
const multiGetObjects_1 = require("../../utils/sui/multiGetObjects");
|
20
|
-
const
|
20
|
+
const getLpTokenSourceRaw_1 = require("../../utils/misc/getLpTokenSourceRaw");
|
21
21
|
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
22
22
|
var _a, _b, _c;
|
23
23
|
const client = (0, clients_1.getClientSui)();
|
@@ -36,19 +36,26 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
36
36
|
(_c = (_b = object.data) === null || _b === void 0 ? void 0 : _b.content) === null || _c === void 0 ? void 0 : _c.fields.strategies.fields.contents.forEach((c) => {
|
37
37
|
amount = amount.plus(c.fields.value.fields.borrowed);
|
38
38
|
});
|
39
|
-
const lpSource = (0,
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
address: vaultInfo.tType,
|
39
|
+
const lpSource = (0, getLpTokenSourceRaw_1.getLpTokenSourceRaw)({
|
40
|
+
networkId: portfolio_core_1.NetworkId.sui,
|
41
|
+
sourceId: constants_1.platformId,
|
42
|
+
platformId: constants_1.platformId,
|
43
|
+
lpDetails: {
|
44
|
+
address: vaultInfo.lpType,
|
46
45
|
decimals: vaultInfo.decimals,
|
47
|
-
|
48
|
-
price: tokenPrice.price,
|
46
|
+
supplyRaw: new bignumber_js_1.default(vault.lp_treasury.fields.total_supply.fields.value),
|
49
47
|
},
|
50
|
-
|
51
|
-
|
48
|
+
poolUnderlyingsRaw: [
|
49
|
+
{
|
50
|
+
address: vaultInfo.tType,
|
51
|
+
decimals: vaultInfo.decimals,
|
52
|
+
reserveAmountRaw: amount,
|
53
|
+
tokenPrice,
|
54
|
+
},
|
55
|
+
],
|
56
|
+
elementName: 'Vaults',
|
57
|
+
});
|
58
|
+
yield cache.setTokenPriceSources(lpSource);
|
52
59
|
}
|
53
60
|
});
|
54
61
|
const job = {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"vaultsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/kai/vaultsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,gEAAqC;AACrC,+DAA2E;AAG3E,2CAAqD;AACrD,iDAAmD;AACnD,qEAAkE;AAElE,
|
1
|
+
{"version":3,"file":"vaultsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/kai/vaultsJob.ts"],"names":[],"mapp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AC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;YACpE,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACvD,CAAC,CAAC,CAAC;QACH,MAAM,QAAQ,GAAG,IAAA,yCAAmB,EAAC;YACnC,SAAS,EAAE,0BAAS,CAAC,GAAG;YACxB,QAAQ,EAAE,sBAAU;YACpB,UAAU,EAAV,sBAAU;YACV,SAAS,EAAE;gBACT,OAAO,EAAE,SAAS,CAAC,MAAM;gBACzB,QAAQ,EAAE,SAAS,CAAC,QAAQ;gBAC5B,SAAS,EAAE,IAAI,sBAAS,CACtB,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,CACnD;aACF;YACD,kBAAkB,EAAE;gBAClB;oBACE,OAAO,EAAE,SAAS,CAAC,KAAK;oBACxB,QAAQ,EAAE,SAAS,CAAC,QAAQ;oBAC5B,gBAAgB,EAAE,MAAM;oBACxB,UAAU;iBACX;aACF;YACD,WAAW,EAAE,QAAQ;SACtB,CAAC,CAAC;QACH,MAAM,KAAK,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC,CAAA,CAAC;AACF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,SAAS;IAC1B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
6
|
exports.fetchers = exports.jobs = exports.platforms = void 0;
|
7
7
|
const constants_1 = require("./constants");
|
8
|
-
const
|
8
|
+
const resizableNftFetcher_1 = __importDefault(require("./resizableNftFetcher"));
|
9
9
|
exports.platforms = [constants_1.platform];
|
10
10
|
exports.jobs = [];
|
11
|
-
exports.fetchers = [
|
11
|
+
exports.fetchers = [resizableNftFetcher_1.default];
|
12
12
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/metaplex/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/metaplex/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,gFAAsD;AAEzC,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,EAAE,CAAC;AACjB,QAAA,QAAQ,GAAc,CAAC,6BAAiB,CAAC,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"resizableNftFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/metaplex/resizableNftFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAA4E;AAC5E,6CAA4C;AAE5C,2CAIqB;AAErB,gFAA6E;AAC7E,iDAAsD;AACtD,+CAAwE;AACxE,uCAAqE;AACrE,gGAA6F;AAE7F,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,uBAAuB,CAAC,IAAI,mBAAS,CAAC,KAAK,CAAC,EAAE;QACvE,SAAS,EAAE,IAAI,mBAAS,CAAC,uBAAc,CAAC;KACzC,CAAC,CAAC;IAEH,MAAM,aAAa,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CACnC,CAAC,OAAO,EAAE,EAAE,CAAC,2BAAkB,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CACrE,CAAC;IAEF,MA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M,EAAE,sBAAU,CAAC,CAAC;IAC1E,MAAM,OAAO,GAAG,eAAe,CAAC,kBAAkB,CAAC;QACjD,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,gBAAgB;KACvB,CAAC,CAAC;IAEH,OAAO,CAAC,QAAQ,CAAC;QACf,OAAO,EAAE,oCAAmB;QAC5B,MAAM;QACN,cAAc,EAAE,IAAI;QACpB,UAAU,EAAE;YACV,WAAW,EAAE,IAAI;SAClB;KACF,CAAC,CAAC;IAEH,OAAO,eAAe,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,SAAS;IAC1B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,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;
|
@@ -42,20 +42,20 @@ const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/token
|
|
42
42
|
const clients_1 = require("../../utils/clients");
|
43
43
|
const getMultipleAccountsInfoSafe_1 = require("../../utils/solana/getMultipleAccountsInfoSafe");
|
44
44
|
const helpers_1 = require("./helpers");
|
45
|
-
const query = (0, graphql_request_1.gql) `
|
46
|
-
query GetAirdropFinalFrontend($authority: String!) {
|
47
|
-
getAirdropFinalFrontend(authority: $authority) {
|
48
|
-
authority
|
49
|
-
community_allocation
|
50
|
-
eligibility
|
51
|
-
main_allocation
|
52
|
-
og_allocation
|
53
|
-
s1_allocation
|
54
|
-
s2_allocation
|
55
|
-
total_allocation
|
56
|
-
__typename
|
57
|
-
}
|
58
|
-
}
|
45
|
+
const query = (0, graphql_request_1.gql) `
|
46
|
+
query GetAirdropFinalFrontend($authority: String!) {
|
47
|
+
getAirdropFinalFrontend(authority: $authority) {
|
48
|
+
authority
|
49
|
+
community_allocation
|
50
|
+
eligibility
|
51
|
+
main_allocation
|
52
|
+
og_allocation
|
53
|
+
s1_allocation
|
54
|
+
s2_allocation
|
55
|
+
total_allocation
|
56
|
+
__typename
|
57
|
+
}
|
58
|
+
}
|
59
59
|
`;
|
60
60
|
const networkId = portfolio_core_1.NetworkId.solana;
|
61
61
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
@@ -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;
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"positionsSolanaFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/metaplex/positionsSolanaFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAA4E;AAC5E,6CAA4C;AAE5C,2CAIqB;AAErB,gFAA6E;AAC7E,iDAAsD;AACtD,+CAAwE;AACxE,uCAAqE;AACrE,gGAA6F;AAE7F,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,uBAAuB,CAAC,IAAI,mBAAS,CAAC,KAAK,CAAC,EAAE;QACvE,SAAS,EAAE,IAAI,mBAAS,CAAC,uBAAc,CAAC;KACzC,CAAC,CAAC;IAEH,MAAM,aAAa,GAAG,KAAK,CAA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