@sonarwatch/portfolio-plugins 0.11.127 → 0.11.128
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +4 -0
- package/package.json +2 -2
- package/src/plugins/bskt/vestingFetcher.js +4 -2
- package/src/plugins/bskt/vestingFetcher.js.map +1 -1
- package/src/plugins/flash/perpetualFetcher.js +3 -3
- package/src/plugins/flash/perpetualFetcher.js.map +1 -1
- package/src/plugins/flash/structs.d.ts +1 -1
- package/src/plugins/flash/types.d.ts +1 -1
- package/src/plugins/flexlend/depositsFetcher.js +4 -8
- package/src/plugins/flexlend/depositsFetcher.js.map +1 -1
- package/src/plugins/jupiter/custodiesJob.js +2 -2
- package/src/plugins/jupiter/custodiesJob.js.map +1 -1
- package/src/plugins/jupiter/filters.js +1 -1
- package/src/plugins/jupiter/helpers.js +3 -0
- package/src/plugins/jupiter/helpers.js.map +1 -1
- package/src/plugins/jupiter/index.js +2 -0
- package/src/plugins/jupiter/index.js.map +1 -1
- package/src/plugins/jupiter/perpetualFetcher.js +4 -4
- package/src/plugins/jupiter/perpetualFetcher.js.map +1 -1
- package/src/plugins/jupiter/poolJob.js +3 -3
- package/src/plugins/jupiter/poolJob.js.map +1 -1
- package/src/plugins/jupiter/{structs.js → structs/perpetuals.js} +2 -2
- package/src/plugins/jupiter/structs/perpetuals.js.map +1 -0
- package/src/plugins/jupiter/structs/valueAverage.js +4 -4
- package/src/plugins/jupiter/structs/valueAverage.js.map +1 -1
- package/src/plugins/jupiter/testFetcher.d.ts +3 -0
- package/src/plugins/jupiter/testFetcher.js +77 -0
- package/src/plugins/jupiter/testFetcher.js.map +1 -0
- package/src/plugins/jupiter/valueAverageFetcher.js +53 -21
- package/src/plugins/jupiter/valueAverageFetcher.js.map +1 -1
- package/src/plugins/solend/obligationsFetcher.js +10 -1
- package/src/plugins/solend/obligationsFetcher.js.map +1 -1
- package/src/plugins/jupiter/structs.js.map +0 -1
- /package/src/plugins/jupiter/{structs.d.ts → structs/perpetuals.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
4
4
|
|
5
|
+
## [0.11.128](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.127...plugins-0.11.128) (2024-03-18)
|
6
|
+
|
7
|
+
|
8
|
+
|
5
9
|
## [0.11.127](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.126...plugins-0.11.127) (2024-03-18)
|
6
10
|
|
7
11
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sonarwatch/portfolio-plugins",
|
3
|
-
"version": "0.11.
|
3
|
+
"version": "0.11.128",
|
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.128"
|
45
45
|
},
|
46
46
|
"main": "./src/index.js",
|
47
47
|
"types": "./src/index.d.ts"
|
@@ -29,8 +29,10 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
29
29
|
const vestingAccounts = yield (0, solana_1.getParsedProgramAccounts)(client, structs_1.vestingAccountStruct, constants_1.bsktPid, (0, filters_1.vestingAccountFilter)(owner));
|
30
30
|
const bsktTokenPrice = yield cache.getTokenPrice(constants_1.bsktMint, portfolio_core_1.NetworkId.solana);
|
31
31
|
if (vestingAccounts.length === 0) {
|
32
|
-
const res = yield axios_1.default
|
33
|
-
|
32
|
+
const res = yield axios_1.default
|
33
|
+
.get(`https://claim.bskt.fi/api/getClaim?wallet=${owner}`)
|
34
|
+
.catch(() => null);
|
35
|
+
if (res && res.data.amount) {
|
34
36
|
const assets = [];
|
35
37
|
const totalAmount = new bignumber_js_1.default(res.data.amount);
|
36
38
|
const amountPerUnlock = new bignumber_js_1.default(totalAmount).dividedBy(30);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"vestingFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/bskt/vestingFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AACpC,kDAA6C;AAC7C,gEAAqC;AAGrC,2CAA0E;AAC1E,+CAA8D;AAC9D,uCAAiD;AACjD,uCAAiD;AACjD,iDAAsD;AACtD,qGAA6E;AAG7E,MAAM,MAAM,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AACnC,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,aAAa,CAAC,CAAC;AAC1C,MAAM,OAAO,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,MAAM,CAAC,CAAC;AAE5D,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,eAAe,GAAG,MAAM,IAAA,iCAAwB,EACpD,MAAM,EACN,8BAAoB,EACpB,mBAAO,EACP,IAAA,8BAAoB,EAAC,KAAK,CAAC,CAC5B,CAAC;IACF,MAAM,cAAc,GAAG,MAAM,KAAK,CAAC,aAAa,CAAC,oBAAQ,EAAE,0BAAS,CAAC,MAAM,CAAC,CAAC;IAE7E,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACjC,MAAM,GAAG,
|
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,qG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,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -23,7 +23,7 @@ const helpers_1 = require("../../utils/solana/pyth/helpers");
|
|
23
23
|
const constants_2 = require("../tokens/constants");
|
24
24
|
const filters_1 = require("./filters");
|
25
25
|
const structs_1 = require("./structs");
|
26
|
-
const
|
26
|
+
const perpetuals_1 = require("../jupiter/structs/perpetuals");
|
27
27
|
const usdFactor = new bignumber_js_1.default(Math.pow(10, 6));
|
28
28
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
29
29
|
const client = (0, clients_1.getClientSolana)();
|
@@ -61,9 +61,9 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
61
61
|
const market = MarketById.get(position.market.toString());
|
62
62
|
if (!market)
|
63
63
|
continue;
|
64
|
-
if (Number(market.side) ===
|
64
|
+
if (Number(market.side) === perpetuals_1.Side.None)
|
65
65
|
continue;
|
66
|
-
const isLong = Number(market.side) ===
|
66
|
+
const isLong = Number(market.side) === perpetuals_1.Side.Long;
|
67
67
|
const collateralCustody = market.collateralCustodyAccount;
|
68
68
|
const targetCustody = market.targetCustodyAccount;
|
69
69
|
if (!market || !collateralCustody)
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"perpetualFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/flash/perpetualFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAQoC;AACpC,gEAAqC;AACrC,6CAA4C;AAG5C,2CAA+D;AAC/D,iDAAsD;AACtD,+CAA8D;AAC9D,gGAA6F;AAC7F,6DAAwE;AACxE,mDAA8D;AAC9D,uCAAsD;AACtD,uCAA2C;AAE3C,
|
1
|
+
{"version":3,"file":"perpetualFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/flash/perpetualFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAQ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BACX,KAAK;aACN;SACF,CAAC,CAAC;IACL,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,aAAa;IAC9B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -2,7 +2,7 @@
|
|
2
2
|
import { BeetStruct } from '@metaplex-foundation/beet';
|
3
3
|
import { PublicKey } from '@solana/web3.js';
|
4
4
|
import BigNumber from 'bignumber.js';
|
5
|
-
import { OracleType, Side } from '../jupiter/structs';
|
5
|
+
import { OracleType, Side } from '../jupiter/structs/perpetuals';
|
6
6
|
export type OracleParams = {
|
7
7
|
oracleAccount: PublicKey;
|
8
8
|
customOracleAccount: PublicKey;
|
@@ -16,19 +16,15 @@ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
|
16
16
|
const constants_1 = require("./constants");
|
17
17
|
const helpers_1 = require("./helpers");
|
18
18
|
const obligationsFetcher_1 = __importDefault(require("../solend/obligationsFetcher"));
|
19
|
-
const deposits_1 = __importDefault(require("../drift/deposits"));
|
20
|
-
const lendsFetcher_1 = __importDefault(require("../kamino/lendsFetcher"));
|
21
|
-
const collateralFetcher_1 = __importDefault(require("../mango/collateralFetcher"));
|
22
|
-
const index_1 = require("../marginfi/index");
|
23
19
|
const constants_2 = require("../tokens/constants");
|
24
20
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
25
21
|
const pda = (0, helpers_1.getDerivedAccount)(owner);
|
26
22
|
const portfolioElements = (yield Promise.all([
|
27
|
-
|
23
|
+
// marginfiDepositsFetchers[0].executor(pda, cache),
|
28
24
|
obligationsFetcher_1.default.executor(pda, cache),
|
29
|
-
|
30
|
-
|
31
|
-
|
25
|
+
// driftDepositsFetcher.executor(pda, cache),
|
26
|
+
// kaminoLendDepositFetcher.executor(pda, cache),
|
27
|
+
// mangoDepositFetcher.executor(pda, cache),
|
32
28
|
])).flat();
|
33
29
|
if (portfolioElements.length === 0)
|
34
30
|
return [];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"depositsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/flexlend/depositsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAyE;AAGzE,2CAAyC;AACzC,uCAA8C;AAC9C,sFAAiE;
|
1
|
+
{"version":3,"file":"depositsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/flexlend/depositsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAyE;AAGzE,2CAAyC;AACzC,uCAA8C;AAC9C,sFAAiE;AAKjE,mDAA2D;AAE3D,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,GAAG,GAAG,IAAA,2BAAiB,EAAC,KAAK,CAAC,CAAC;IAErC,MAAM,iBAAiB,GAAG,CACxB,MAAM,OAAO,CAAC,GAAG,CAAC;QAChB,oDAAoD;QACpD,4BAAqB,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC;QAC1C,6CAA6C;QAC7C,iDAAiD;QACjD,4CAA4C;KAC7C,CAAC,CACH,CAAC,IAAI,EAAE,CAAC;IAET,IAAI,iBAAiB,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAE9C,MAAM,QAAQ,GAAuB,EAAE,CAAC;IACxC,KAAK,MAAM,OAAO,IAAI,iBAAiB,EAAE,CAAC;QACxC,MAAM,UAAU,GAAG,OAAO,CAAC;QAC3B,UAAU,CAAC,IAAI;YACb,UAAU,CAAC,UAAU,KAAK,gCAAoB,CAAC,EAAE;gBAC/C,CAAC,CAAC,gBAAgB;gBAClB,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE;oBAC/C,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACrC,UAAU,CAAC,UAAU,GAAG,sBAAU,CAAC;QACnC,QAAQ,CAAC,IAAI,mBACR,UAAU,EACb,CAAC;IACL,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -14,10 +14,10 @@ const clients_1 = require("../../utils/clients");
|
|
14
14
|
const solana_1 = require("../../utils/solana");
|
15
15
|
const filters_1 = require("../../utils/solana/filters");
|
16
16
|
const constants_1 = require("./constants");
|
17
|
-
const
|
17
|
+
const perpetuals_1 = require("./structs/perpetuals");
|
18
18
|
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
19
19
|
const client = (0, clients_1.getClientSolana)();
|
20
|
-
const custodiesAccounts = yield (0, solana_1.getParsedProgramAccounts)(client,
|
20
|
+
const custodiesAccounts = yield (0, solana_1.getParsedProgramAccounts)(client, perpetuals_1.custodyStruct, constants_1.perpsProgramId, (0, filters_1.dataStructSizeFilter)(perpetuals_1.custodyStruct));
|
21
21
|
if (custodiesAccounts.length === 0)
|
22
22
|
return;
|
23
23
|
const accounts = custodiesAccounts.map((acc) => (Object.assign({ pubkey: acc.pubkey.toString() }, acc)));
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"custodiesJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jupiter/custodiesJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAGvD,iDAAsD;AACtD,+CAA8D;AAC9D,wDAAkE;AAClE,2CAAuE;AACvE,
|
1
|
+
{"version":3,"file":"custodiesJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jupiter/custodiesJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAGvD,iDAAsD;AACtD,+CAA8D;AAC9D,wDAAkE;AAClE,2CAAuE;AACvE,qDAA8D;AAE9D,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,iBAAiB,GAAG,MAAM,IAAA,iCAAwB,EACtD,MAAM,EACN,0BAAa,EACb,0BAAc,EACd,IAAA,8BAAoB,EAAC,0BAAa,CAAC,CACpC,CAAC;IACF,IAAI,iBAAiB,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAE3C,MAAM,QAAQ,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,iBAC9C,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,IACzB,GAAe,EACnB,CAAC,CAAC;IAEJ,MAAM,KAAK,CAAC,OAAO,CAAC,wBAAY,EAAE,QAAQ,EAAE;QAC1C,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,YAAY;IAC7B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -15,6 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.getMergedAssets = exports.getPrices = exports.getVotePda = exports.deriveClaimStatus = void 0;
|
16
16
|
const web3_js_1 = require("@solana/web3.js");
|
17
17
|
const axios_1 = __importDefault(require("axios"));
|
18
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
18
19
|
const constants_1 = require("./constants");
|
19
20
|
function deriveClaimStatus(claimant, distributor, programId) {
|
20
21
|
return web3_js_1.PublicKey.findProgramAddressSync([Buffer.from('ClaimStatus'), claimant.toBytes(), distributor.toBytes()], programId);
|
@@ -51,12 +52,14 @@ function getMergedAssets(assets) {
|
|
51
52
|
continue;
|
52
53
|
const { address } = asset.data;
|
53
54
|
const amountToAdd = asset.data.amount;
|
55
|
+
const valueToAdd = asset.value;
|
54
56
|
const existingAsset = assetByMint.get(address);
|
55
57
|
if (!existingAsset) {
|
56
58
|
assetByMint.set(address, asset);
|
57
59
|
}
|
58
60
|
else {
|
59
61
|
existingAsset.data.amount += amountToAdd;
|
62
|
+
existingAsset.value = (0, portfolio_core_1.getUsdValueSum)([valueToAdd, existingAsset.value]);
|
60
63
|
assetByMint.set(address, existingAsset);
|
61
64
|
}
|
62
65
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jupiter/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAA4C;AAC5C,kDAA6C;
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jupiter/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAA4C;AAC5C,kDAA6C;AAC7C,+DAA4E;AAC5E,2CAA0D;AAG1D,SAAgB,iBAAiB,CAC/B,QAAmB,EACnB,WAAsB,EACtB,SAAoB;IAEpB,OAAO,mBAAS,CAAC,sBAAsB,CACrC,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,QAAQ,CAAC,OAAO,EAAE,EAAE,WAAW,CAAC,OAAO,EAAE,CAAC,EACvE,SAAS,CACV,CAAC;AACJ,CAAC;AATD,8CASC;AAED,SAAgB,UAAU,CAAC,KAAa;IACtC,OAAO,mBAAS,CAAC,sBAAsB,CACrC;QACE,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;QACrB,wBAAY,CAAC,OAAO,EAAE;QACtB,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE;KAC/B,EACD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;QAClC,CAAC;aAAM,CAAC;YACN,aAAa,CAAC,IAAI,CAAC,MAAM,IAAI,WAAW,CAAC;YACzC,aAAa,CAAC,KAAK,GAAG,IAAA,+BAAc,EAAC,CAAC,UAAU,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;YACxE,WAAW,CAAC,GAAG,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;QAC1C,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC;AAC1C,CAAC;AAnBD,0CAmBC"}
|
@@ -10,6 +10,7 @@ const airdropFetcher_1 = __importDefault(require("./airdropFetcher"));
|
|
10
10
|
const voteFetcher_1 = __importDefault(require("./voteFetcher"));
|
11
11
|
const constants_1 = require("./constants");
|
12
12
|
const valueAverageFetcher_1 = __importDefault(require("./valueAverageFetcher"));
|
13
|
+
const testFetcher_1 = __importDefault(require("./testFetcher"));
|
13
14
|
exports.platforms = [constants_1.jupiterPlatform];
|
14
15
|
exports.jobs = [custodiesJob_1.default];
|
15
16
|
exports.fetchers = [
|
@@ -17,5 +18,6 @@ exports.fetchers = [
|
|
17
18
|
airdropFetcher_1.default,
|
18
19
|
voteFetcher_1.default,
|
19
20
|
valueAverageFetcher_1.default,
|
21
|
+
testFetcher_1.default,
|
20
22
|
];
|
21
23
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jupiter/index.ts"],"names":[],"mappings":";;;;;;AAGA,0EAAkD;AAClD,kEAA0C;AAC1C,sEAA8C;AAC9C,gEAAwC;AACxC,2CAA8C;AAC9C,gFAAwD;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jupiter/index.ts"],"names":[],"mappings":";;;;;;AAGA,0EAAkD;AAClD,kEAA0C;AAC1C,sEAA8C;AAC9C,gEAAwC;AACxC,2CAA8C;AAC9C,gFAAwD;AACxD,gEAAiC;AAEpB,QAAA,SAAS,GAAe,CAAC,2BAAe,CAAC,CAAC;AAC1C,QAAA,IAAI,GAAU,CAAC,sBAAY,CAAC,CAAC;AAC7B,QAAA,QAAQ,GAAc;IACjC,0BAAgB;IAChB,wBAAc;IACd,qBAAW;IACX,6BAAmB;IACnB,qBAAI;CACL,CAAC"}
|
@@ -18,15 +18,15 @@ const web3_js_1 = require("@solana/web3.js");
|
|
18
18
|
const constants_1 = require("./constants");
|
19
19
|
const clients_1 = require("../../utils/clients");
|
20
20
|
const solana_1 = require("../../utils/solana");
|
21
|
-
const structs_1 = require("./structs");
|
22
21
|
const filters_1 = require("./filters");
|
23
22
|
const getMultipleAccountsInfoSafe_1 = require("../../utils/solana/getMultipleAccountsInfoSafe");
|
24
23
|
const helpers_1 = require("../../utils/solana/pyth/helpers");
|
25
24
|
const constants_2 = require("../tokens/constants");
|
25
|
+
const perpetuals_1 = require("./structs/perpetuals");
|
26
26
|
const usdFactor = new bignumber_js_1.default(Math.pow(10, 6));
|
27
27
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
28
28
|
const client = (0, clients_1.getClientSolana)();
|
29
|
-
const perpetualsPositions = yield (0, solana_1.getParsedProgramAccounts)(client,
|
29
|
+
const perpetualsPositions = yield (0, solana_1.getParsedProgramAccounts)(client, perpetuals_1.positionStruct, constants_1.perpsProgramId, (0, filters_1.perpetualsPositionsFilter)(owner));
|
30
30
|
if (perpetualsPositions.length === 0 ||
|
31
31
|
!perpetualsPositions.some((perp) => perp.sizeUsd.isGreaterThan(0)))
|
32
32
|
return [];
|
@@ -51,9 +51,9 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
51
51
|
for (const position of perpetualsPositions) {
|
52
52
|
if (position.sizeUsd.isLessThanOrEqualTo(0))
|
53
53
|
continue;
|
54
|
-
if (position.side ===
|
54
|
+
if (position.side === perpetuals_1.Side.None)
|
55
55
|
continue;
|
56
|
-
const isLong = position.side ===
|
56
|
+
const isLong = position.side === perpetuals_1.Side.Long;
|
57
57
|
const custody = custodyById.get(position.custody.toString());
|
58
58
|
const collateralCustody = custodyById.get(position.collateralCustody.toString());
|
59
59
|
if (!custody || !collateralCustody)
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"perpetualFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jupiter/perpetualFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAQoC;AACpC,gEAAqC;AACrC,6CAA4C;AAG5C,2CAAuE;AACvE,iDAAsD;AACtD,+CAA8D;AAC9D,
|
1
|
+
{"version":3,"file":"perpetualFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jupiter/perpetualFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAQoC;AACpC,gEAAqC;AACrC,6CAA4C;AAG5C,2CAAuE;AACvE,iDAAsD;AACtD,+CAA8D;AAC9D,uCAAsD;AAEtD,gGAA6F;AAC7F,6DAAwE;AACxE,mDAA8D;AAC9D,qDAA4D;AAE5D,MAAM,SAAS,GAAG,IAAI,sBAAS,CAAC,SAAA,EAAE,EAAI,CAAC,CAAA,CAAC,CAAC;AACzC,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,mBAAmB,GAAG,MAAM,IAAA,iCAAwB,EACxD,MAAM,EACN,2BAAc,EACd,0BAAc,EACd,IAAA,mCAAyB,EAAC,KAAK,CAAC,CACjC,CAAC;IACF,IACE,mBAAmB,CAAC,MAAM,KAAK,CAAC;QAChC,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;QAElE,OAAO,EAAE,CAAC;IAEZ,MA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AC,MAAM,KAAK,CAAC,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QAEzE,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,GAC9D,IAAA,wCAAuB,EAAC,cAAc,EAAE,cAAc,EAAE,YAAY,CAAC,CAAC;QAExE,MAAM,KAAK,GAAG,aAAa,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC;QACtE,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;QAEvC,QAAQ,CAAC,IAAI,CAAC;YACZ,IAAI,EAAE,qCAAoB,CAAC,UAAU;YACrC,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAV,sBAAU;YACV,KAAK,EAAE,UAAU;YACjB,KAAK;YACL,IAAI,EAAE,GAAG,WAAW,IAAI,IAAI,IAAI,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG;YAC5D,IAAI,EAAE;gBACJ,cAAc;gBACd,aAAa;gBACb,cAAc;gBACd,cAAc;gBACd,aAAa;gBACb,cAAc;gBACd,eAAe,EAAE,IAAI;gBAErB,YAAY;gBACZ,WAAW;gBACX,WAAW;gBACX,KAAK;aACN;SACF,CAAC,CAAC;IACL,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,YAAY;IAC7B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -17,13 +17,13 @@ const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
17
17
|
const clients_1 = require("../../utils/clients");
|
18
18
|
const solana_1 = require("../../utils/solana");
|
19
19
|
const constants_1 = require("./constants");
|
20
|
-
const
|
20
|
+
const perpetuals_1 = require("./structs/perpetuals");
|
21
21
|
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
22
22
|
const client = (0, clients_1.getClientSolana)();
|
23
|
-
const poolAccount = (yield (0, solana_1.getParsedMultipleAccountsInfo)(client,
|
23
|
+
const poolAccount = (yield (0, solana_1.getParsedMultipleAccountsInfo)(client, perpetuals_1.perpetualPoolStruct, [constants_1.jlpPool]))[0];
|
24
24
|
if (!poolAccount)
|
25
25
|
return;
|
26
|
-
const custodiesAccounts = yield (0, solana_1.getParsedMultipleAccountsInfo)(client,
|
26
|
+
const custodiesAccounts = yield (0, solana_1.getParsedMultipleAccountsInfo)(client, perpetuals_1.custodyStruct, poolAccount.custodies);
|
27
27
|
const mints = [];
|
28
28
|
const tokensAccountsAddresses = [];
|
29
29
|
custodiesAccounts.forEach((acc) => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"poolJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jupiter/poolJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AACpC,gEAAqC;AAIrC,iDAAsD;AACtD,+CAG4B;AAC5B,2CAA4D;AAC5D,
|
1
|
+
{"version":3,"file":"poolJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jupiter/poolJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AACpC,gEAAqC;AAIrC,iDAAsD;AACtD,+CAG4B;AAC5B,2CAA4D;AAC5D,qDAA0E;AAE1E,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,WAAW,GAAG,CAClB,MAAM,IAAA,sCAA6B,EAAC,MAAM,EAAE,gCAAmB,EAAE,CAAC,mBAAO,CAAC,CAAC,CAC5E,CAAC,CAAC,CAAC,CAAC;IACL,IAAI,CAAC,WAAW;QAAE,OAAO;IAEzB,MA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AC5B,QAAQ,EAAE,CAAC;QACX,EAAE,EAAE,sBAAU;QACd,SAAS,EAAE,0BAAS,CAAC,MAAM;QAC3B,WAAW,EAAE,UAAU;QACvB,UAAU,EAAV,sBAAU;QACV,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE;QACvB,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;QACrB,MAAM,EAAE,CAAC;QACT,WAAW;KACZ,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,OAAO;IACxB,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.positionStruct = exports.Side = exports.custodyStruct = exports.fundingRateStateStruct = exports.assetsStruct = exports.permissionsStruct = exports.pricingParamsStruct = exports.oracleParamsStruct = exports.OracleType = exports.perpetualPoolStruct = exports.feesStruct = exports.poolAprStruct = exports.limitStruct = void 0;
|
4
4
|
const beet_1 = require("@metaplex-foundation/beet");
|
5
5
|
const beet_solana_1 = require("@metaplex-foundation/beet-solana");
|
6
|
-
const solana_1 = require("
|
6
|
+
const solana_1 = require("../../../utils/solana");
|
7
7
|
exports.limitStruct = new beet_1.BeetStruct([
|
8
8
|
['maxAumUsd', solana_1.u128],
|
9
9
|
['maxIndividualLpToken', solana_1.u128],
|
@@ -120,4 +120,4 @@ exports.positionStruct = new beet_1.BeetStruct([
|
|
120
120
|
['lockedAmount', solana_1.u64],
|
121
121
|
['bump', beet_1.u8],
|
122
122
|
], (args) => args);
|
123
|
-
//# sourceMappingURL=
|
123
|
+
//# sourceMappingURL=perpetuals.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"perpetuals.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/structs/perpetuals.ts"],"names":[],"mappings":";;;AAAA,oDAO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C,MAAM,EAAE,SAAE,CAAC;IACZ,CAAC,kBAAkB,EAAE,SAAE,CAAC;IACxB,CAAC,SAAS,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;CACrB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAe,CAC1B,CAAC;AAEF,IAAY,IAIX;AAJD,WAAY,IAAI;IACd,+BAAI,CAAA;IACJ,+BAAI,CAAA;IACJ,iCAAK,CAAA;AACP,CAAC,EAJW,IAAI,oBAAJ,IAAI,QAIf;AAoBY,QAAA,cAAc,GAAG,IAAI,iBAAU,CAC1C;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,OAAO,EAAE,uBAAS,CAAC;IACpB,CAAC,MAAM,EAAE,uBAAS,CAAC;IACnB,CAAC,SAAS,EAAE,uBAAS,CAAC;IACtB,CAAC,mBAAmB,EAAE,uBAAS,CAAC;IAChC,CAAC,UAAU,EAAE,YAAG,CAAC;IACjB,CAAC,YAAY,EAAE,YAAG,CAAC;IACnB,CAAC,MAAM,EAAE,SAAE,CAAC;IACZ,CAAC,OAAO,EAAE,YAAG,CAAC;IACd,CAAC,SAAS,EAAE,YAAG,CAAC;IAChB,CAAC,eAAe,EAAE,YAAG,CAAC;IACtB,CAAC,gBAAgB,EAAE,YAAG,CAAC;IACvB,CAAC,4BAA4B,EAAE,aAAI,CAAC;IACpC,CAAC,cAAc,EAAE,YAAG,CAAC;IACrB,CAAC,MAAM,EAAE,SAAE,CAAC;CACb,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAgB,CAC3B,CAAC"}
|
@@ -5,10 +5,10 @@ const beet_1 = require("@metaplex-foundation/beet");
|
|
5
5
|
const beet_solana_1 = require("@metaplex-foundation/beet-solana");
|
6
6
|
const solana_1 = require("../../../utils/solana");
|
7
7
|
exports.valueAverageStruct = new beet_1.BeetStruct([
|
8
|
-
['buffer', (0, solana_1.blob)(8)],
|
9
|
-
['isStale', beet_1.bool],
|
10
|
-
['idx', solana_1.u64],
|
11
|
-
['bump', beet_1.u8],
|
8
|
+
['buffer', (0, solana_1.blob)(8)], // 8
|
9
|
+
['isStale', beet_1.bool], // 1
|
10
|
+
['idx', solana_1.u64], // 8
|
11
|
+
['bump', beet_1.u8], // 1
|
12
12
|
['user', beet_solana_1.publicKey],
|
13
13
|
['inputMint', beet_solana_1.publicKey],
|
14
14
|
['outputMint', beet_solana_1.publicKey],
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"valueAverage.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/structs/valueAverage.ts"],"names":[],"mappings":";;;AAAA,oDAAiE;AACjE,kEAA6D;AAG7D,kDAAuD;AA6B1C,QAAA,kBAAkB,GAAG,IAAI,iBAAU,CAC9C;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;
|
1
|
+
{"version":3,"file":"valueAverage.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/structs/valueAverage.ts"],"names":[],"mappings":";;;AAAA,oDAAiE;AACjE,kEAA6D;AAG7D,kDAAuD;AA6B1C,QAAA,kBAAkB,GAAG,IAAI,iBAAU,CAC9C;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC,EAAE,IAAI;IACzB,CAAC,SAAS,EAAE,WAAI,CAAC,EAAE,IAAI;IACvB,CAAC,KAAK,EAAE,YAAG,CAAC,EAAE,IAAI;IAClB,CAAC,MAAM,EAAE,SAAE,CAAC,EAAE,IAAI;IAClB,CAAC,MAAM,EAAE,uBAAS,CAAC;IACnB,CAAC,WAAW,EAAE,uBAAS,CAAC;IACxB,CAAC,YAAY,EAAE,uBAAS,CAAC;IACzB,CAAC,oBAAoB,EAAE,YAAG,CAAC;IAC3B,CAAC,eAAe,EAAE,YAAG,CAAC;IACtB,CAAC,YAAY,EAAE,uBAAS,CAAC;IACzB,CAAC,aAAa,EAAE,uBAAS,CAAC;IAC1B,CAAC,cAAc,EAAE,WAAI,CAAC;IACtB,CAAC,gBAAgB,EAAE,uBAAS,CAAC;IAC7B,CAAC,oBAAoB,EAAE,uBAAS,CAAC;IACjC,CAAC,WAAW,EAAE,YAAG,CAAC;IAClB,CAAC,aAAa,EAAE,YAAG,CAAC;IACpB,CAAC,QAAQ,EAAE,YAAG,CAAC;IACf,CAAC,QAAQ,EAAE,YAAG,CAAC;IACf,CAAC,aAAa,EAAE,YAAG,CAAC;IACpB,CAAC,aAAa,EAAE,YAAG,CAAC;IACpB,CAAC,cAAc,EAAE,YAAG,CAAC;IACrB,CAAC,mBAAmB,EAAE,YAAG,CAAC;IAC1B,CAAC,aAAa,EAAE,YAAG,CAAC;IACpB,CAAC,sBAAsB,EAAE,YAAG,CAAC;CAC9B,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAoB,CAC/B,CAAC"}
|
@@ -0,0 +1,77 @@
|
|
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 solana_1 = require("../../utils/solana");
|
19
|
+
const clients_1 = require("../../utils/clients");
|
20
|
+
const vote_1 = require("./structs/vote");
|
21
|
+
const filters_1 = require("../../utils/solana/filters");
|
22
|
+
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
23
|
+
const client = (0, clients_1.getClientSolana)();
|
24
|
+
const escrowAccount = yield (0, solana_1.getParsedProgramAccounts)(client, vote_1.escrowStruct, constants_1.voteProgramId, (0, filters_1.dataSizeFilter)(322));
|
25
|
+
if (!escrowAccount)
|
26
|
+
return [];
|
27
|
+
const jupTokenPrice = yield cache.getTokenPrice(constants_1.jupMint, portfolio_core_1.NetworkId.solana);
|
28
|
+
if (!jupTokenPrice)
|
29
|
+
return [];
|
30
|
+
const { decimals } = jupTokenPrice;
|
31
|
+
let lockedWithoutWithdraw = 0;
|
32
|
+
const unlockEachDay = [];
|
33
|
+
for (const account of escrowAccount) {
|
34
|
+
const amount = account.amount.dividedBy(Math.pow(10, decimals)).toNumber();
|
35
|
+
if (!account.escrowStartedAt.isZero()) {
|
36
|
+
const unlockingAt = new Date(account.escrowEndsAt.times(1000).toNumber());
|
37
|
+
const daysUntilUnlock = new bignumber_js_1.default(unlockingAt.getTime() - Date.now())
|
38
|
+
.dividedBy(1000 * 60 * 60 * 24)
|
39
|
+
.decimalPlaces(0, bignumber_js_1.default.ROUND_DOWN)
|
40
|
+
.toNumber();
|
41
|
+
if (unlockEachDay[daysUntilUnlock]) {
|
42
|
+
unlockEachDay[daysUntilUnlock] += amount;
|
43
|
+
}
|
44
|
+
else {
|
45
|
+
unlockEachDay[daysUntilUnlock] = amount;
|
46
|
+
}
|
47
|
+
}
|
48
|
+
else {
|
49
|
+
lockedWithoutWithdraw += amount;
|
50
|
+
}
|
51
|
+
}
|
52
|
+
const unlockingAmount = unlockEachDay.reduce((amount, sum) => amount + sum);
|
53
|
+
const total = unlockingAmount + lockedWithoutWithdraw;
|
54
|
+
console.log('Amount Total : ', total);
|
55
|
+
console.log(`Amount Locked : ${lockedWithoutWithdraw}(${(lockedWithoutWithdraw / total) * 100}%)`);
|
56
|
+
console.log(`Amount unlocking :${unlockingAmount}(${(unlockingAmount / total) * 100}%)`);
|
57
|
+
for (let i = 0; i < unlockEachDay.length; i++) {
|
58
|
+
const unlocking = unlockEachDay[i];
|
59
|
+
if (!unlocking)
|
60
|
+
continue;
|
61
|
+
const value = unlocking * jupTokenPrice.price;
|
62
|
+
const percent = new bignumber_js_1.default(unlocking / total)
|
63
|
+
.times(100)
|
64
|
+
.decimalPlaces(2, bignumber_js_1.default.ROUND_DOWN)
|
65
|
+
.toNumber();
|
66
|
+
console.log(`Unlock in ${i} days : ${percent}% (${unlocking} JUP/ ${value}$) `);
|
67
|
+
}
|
68
|
+
const elements = [];
|
69
|
+
return elements;
|
70
|
+
});
|
71
|
+
const fetcher = {
|
72
|
+
id: `${constants_1.platformId}-test`,
|
73
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
74
|
+
executor,
|
75
|
+
};
|
76
|
+
exports.default = fetcher;
|
77
|
+
//# sourceMappingURL=testFetcher.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"testFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jupiter/testFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAyE;AACzE,gEAAqC;AAGrC,2CAAiE;AACjE,+CAA8D;AAC9D,iDAAsD;AACtD,yCAA8C;AAC9C,wDAA4D;AAE5D,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,aAAa,GAAG,MAAM,IAAA,iCAAwB,EAClD,MAAM,EACN,mBAAY,EACZ,yBAAa,EACb,IAAA,wBAAc,EAAC,GAAG,CAAC,CACpB,CAAC;IAEF,IAAI,CAAC,aAAa;QAAE,OAAO,EAAE,CAAC;IAE9B,MAAM,a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0)
|
27
27
|
return [];
|
28
28
|
const mints = new Set();
|
29
|
-
valueAverageAccounts.forEach((vA) =>
|
29
|
+
valueAverageAccounts.forEach((vA) => {
|
30
|
+
mints.add(vA.inputMint.toString());
|
31
|
+
mints.add(vA.outputMint.toString());
|
32
|
+
});
|
30
33
|
const tokenPriceById = yield cache.getTokenPricesAsMap(Array.from(mints), portfolio_core_1.NetworkId.solana);
|
31
|
-
const
|
32
|
-
|
33
|
-
|
34
|
-
const
|
35
|
-
|
36
|
-
|
37
|
-
const
|
38
|
-
const
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
34
|
+
const allAssets = [];
|
35
|
+
const elements = [];
|
36
|
+
for (const valueAverageOrder of valueAverageAccounts) {
|
37
|
+
const accountAssets = [];
|
38
|
+
const inputMint = valueAverageOrder.inputMint.toString();
|
39
|
+
const outputMint = valueAverageOrder.outputMint.toString();
|
40
|
+
const inputTokenPrice = tokenPriceById.get(inputMint);
|
41
|
+
const outputTokenPrice = tokenPriceById.get(outputMint);
|
42
|
+
if (inputTokenPrice && !valueAverageOrder.inLeft.isZero()) {
|
43
|
+
const amount = valueAverageOrder.inLeft.dividedBy(Math.pow(10, inputTokenPrice.decimals));
|
44
|
+
const asset = (0, tokenPriceToAssetToken_1.default)(inputTokenPrice.address, amount.toNumber(), portfolio_core_1.NetworkId.solana, inputTokenPrice);
|
45
|
+
allAssets.push(asset);
|
46
|
+
accountAssets.push(asset);
|
47
|
+
}
|
48
|
+
if (!valueAverageOrder.autoWithdraw &&
|
49
|
+
!valueAverageOrder.outReceived
|
50
|
+
.minus(valueAverageOrder.outWithdrawn)
|
51
|
+
.isZero() &&
|
52
|
+
outputTokenPrice) {
|
53
|
+
const amountToClaim = valueAverageOrder.outReceived
|
54
|
+
.minus(valueAverageOrder.outWithdrawn)
|
55
|
+
.dividedBy(Math.pow(10, outputTokenPrice.decimals));
|
56
|
+
const assetToClaim = (0, tokenPriceToAssetToken_1.default)(outputTokenPrice.address, amountToClaim.toNumber(), portfolio_core_1.NetworkId.solana, outputTokenPrice);
|
57
|
+
allAssets.push(assetToClaim);
|
58
|
+
accountAssets.push(Object.assign(Object.assign({}, assetToClaim), { attributes: { isClaimable: true } }));
|
59
|
+
}
|
60
|
+
elements.push({
|
46
61
|
type: 'multiple',
|
47
62
|
networkId: portfolio_core_1.NetworkId.solana,
|
48
63
|
platformId: constants_1.jupiterPlatform.id,
|
49
|
-
value: (0, portfolio_core_1.getUsdValueSum)(
|
64
|
+
value: (0, portfolio_core_1.getUsdValueSum)(accountAssets.map((a) => a.value)),
|
50
65
|
label: 'Deposit',
|
51
|
-
name: `VA
|
52
|
-
data: { assets },
|
53
|
-
}
|
54
|
-
|
66
|
+
name: `VA Order`,
|
67
|
+
data: { assets: accountAssets },
|
68
|
+
});
|
69
|
+
}
|
70
|
+
if (allAssets.length === 0)
|
71
|
+
return [];
|
72
|
+
if (allAssets.length > 20) {
|
73
|
+
const assets = (0, helpers_1.getMergedAssets)(allAssets);
|
74
|
+
return [
|
75
|
+
{
|
76
|
+
type: 'multiple',
|
77
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
78
|
+
platformId: constants_1.jupiterPlatform.id,
|
79
|
+
value: (0, portfolio_core_1.getUsdValueSum)(assets.map((asset) => asset.value)),
|
80
|
+
label: 'Deposit',
|
81
|
+
name: `VA Orders (${elements.length})`,
|
82
|
+
data: { assets },
|
83
|
+
},
|
84
|
+
];
|
85
|
+
}
|
86
|
+
return elements;
|
55
87
|
});
|
56
88
|
const fetcher = {
|
57
89
|
id: `${constants_1.platformId}-value-average`,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"valueAverageFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jupiter/valueAverageFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+
|
1
|
+
{"version":3,"file":"valueAverageFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/j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37
37
|
markets.forEach((market) => {
|
38
|
-
|
38
|
+
if (market)
|
39
|
+
marketsByAddress.set(market.address.toString(), market);
|
39
40
|
});
|
40
41
|
for (const marketInfo of markets) {
|
42
|
+
if (!marketInfo)
|
43
|
+
continue;
|
41
44
|
const seeds = [
|
42
45
|
(0, helpers_1.getObligationSeed)(marketInfo.address, 0),
|
43
46
|
(0, helpers_1.getObligationSeed)(marketInfo.address, 1),
|
@@ -49,12 +52,18 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
49
52
|
obligationAddresses.push(obligationAddress);
|
50
53
|
}
|
51
54
|
}
|
55
|
+
console.log('constexecutor:FetcherExecutor= ~ owner:', owner);
|
52
56
|
// Flexlend, only support the main pool on Solend
|
57
|
+
// mainMarket = 4UpD2fh7xH3VP9QQaXtsS1YY3bxzWhtfpks7FatyKvdY
|
53
58
|
const marketSeed = constants_1.mainMarket.slice(0, 16);
|
59
|
+
// owner = 5MBMRrJcAFmkQ39iSB3v6U8ifz4HqizS32voDrmSC6nu
|
54
60
|
const ownerSeed = owner.slice(0, 16);
|
55
61
|
const obligationSeed = ownerSeed + marketSeed;
|
62
|
+
// AUTOMATION PUBLIC KEY = 8PWR75ppAGonv9dXStjficjXmdsuDKmDoVNcy4oYhAMs
|
56
63
|
const oldFlexlendObligAddress = yield web3_js_1.PublicKey.createWithSeed(constants_2.AUTOMATION_PUBLIC_KEY, obligationSeed, constants_1.pid);
|
64
|
+
// -> gives : 3UHaFeLkzaHn1Rnks1p8s1xJdwHqMzD4JazWZH4PkzJ9 (correct)
|
57
65
|
const newFlexlendObligAddress = yield web3_js_1.PublicKey.createWithSeed(new web3_js_1.PublicKey(owner), obligationSeed, constants_1.pid);
|
66
|
+
// -> gives : AnwJKJf4YYKqYz6QBDbf1GhUFhPCExGAH4tNGjKXMBtP (inccorect)
|
58
67
|
obligationAddresses.push(...[oldFlexlendObligAddress, newFlexlendObligAddress]);
|
59
68
|
const obligations = yield (0, solana_1.getParsedMultipleAccountsInfo)(client, structs_1.obligationStruct, obligationAddresses);
|
60
69
|
if (obligations.length === 0)
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"obligationsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/solend/obligationsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DASoC;AACpC,gEAAqC;AACrC,6CAA4C;AAG5C,2CAOqB;AACrB,uCAA6D;AAE7D,+CAAmE;AACnE,iDAAsD;AACtD,uCAA6C;AAC7C,qGAA6E;AAC7E,6EAAqD;AACrD,qDAA8D;AAC9D,6DAAiE;AAEjE,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,mBAAmB,GAAG,EAAE,CAAC;IAE/B,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,WAAW,CAAa;QAClD,MAAM,EAAE,yBAAa;QACrB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;IACH,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACpC,MAAM,gBAAgB,GAA4B,IAAI,GAAG,EAAE,CAAC;IAC5D,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;QACzB,gBAAgB,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,MAAM,CAAC,CAAC;
|
1
|
+
{"version":3,"file":"obligationsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/solend/obligationsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DASoC;AACpC,gEAAqC;AACrC,6CAA4C;AAG5C,2CAOqB;AACrB,uCAA6D;AAE7D,+CAAmE;AACnE,iDAAsD;AACtD,uCAA6C;AAC7C,qGAA6E;AAC7E,6EAAqD;AACrD,qDAA8D;AAC9D,6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AAE,SAAS;YAChB,KAAK;YACL,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,IAAI,EAAE;gBACJ,cAAc;gBACd,aAAa;gBACb,cAAc;gBACd,cAAc;gBACd,aAAa;gBACb,cAAc;gBACd,eAAe,EAAE,IAAI;gBAErB,WAAW;gBACX,YAAY;gBACZ,WAAW;gBACX,KAAK;aACN;SACF,CAAC,CAAC;IACL,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,cAAc;IAC/B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jupiter/structs.ts"],"names":[],"mappings":";;;AAAA,oDAOmC;AAGnC,kEAA6D;AAC7D,+CAA0D;AAQ7C,QAAA,WAAW,GAAG,IAAI,iBAAU,CACvC;IACE,CAAC,WAAW,EAAE,aAAI,CAAC;IACnB,CAAC,sBAAsB,EAAE,aAAI,CAAC;IAC9B,CAAC,gBAAgB,EAAE,YAAG,CAAC;CACxB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAa,CACxB,CAAC;AAQW,QAAA,aAAa,GAAG,IAAI,iBAAU,CACzC;IACE,CAAC,aAAa,EAAE,YAAG,CAAC;IACpB,CAAC,WAAW,EAAE,YAAG,CAAC;IAClB,CAAC,gBAAgB,EAAE,YAAG,CAAC;CACxB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAe,CAC1B,CAAC;AAcW,QAAA,UAAU,GAAG,IAAI,iBAAU,CACtC;IACE,CAAC,qBAAqB,EAAE,YAAG,CAAC;IAC5B,CAAC,qBAAqB,EAAE,YAAG,CAAC;IAC5B,CAAC,uBAAuB,EAAE,YAAG,CAAC;IAC9B,CAAC,SAAS,E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