@sonarwatch/portfolio-plugins 0.11.219 → 0.11.221
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/index.js +8 -0
- package/src/index.js.map +1 -1
- package/src/plugins/cropper/clmmJob.d.ts +3 -0
- package/src/plugins/cropper/clmmJob.js +15 -0
- package/src/plugins/cropper/clmmJob.js.map +1 -0
- package/src/plugins/cropper/constants.d.ts +5 -0
- package/src/plugins/cropper/constants.js +15 -0
- package/src/plugins/cropper/constants.js.map +1 -0
- package/src/plugins/cropper/helpers.d.ts +2 -0
- package/src/plugins/cropper/helpers.js +9 -0
- package/src/plugins/cropper/helpers.js.map +1 -0
- package/src/plugins/cropper/index.d.ts +6 -0
- package/src/plugins/cropper/index.js +12 -0
- package/src/plugins/cropper/index.js.map +1 -0
- package/src/plugins/hedgehog/ammJob.d.ts +3 -0
- package/src/plugins/hedgehog/ammJob.js +119 -0
- package/src/plugins/hedgehog/ammJob.js.map +1 -0
- package/src/plugins/hedgehog/constants.d.ts +6 -0
- package/src/plugins/hedgehog/constants.js +16 -0
- package/src/plugins/hedgehog/constants.js.map +1 -0
- package/src/plugins/hedgehog/index.d.ts +6 -0
- package/src/plugins/hedgehog/index.js +12 -0
- package/src/plugins/hedgehog/index.js.map +1 -0
- package/src/plugins/hedgehog/structs.d.ts +40 -0
- package/src/plugins/hedgehog/structs.js +41 -0
- package/src/plugins/hedgehog/structs.js.map +1 -0
- package/src/plugins/navi/collateralFetcher.js +7 -5
- package/src/plugins/navi/collateralFetcher.js.map +1 -1
- package/src/plugins/orca/getWhirlpoolPositions.d.ts +4 -3
- package/src/plugins/orca/getWhirlpoolPositions.js +7 -6
- package/src/plugins/orca/getWhirlpoolPositions.js.map +1 -1
- package/src/plugins/orca/getWhirlpoolsJob.d.ts +3 -0
- package/src/plugins/orca/getWhirlpoolsJob.js +47 -0
- package/src/plugins/orca/getWhirlpoolsJob.js.map +1 -0
- package/src/plugins/orca/structs/whirlpool.d.ts +0 -5
- package/src/plugins/orca/structs/whirlpool.js.map +1 -1
- package/src/plugins/orca/whirlpoolsJob.js +2 -33
- package/src/plugins/orca/whirlpoolsJob.js.map +1 -1
- package/src/plugins/raydium/clmmJob.js +1 -1
- package/src/plugins/raydium/clmmJob.js.map +1 -1
- package/src/plugins/raydium/constants.d.ts +1 -0
- package/src/plugins/raydium/constants.js +2 -1
- package/src/plugins/raydium/constants.js.map +1 -1
- package/src/plugins/raydium/cpmmJob.d.ts +3 -0
- package/src/plugins/raydium/cpmmJob.js +98 -0
- package/src/plugins/raydium/cpmmJob.js.map +1 -0
- package/src/plugins/raydium/filters.d.ts +2 -1
- package/src/plugins/raydium/filters.js +5 -2
- package/src/plugins/raydium/filters.js.map +1 -1
- package/src/plugins/raydium/index.js +2 -1
- package/src/plugins/raydium/index.js.map +1 -1
- package/src/plugins/raydium/structs/cpmm.d.ts +30 -0
- package/src/plugins/raydium/structs/cpmm.js +32 -0
- package/src/plugins/raydium/structs/cpmm.js.map +1 -0
- package/src/plugins/scallop/cnyAirdropFetcher.d.ts +3 -0
- package/src/plugins/scallop/cnyAirdropFetcher.js +79 -0
- package/src/plugins/scallop/cnyAirdropFetcher.js.map +1 -0
- package/src/plugins/scallop/constants.d.ts +2 -0
- package/src/plugins/scallop/constants.js +3 -1
- package/src/plugins/scallop/constants.js.map +1 -1
- package/src/plugins/scallop/index.js +2 -0
- package/src/plugins/scallop/index.js.map +1 -1
- package/src/plugins/scallop/types/data.d.ts +29 -0
- package/src/plugins/tokens/fetchers/solana-nfts-underlyings.js +43 -24
- package/src/plugins/tokens/fetchers/solana-nfts-underlyings.js.map +1 -1
- package/src/plugins/tokens/fetchers/solana.js +2 -0
- package/src/plugins/tokens/fetchers/solana.js.map +1 -1
- package/src/plugins/tokens/types.d.ts +3 -0
- package/src/utils/misc/getLpTokenSourceRaw.js +1 -1
- package/src/utils/misc/getLpTokenSourceRaw.js.map +1 -1
- package/src/utils/misc/getLpUnderlyingTokenSource.js +6 -6
- package/src/utils/misc/getLpUnderlyingTokenSource.js.map +1 -1
@@ -0,0 +1,47 @@
|
|
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 whirlpool_1 = require("./structs/whirlpool");
|
21
|
+
const filters_1 = require("./filters");
|
22
|
+
const tokenPricesFromSqrt_1 = __importDefault(require("../../utils/clmm/tokenPricesFromSqrt"));
|
23
|
+
function getWhirlpoolsJob(programId) {
|
24
|
+
return (cache) => __awaiter(this, void 0, void 0, function* () {
|
25
|
+
const client = (0, clients_1.getClientSolana)();
|
26
|
+
const whirlpoolsInfo = yield (0, solana_1.getParsedProgramAccounts)(client, whirlpool_1.whirlpoolStruct, programId, filters_1.whirlpoolFilters);
|
27
|
+
const items = [];
|
28
|
+
for (let id = 0; id < whirlpoolsInfo.length; id++) {
|
29
|
+
const whirlpoolInfo = whirlpoolsInfo[id];
|
30
|
+
if (whirlpoolInfo.liquidity.isZero())
|
31
|
+
continue;
|
32
|
+
const reserveX = yield client.getBalance(whirlpoolInfo.tokenVaultA);
|
33
|
+
const reserveY = yield client.getBalance(whirlpoolInfo.tokenVaultB);
|
34
|
+
yield (0, tokenPricesFromSqrt_1.default)(cache, portfolio_core_1.NetworkId.solana, whirlpoolInfo.pubkey.toString(), new bignumber_js_1.default(reserveX), new bignumber_js_1.default(reserveY), whirlpoolInfo.sqrtPrice, whirlpoolInfo.tokenMintA.toString(), whirlpoolInfo.tokenMintB.toString());
|
35
|
+
items.push({
|
36
|
+
key: whirlpoolInfo.pubkey.toString(),
|
37
|
+
value: whirlpoolInfo,
|
38
|
+
});
|
39
|
+
}
|
40
|
+
yield cache.setItems(items, {
|
41
|
+
prefix: constants_1.whirlpoolPrefix,
|
42
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
43
|
+
});
|
44
|
+
});
|
45
|
+
}
|
46
|
+
exports.default = getWhirlpoolsJob;
|
47
|
+
//# sourceMappingURL=getWhirlpoolsJob.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getWhirlpoolsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/orca/getWhirlpoolsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAuD;AACvD,gEAAqC;AAErC,2CAA8C;AAC9C,+CAA8D;AAC9D,iDAAsD;AACtD,mDAAsD;AACtD,uCAA6C;AAG7C,+FAA4E;AAE5E,SAAwB,gBAAgB,CAAC,SAAoB;IAC3D,OAAO,CAAO,KAAY,EAAE,EAAE;QAC5B,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;QAEjC,MAAM,cAAc,GAAG,MAAM,IAAA,iCAAwB,EACnD,MAAM,EACN,2BAAe,EACf,SAAS,EACT,0BAAgB,CACjB,CAAC;QAEF,MAAM,KAAK,GAAG,EAAE,CAAC;QACjB,KAAK,IAAI,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,cAAc,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC;YAClD,MAAM,aAAa,GAAG,cAAc,CAAC,EAAE,CAAC,CAAC;YACzC,IAAI,aAAa,CAAC,SAAS,CAAC,MAAM,EAAE;gBAAE,SAAS;YAE/C,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;YACpE,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;YACpE,MAAM,IAAA,6BAAwB,EAC5B,KAAK,EACL,0BAAS,CAAC,MAAM,EAChB,aAAa,CAAC,MAAM,CAAC,QAAQ,EAAE,EAC/B,IAAI,sBAAS,CAAC,QAAQ,CAAC,EACvB,IAAI,sBAAS,CAAC,QAAQ,CAAC,EACvB,aAAa,CAAC,SAAS,EACvB,aAAa,CAAC,UAAU,CAAC,QAAQ,EAAE,EACnC,aAAa,CAAC,UAAU,CAAC,QAAQ,EAAE,CACpC,CAAC;YAEF,KAAK,CAAC,IAAI,CAAC;gBACT,GAAG,EAAE,aAAa,CAAC,MAAM,CAAC,QAAQ,EAAE;gBACpC,KAAK,EAAE,aAAa;aACrB,CAAC,CAAC;QACL,CAAC;QACD,MAAM,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE;YAC1B,MAAM,EAAE,2BAAe;YACvB,SAAS,EAAE,0BAAS,CAAC,MAAM;SAC5B,CAAC,CAAC;IACL,CAAC,CAAA,CAAC;AACJ,CAAC;AAvCD,mCAuCC"}
|
@@ -7,11 +7,6 @@ export type PositionRewardInfo = {
|
|
7
7
|
amountOwed: BigNumber;
|
8
8
|
};
|
9
9
|
export declare const positionRewardInfoStruct: BeetStruct<PositionRewardInfo, Partial<PositionRewardInfo>>;
|
10
|
-
export type PositionWhirlpool = Position & {
|
11
|
-
tickCurrentIndex?: number;
|
12
|
-
tokenMintA?: PublicKey;
|
13
|
-
tokenMintB?: PublicKey;
|
14
|
-
};
|
15
10
|
export type Position = {
|
16
11
|
padding: Buffer;
|
17
12
|
whirlpool: PublicKey;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"whirlpool.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/orca/structs/whirlpool.ts"],"names":[],"mappings":";;;AAAA,oDAMmC;AACnC,kEAA6D;AAG7D,kDAAwD;AAO3C,QAAA,wBAAwB,GAAG,IAAI,iBAAU,CACpD;IACE,CAAC,wBAAwB,EAAE,aAAI,CAAC;IAChC,CAAC,YAAY,EAAE,YAAG,CAAC;CACpB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAA0B,CACrC,CAAC;
|
1
|
+
{"version":3,"file":"whirlpool.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/orca/structs/whirlpool.ts"],"names":[],"mappings":";;;AAAA,oDAMmC;AACnC,kEAA6D;AAG7D,kDAAwD;AAO3C,QAAA,wBAAwB,GAAG,IAAI,iBAAU,CACpD;IACE,CAAC,wBAAwB,EAAE,aAAI,CAAC;IAChC,CAAC,YAAY,EAAE,YAAG,CAAC;CACpB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAA0B,CACrC,CAAC;AAgBW,QAAA,cAAc,GAAG,IAAI,iBAAU,CAC1C;IACE,CAAC,SAAS,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACpB,CAAC,WAAW,EAAE,uBAAS,CAAC;IACxB,CAAC,cAAc,EAAE,uBAAS,CAAC;IAC3B,CAAC,WAAW,EAAE,aAAI,CAAC;IACnB,CAAC,gBAAgB,EAAE,UAAG,CAAC;IACvB,CAAC,gBAAgB,EAAE,UAAG,CAAC;IACvB,CAAC,sBAAsB,EAAE,aAAI,CAAC;IAC9B,CAAC,UAAU,EAAE,YAAG,CAAC;IACjB,CAAC,sBAAsB,EAAE,aAAI,CAAC;IAC9B,CAAC,UAAU,EAAE,YAAG,CAAC;IACjB,CAAC,aAAa,EAAE,IAAA,4BAAqB,EAAC,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AA4B,EAAE,YAAG,CAAC;IACnC,CAAC,aAAa,EAAE,IAAA,4BAAqB,EAAC,iCAAyB,EAAE,CAAC,CAAC,CAAC;CACrE,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAiB,CAC5B,CAAC"}
|
@@ -1,44 +1,13 @@
|
|
1
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
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
4
|
};
|
14
5
|
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
6
|
const constants_1 = require("./constants");
|
18
|
-
const
|
19
|
-
const clients_1 = require("../../utils/clients");
|
20
|
-
const whirlpool_1 = require("./structs/whirlpool");
|
21
|
-
const filters_1 = require("./filters");
|
22
|
-
const tokenPricesFromSqrt_1 = __importDefault(require("../../utils/clmm/tokenPricesFromSqrt"));
|
23
|
-
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
24
|
-
const client = (0, clients_1.getClientSolana)();
|
25
|
-
const whirlpoolsInfo = yield (0, solana_1.getParsedProgramAccounts)(client, whirlpool_1.whirlpoolStruct, constants_1.whirlpoolProgram, filters_1.whirlpoolFilters);
|
26
|
-
for (let id = 0; id < whirlpoolsInfo.length; id++) {
|
27
|
-
const whirlpoolInfo = whirlpoolsInfo[id];
|
28
|
-
if (whirlpoolInfo.liquidity.isZero())
|
29
|
-
continue;
|
30
|
-
const reserveX = yield client.getBalance(whirlpoolInfo.tokenVaultA);
|
31
|
-
const reserveY = yield client.getBalance(whirlpoolInfo.tokenVaultB);
|
32
|
-
yield (0, tokenPricesFromSqrt_1.default)(cache, portfolio_core_1.NetworkId.solana, whirlpoolInfo.pubkey.toString(), new bignumber_js_1.default(reserveX), new bignumber_js_1.default(reserveY), whirlpoolInfo.sqrtPrice, whirlpoolInfo.tokenMintA.toString(), whirlpoolInfo.tokenMintB.toString());
|
33
|
-
yield cache.setItem(whirlpoolInfo.pubkey.toString(), whirlpoolInfo, {
|
34
|
-
prefix: constants_1.whirlpoolPrefix,
|
35
|
-
networkId: portfolio_core_1.NetworkId.solana,
|
36
|
-
});
|
37
|
-
}
|
38
|
-
});
|
7
|
+
const getWhirlpoolsJob_1 = __importDefault(require("./getWhirlpoolsJob"));
|
39
8
|
const job = {
|
40
9
|
id: `${constants_1.platformId}-whirlpools`,
|
41
|
-
executor,
|
10
|
+
executor: (0, getWhirlpoolsJob_1.default)(constants_1.whirlpoolProgram),
|
42
11
|
label: 'normal',
|
43
12
|
};
|
44
13
|
exports.default = job;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"whirlpoolsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/orca/whirlpoolsJob.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"whirlpoolsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/orca/whirlpoolsJob.ts"],"names":[],"mappings":";;;;;AACA,2CAA2D;AAC3D,0EAAkD;AAElD,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,aAAa;IAC9B,QAAQ,EAAE,IAAA,0BAAgB,EAAC,4BAAgB,CAAC;IAC5C,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -22,7 +22,7 @@ const clmms_1 = require("./structs/clmms");
|
|
22
22
|
const filters_1 = require("./filters");
|
23
23
|
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
24
24
|
const client = (0, clients_1.getClientSolana)();
|
25
|
-
const clmmPoolsInfo = yield (0, solana_1.getParsedProgramAccounts)(client, clmms_1.poolStateStruct, constants_1.raydiumProgram, filters_1.
|
25
|
+
const clmmPoolsInfo = yield (0, solana_1.getParsedProgramAccounts)(client, clmms_1.poolStateStruct, constants_1.raydiumProgram, filters_1.clmmPoolsStateFilter);
|
26
26
|
const promises = [];
|
27
27
|
for (let id = 0; id < clmmPoolsInfo.length; id++) {
|
28
28
|
const poolState = clmmPoolsInfo[id];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"clmmJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/clmmJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAuD;AACvD,gEAAqC;AACrC,2CAA2E;AAC3E,+CAA8D;AAC9D,iDAAsD;AAGtD,+FAA4E;AAC5E,2CAAkD;AAClD,
|
1
|
+
{"version":3,"file":"clmmJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/clmmJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAuD;AACvD,gEAAqC;AACrC,2CAA2E;AAC3E,+CAA8D;AAC9D,iDAAsD;AAGtD,+FAA4E;AAC5E,2CAAkD;AAClD,uCAAiD;AAEjD,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,uBAAe,EACf,0BAAc,EACd,8BAAoB,CACrB,CAAC;IAEF,MAAM,QAAQ,GAAG,EAAE,CAAC;IACpB,KAAK,IAAI,EAAE,G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declare const AMM_PROGRAM_ID_V5: PublicKey;
|
8
8
|
export declare const raydiumProgram: PublicKey;
|
9
|
+
export declare const cpmmProgramId: PublicKey;
|
9
10
|
export declare const poolStatesPrefix = "raydium-poolSates";
|
10
11
|
export declare const positionsIdentifier = "Raydium Concentrated Liquidity";
|
11
12
|
export declare const rayMint = "4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R";
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.rayDecimals = exports.rayMint = exports.positionsIdentifier = exports.poolStatesPrefix = exports.raydiumProgram = exports.AMM_PROGRAM_ID_V5 = exports.AMM_PROGRAM_ID_V4 = exports.AMM_PROGRAM_ID_V3 = exports.platform = exports.platformId = void 0;
|
3
|
+
exports.rayDecimals = exports.rayMint = exports.positionsIdentifier = exports.poolStatesPrefix = exports.cpmmProgramId = exports.raydiumProgram = exports.AMM_PROGRAM_ID_V5 = exports.AMM_PROGRAM_ID_V4 = exports.AMM_PROGRAM_ID_V3 = exports.platform = exports.platformId = void 0;
|
4
4
|
const web3_js_1 = require("@solana/web3.js");
|
5
5
|
exports.platformId = 'raydium';
|
6
6
|
exports.platform = {
|
@@ -14,6 +14,7 @@ exports.AMM_PROGRAM_ID_V3 = new web3_js_1.PublicKey('EhhTKczWMGQt46ynNeRX1Wfeagw
|
|
14
14
|
exports.AMM_PROGRAM_ID_V4 = new web3_js_1.PublicKey('675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8');
|
15
15
|
exports.AMM_PROGRAM_ID_V5 = new web3_js_1.PublicKey('5quBtoiQqxF9Jv6KYKctB59NT3gtJD2Y65kdnB1Uev3h');
|
16
16
|
exports.raydiumProgram = new web3_js_1.PublicKey('CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK');
|
17
|
+
exports.cpmmProgramId = new web3_js_1.PublicKey('CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C');
|
17
18
|
exports.poolStatesPrefix = `${exports.platformId}-poolSates`;
|
18
19
|
exports.positionsIdentifier = 'Raydium Concentrated Liquidity';
|
19
20
|
exports.rayMint = '4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,+CAA+C;IACtD,WAAW,EAAE,SAAS;IACtB,OAAO,EAAE,qBAAqB;CAC/B,CAAC;AAEW,QAAA,iBAAiB,GAAG,IAAI,mBAAS,CAC5C,8CAA8C,CAC/C,CAAC;AAEW,QAAA,iBAAiB,GAAG,IAAI,mBAAS,CAC5C,8CAA8C,CAC/C,CAAC;AAEW,QAAA,iBAAiB,GAAG,IAAI,mBAAS,CAC5C,8CAA8C,CAC/C,CAAC;AAEW,QAAA,cAAc,GAAG,IAAI,mBAAS,CACzC,8CAA8C,CAC/C,CAAC;AAEW,QAAA,gBAAgB,GAAG,GAAG,kBAAU,YAAY,CAAC;AAE7C,QAAA,mBAAmB,GAAG,gCAAgC,CAAC;AAEvD,QAAA,OAAO,GAAG,8CAA8C,CAAC;AACzD,QAAA,WAAW,GAAG,CAAC,CAAC"}
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,+CAA+C;IACtD,WAAW,EAAE,SAAS;IACtB,OAAO,EAAE,qBAAqB;CAC/B,CAAC;AAEW,QAAA,iBAAiB,GAAG,IAAI,mBAAS,CAC5C,8CAA8C,CAC/C,CAAC;AAEW,QAAA,iBAAiB,GAAG,IAAI,mBAAS,CAC5C,8CAA8C,CAC/C,CAAC;AAEW,QAAA,iBAAiB,GAAG,IAAI,mBAAS,CAC5C,8CAA8C,CAC/C,CAAC;AAEW,QAAA,cAAc,GAAG,IAAI,mBAAS,CACzC,8CAA8C,CAC/C,CAAC;AAEW,QAAA,aAAa,GAAG,IAAI,mBAAS,CACxC,8CAA8C,CAC/C,CAAC;AAEW,QAAA,gBAAgB,GAAG,GAAG,kBAAU,YAAY,CAAC;AAE7C,QAAA,mBAAmB,GAAG,gCAAgC,CAAC;AAEvD,QAAA,OAAO,GAAG,8CAA8C,CAAC;AACzD,QAAA,WAAW,GAAG,CAAC,CAAC"}
|
@@ -0,0 +1,98 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
13
|
+
const constants_1 = require("./constants");
|
14
|
+
const solana_1 = require("../../utils/solana");
|
15
|
+
const clients_1 = require("../../utils/clients");
|
16
|
+
const filters_1 = require("./filters");
|
17
|
+
const cpmm_1 = require("./structs/cpmm");
|
18
|
+
const getLpTokenSourceRaw_1 = require("../../utils/misc/getLpTokenSourceRaw");
|
19
|
+
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
20
|
+
const client = (0, clients_1.getClientSolana)();
|
21
|
+
const clmmPoolsInfo = yield (0, solana_1.getParsedProgramAccounts)(client, cpmm_1.poolStateStruct, constants_1.cpmmProgramId, filters_1.cpmmPoolsStateFilter);
|
22
|
+
const tokenAccountsPkeys = [];
|
23
|
+
const mints = new Set();
|
24
|
+
clmmPoolsInfo.forEach((pI) => {
|
25
|
+
mints.add(pI.token0Mint.toString());
|
26
|
+
mints.add(pI.token1Mint.toString());
|
27
|
+
tokenAccountsPkeys.push(...[pI.token0Vault, pI.token1Vault]);
|
28
|
+
});
|
29
|
+
const [tokenAccounts, tokenPriceById] = yield Promise.all([
|
30
|
+
(0, solana_1.getParsedMultipleAccountsInfo)(client, solana_1.tokenAccountStruct, tokenAccountsPkeys),
|
31
|
+
cache.getTokenPricesAsMap(Array.from(mints), portfolio_core_1.NetworkId.solana),
|
32
|
+
]);
|
33
|
+
const tokenAccountsMap = new Map();
|
34
|
+
tokenAccounts.forEach((tA) => {
|
35
|
+
if (!tA)
|
36
|
+
return;
|
37
|
+
tokenAccountsMap.set(tA.pubkey.toString(), tA);
|
38
|
+
});
|
39
|
+
const tokenPriceSources = [];
|
40
|
+
for (let id = 0; id < clmmPoolsInfo.length; id++) {
|
41
|
+
const poolState = clmmPoolsInfo[id];
|
42
|
+
const mintA = poolState.token0Mint.toString();
|
43
|
+
const mintB = poolState.token1Mint.toString();
|
44
|
+
const tokenAccountA = tokenAccountsMap.get(poolState.token0Vault.toString());
|
45
|
+
const tokenAccountB = tokenAccountsMap.get(poolState.token1Vault.toString());
|
46
|
+
if (!tokenAccountA || !tokenAccountB)
|
47
|
+
continue;
|
48
|
+
const decimalsA = poolState.mint0Decimals;
|
49
|
+
const decimalsB = poolState.mint1Decimals;
|
50
|
+
const tokenAmountARaw = tokenAccountA.amount;
|
51
|
+
const tokenAmountBRaw = tokenAccountB.amount;
|
52
|
+
if (tokenAmountARaw.isZero() && tokenAmountBRaw.isZero())
|
53
|
+
continue;
|
54
|
+
const [tokenPriceA, tokenPriceB] = [
|
55
|
+
tokenPriceById.get(mintA),
|
56
|
+
tokenPriceById.get(mintB),
|
57
|
+
];
|
58
|
+
const { lpMint, lpMintDecimals, lpSupply } = poolState;
|
59
|
+
if (lpSupply.isZero())
|
60
|
+
continue;
|
61
|
+
tokenPriceSources.push(...(0, getLpTokenSourceRaw_1.getLpTokenSourceRaw)({
|
62
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
63
|
+
lpDetails: {
|
64
|
+
address: lpMint.toString(),
|
65
|
+
decimals: lpMintDecimals,
|
66
|
+
supplyRaw: lpSupply,
|
67
|
+
},
|
68
|
+
poolUnderlyingsRaw: [
|
69
|
+
{
|
70
|
+
address: mintA,
|
71
|
+
decimals: decimalsA,
|
72
|
+
tokenPrice: tokenPriceA,
|
73
|
+
reserveAmountRaw: tokenAmountARaw,
|
74
|
+
weight: 0.5,
|
75
|
+
},
|
76
|
+
{
|
77
|
+
address: mintB,
|
78
|
+
decimals: decimalsB,
|
79
|
+
tokenPrice: tokenPriceB,
|
80
|
+
reserveAmountRaw: tokenAmountBRaw,
|
81
|
+
weight: 0.5,
|
82
|
+
},
|
83
|
+
],
|
84
|
+
sourceId: poolState.pubkey.toString(),
|
85
|
+
elementName: 'CPMM',
|
86
|
+
platformId: constants_1.platformId,
|
87
|
+
priceUnderlyings: true,
|
88
|
+
}));
|
89
|
+
}
|
90
|
+
yield cache.setTokenPriceSources(tokenPriceSources);
|
91
|
+
});
|
92
|
+
const job = {
|
93
|
+
id: `${constants_1.platformId}-cpmm`,
|
94
|
+
executor,
|
95
|
+
label: 'normal',
|
96
|
+
};
|
97
|
+
exports.default = job;
|
98
|
+
//# sourceMappingURL=cpmmJob.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"cpmmJob.js","sourceRoot":"","sources":["../../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SAAS;QAEhC,iBAAiB,CAAC,IAAI,CACpB,GAAG,IAAA,yCAAmB,EAAC;YACrB,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,SAAS,EAAE;gBACT,OAAO,EAAE,MAAM,CAAC,QAAQ,EAAE;gBAC1B,QAAQ,EAAE,cAAc;gBACxB,SAAS,EAAE,QAAQ;aACpB;YACD,kBAAkB,EAAE;gBAClB;oBACE,OAAO,EAAE,KAAK;oBACd,QAAQ,EAAE,SAAS;oBACnB,UAAU,EAAE,WAAW;oBACvB,gBAAgB,EAAE,eAAe;oBACjC,MAAM,EAAE,GAAG;iBACZ;gBACD;oBACE,OAAO,EAAE,KAAK;oBACd,QAAQ,EAAE,SAAS;oBACnB,UAAU,EAAE,WAAW;oBACvB,gBAAgB,EAAE,eAAe;oBACjC,MAAM,EAAE,GAAG;iBACZ;aACF;YACD,QAAQ,EAAE,SAAS,CAAC,MAAM,CAAC,QAAQ,EAAE;YACrC,WAAW,EAAE,MAAM;YACnB,UAAU,EAAV,sBAAU;YACV,gBAAgB,EAAE,IAAI;SACvB,CAAC,CACH,CAAC;IACJ,CAAC;IACD,MAAM,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AACtD,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"}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { GetProgramAccountsFilter } from '@solana/web3.js';
|
2
2
|
export declare const ammV4Filter: GetProgramAccountsFilter[];
|
3
3
|
export declare const ammV5Filter: GetProgramAccountsFilter[];
|
4
|
-
export declare const
|
4
|
+
export declare const clmmPoolsStateFilter: GetProgramAccountsFilter[];
|
5
|
+
export declare const cpmmPoolsStateFilter: GetProgramAccountsFilter[];
|
5
6
|
export declare const stakingFilters: (owner: string) => GetProgramAccountsFilter[];
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.stakingFilters = exports.
|
3
|
+
exports.stakingFilters = exports.cpmmPoolsStateFilter = exports.clmmPoolsStateFilter = exports.ammV5Filter = exports.ammV4Filter = void 0;
|
4
4
|
const amms_1 = require("./structs/amms");
|
5
5
|
exports.ammV4Filter = [
|
6
6
|
{ dataSize: amms_1.ammInfoV4Struct.byteSize },
|
@@ -8,9 +8,12 @@ exports.ammV4Filter = [
|
|
8
8
|
exports.ammV5Filter = [
|
9
9
|
{ dataSize: amms_1.ammInfoV5Struct.byteSize },
|
10
10
|
];
|
11
|
-
exports.
|
11
|
+
exports.clmmPoolsStateFilter = [
|
12
12
|
{ dataSize: 1544 },
|
13
13
|
];
|
14
|
+
exports.cpmmPoolsStateFilter = [
|
15
|
+
{ dataSize: 637 },
|
16
|
+
];
|
14
17
|
const stakingFilters = (owner) => [
|
15
18
|
{
|
16
19
|
memcmp: {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/filters.ts"],"names":[],"mappings":";;;AACA,yCAAkE;AAErD,QAAA,WAAW,GAA+B;IACrD,EAAE,QAAQ,EAAE,sBAAe,CAAC,QAAQ,EAAE;CACvC,CAAC;AAEW,QAAA,WAAW,GAA+B;IACrD,EAAE,QAAQ,EAAE,sBAAe,CAAC,QAAQ,EAAE;CACvC,CAAC;AAEW,QAAA,
|
1
|
+
{"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/filters.ts"],"names":[],"mappings":";;;AACA,yCAAkE;AAErD,QAAA,WAAW,GAA+B;IACrD,EAAE,QAAQ,EAAE,sBAAe,CAAC,QAAQ,EAAE;CACvC,CAAC;AAEW,QAAA,WAAW,GAA+B;IACrD,EAAE,QAAQ,EAAE,sBAAe,CAAC,QAAQ,EAAE;CACvC,CAAC;AAEW,QAAA,oBAAoB,GAA+B;IAC9D,EAAE,QAAQ,EAAE,IAAI,EAAE;CACnB,CAAC;AAEW,QAAA,oBAAoB,GAA+B;IAC9D,EAAE,QAAQ,EAAE,GAAG,EAAE;CAClB,CAAC;AAEK,MAAM,cAAc,GAAG,CAAC,KAAa,EAA8B,EAAE,CAAC;IAC3E;QACE,MAAM,EAAE;YACN,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,KAAK;SACb;KACF;IACD,EAAE,QAAQ,EAAE,GAAG,EAAE;CAClB,CAAC;AARW,QAAA,cAAc,kBAQzB"}
|
@@ -6,9 +6,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.fetchers = exports.jobs = exports.platforms = void 0;
|
7
7
|
const lpTokensJob_1 = __importDefault(require("./lpTokensJob"));
|
8
8
|
const clmmJob_1 = __importDefault(require("./clmmJob"));
|
9
|
+
const cpmmJob_1 = __importDefault(require("./cpmmJob"));
|
9
10
|
const constants_1 = require("./constants");
|
10
11
|
const stakingFetcher_1 = __importDefault(require("./stakingFetcher"));
|
11
12
|
exports.platforms = [constants_1.platform];
|
12
|
-
exports.jobs = [lpTokensJob_1.default, clmmJob_1.default];
|
13
|
+
exports.jobs = [lpTokensJob_1.default, clmmJob_1.default, cpmmJob_1.default];
|
13
14
|
exports.fetchers = [stakingFetcher_1.default];
|
14
15
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/index.ts"],"names":[],"mappings":";;;;;;AAGA,gEAAwC;AACxC,wDAAgC;AAChC,2CAAuC;AACvC,sEAA8C;AAEjC,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,qBAAW,EAAE,iBAAO,CAAC,CAAC;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/index.ts"],"names":[],"mappings":";;;;;;AAGA,gEAAwC;AACxC,wDAAgC;AAChC,wDAAgC;AAChC,2CAAuC;AACvC,sEAA8C;AAEjC,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,qBAAW,EAAE,iBAAO,EAAE,iBAAO,CAAC,CAAC;AAC9C,QAAA,QAAQ,GAAc,CAAC,wBAAc,CAAC,CAAC"}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
/// <reference types="node" />
|
2
|
+
import { BeetStruct } from '@metaplex-foundation/beet';
|
3
|
+
import { PublicKey } from '@metaplex-foundation/js';
|
4
|
+
import BigNumber from 'bignumber.js';
|
5
|
+
export type PoolState = {
|
6
|
+
buffer: Buffer;
|
7
|
+
ammConfig: PublicKey;
|
8
|
+
poolCreator: PublicKey;
|
9
|
+
token0Vault: PublicKey;
|
10
|
+
token1Vault: PublicKey;
|
11
|
+
lpMint: PublicKey;
|
12
|
+
token0Mint: PublicKey;
|
13
|
+
token1Mint: PublicKey;
|
14
|
+
token0Program: PublicKey;
|
15
|
+
token1Program: PublicKey;
|
16
|
+
observationKey: PublicKey;
|
17
|
+
authBump: number;
|
18
|
+
status: number;
|
19
|
+
lpMintDecimals: number;
|
20
|
+
mint0Decimals: number;
|
21
|
+
mint1Decimals: number;
|
22
|
+
lpSupply: BigNumber;
|
23
|
+
protocolFeesToken0: BigNumber;
|
24
|
+
protocolFeesToken1: BigNumber;
|
25
|
+
fundFeesToken0: BigNumber;
|
26
|
+
fundFeesToken1: BigNumber;
|
27
|
+
openTime: BigNumber;
|
28
|
+
padding: BigNumber[];
|
29
|
+
};
|
30
|
+
export declare const poolStateStruct: BeetStruct<PoolState, Partial<PoolState>>;
|
@@ -0,0 +1,32 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.poolStateStruct = void 0;
|
4
|
+
const beet_1 = require("@metaplex-foundation/beet");
|
5
|
+
const beet_solana_1 = require("@metaplex-foundation/beet-solana");
|
6
|
+
const solana_1 = require("../../../utils/solana");
|
7
|
+
exports.poolStateStruct = new beet_1.BeetStruct([
|
8
|
+
['buffer', (0, solana_1.blob)(8)],
|
9
|
+
['ammConfig', beet_solana_1.publicKey],
|
10
|
+
['poolCreator', beet_solana_1.publicKey],
|
11
|
+
['token0Vault', beet_solana_1.publicKey],
|
12
|
+
['token1Vault', beet_solana_1.publicKey],
|
13
|
+
['lpMint', beet_solana_1.publicKey],
|
14
|
+
['token0Mint', beet_solana_1.publicKey],
|
15
|
+
['token1Mint', beet_solana_1.publicKey],
|
16
|
+
['token0Program', beet_solana_1.publicKey],
|
17
|
+
['token1Program', beet_solana_1.publicKey],
|
18
|
+
['observationKey', beet_solana_1.publicKey],
|
19
|
+
['authBump', beet_1.u8],
|
20
|
+
['status', beet_1.u8],
|
21
|
+
['lpMintDecimals', beet_1.u8],
|
22
|
+
['mint0Decimals', beet_1.u8],
|
23
|
+
['mint1Decimals', beet_1.u8],
|
24
|
+
['lpSupply', solana_1.u64],
|
25
|
+
['protocolFeesToken0', solana_1.u64],
|
26
|
+
['protocolFeesToken1', solana_1.u64],
|
27
|
+
['fundFeesToken0', solana_1.u64],
|
28
|
+
['fundFeesToken1', solana_1.u64],
|
29
|
+
['openTime', solana_1.u64],
|
30
|
+
['padding', (0, beet_1.uniformFixedSizeArray)(solana_1.u64, 32)],
|
31
|
+
], (args) => args);
|
32
|
+
//# sourceMappingURL=cpmm.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"cpmm.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/raydium/structs/cpmm.ts"],"names":[],"mappings":";;;AAAA,oDAImC;AAGnC,kEAA6D;AAC7D,kDAAkD;AA4BrC,QAAA,eAAe,GAAG,IAAI,iBAAU,CAC3C;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,WAAW,EAAE,uBAAS,CAAC;IACxB,CAAC,aAAa,EAAE,uBAAS,CAAC;IAC1B,CAAC,aAAa,EAAE,uBAAS,CAAC;IAC1B,CAAC,aAAa,EAAE,uBAAS,CAAC;IAC1B,CAAC,QAAQ,EAAE,uBAAS,CAAC;IACrB,CAAC,YAAY,EAAE,uBAAS,CAAC;IACzB,CAAC,YAAY,EAAE,uBAAS,CAAC;IACzB,CAAC,eAAe,EAAE,uBAAS,CAAC;IAC5B,CAAC,eAAe,EAAE,uBAAS,CAAC;IAC5B,CAAC,gBAAgB,EAAE,uBAAS,CAAC;IAC7B,CAAC,UAAU,EAAE,SAAE,CAAC;IAChB,CAAC,QAAQ,EAAE,SAAE,CAAC;IACd,CAAC,gBAAgB,EAAE,SAAE,CAAC;IACtB,CAAC,eAAe,EAAE,SAAE,CAAC;IACrB,CAAC,eAAe,EAAE,SAAE,CAAC;IACrB,CAAC,UAAU,EAAE,YAAG,CAAC;IACjB,CAAC,oBAAoB,EAAE,YAAG,CAAC;IAC3B,CAAC,oBAAoB,EAAE,YAAG,CAAC;IAC3B,CAAC,gBAAgB,EAAE,YAAG,CAAC;IACvB,CAAC,gBAAgB,EAAE,YAAG,CAAC;IACvB,CAAC,UAAU,EAAE,YAAG,CAAC;IACjB,CAAC,SAAS,EAAE,IAAA,4BAAqB,EAAC,YAAG,EAAE,EAAE,CAAC,CAAC;CAC5C,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAiB,CAC5B,CAAC"}
|
@@ -0,0 +1,79 @@
|
|
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 bcs_1 = require("@mysten/bcs");
|
17
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
18
|
+
const axios_1 = __importDefault(require("axios"));
|
19
|
+
const constants_1 = require("./constants");
|
20
|
+
const clients_1 = require("../../utils/clients");
|
21
|
+
const getDynamicFieldObject_1 = require("../../utils/sui/getDynamicFieldObject");
|
22
|
+
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
23
|
+
const constants_2 = require("../pyth/constants");
|
24
|
+
function getAmount(claimData) {
|
25
|
+
if (!claimData)
|
26
|
+
return undefined;
|
27
|
+
const bcs = new bcs_1.BCS((0, bcs_1.getSuiMoveConfig)());
|
28
|
+
bcs.registerStructType('Validation', {
|
29
|
+
prefix: 'vector<u8>',
|
30
|
+
address: 'address',
|
31
|
+
amount: 'u64',
|
32
|
+
});
|
33
|
+
const eligibility = bcs.de('Validation', claimData, 'base64');
|
34
|
+
return (0, bignumber_js_1.default)(eligibility.amount)
|
35
|
+
.shiftedBy(-1 * 6)
|
36
|
+
.toNumber();
|
37
|
+
}
|
38
|
+
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
39
|
+
const signature = yield axios_1.default
|
40
|
+
.get(constants_1.airdropUrl + owner)
|
41
|
+
.catch(() => null);
|
42
|
+
if (!(signature === null || signature === void 0 ? void 0 : signature.data.data) || signature.status === 404)
|
43
|
+
return [];
|
44
|
+
const client = (0, clients_1.getClientSui)();
|
45
|
+
const amount = getAmount(signature.data.data);
|
46
|
+
if (!amount)
|
47
|
+
return [];
|
48
|
+
const claimStatus = yield (0, getDynamicFieldObject_1.getDynamicFieldObject)(client, {
|
49
|
+
name: {
|
50
|
+
type: 'address',
|
51
|
+
value: owner,
|
52
|
+
},
|
53
|
+
parentId: constants_1.tableId,
|
54
|
+
});
|
55
|
+
if (claimStatus.data)
|
56
|
+
return [];
|
57
|
+
const pythPrice = yield cache.getTokenPrice(constants_2.pythMint, portfolio_core_1.NetworkId.solana);
|
58
|
+
const asset = (0, tokenPriceToAssetToken_1.default)(constants_2.pythMint, amount, portfolio_core_1.NetworkId.solana, pythPrice, undefined, { isClaimable: true });
|
59
|
+
return [
|
60
|
+
{
|
61
|
+
type: portfolio_core_1.PortfolioElementType.multiple,
|
62
|
+
label: 'Airdrop',
|
63
|
+
name: 'CNY',
|
64
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
65
|
+
platformId: constants_1.platformId,
|
66
|
+
data: {
|
67
|
+
assets: [asset],
|
68
|
+
},
|
69
|
+
value: asset.value,
|
70
|
+
},
|
71
|
+
];
|
72
|
+
});
|
73
|
+
const fetcher = {
|
74
|
+
id: `${constants_1.platformId}-cny-airdrop`,
|
75
|
+
networkId: portfolio_core_1.NetworkId.sui,
|
76
|
+
executor,
|
77
|
+
};
|
78
|
+
exports.default = fetcher;
|
79
|
+
//# sourceMappingURL=cnyAirdropFetcher.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"cnyAirdropFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/scallop/cnyAirdropFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAA6E;AAC7E,qCAAoD;AACpD,gEAAqC;AACrC,kDAA6C;AAG7C,2CAA8D;AAC9D,iDAAmD;AACnD,iFAA8E;AAE9E,qGAA6E;AAC7E,iDAA6C;AAE7C,SAAS,SAAS,CAAC,SAAiB;IAClC,IAAI,CAAC,SAAS;QAAE,OAAO,SAAS,CAAC;IAEjC,M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a,CAAC,oBAAQ,EAAE,0BAAS,CAAC,MAAM,CAAC,CAAC;IACxE,MAAM,KAAK,GAAG,IAAA,gCAAsB,EAClC,oBAAQ,EACR,MAAM,EACN,0BAAS,CAAC,MAAM,EAChB,SAAS,EACT,SAAS,EACT,EAAE,WAAW,EAAE,IAAI,EAAE,CACtB,CAAC;IAEF,OAAO;QACL;YACE,IAAI,EAAE,qCAAoB,CAAC,QAAQ;YACnC,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,KAAK;YACX,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAV,sBAAU;YACV,IAAI,EAAE;gBACJ,MAAM,EAAE,CAAC,KAAK,CAAC;aAChB;YACD,KAAK,EAAE,KAAK,CAAC,KAAK;SACnB;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,cAAc;IAC/B,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -16,3 +16,5 @@ export declare const obligationKeyPackageId = "0xefe8b36d5b2e43728cc323298626b83
|
|
16
16
|
export declare const baseIndexRate = 1000000000;
|
17
17
|
export declare const scaAddress = "0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6::sca::SCA";
|
18
18
|
export declare const scaDecimals = 9;
|
19
|
+
export declare const tableId = "0xbfbbbdf1fe9b70cdd1ebd1444ca273000177f81a405935f6007b7727d2ff90c2";
|
20
|
+
export declare const airdropUrl = "https://airdrop.apis.scallop.io/cny-campaign/claim-signature/";
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.scaDecimals = exports.scaAddress = exports.baseIndexRate = exports.obligationKeyPackageId = exports.marketCoinPackageId = exports.spoolAccountPackageId = exports.spoolsKey = exports.poolsKey = exports.marketKey = exports.addressKey = exports.addressEndpoint = exports.spoolsPrefix = exports.poolsPrefix = exports.marketPrefix = exports.addressPrefix = exports.platform = exports.platformId = void 0;
|
3
|
+
exports.airdropUrl = exports.tableId = exports.scaDecimals = exports.scaAddress = exports.baseIndexRate = exports.obligationKeyPackageId = exports.marketCoinPackageId = exports.spoolAccountPackageId = exports.spoolsKey = exports.poolsKey = exports.marketKey = exports.addressKey = exports.addressEndpoint = exports.spoolsPrefix = exports.poolsPrefix = exports.marketPrefix = exports.addressPrefix = exports.platform = exports.platformId = void 0;
|
4
4
|
exports.platformId = 'scallop';
|
5
5
|
exports.platform = {
|
6
6
|
id: exports.platformId,
|
@@ -25,4 +25,6 @@ exports.obligationKeyPackageId = `${PROTOCOL_OBJECT_ID}::obligation::ObligationK
|
|
25
25
|
exports.baseIndexRate = 1000000000;
|
26
26
|
exports.scaAddress = '0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6::sca::SCA';
|
27
27
|
exports.scaDecimals = 9;
|
28
|
+
exports.tableId = '0xbfbbbdf1fe9b70cdd1ebd1444ca273000177f81a405935f6007b7727d2ff90c2';
|
29
|
+
exports.airdropUrl = 'https://airdrop.apis.scallop.io/cny-campaign/claim-signature/';
|
28
30
|
//# sourceMappingURL=constants.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/scallop/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,qCAAqC,kBAAU,MAAM;IAC5D,WAAW,EAAE,gBAAgB;IAC7B,OAAO,EAAE,yBAAyB;CACnC,CAAC;AAEW,QAAA,aAAa,GAAG,GAAG,kBAAU,UAAU,CAAC;AACxC,QAAA,YAAY,GAAG,GAAG,kBAAU,SAAS,CAAC;AACtC,QAAA,WAAW,GAAG,GAAG,kBAAU,QAAQ,CAAC;AACpC,QAAA,YAAY,GAAG,GAAG,kBAAU,eAAe,CAAC;AAE5C,QAAA,eAAe,GAC1B,+DAA+D,CAAC;AACrD,QAAA,UAAU,GAAG,qBAAqB,CAAC;AACnC,QAAA,SAAS,GAAG,oBAAoB,CAAC;AACjC,QAAA,QAAQ,GAAG,mBAAmB,CAAC;AAC/B,QAAA,SAAS,GAAG,0BAA0B,CAAC;AAEvC,QAAA,qBAAqB,GAAG,iGAAiG,CAAC;AACvI,MAAM,kBAAkB,GACtB,oEAAoE,CAAC;AAC1D,QAAA,mBAAmB,GAAG,GAAG,kBAAkB,uBAAuB,CAAC;AACnE,QAAA,sBAAsB,GAAG,GAAG,kBAAkB,6BAA6B,CAAC;AAC5E,QAAA,aAAa,GAAG,UAAa,CAAC;AAC9B,QAAA,UAAU,GACrB,8EAA8E,CAAC;AACpE,QAAA,WAAW,GAAG,CAAC,CAAC"}
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/scallop/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,qCAAqC,kBAAU,MAAM;IAC5D,WAAW,EAAE,gBAAgB;IAC7B,OAAO,EAAE,yBAAyB;CACnC,CAAC;AAEW,QAAA,aAAa,GAAG,GAAG,kBAAU,UAAU,CAAC;AACxC,QAAA,YAAY,GAAG,GAAG,kBAAU,SAAS,CAAC;AACtC,QAAA,WAAW,GAAG,GAAG,kBAAU,QAAQ,CAAC;AACpC,QAAA,YAAY,GAAG,GAAG,kBAAU,eAAe,CAAC;AAE5C,QAAA,eAAe,GAC1B,+DAA+D,CAAC;AACrD,QAAA,UAAU,GAAG,qBAAqB,CAAC;AACnC,QAAA,SAAS,GAAG,oBAAoB,CAAC;AACjC,QAAA,QAAQ,GAAG,mBAAmB,CAAC;AAC/B,QAAA,SAAS,GAAG,0BAA0B,CAAC;AAEvC,QAAA,qBAAqB,GAAG,iGAAiG,CAAC;AACvI,MAAM,kBAAkB,GACtB,oEAAoE,CAAC;AAC1D,QAAA,mBAAmB,GAAG,GAAG,kBAAkB,uBAAuB,CAAC;AACnE,QAAA,sBAAsB,GAAG,GAAG,kBAAkB,6BAA6B,CAAC;AAC5E,QAAA,aAAa,GAAG,UAAa,CAAC;AAC9B,QAAA,UAAU,GACrB,8EAA8E,CAAC;AACpE,QAAA,WAAW,GAAG,CAAC,CAAC;AAEhB,QAAA,OAAO,GAClB,oEAAoE,CAAC;AAC1D,QAAA,UAAU,GACrB,+DAA+D,CAAC"}
|
@@ -11,12 +11,14 @@ const spoolsMarketJob_1 = __importDefault(require("./spoolsMarketJob"));
|
|
11
11
|
const lendingsFetcher_1 = __importDefault(require("./lendingsFetcher"));
|
12
12
|
const veScaFetcher_1 = __importDefault(require("./veScaFetcher"));
|
13
13
|
const obligationsFetcher_1 = __importDefault(require("./obligationsFetcher"));
|
14
|
+
const cnyAirdropFetcher_1 = __importDefault(require("./cnyAirdropFetcher"));
|
14
15
|
const constants_1 = require("./constants");
|
15
16
|
exports.jobs = [addressJob_1.default, poolsJob_1.default, marketJob_1.default, spoolsMarketJob_1.default];
|
16
17
|
exports.fetchers = [
|
17
18
|
lendingsFetcher_1.default,
|
18
19
|
obligationsFetcher_1.default,
|
19
20
|
veScaFetcher_1.default,
|
21
|
+
cnyAirdropFetcher_1.default,
|
20
22
|
];
|
21
23
|
exports.platforms = [constants_1.platform];
|
22
24
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/scallop/index.ts"],"names":[],"mappings":";;;;;;AAGA,0DAAkC;AAClC,8DAAsC;AACtC,4DAAoC;AACpC,wEAAgD;AAEhD,wEAAgD;AAChD,kEAA0C;AAC1C,8EAAsD;AACtD,2CAAuC;AAE1B,QAAA,IAAI,GAAU,CAAC,oBAAU,EAAE,kBAAQ,EAAE,mBAAS,EAAE,yBAAe,CAAC,CAAC;AACjE,QAAA,QAAQ,GAAc;IACjC,yBAAe;IACf,4BAAkB;IAClB,sBAAY;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/scallop/index.ts"],"names":[],"mappings":";;;;;;AAGA,0DAAkC;AAClC,8DAAsC;AACtC,4DAAoC;AACpC,wEAAgD;AAEhD,wEAAgD;AAChD,kEAA0C;AAC1C,8EAAsD;AACtD,4EAAmD;AACnD,2CAAuC;AAE1B,QAAA,IAAI,GAAU,CAAC,oBAAU,EAAE,kBAAQ,EAAE,mBAAS,EAAE,yBAAe,CAAC,CAAC;AACjE,QAAA,QAAQ,GAAc;IACjC,yBAAe;IACf,4BAAkB;IAClB,sBAAY;IACZ,2BAAgB;CACjB,CAAC;AACW,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC"}
|
@@ -24,3 +24,32 @@ export type UserStakeAccounts = {
|
|
24
24
|
export type Pools = {
|
25
25
|
[T in string]: CoinTypeMetadata;
|
26
26
|
};
|
27
|
+
export type ClaimStatus = {
|
28
|
+
name: string;
|
29
|
+
value: number;
|
30
|
+
id: ID;
|
31
|
+
};
|
32
|
+
export type TreasuryInfo = {
|
33
|
+
claim_enabled: boolean;
|
34
|
+
claim_record: ClaimRecord;
|
35
|
+
id: ID;
|
36
|
+
msg_author_pubkey: number[];
|
37
|
+
treasury: string;
|
38
|
+
};
|
39
|
+
export type ClaimRecord = {
|
40
|
+
fields: Fields;
|
41
|
+
type: string;
|
42
|
+
};
|
43
|
+
export type Fields = {
|
44
|
+
id: ID;
|
45
|
+
size: string;
|
46
|
+
};
|
47
|
+
export type ID = {
|
48
|
+
id: string;
|
49
|
+
};
|
50
|
+
export type ApiResponse = {
|
51
|
+
signature: {
|
52
|
+
[key: string]: number;
|
53
|
+
};
|
54
|
+
data: string;
|
55
|
+
};
|