@sonarwatch/portfolio-plugins 0.11.127 → 0.11.129
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +1239 -1231
- package/README.md +3 -3
- package/package.json +2 -2
- package/src/plugins/balancer/helpers/pools.js +21 -21
- package/src/plugins/bskt/vestingFetcher.js +4 -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/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.d.ts +1 -1
- package/src/plugins/jupiter/helpers.js +6 -3
- package/src/plugins/jupiter/helpers.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/valueAverageFetcher.js +53 -21
- package/src/plugins/jupiter/valueAverageFetcher.js.map +1 -1
- package/src/plugins/lifinity/xLfntyJob.js +4 -4
- package/src/plugins/lifinity/xLfntyJob.js.map +1 -1
- package/src/plugins/sushiswap/helpers.js +24 -24
- package/src/plugins/symmetry/basketsJob.js +12 -9
- package/src/plugins/symmetry/basketsJob.js.map +1 -1
- package/src/plugins/symmetry/structs.d.ts +5 -1
- package/src/plugins/symmetry/structs.js +7 -2
- package/src/plugins/symmetry/structs.js.map +1 -1
- package/src/plugins/uniswap-v2/helpers.js +22 -22
- package/src/utils/sei/constants.js +8 -8
- package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
- package/src/utils/solana/getDecimals.d.ts +3 -0
- package/src/utils/solana/getDecimals.js +26 -0
- package/src/utils/solana/getDecimals.js.map +1 -0
- package/src/utils/solana/getMultipleDecimals.d.ts +3 -0
- package/src/utils/solana/getMultipleDecimals.js +32 -0
- package/src/utils/solana/getMultipleDecimals.js.map +1 -0
- package/src/plugins/jupiter/structs.js.map +0 -1
- /package/src/plugins/jupiter/{structs.d.ts → structs/perpetuals.d.ts} +0 -0
package/README.md
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
# @sonarwatch/portfolio-plugins
|
2
|
-
|
3
|
-
This library is @sonarwatch/portfolio-plugins
|
1
|
+
# @sonarwatch/portfolio-plugins
|
2
|
+
|
3
|
+
This library is @sonarwatch/portfolio-plugins
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sonarwatch/portfolio-plugins",
|
3
|
-
"version": "0.11.
|
3
|
+
"version": "0.11.129",
|
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.129"
|
45
45
|
},
|
46
46
|
"main": "./src/index.js",
|
47
47
|
"types": "./src/index.d.ts"
|
@@ -36,27 +36,27 @@ exports.getBalancerPoolsV2 = void 0;
|
|
36
36
|
const graphql_request_1 = __importStar(require("graphql-request"));
|
37
37
|
function getBalancerPoolsV2(url) {
|
38
38
|
return __awaiter(this, void 0, void 0, function* () {
|
39
|
-
const query = (0, graphql_request_1.gql) `
|
40
|
-
query pools {
|
41
|
-
pools(
|
42
|
-
first: 1000
|
43
|
-
orderBy: totalLiquidity
|
44
|
-
orderDirection: desc
|
45
|
-
where: { totalLiquidity_gt: "500" }
|
46
|
-
) {
|
47
|
-
id
|
48
|
-
address
|
49
|
-
symbol
|
50
|
-
totalLiquidity
|
51
|
-
totalShares
|
52
|
-
tokens {
|
53
|
-
balance
|
54
|
-
decimals
|
55
|
-
symbol
|
56
|
-
address
|
57
|
-
}
|
58
|
-
}
|
59
|
-
}
|
39
|
+
const query = (0, graphql_request_1.gql) `
|
40
|
+
query pools {
|
41
|
+
pools(
|
42
|
+
first: 1000
|
43
|
+
orderBy: totalLiquidity
|
44
|
+
orderDirection: desc
|
45
|
+
where: { totalLiquidity_gt: "500" }
|
46
|
+
) {
|
47
|
+
id
|
48
|
+
address
|
49
|
+
symbol
|
50
|
+
totalLiquidity
|
51
|
+
totalShares
|
52
|
+
tokens {
|
53
|
+
balance
|
54
|
+
decimals
|
55
|
+
symbol
|
56
|
+
address
|
57
|
+
}
|
58
|
+
}
|
59
|
+
}
|
60
60
|
`;
|
61
61
|
const res = yield (0, graphql_request_1.default)(url, query);
|
62
62
|
const pools = res.pools;
|
@@ -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,qGAA6E;AAG7E,MAAM,MAAM,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AACnC,MAAM,SAAS,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+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,+DAQoC;AACpC,gEAAqC;AACrC,6CAA4C;AAG5C,2CAA+D;AAC/D,iDAAsD;AACtD,+CAA8D;AAC9D,gGAA6F;AAC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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;
|
@@ -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"}
|
@@ -2,5 +2,5 @@ import { PublicKey } from '@solana/web3.js';
|
|
2
2
|
import { PortfolioAsset } from '@sonarwatch/portfolio-core';
|
3
3
|
export declare function deriveClaimStatus(claimant: PublicKey, distributor: PublicKey, programId: PublicKey): [PublicKey, number];
|
4
4
|
export declare function getVotePda(owner: string): PublicKey;
|
5
|
-
export declare function
|
5
|
+
export declare function getJupiterPrices(mints: PublicKey[], vsMint: PublicKey): Promise<Map<string, number>>;
|
6
6
|
export declare function getMergedAssets(assets: PortfolioAsset[]): PortfolioAsset[];
|
@@ -12,9 +12,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
13
|
};
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
-
exports.getMergedAssets = exports.
|
15
|
+
exports.getMergedAssets = exports.getJupiterPrices = 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);
|
@@ -28,7 +29,7 @@ function getVotePda(owner) {
|
|
28
29
|
], constants_1.voteProgramId)[0];
|
29
30
|
}
|
30
31
|
exports.getVotePda = getVotePda;
|
31
|
-
function
|
32
|
+
function getJupiterPrices(mints, vsMint) {
|
32
33
|
return __awaiter(this, void 0, void 0, function* () {
|
33
34
|
const res = yield axios_1.default.get('https://price.jup.ag/v4/price', {
|
34
35
|
params: {
|
@@ -43,7 +44,7 @@ function getPrices(mints, vsMint) {
|
|
43
44
|
return prices;
|
44
45
|
});
|
45
46
|
}
|
46
|
-
exports.
|
47
|
+
exports.getJupiterPrices = getJupiterPrices;
|
47
48
|
function getMergedAssets(assets) {
|
48
49
|
const assetByMint = new Map();
|
49
50
|
for (const asset of assets) {
|
@@ -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,yBAAa,CACd,CAAC,CAAC,CAAC,CAAC;AACP,CAAC;AATD,gCASC;AAED,SAAsB,gBAAgB,CAAC,KAAkB,EAAE,MAAiB;;QAC1E,MAAM,GAAG,GAAG,MAAM,eAAK,CAAC,GAAG,CACzB,+BAA+B,EAC/B;YACE,MAAM,EAAE;gBACN,GAAG,EAAE,KAAK,CAAC,GAAG,CA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CAAC,CAAC;QAC1C,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC;AAC1C,CAAC;AAnBD,0CAmBC"}
|
@@ -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,MAAM,iBAAiB,GAAG,MAAM,KAAK,CAAC,OAAO,CAAgB,wBAAY,EAAE;QACzE,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS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,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,MAAM,iBAAiB,GAAG,MAAM,IAAA,sCAA6B,EAC3D,MAAM,EACN,0BAAa,EACb,WAAW,CAAC,SAAS,CACtB,CAAC;IAEF,MAAM,K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ACvB,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,oDAOmC;AAGnC,kEAA6D;AAC7D,kDAA6D;AAQhD,QAAA,WAAW,GAAG,IAAI,iBAAU,CACvC;IACE,CAAC,WAAW,EAAE,aAAI,CAA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,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"}
|
@@ -26,32 +26,64 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
26
26
|
if (valueAverageAccounts.length === 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/jupiter/valueAverageFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AAGpC,2CAIqB;AACrB,iDAAsD;AACtD,+CAA8D;AAC9D,yDAA4D;AAC5D,uCAA+C;AAC/C,qGAA6E;AAC7E,uCAA4C;AAE5C,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,oBAAoB,GAAG,MAAM,IAAA,iCAAwB,EACzD,MAAM,EACN,iCAAkB,EAClB,iCAAqB,EACrB,IAAA,4BAAkB,EAAC,KAAK,CAAC,CAC1B,CAAC;IACF,IAAI,oBAAoB,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEjD,MAAM,KAAK,GAAgB,IAAI,GAAG,EAAE,CAAC;IACrC,oBAAoB,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE;QAClC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC;QACnC,KAAK,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AAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;gBACzD,KAAK,EAAE,SAAS;gBAChB,IAAI,EAAE,cAAc,QAAQ,CAAC,MAAM,GAAG;gBACtC,IAAI,EAAE,EAAE,MAAM,EAAE;aACjB;SACF,CAAC;IACJ,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,gBAAgB;IACjC,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -15,13 +15,13 @@ const constants_1 = require("./constants");
|
|
15
15
|
const helpers_1 = require("../jupiter/helpers");
|
16
16
|
const constants_2 = require("../tokens/constants");
|
17
17
|
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
18
|
-
const prices = yield (0, helpers_1.getPrices)([new web3_js_1.PublicKey(constants_1.xLfntyMint)], new web3_js_1.PublicKey(constants_1.lfntyMint));
|
19
|
-
const price = prices.get(constants_1.xLfntyMint);
|
20
|
-
if (!price)
|
21
|
-
return;
|
22
18
|
const lfntyTokenPrice = yield cache.getTokenPrice(constants_1.lfntyMint, portfolio_core_1.NetworkId.solana);
|
23
19
|
if (!lfntyTokenPrice)
|
24
20
|
return;
|
21
|
+
const prices = yield (0, helpers_1.getJupiterPrices)([new web3_js_1.PublicKey(constants_1.xLfntyMint)], new web3_js_1.PublicKey(constants_1.lfntyMint));
|
22
|
+
const price = prices.get(constants_1.xLfntyMint);
|
23
|
+
if (!price)
|
24
|
+
return;
|
25
25
|
const source = {
|
26
26
|
address: constants_1.xLfntyMint,
|
27
27
|
decimals: constants_1.xLfntyDecimals,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"xLfntyJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/lifinity/xLfntyJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAyE;AACzE,6CAA4C;AAG5C,2CAAgF;AAChF,
|
1
|
+
{"version":3,"file":"xLfntyJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/lifinity/xLfntyJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAyE;AACzE,6CAA4C;AAG5C,2CAAgF;AAChF,gDAAsD;AACtD,mDAA2D;AAE3D,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,eAAe,GAAG,MAAM,KAAK,CAAC,aAAa,CAC/C,qBAAS,EACT,0BAAS,CAAC,MAAM,CACjB,CAAC;IACF,IAAI,CAAC,eAAe;QAAE,OAAO;IAE7B,MAAM,MAAM,GAAG,MAAM,IAAA,0BAAgB,EACnC,CAAC,IAAI,mBAAS,CAAC,sBAAU,CAAC,CAAC,EAC3B,IAAI,mBAAS,CAAC,qBAAS,CAAC,CACzB,CAAC;IACF,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,sBAAU,CAAC,CAAC;IACrC,IAAI,CAAC,KAAK;QAAE,OAAO;IAEnB,MAAM,MAAM,GAAqB;QAC/B,OAAO,EAAE,sBAAU;QACnB,QAAQ,EAAE,0BAAc;QACxB,EAAE,EAAE,aAAa;QACjB,SAAS,EAAE,0BAAS,CAAC,MAAM;QAC3B,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;QACrB,KAAK,EAAE,KAAK,GAAG,eAAe,CAAC,KAAK;QACpC,UAAU,EAAE,gCAAoB,CAAC,EAAE;QACnC,MAAM,EAAE,GAAG;KACZ,CAAC;IACF,MAAM,KAAK,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;AAC1C,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"}
|