@sonarwatch/portfolio-plugins 0.11.157 → 0.11.159
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +8 -0
- package/package.json +2 -2
- package/src/plugins/abex/marketsJob.js +2 -2
- package/src/plugins/abex/marketsJob.js.map +1 -1
- package/src/plugins/aftermath/poolsJob.js +36 -102
- package/src/plugins/aftermath/poolsJob.js.map +1 -1
- package/src/plugins/atrix/poolsV1Job.js +2 -2
- package/src/plugins/atrix/poolsV1Job.js.map +1 -1
- package/src/plugins/auxexchange/aptosLpJob.js +6 -4
- package/src/plugins/auxexchange/aptosLpJob.js.map +1 -1
- package/src/plugins/bskt/vestingFetcher.js +4 -24
- package/src/plugins/bskt/vestingFetcher.js.map +1 -1
- package/src/plugins/fluxbeam/poolsJob.js +6 -4
- package/src/plugins/fluxbeam/poolsJob.js.map +1 -1
- package/src/plugins/kai/vaultsJob.js +2 -2
- package/src/plugins/kai/vaultsJob.js.map +1 -1
- package/src/plugins/liquiditypools-sei/job.js +6 -4
- package/src/plugins/liquiditypools-sei/job.js.map +1 -1
- package/src/plugins/liquidswap/aptosLpJob.js +2 -2
- package/src/plugins/liquidswap/aptosLpJob.js.map +1 -1
- package/src/plugins/marginfi/banksJob.d.ts +3 -0
- package/src/plugins/marginfi/{jobExecutor.js → banksJob.js} +8 -3
- package/src/plugins/marginfi/banksJob.js.map +1 -0
- package/src/plugins/marginfi/depositsFetcher.d.ts +3 -0
- package/src/plugins/marginfi/{fetcherExecutor.js → depositsFetcher.js} +8 -3
- package/src/plugins/marginfi/{fetcherExecutor.js.map → depositsFetcher.js.map} +1 -1
- package/src/plugins/marginfi/index.js +4 -17
- package/src/plugins/marginfi/index.js.map +1 -1
- package/src/plugins/meteora/multiTokenPoolsJob.js +2 -2
- package/src/plugins/meteora/multiTokenPoolsJob.js.map +1 -1
- package/src/plugins/meteora/poolsJob.js +6 -4
- package/src/plugins/meteora/poolsJob.js.map +1 -1
- package/src/plugins/navi/collateralFetcher.js +5 -1
- package/src/plugins/navi/collateralFetcher.js.map +1 -1
- package/src/plugins/orca/lpTokensJob.js +6 -4
- package/src/plugins/orca/lpTokensJob.js.map +1 -1
- package/src/plugins/pancakeswap/aptosLpJob.js +6 -4
- package/src/plugins/pancakeswap/aptosLpJob.js.map +1 -1
- package/src/plugins/raydium/lpTokensJob.js +8 -10
- 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/aptos/poolsJob.js +2 -2
- package/src/plugins/sushiswap/aptos/poolsJob.js.map +1 -1
- package/src/plugins/symmetry/basketsJob.js +2 -2
- package/src/plugins/symmetry/basketsJob.js.map +1 -1
- package/src/plugins/tulip/lendingTokensJob.js +2 -2
- package/src/plugins/tulip/lendingTokensJob.js.map +1 -1
- package/src/plugins/tulip/strategyTokensJob.js +2 -2
- package/src/plugins/tulip/strategyTokensJob.js.map +1 -1
- package/src/utils/clmm/tokenPricesFromSqrt.js +11 -4
- package/src/utils/clmm/tokenPricesFromSqrt.js.map +1 -1
- package/src/utils/misc/getLpTokenSource.d.ts +13 -9
- package/src/utils/misc/getLpTokenSource.js +29 -8
- package/src/utils/misc/getLpTokenSource.js.map +1 -1
- package/src/utils/misc/getLpTokenSourceOld.d.ts +18 -0
- package/src/utils/misc/getLpTokenSourceOld.js +32 -0
- package/src/utils/misc/getLpTokenSourceOld.js.map +1 -0
- package/src/utils/misc/getLpTokenSourceRaw.d.ts +16 -5
- package/src/utils/misc/getLpTokenSourceRaw.js +22 -6
- package/src/utils/misc/getLpTokenSourceRaw.js.map +1 -1
- package/src/utils/misc/getLpTokenSourceRawOld.d.ts +25 -0
- package/src/utils/misc/getLpTokenSourceRawOld.js +20 -0
- package/src/utils/misc/getLpTokenSourceRawOld.js.map +1 -0
- package/src/utils/misc/getLpUnderlyingTokenSource.d.ts +14 -18
- package/src/utils/misc/getLpUnderlyingTokenSource.js +101 -70
- package/src/utils/misc/getLpUnderlyingTokenSource.js.map +1 -1
- package/src/utils/misc/getLpUnderlyingTokenSourceOld.d.ts +26 -0
- package/src/utils/misc/getLpUnderlyingTokenSourceOld.js +73 -0
- package/src/utils/misc/getLpUnderlyingTokenSourceOld.js.map +1 -0
- package/src/plugins/marginfi/fetcherExecutor.d.ts +0 -3
- package/src/plugins/marginfi/jobExecutor.d.ts +0 -3
- package/src/plugins/marginfi/jobExecutor.js.map +0 -1
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
4
4
|
|
5
|
+
## [0.11.159](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.158...plugins-0.11.159) (2024-04-03)
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
## [0.11.158](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.157...plugins-0.11.158) (2024-04-02)
|
10
|
+
|
11
|
+
|
12
|
+
|
5
13
|
## [0.11.157](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.156...plugins-0.11.157) (2024-04-02)
|
6
14
|
|
7
15
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sonarwatch/portfolio-plugins",
|
3
|
-
"version": "0.11.
|
3
|
+
"version": "0.11.159",
|
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.159"
|
45
45
|
},
|
46
46
|
"main": "./src/index.js",
|
47
47
|
"types": "./src/index.d.ts"
|
@@ -18,7 +18,7 @@ const constants_1 = require("./constants");
|
|
18
18
|
const clients_1 = require("../../utils/clients");
|
19
19
|
const getDynamicFields_1 = require("../../utils/sui/getDynamicFields");
|
20
20
|
const multiGetObjects_1 = require("../../utils/sui/multiGetObjects");
|
21
|
-
const
|
21
|
+
const getLpTokenSourceRawOld_1 = __importDefault(require("../../utils/misc/getLpTokenSourceRawOld"));
|
22
22
|
const aptos_1 = require("../../utils/aptos");
|
23
23
|
const getObject_1 = require("../../utils/sui/getObject");
|
24
24
|
const constants_2 = require("../tokens/constants");
|
@@ -72,7 +72,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
72
72
|
price: tokenPrice.price,
|
73
73
|
});
|
74
74
|
}
|
75
|
-
const lpSource = (0,
|
75
|
+
const lpSource = (0, getLpTokenSourceRawOld_1.default)(portfolio_core_1.NetworkId.sui, constants_1.platformId, constants_1.platformId, {
|
76
76
|
address: constants_1.alpType,
|
77
77
|
decimals: constants_1.alpDecimals,
|
78
78
|
supplyRaw: new bignumber_js_1.default(lpSupply),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"marketsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/abex/marketsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAA2E;AAC3E,gEAAqC;AAGrC,2CAQqB;AACrB,iDAAmD;AACnD,uEAAoE;AAEpE,qEAAkE;AAClE
|
1
|
+
{"version":3,"file":"marketsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/abex/marketsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAA2E;AAC3E,gEAAqC;AAGrC,2CAQqB;AACrB,iDAAmD;AACnD,uEAAoE;AAEpE,qEAAkE;AAClE,qGAEiD;AACjD,6CAAoD;AACpD,yDAAsD;AACtD,mDAA2D;AAE3D,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;;IACnD,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,OAAO;IACP,MAAM,UAAU,GAAG,MAAM,I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,0BAAS,CAAC,GAAG,EACb,sBAAU,EACV,sBAAU,EACV;QACE,OAAO,EAAE,mBAAO;QAChB,QAAQ,EAAE,uBAAW;QACrB,SAAS,EAAE,IAAI,sBAAS,CAAC,QAAQ,CAAC;KACnC,EACD,aAAa,EACb,QAAQ,CACT,CAAC;IACF,MAAM,KAAK,CAAC,mBAAmB,CAAC;QAC9B,EAAE,EAAE,KAAK;QACT,SAAS,EAAE,0BAAS,CAAC,GAAG;QACxB,UAAU,EAAE,gCAAoB,CAAC,EAAE;QACnC,OAAO,EAAE,mBAAO;QAChB,QAAQ,EAAE,uBAAW;QACrB,KAAK,EAAE,QAAQ,CAAC,KAAK;QACrB,WAAW,EAAE,SAAS;QACtB,WAAW,EAAE,SAAS;QACtB,MAAM,EAAE,CAAC;QACT,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;KACtB,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AACF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -16,17 +16,14 @@ const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
16
16
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
17
17
|
const clients_1 = require("../../utils/clients");
|
18
18
|
const constants_1 = require("./constants");
|
19
|
-
const computeAndStoreLpPrice_1 = require("../../utils/misc/computeAndStoreLpPrice");
|
20
19
|
const aptos_1 = require("../../utils/aptos");
|
21
|
-
const getTokensPricesMap_1 = __importDefault(require("../../utils/misc/getTokensPricesMap"));
|
22
|
-
const getLpUnderlyingTokenSource_1 = __importDefault(require("../../utils/misc/getLpUnderlyingTokenSource"));
|
23
|
-
const getLpTokenSourceRaw_1 = __importDefault(require("../../utils/misc/getLpTokenSourceRaw"));
|
24
20
|
const getDynamicFields_1 = require("../../utils/sui/getDynamicFields");
|
25
21
|
const multiGetObjects_1 = require("../../utils/sui/multiGetObjects");
|
22
|
+
const getLpTokenSourceRaw_1 = require("../../utils/misc/getLpTokenSourceRaw");
|
23
|
+
const networkId = portfolio_core_1.NetworkId.sui;
|
26
24
|
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
27
|
-
var _a, _b, _c, _d
|
25
|
+
var _a, _b, _c, _d;
|
28
26
|
const client = (0, clients_1.getClientSui)();
|
29
|
-
const networkId = portfolio_core_1.NetworkId.sui;
|
30
27
|
const coinsTableFields = yield (0, getDynamicFields_1.getDynamicFields)(client, constants_1.lpCoinsTable);
|
31
28
|
const poolFactoryIds = coinsTableFields.map((f) => f.objectId);
|
32
29
|
if (!poolFactoryIds.length)
|
@@ -46,15 +43,10 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
46
43
|
if (!poolsIds.length)
|
47
44
|
return;
|
48
45
|
const poolsInfo = yield (0, multiGetObjects_1.multiGetObjects)(client, poolsIds);
|
49
|
-
const tokenPriceById = yield
|
50
|
-
.map((pool) => {
|
51
|
-
|
52
|
-
|
53
|
-
? ((_d = (_c = pool.data) === null || _c === void 0 ? void 0 : _c.content) === null || _d === void 0 ? void 0 : _d.fields).type_names
|
54
|
-
: [];
|
55
|
-
})
|
56
|
-
.flat()
|
57
|
-
.map((type) => `0x${type}`), networkId, cache);
|
46
|
+
const tokenPriceById = yield cache.getTokenPricesAsMap(poolsInfo
|
47
|
+
.map((pool) => { var _a, _b, _c; return ((_c = (_b = (_a = pool.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields) === null || _c === void 0 ? void 0 : _c.type_names) || []; })
|
48
|
+
.flat(), networkId);
|
49
|
+
const sources = [];
|
58
50
|
for (const pool of poolsInfo) {
|
59
51
|
if (!((_b = (_a = pool.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields))
|
60
52
|
continue;
|
@@ -64,96 +56,38 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
64
56
|
const moveType = (0, aptos_1.parseTypeString)(poolInfo.lp_supply.type);
|
65
57
|
if (!moveType.keys)
|
66
58
|
continue;
|
67
|
-
const
|
68
|
-
|
69
|
-
|
70
|
-
const
|
71
|
-
const
|
72
|
-
if (!
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
const decimals = poolInfo.lp_decimals;
|
81
|
-
const poolSupply = new bignumber_js_1.default(poolInfo.lp_supply.fields.value).dividedBy(Math.pow(10, decimals));
|
82
|
-
let totalLiquidity = new bignumber_js_1.default(0);
|
83
|
-
const underlyings = [];
|
84
|
-
for (let i = 0; i < totalTokens; i++) {
|
85
|
-
const coinDecimal = poolInfo.coin_decimals[i];
|
86
|
-
const reserveAmount = new bignumber_js_1.default(poolInfo.normalized_balances[i])
|
87
|
-
.dividedBy(Math.pow(10, coinDecimal))
|
88
|
-
.dividedBy(poolInfo.decimal_scalars[i]);
|
89
|
-
const tokenLiquidity = reserveAmount.multipliedBy(tokenPriceRef);
|
90
|
-
const amountPerLp = reserveAmount.dividedBy(poolSupply).toNumber();
|
91
|
-
totalLiquidity = totalLiquidity.plus(tokenLiquidity);
|
92
|
-
underlyings.push({
|
93
|
-
address: mints[i],
|
94
|
-
amountPerLp,
|
95
|
-
decimals: coinDecimal,
|
96
|
-
networkId,
|
97
|
-
price: tokenPriceRef,
|
98
|
-
});
|
99
|
-
}
|
100
|
-
if (totalLiquidity.isLessThan(computeAndStoreLpPrice_1.minimumLiquidity))
|
101
|
-
continue;
|
102
|
-
const price = totalLiquidity.dividedBy(poolSupply).toNumber();
|
103
|
-
const tokenPriceSoure = {
|
104
|
-
id: constants_1.platformId,
|
105
|
-
weight: 1,
|
106
|
-
address,
|
107
|
-
networkId,
|
108
|
-
platformId: constants_1.platformId,
|
109
|
-
decimals,
|
110
|
-
price,
|
111
|
-
underlyings,
|
112
|
-
timestamp: Date.now(),
|
113
|
-
};
|
114
|
-
yield cache.setTokenPriceSource(tokenPriceSoure);
|
115
|
-
}
|
116
|
-
else {
|
117
|
-
const tokenPriceA = tokenPriceById.get(`0x${poolInfo.type_names[0]}`);
|
118
|
-
const tokenPriceB = tokenPriceById.get(`0x${poolInfo.type_names[1]}`);
|
119
|
-
const reserveAmountRawA = new bignumber_js_1.default(poolInfo.normalized_balances[0]).dividedBy(poolInfo.decimal_scalars[0]);
|
120
|
-
const reserveAmountRawB = new bignumber_js_1.default(poolInfo.normalized_balances[1]).dividedBy(poolInfo.decimal_scalars[1]);
|
121
|
-
const underlyingSource = (0, getLpUnderlyingTokenSource_1.default)(address, networkId, {
|
122
|
-
address: `0x${poolInfo.type_names[0]}`,
|
123
|
-
decimals: poolInfo.coin_decimals[0],
|
124
|
-
reserveAmountRaw: reserveAmountRawA,
|
125
|
-
tokenPrice: tokenPriceA,
|
126
|
-
}, {
|
127
|
-
address: `0x${poolInfo.type_names[1]}`,
|
128
|
-
decimals: poolInfo.coin_decimals[1],
|
129
|
-
reserveAmountRaw: reserveAmountRawB,
|
130
|
-
tokenPrice: tokenPriceB,
|
59
|
+
const lpAddress = moveType.keys[0].type;
|
60
|
+
const poolUnderlyingsRaw = [];
|
61
|
+
poolInfo.normalized_balances.forEach((nBalance, i) => {
|
62
|
+
const caddress = (0, portfolio_core_1.formatTokenAddress)(`0x${poolInfo.type_names[i]}`, networkId);
|
63
|
+
const tokenPrice = tokenPriceById.get(caddress);
|
64
|
+
if (!tokenPrice)
|
65
|
+
return;
|
66
|
+
poolUnderlyingsRaw.push({
|
67
|
+
address: caddress,
|
68
|
+
decimals: poolInfo.coin_decimals[i],
|
69
|
+
reserveAmountRaw: new bignumber_js_1.default(poolInfo.normalized_balances[i]).dividedBy(poolInfo.decimal_scalars[i]),
|
70
|
+
tokenPrice,
|
71
|
+
weight: new bignumber_js_1.default(poolInfo.weights[i]).div(Math.pow(10, 18)).toNumber(),
|
131
72
|
});
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
73
|
+
});
|
74
|
+
if (poolUnderlyingsRaw.length !== poolInfo.normalized_balances.length)
|
75
|
+
continue;
|
76
|
+
const lpSources = (0, getLpTokenSourceRaw_1.getLpTokenSourceRaw)({
|
77
|
+
networkId,
|
78
|
+
platformId: constants_1.platformId,
|
79
|
+
lpDetails: {
|
80
|
+
address: lpAddress,
|
138
81
|
decimals: poolInfo.lp_decimals,
|
139
|
-
supplyRaw:
|
140
|
-
},
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
},
|
147
|
-
{
|
148
|
-
address: tokenPriceB.address,
|
149
|
-
decimals: tokenPriceB.decimals,
|
150
|
-
price: tokenPriceB.price,
|
151
|
-
reserveAmountRaw: reserveAmountRawB,
|
152
|
-
},
|
153
|
-
], '');
|
154
|
-
yield cache.setTokenPriceSource(lpSource);
|
155
|
-
}
|
82
|
+
supplyRaw: poolInfo.lp_supply.fields.value,
|
83
|
+
},
|
84
|
+
sourceId: lpAddress,
|
85
|
+
poolUnderlyingsRaw,
|
86
|
+
priceUnderlyings: true,
|
87
|
+
});
|
88
|
+
sources.push(...lpSources);
|
156
89
|
}
|
90
|
+
yield cache.setTokenPriceSources(sources);
|
157
91
|
});
|
158
92
|
const job = {
|
159
93
|
id: `${constants_1.platformId}-pools`,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"poolsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aftermath/poolsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,gEAAqC;AACrC,+
|
1
|
+
{"version":3,"file":"poolsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aftermath/poolsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,gEAAqC;AACrC,+DAA2E;AAG3E,iDAAmD;AACnD,2CAAuD;AAEvD,6CAAoD;AACpD,uEAAoE;AACpE,qEAAkE;AAClE,8EAG8C;AAE9C,MAAM,SAA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EAAE,IAAI,sBAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,SAAA,EAAE,EAAI,EAAE,CAAA,CAAC,CAAC,QAAQ,EAAE;aACpE,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QACH,IAAI,kBAAkB,CAAC,MAAM,KAAK,QAAQ,CAAC,mBAAmB,CAAC,MAAM;YACnE,SAAS;QACX,MAAM,SAAS,GAAG,IAAA,yCAAmB,EAAC;YACpC,SAAS;YACT,UAAU,EAAV,sBAAU;YACV,SAAS,EAAE;gBACT,OAAO,EAAE,SAAS;gBAClB,QAAQ,EAAE,QAAQ,CAAC,WAAW;gBAC9B,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK;aAC3C;YACD,QAAQ,EAAE,SAAS;YACnB,kBAAkB;YAClB,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;QACH,OAAO,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC;IAC7B,CAAC;IACD,MAAM,KAAK,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,QAAQ;IACzB,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -19,7 +19,7 @@ const structs_1 = require("../orders/clobs-solana/structs");
|
|
19
19
|
const constants_1 = require("./constants");
|
20
20
|
const structs_2 = require("./structs");
|
21
21
|
const fetchTokenSupplyAndDecimals_1 = require("../../utils/solana/fetchTokenSupplyAndDecimals");
|
22
|
-
const
|
22
|
+
const getLpTokenSourceOld_1 = __importDefault(require("../../utils/misc/getLpTokenSourceOld"));
|
23
23
|
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
24
24
|
const client = (0, clients_1.getClientSolana)();
|
25
25
|
const poolsAccounts = yield (0, solana_1.getParsedProgramAccounts)(client, structs_2.poolStruct, constants_1.atrixV1);
|
@@ -93,7 +93,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
93
93
|
decimals,
|
94
94
|
supply,
|
95
95
|
};
|
96
|
-
const source = (0,
|
96
|
+
const source = (0, getLpTokenSourceOld_1.default)(portfolio_core_1.NetworkId.solana, pool.pubkey.toString(), constants_1.platformId, lpDetailsRaw, poolUnderlyings, 'V1 (Deprecated)');
|
97
97
|
sourcesPromises.push(cache.setTokenPriceSource(source));
|
98
98
|
}
|
99
99
|
yield Promise.allSettled(sourcesPromises);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"poolsV1Job.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/atrix/poolsV1Job.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,+DAAmE;AAGnE,iDAAsD;AACtD,+CAK4B;AAC5B,4DAGwC;AACxC,2CAAkD;AAClD,uCAAuC;AACvC,gGAA6F;AAC7F
|
1
|
+
{"version":3,"file":"poolsV1Job.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/atrix/poolsV1Job.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,+DAAmE;AAGnE,iDAAsD;AACtD,+CAK4B;AAC5B,4DAGwC;AACxC,2CAAkD;AAClD,uCAAuC;AACvC,gGAA6F;AAC7F,+FAAuE;AAEvE,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,aAAa,GAAG,MAAM,IAAA,iCAAwB,EAClD,MAAM,EACN,oBAAU,EACV,mBAAO,CACR,CAAC;IAEF,MAAM,uBAAuB,GAAgB,EAAE,CAAC;IAChD,MAAM,uBAAuB,GAAgB,EAAE,CAAC;IAChD,MAAM,eAAe,GAAgB,IAAI,GAAG,EAAE,CAAC;IAE/C,aAAa,CAAC,OAAO,CAAC,CAAC,IAAI,E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CAAC;AAC5C,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -18,8 +18,8 @@ const aptos_1 = require("../../utils/aptos");
|
|
18
18
|
const clients_1 = require("../../utils/clients");
|
19
19
|
const constants_1 = require("./constants");
|
20
20
|
const getDecimalsForToken_1 = require("../../utils/misc/getDecimalsForToken");
|
21
|
-
const
|
22
|
-
const
|
21
|
+
const getLpUnderlyingTokenSourceOld_1 = __importDefault(require("../../utils/misc/getLpUnderlyingTokenSourceOld"));
|
22
|
+
const getLpTokenSourceRawOld_1 = __importDefault(require("../../utils/misc/getLpTokenSourceRawOld"));
|
23
23
|
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
24
24
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
25
25
|
const client = (0, clients_1.getClientAptos)();
|
@@ -76,22 +76,24 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
76
76
|
new bignumber_js_1.default(tokenPairData.x_reserve.value),
|
77
77
|
new bignumber_js_1.default(tokenPairData.y_reserve.value),
|
78
78
|
];
|
79
|
-
const underlyingSource = (0,
|
79
|
+
const underlyingSource = (0, getLpUnderlyingTokenSourceOld_1.default)(lpType, portfolio_core_1.NetworkId.aptos, {
|
80
80
|
address: typeX,
|
81
81
|
decimals: decimalsX,
|
82
82
|
reserveAmountRaw: reserveAmountRawX,
|
83
83
|
tokenPrice: tokenPriceX,
|
84
|
+
weight: 0.5,
|
84
85
|
}, {
|
85
86
|
address: typeY,
|
86
87
|
decimals: decimalsY,
|
87
88
|
reserveAmountRaw: reserveAmountRawY,
|
88
89
|
tokenPrice: tokenPriceY,
|
90
|
+
weight: 0.5,
|
89
91
|
});
|
90
92
|
if (underlyingSource)
|
91
93
|
lpSources.push(underlyingSource);
|
92
94
|
if (!tokenPriceX || !tokenPriceY)
|
93
95
|
continue;
|
94
|
-
const lpSource = (0,
|
96
|
+
const lpSource = (0, getLpTokenSourceRawOld_1.default)(portfolio_core_1.NetworkId.aptos, lpType, constants_1.platformId, {
|
95
97
|
address: lpType,
|
96
98
|
decimals: lpDecimals,
|
97
99
|
supplyRaw: lpSupply,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"aptosLpJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/auxexchange/aptosLpJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,gEAAqC;AACrC,+DAIoC;AAGpC,6CAK2B;AAC3B,iDAAqD;AACrD,2CAA+E;AAC/E,8EAA2E;AAC3E,
|
1
|
+
{"version":3,"file":"aptosLpJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/auxexchange/aptosLpJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,gEAAqC;AACrC,+DAIoC;AAGpC,6CAK2B;AAC3B,iDAAqD;AACrD,2CAA+E;AAC/E,8EAA2E;AAC3E,mHAA2F;AAC3F,qGAA6E;AAO7E,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;;IACnD,MAAM,MAAM,GAAG,IAAA,wBAAc,GAAE,CAAC;IAChC,MAAM,SAAS,GAAG,MAAM,IAAA,2BAAmB,EAAC,MAAM,EAAE,0BAAc,CAAC,CAAC;IACpE,IAAI,CAAC,SAAS;QAAE,OAAO;IAEvB,MAAM,eAAe,GAAuC,IAAI,GAAG,EAAE,CAAC;IACtE,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC7B,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,MAAM,KAAK,CAAC,mBAAmB,CACjD,SAAS;SACN,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE;Q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;IACD,MAAM,KAAK,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC;AAC9C,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -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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/clients");
|
19
19
|
const solana_1 = require("../../utils/solana");
|
20
20
|
const structs_1 = require("./structs");
|
21
|
-
const
|
22
|
-
const
|
21
|
+
const getLpTokenSourceRawOld_1 = __importDefault(require("../../utils/misc/getLpTokenSourceRawOld"));
|
22
|
+
const getLpUnderlyingTokenSourceOld_1 = __importDefault(require("../../utils/misc/getLpUnderlyingTokenSourceOld"));
|
23
23
|
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
24
24
|
const connection = (0, clients_1.getClientSolana)();
|
25
25
|
let pools = yield (0, solana_1.getParsedProgramAccounts)(connection, structs_1.poolStruct, new web3_js_1.PublicKey(constants_1.fluxbeamPoolsPid), [{ dataSize: structs_1.poolStruct.byteSize }]);
|
@@ -71,23 +71,25 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
71
71
|
continue;
|
72
72
|
const tokenPriceA = tokenPrices.get(pool.tokenAMint.toString());
|
73
73
|
const tokenPriceB = tokenPrices.get(pool.tokenBMint.toString());
|
74
|
-
const underlyingsSource = (0,
|
74
|
+
const underlyingsSource = (0, getLpUnderlyingTokenSourceOld_1.default)(pool.poolMint.toString(), portfolio_core_1.NetworkId.solana, {
|
75
75
|
address: pool.tokenAMint.toString(),
|
76
76
|
decimals: mintAccountA.decimals,
|
77
77
|
reserveAmountRaw: tokenAccountA.amount,
|
78
78
|
tokenPrice: tokenPriceA,
|
79
|
+
weight: 0.5,
|
79
80
|
}, {
|
80
81
|
address: pool.tokenBMint.toString(),
|
81
82
|
decimals: mintAccountB.decimals,
|
82
83
|
reserveAmountRaw: tokenAccountB.amount,
|
83
84
|
tokenPrice: tokenPriceB,
|
85
|
+
weight: 0.5,
|
84
86
|
});
|
85
87
|
if (underlyingsSource) {
|
86
88
|
yield cache.setTokenPriceSource(underlyingsSource);
|
87
89
|
}
|
88
90
|
if (!tokenPriceA || !tokenPriceB)
|
89
91
|
continue;
|
90
|
-
const lpSource = (0,
|
92
|
+
const lpSource = (0, getLpTokenSourceRawOld_1.default)(portfolio_core_1.NetworkId.solana, constants_1.platformId, constants_1.platformId, {
|
91
93
|
address: pool.poolMint.toString(),
|
92
94
|
decimals: poolMint.decimals,
|
93
95
|
supplyRaw: poolMint.supply,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"poolsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/fluxbeam/poolsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,6CAA4C;AAC5C,+DAAmE;AAGnE,2CAA2D;AAC3D,iDAAsD;AACtD,+CAQ4B;AAC5B,uCAAuC;AACvC
|
1
|
+
{"version":3,"file":"poolsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/fluxbeam/poolsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,6CAA4C;AAC5C,+DAAmE;AAGnE,2CAA2D;AAC3D,iDAAsD;AACtD,+CAQ4B;AAC5B,uCAAuC;AACvC,qGAA6E;AAC7E,mHAA2F;AAE3F,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IACrC,IAAI,KAAK,GAAG,MAAM,IAAA,iCAAwB,EACxC,UAAU,EACV,oBAAU,EACV,IAAI,mBAAS,CAAC,4BAAgB,CAAC,EAC/B,CAAC,EAAE,QAAQ,EAAE,oBAAU,CAAC,QAAQ,EAAE,CAAC,CACpC,CAAC;IACF,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAEnD,MAAM,wBAAwB,GAAG,KAAK;SACnC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;SACzC,IAAI,EAAE,CAAC;IACV,MAAM,aAAa,GAAG,MAAM,IAAA,sCAA6B,EACvD,UAAU,EACV,2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;gBACxB,gBAAgB,EAAE,aAAa,CAAC,MAAM;aACvC;SACF,EACD,OAAO,CACR,CAAC;QACF,MAAM,KAAK,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC;AACH,CAAC,CAAA,CAAC;AACF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,QAAQ;IACzB,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -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 getLpTokenSourceRawOld_1 = __importDefault(require("../../utils/misc/getLpTokenSourceRawOld"));
|
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,7 +36,7 @@ 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,
|
39
|
+
const lpSource = (0, getLpTokenSourceRawOld_1.default)(portfolio_core_1.NetworkId.sui, constants_1.platformId, constants_1.platformId, {
|
40
40
|
address: vaultInfo.lpType,
|
41
41
|
decimals: vaultInfo.decimals,
|
42
42
|
supplyRaw: new bignumber_js_1.default(vault.lp_treasury.fields.total_supply.fields.value),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"vaultsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/kai/vaultsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;A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MAAM,CAAC;QACzC,IAAI,MAAM,GAAG,IAAI,sBAAS,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAC/C,MAAA,MAAA,MAAM,CAAC,IAAI,0CAAE,OAAO,0CAAE,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,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,gCAAsB,EACrC,0BAAS,CAAC,GAAG,EACb,sBAAU,EACV,sBAAU,EACV;YACE,OAAO,EAAE,SAAS,CAAC,MAAM;YACzB,QAAQ,EAAE,SAAS,CAAC,QAAQ;YAC5B,SAAS,EAAE,IAAI,sBAAS,CACtB,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,CACnD;SACF,EACD;YACE;gBACE,OAAO,EAAE,SAAS,CAAC,KAAK;gBACxB,QAAQ,EAAE,SAAS,CAAC,QAAQ;gBAC5B,gBAAgB,EAAE,MAAM;gBACxB,KAAK,EAAE,UAAU,CAAC,KAAK;aACxB;SACF,EACD,QAAQ,CACT,CAAC;QACF,MAAM,KAAK,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAC5C,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"}
|
@@ -20,8 +20,8 @@ const constants_2 = require("./constants");
|
|
20
20
|
const sei_1 = require("../../utils/sei");
|
21
21
|
const isAContract_1 = __importDefault(require("../../utils/sei/isAContract"));
|
22
22
|
const getDecimalsForToken_1 = require("../../utils/misc/getDecimalsForToken");
|
23
|
-
const
|
24
|
-
const
|
23
|
+
const getLpUnderlyingTokenSourceOld_1 = __importDefault(require("../../utils/misc/getLpUnderlyingTokenSourceOld"));
|
24
|
+
const getLpTokenSourceRawOld_1 = __importDefault(require("../../utils/misc/getLpTokenSourceRawOld"));
|
25
25
|
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
26
26
|
const cosmWasmClient = yield (0, core_1.getCosmWasmClient)((0, constants_1.getUrlEndpoint)(portfolio_core_1.NetworkId.sei));
|
27
27
|
const pushedContractsByPlatform = new Map();
|
@@ -64,22 +64,24 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
64
64
|
];
|
65
65
|
if (!decimalsX || !decimalsY)
|
66
66
|
continue;
|
67
|
-
const underlyingSource = (0,
|
67
|
+
const underlyingSource = (0, getLpUnderlyingTokenSourceOld_1.default)(lpContract, portfolio_core_1.NetworkId.sei, {
|
68
68
|
address: poolInfo.mintX,
|
69
69
|
decimals: decimalsX,
|
70
70
|
reserveAmountRaw: reserveAmountRawX,
|
71
71
|
tokenPrice: tokenPriceX,
|
72
|
+
weight: 0.5,
|
72
73
|
}, {
|
73
74
|
address: poolInfo.mintY,
|
74
75
|
decimals: decimalsY,
|
75
76
|
reserveAmountRaw: reserveAmountRawY,
|
76
77
|
tokenPrice: tokenPriceY,
|
78
|
+
weight: 0.5,
|
77
79
|
});
|
78
80
|
if (underlyingSource)
|
79
81
|
yield cache.setTokenPriceSource(underlyingSource);
|
80
82
|
if (!tokenPriceX || !tokenPriceY)
|
81
83
|
continue;
|
82
|
-
const lpSource = (0,
|
84
|
+
const lpSource = (0, getLpTokenSourceRawOld_1.default)(portfolio_core_1.NetworkId.sei, lpContract, platformId, {
|
83
85
|
address: lpContract,
|
84
86
|
decimals: lpTokenInfo.decimals,
|
85
87
|
supplyRaw: supply,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"job.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/liquiditypools-sei/job.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,uCAAiD;AACjD,+DAAuD;AACvD,gEAAqC;AAGrC,6DAA+D;AAC/D,2CAA4D;AAC5D,yCAKyB;AACzB,8EAAsD;AACtD,8EAA2E;AAC3E,
|
1
|
+
{"version":3,"file":"job.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/liquiditypools-sei/job.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,uCAAiD;AACjD,+DAAuD;AACvD,gEAAqC;AAGrC,6DAA+D;AAC/D,2CAA4D;AAC5D,yCAKyB;AACzB,8EAAsD;AACtD,8EAA2E;AAC3E,mHAA2F;AAC3F,qGAA6E;AAE7E,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,cAAc,GAAG,MAAM,IAAA,wBAAiB,EAAC,IAAA,0BAAc,EAAC,0BAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IAE9E,MAAM,yBAAyB,GAA0B,IAAI,GAAG,EAAE,CAAC;IACnE,KAAK,MAAM,iBAAiB,IAAI,+BAAmB,EAAE,CAAC;QACpD,MAAM,EAAE,KAAK,EAAE,GAAG,iBAAiB,CAAC;QACpC,MAAM,SAAS,GAAa,EAAE,CAAC;QAC/B,MAAM,EAAE,UAAU,EAAE,GAAG,iBAAiB,CAAC;QACzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACtC,MAAM,cAAc,GAAG,MAAM,cAAc,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YACnE,SAAS,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,CAAC;QACpC,CAAC;QACD,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QAErC,MAAM,WAAW,GAAG,iBAAiB,CAAC,YAAY,CAAC;QACnD,KAAK,MAAM,UAAU,IAAI,SAAS,E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ACD,EAAE,CACH,CAAC;YACF,MAAM,KAAK,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;YAE1C,IAAI,yBAAyB,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;gBAC9C,MAAM,eAAe,GAAG,yBAAyB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;gBAClE,IAAI,CAAC,eAAe;oBAAE,SAAS;gBAC/B,yBAAyB,CAAC,GAAG,CAAC,UAAU,EAAE;oBACxC,GAAG,eAAe;oBAClB,UAAU;iBACX,CAAC,CAAC;YACL,CAAC;iBAAM,CAAC;gBACN,yBAAyB,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;YAC1D,CAAC;QACH,CAAC;IACH,CAAC;IAED,KAAK,MAAM,QAAQ,IAAI,yBAAyB,CAAC,IAAI,EAAE,EAAE,CAAC;QACxD,MAAM,SAAS,GAAG,yBAAyB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC1D,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QACnD,MAAM,KAAK,CAAC,OAAO,CACjB,QAAQ,EACR,EAAE,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,EAC3B;YACE,MAAM,EAAE,oBAAQ;YAChB,SAAS,EAAE,0BAAS,CAAC,GAAG;SACzB,CACF,CAAC;IACJ,CAAC;AACH,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,oBAAQ;IACZ,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -17,7 +17,7 @@ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
|
17
17
|
const aptos_1 = require("../../utils/aptos");
|
18
18
|
const clients_1 = require("../../utils/clients");
|
19
19
|
const constants_1 = require("./constants");
|
20
|
-
const
|
20
|
+
const getLpTokenSourceRawOld_1 = __importDefault(require("../../utils/misc/getLpTokenSourceRawOld"));
|
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.getClientAptos)();
|
@@ -89,7 +89,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
89
89
|
];
|
90
90
|
if (!tokenPriceX || !tokenPriceY)
|
91
91
|
continue;
|
92
|
-
const lpSource = (0,
|
92
|
+
const lpSource = (0, getLpTokenSourceRawOld_1.default)(portfolio_core_1.NetworkId.aptos, lpType, constants_1.platformId, {
|
93
93
|
address: lpType,
|
94
94
|
decimals: lpDecimals,
|
95
95
|
supplyRaw: lpSupply,
|