@sonarwatch/portfolio-plugins 0.11.192 → 0.11.193

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. package/CHANGELOG.md +1513 -1509
  2. package/README.md +3 -3
  3. package/package.json +2 -2
  4. package/src/index.js +5 -0
  5. package/src/index.js.map +1 -1
  6. package/src/plugins/aftermath/constants.d.ts +2 -0
  7. package/src/plugins/aftermath/constants.js +3 -1
  8. package/src/plugins/aftermath/constants.js.map +1 -1
  9. package/src/plugins/aftermath/index.js +2 -1
  10. package/src/plugins/aftermath/index.js.map +1 -1
  11. package/src/plugins/aftermath/stakingFetcher.d.ts +3 -0
  12. package/src/plugins/aftermath/stakingFetcher.js +102 -0
  13. package/src/plugins/aftermath/stakingFetcher.js.map +1 -0
  14. package/src/plugins/aftermath/types.d.ts +17 -0
  15. package/src/plugins/balancer/helpers/pools.js +21 -21
  16. package/src/plugins/drift/airdropFetcher.d.ts +3 -0
  17. package/src/plugins/drift/airdropFetcher.js +79 -0
  18. package/src/plugins/drift/airdropFetcher.js.map +1 -0
  19. package/src/plugins/drift/constants.d.ts +2 -0
  20. package/src/plugins/drift/constants.js +3 -1
  21. package/src/plugins/drift/constants.js.map +1 -1
  22. package/src/plugins/drift/index.js +2 -1
  23. package/src/plugins/drift/index.js.map +1 -1
  24. package/src/plugins/drift/types.d.ts +12 -0
  25. package/src/plugins/jito/airdropFetcher.js +1 -2
  26. package/src/plugins/jito/airdropFetcher.js.map +1 -1
  27. package/src/plugins/jupiter/launchpad/allocationsFetcher.js +1 -1
  28. package/src/plugins/kamino/airdropFetcher.js +1 -1
  29. package/src/plugins/parcl/airdropFetcher.js +1 -2
  30. package/src/plugins/parcl/airdropFetcher.js.map +1 -1
  31. package/src/plugins/sandglass/constants.d.ts +6 -0
  32. package/src/plugins/sandglass/constants.js +16 -0
  33. package/src/plugins/sandglass/constants.js.map +1 -0
  34. package/src/plugins/sandglass/depositFetcher.d.ts +3 -0
  35. package/src/plugins/sandglass/depositFetcher.js +82 -0
  36. package/src/plugins/sandglass/depositFetcher.js.map +1 -0
  37. package/src/plugins/sandglass/filters.d.ts +3 -0
  38. package/src/plugins/sandglass/filters.js +21 -0
  39. package/src/plugins/sandglass/filters.js.map +1 -0
  40. package/src/plugins/sandglass/index.d.ts +6 -0
  41. package/src/plugins/sandglass/index.js +13 -0
  42. package/src/plugins/sandglass/index.js.map +1 -0
  43. package/src/plugins/sandglass/marketsJob.d.ts +3 -0
  44. package/src/plugins/sandglass/marketsJob.js +96 -0
  45. package/src/plugins/sandglass/marketsJob.js.map +1 -0
  46. package/src/plugins/sandglass/structs.d.ts +150 -0
  47. package/src/plugins/sandglass/structs.js +144 -0
  48. package/src/plugins/sandglass/structs.js.map +1 -0
  49. package/src/plugins/sandglass/types.d.ts +7 -0
  50. package/src/plugins/sandglass/types.js +3 -0
  51. package/src/plugins/sandglass/types.js.map +1 -0
  52. package/src/plugins/sushiswap/helpers.js +24 -24
  53. package/src/plugins/tensor/airdropPowerUsersFetcher.d.ts +3 -0
  54. package/src/plugins/tensor/airdropPowerUsersFetcher.js +45 -0
  55. package/src/plugins/tensor/airdropPowerUsersFetcher.js.map +1 -0
  56. package/src/plugins/tensor/constants.d.ts +2 -0
  57. package/src/plugins/tensor/constants.js +3 -1
  58. package/src/plugins/tensor/constants.js.map +1 -1
  59. package/src/plugins/tensor/helpers.d.ts +1 -0
  60. package/src/plugins/tensor/helpers.js +16 -0
  61. package/src/plugins/tensor/helpers.js.map +1 -0
  62. package/src/plugins/tensor/index.js +6 -1
  63. package/src/plugins/tensor/index.js.map +1 -1
  64. package/src/plugins/tensor/powerUsers.json +2898 -0
  65. package/src/plugins/uniswap-v2/helpers.js +22 -22
  66. package/src/plugins/wormhole/airdropFetcher.js +1 -2
  67. package/src/plugins/wormhole/airdropFetcher.js.map +1 -1
  68. package/src/utils/sei/constants.js +8 -8
  69. package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
@@ -0,0 +1,82 @@
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 constants_1 = require("./constants");
17
+ const clients_1 = require("../../utils/clients");
18
+ const solana_1 = require("../../utils/solana");
19
+ const structs_1 = require("./structs");
20
+ const filters_1 = require("./filters");
21
+ const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
22
+ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
23
+ const client = (0, clients_1.getClientSolana)();
24
+ const accounts = yield (0, solana_1.getParsedProgramAccounts)(client, structs_1.sandglassAccountStruct, constants_1.programId, (0, filters_1.userAccountFilters)(owner));
25
+ if (accounts.length === 0)
26
+ return [];
27
+ const marketsInfos = yield cache.getItem(constants_1.marketsInfoKey, {
28
+ prefix: constants_1.platformId,
29
+ networkId: portfolio_core_1.NetworkId.solana,
30
+ });
31
+ if (!marketsInfos)
32
+ return [];
33
+ const marketInfoById = new Map();
34
+ marketsInfos.forEach((marketInfo) => marketInfoById.set(marketInfo.pubkey.toString(), marketInfo));
35
+ const mints = marketsInfos
36
+ .map((marketInfo) => [
37
+ marketInfo.ptMint,
38
+ marketInfo.ytMint,
39
+ // marketInfo.lpMint,
40
+ // marketInfo.syMint,
41
+ ])
42
+ .flat();
43
+ const tokenPriceById = yield cache.getTokenPricesAsMap(mints, portfolio_core_1.NetworkId.solana);
44
+ const assets = [];
45
+ for (const account of accounts) {
46
+ const market = marketInfoById.get(account.marketAccount.toString());
47
+ if (!market)
48
+ continue;
49
+ const { stakePtAmount, stakeYtAmount } = account.stakeInfo;
50
+ const ptPrice = tokenPriceById.get(market.ptMint);
51
+ const ytPrice = tokenPriceById.get(market.ytMint);
52
+ if (ptPrice && !stakePtAmount.isZero()) {
53
+ const amount = stakePtAmount.dividedBy(Math.pow(10, ptPrice.decimals)).toNumber();
54
+ assets.push((0, tokenPriceToAssetToken_1.default)(market.ptMint, amount, portfolio_core_1.NetworkId.solana, ptPrice));
55
+ }
56
+ if (ytPrice && !stakeYtAmount.isZero()) {
57
+ const amount = stakeYtAmount.dividedBy(Math.pow(10, ytPrice.decimals)).toNumber();
58
+ assets.push((0, tokenPriceToAssetToken_1.default)(market.ytMint, amount, portfolio_core_1.NetworkId.solana, ytPrice));
59
+ }
60
+ }
61
+ if (assets.length === 0)
62
+ return [];
63
+ return [
64
+ {
65
+ label: 'Staked',
66
+ networkId: portfolio_core_1.NetworkId.solana,
67
+ platformId: constants_1.platformId,
68
+ type: 'multiple',
69
+ value: (0, portfolio_core_1.getUsdValueSum)(assets.map((asset) => asset.value)),
70
+ data: {
71
+ assets,
72
+ },
73
+ },
74
+ ];
75
+ });
76
+ const fetcher = {
77
+ id: `${constants_1.platformId}-deposit`,
78
+ networkId: portfolio_core_1.NetworkId.solana,
79
+ executor,
80
+ };
81
+ exports.default = fetcher;
82
+ //# sourceMappingURL=depositFetcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"depositFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sandglass/depositFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AAGpC,2CAAoE;AACpE,iDAAsD;AACtD,+CAA8D;AAC9D,uCAAmD;AACnD,uCAA+C;AAE/C,qGAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KA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CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { GetProgramAccountsFilter } from '@solana/web3.js';
2
+ export declare const userAccountFilters: (owner: string) => GetProgramAccountsFilter[];
3
+ export declare const marketAccountFilters: GetProgramAccountsFilter[];
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.marketAccountFilters = exports.userAccountFilters = void 0;
4
+ const userAccountFilters = (owner) => [
5
+ {
6
+ memcmp: {
7
+ offset: 41,
8
+ bytes: owner,
9
+ },
10
+ },
11
+ {
12
+ dataSize: 416,
13
+ },
14
+ ];
15
+ exports.userAccountFilters = userAccountFilters;
16
+ exports.marketAccountFilters = [
17
+ {
18
+ dataSize: 1104,
19
+ },
20
+ ];
21
+ //# sourceMappingURL=filters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sandglass/filters.ts"],"names":[],"mappings":";;;AAEO,MAAM,kBAAkB,GAAG,CAChC,KAAa,EACe,EAAE,CAAC;IAC/B;QACE,MAAM,EAAE;YACN,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,KAAK;SACb;KACF;IACD;QACE,QAAQ,EAAE,GAAG;KACd;CACF,CAAC;AAZW,QAAA,kBAAkB,sBAY7B;AAEW,QAAA,oBAAoB,GAA+B;IAC9D;QACE,QAAQ,EAAE,IAAI;KACf;CACF,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { Platform } from '@sonarwatch/portfolio-core';
2
+ import { Fetcher } from '../../Fetcher';
3
+ import { Job } from '../../Job';
4
+ export declare const platforms: Platform[];
5
+ export declare const jobs: Job[];
6
+ export declare const fetchers: Fetcher[];
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.fetchers = exports.jobs = exports.platforms = void 0;
7
+ const constants_1 = require("./constants");
8
+ const depositFetcher_1 = __importDefault(require("./depositFetcher"));
9
+ const marketsJob_1 = __importDefault(require("./marketsJob"));
10
+ exports.platforms = [constants_1.platform];
11
+ exports.jobs = [marketsJob_1.default];
12
+ exports.fetchers = [depositFetcher_1.default];
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sandglass/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,sEAA8C;AAC9C,8DAAqC;AAExB,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,oBAAS,CAAC,CAAC;AAC1B,QAAA,QAAQ,GAAc,CAAC,wBAAc,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Job } from '../../Job';
2
+ declare const job: Job;
3
+ export default job;
@@ -0,0 +1,96 @@
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 bignumber_js_1 = __importDefault(require("bignumber.js"));
16
+ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
17
+ const clients_1 = require("../../utils/clients");
18
+ const solana_1 = require("../../utils/solana");
19
+ const constants_1 = require("./constants");
20
+ const structs_1 = require("./structs");
21
+ const filters_1 = require("./filters");
22
+ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
23
+ var _a, _b;
24
+ const client = (0, clients_1.getClientSolana)();
25
+ const markets = yield (0, solana_1.getParsedProgramAccounts)(client, structs_1.marketStruct, constants_1.programId, filters_1.marketAccountFilters);
26
+ const mints = markets
27
+ .map((market) => [
28
+ market.tokenLpMintAddress,
29
+ market.tokenPtMintAddress,
30
+ market.tokenYtMintAddress,
31
+ market.tokenLpMintAddress,
32
+ ])
33
+ .flat();
34
+ const baseMints = markets.map((market) => market.tokenSyMintAddress.toString());
35
+ const baseTokenPriceById = yield cache.getTokenPricesAsMap(baseMints, portfolio_core_1.NetworkId.solana);
36
+ const mintsAccounts = yield (0, solana_1.getParsedMultipleAccountsInfo)(client, solana_1.mintAccountStruct, mints);
37
+ const mintsInfoById = new Map();
38
+ mintsAccounts.forEach((mintAccount) => {
39
+ if (mintAccount)
40
+ mintsInfoById.set(mintAccount === null || mintAccount === void 0 ? void 0 : mintAccount.pubkey.toString(), mintAccount);
41
+ });
42
+ const sources = [];
43
+ const marketsInfos = [];
44
+ for (const market of markets) {
45
+ const baseTokenPrice = baseTokenPriceById.get(market.tokenSyMintAddress.toString());
46
+ if (!baseTokenPrice)
47
+ continue;
48
+ const ptPrice = market.marketConfig.startPrice.dividedBy(market.marketConfig.marketEndPrice);
49
+ const ytPrice = new bignumber_js_1.default(1).minus(ptPrice);
50
+ const ptMint = market.tokenPtMintAddress;
51
+ const ytMint = market.tokenYtMintAddress;
52
+ const ptDecimals = (_a = mintsInfoById.get(ptMint.toString())) === null || _a === void 0 ? void 0 : _a.decimals;
53
+ const ytDecimals = (_b = mintsInfoById.get(ytMint.toString())) === null || _b === void 0 ? void 0 : _b.decimals;
54
+ if (ptDecimals)
55
+ sources.push({
56
+ address: ptMint.toString(),
57
+ decimals: ptDecimals,
58
+ id: market.pubkey.toString(),
59
+ networkId: portfolio_core_1.NetworkId.solana,
60
+ platformId: constants_1.platformId,
61
+ price: ptPrice.times(baseTokenPrice.price).toNumber(),
62
+ timestamp: Date.now(),
63
+ weight: 1,
64
+ });
65
+ if (ytDecimals)
66
+ sources.push({
67
+ address: ytMint.toString(),
68
+ decimals: ytDecimals,
69
+ id: market.pubkey.toString(),
70
+ networkId: portfolio_core_1.NetworkId.solana,
71
+ platformId: constants_1.platformId,
72
+ price: ytPrice.times(baseTokenPrice.price).toNumber(),
73
+ timestamp: Date.now(),
74
+ weight: 1,
75
+ });
76
+ marketsInfos.push({
77
+ pubkey: market.pubkey.toString(),
78
+ ytMint: market.tokenYtMintAddress.toString(),
79
+ lpMint: market.tokenLpMintAddress.toString(),
80
+ ptMint: market.tokenPtMintAddress.toString(),
81
+ syMint: market.tokenSyMintAddress.toString(),
82
+ });
83
+ }
84
+ yield cache.setItem(constants_1.marketsInfoKey, marketsInfos, {
85
+ prefix: constants_1.platformId,
86
+ networkId: portfolio_core_1.NetworkId.solana,
87
+ });
88
+ yield cache.setTokenPriceSources(sources);
89
+ });
90
+ const job = {
91
+ id: `${constants_1.platformId}-markets`,
92
+ executor,
93
+ label: 'normal',
94
+ };
95
+ exports.default = job;
96
+ //# sourceMappingURL=marketsJob.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"marketsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sandglass/marketsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,gEAAqC;AACrC,+DAAyE;AAGzE,iDAAsD;AACtD,+CAK4B;AAC5B,2CAAoE;AACpE,uCAAyC;AACzC,uCAAiD;AAGjD,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;;IACnD,MAAM,MAAM,GAAG,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ACrD,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;gBACrB,MAAM,EAAE,CAAC;aACV,CAAC,CAAC;QAEL,YAAY,CAAC,IAAI,CAAC;YAChB,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE;YAChC,MAAM,EAAE,MAAM,CAAC,kBAAkB,CAAC,QAAQ,EAAE;YAC5C,MAAM,EAAE,MAAM,CAAC,kBAAkB,CAAC,QAAQ,EAAE;YAC5C,MAAM,EAAE,MAAM,CAAC,kBAAkB,CAAC,QAAQ,EAAE;YAC5C,MAAM,EAAE,MAAM,CAAC,kBAAkB,CAAC,QAAQ,EAAE;SAC7C,CAAC,CAAC;IACL,CAAC;IAED,MAAM,KAAK,CAAC,OAAO,CAAC,0BAAc,EAAE,YAAY,EAAE;QAChD,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;IAEH,MAAM,KAAK,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -0,0 +1,150 @@
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 MarketInfo = {
6
+ vaultSyAmount: BigNumber;
7
+ vaultPtAmount: BigNumber;
8
+ vaultYtAmount: BigNumber;
9
+ vaultLpAmount: BigNumber;
10
+ volume: BigNumber;
11
+ feeTrade: BigNumber;
12
+ feePlatform: BigNumber;
13
+ feeTradeVolume: BigNumber;
14
+ feePlatformVolume: BigNumber;
15
+ infoTemp1: BigNumber;
16
+ infoTemp2: BigNumber;
17
+ infoTemp3: BigNumber;
18
+ infoTemp4: BigNumber;
19
+ };
20
+ export declare const marketInfoStruct: BeetStruct<MarketInfo, Partial<MarketInfo>>;
21
+ export type MarketConfig = {
22
+ priceBase: BigNumber;
23
+ startTime: BigNumber;
24
+ startPrice: BigNumber;
25
+ startEpoch: BigNumber;
26
+ startLpValue: BigNumber;
27
+ endTime: BigNumber;
28
+ marketEndPrice: BigNumber;
29
+ marketApy: BigNumber;
30
+ updateSkipTime: BigNumber;
31
+ lastUpdateEpoch: BigNumber;
32
+ marketSolPrice: BigNumber;
33
+ lastUpdateTime: BigNumber;
34
+ marketConfig1: BigNumber;
35
+ marketConfig2: BigNumber;
36
+ marketConfig3: BigNumber;
37
+ marketConfig4: BigNumber;
38
+ marketConfig5: BigNumber;
39
+ marketConfig6: BigNumber;
40
+ marketConfig7: BigNumber;
41
+ };
42
+ export declare const marketConfigStruct: BeetStruct<MarketConfig, Partial<MarketConfig>>;
43
+ export type Freeze = {
44
+ market: number;
45
+ mint: number;
46
+ redeem: number;
47
+ trade: number;
48
+ deposi: number;
49
+ withdr: number;
50
+ };
51
+ export declare const freezeStruct: BeetStruct<Freeze, Partial<Freeze>>;
52
+ export type Fees = {
53
+ feeDenominator: BigNumber;
54
+ tradeFeeNumerator: BigNumber;
55
+ platformFeeNumerator: BigNumber;
56
+ yieldFeeNumerator: BigNumber;
57
+ feeNumerator1: BigNumber;
58
+ feeNumerator2: BigNumber;
59
+ };
60
+ export declare const feesStruct: BeetStruct<Fees, Partial<Fees>>;
61
+ export type PoolConfig = {
62
+ fees: Fees;
63
+ configDenominator: BigNumber;
64
+ leverage: BigNumber;
65
+ poolConfig8: BigNumber;
66
+ poolConfig9: BigNumber;
67
+ spreadReduce: BigNumber;
68
+ feeTimeExp: BigNumber;
69
+ depositCapPt: BigNumber;
70
+ poolConfig1: BigNumber;
71
+ poolConfig2: BigNumber;
72
+ poolConfig3: BigNumber;
73
+ poolConfig4: BigNumber;
74
+ poolConfig5: BigNumber;
75
+ poolConfig6: BigNumber;
76
+ poolConfig7: BigNumber;
77
+ };
78
+ export declare const poolConfigStruct: BeetStruct<PoolConfig, Partial<PoolConfig>>;
79
+ export type Market = {
80
+ buffer: Buffer;
81
+ bumpSeed: number;
82
+ freeze: Freeze;
83
+ marketSigner: PublicKey;
84
+ tokenProgram: PublicKey;
85
+ marketInfo: MarketInfo;
86
+ marketConfig: MarketConfig;
87
+ poolConfig: PoolConfig;
88
+ oracleAccount: PublicKey;
89
+ tokenSyMintAddress: PublicKey;
90
+ tokenPtMintAddress: PublicKey;
91
+ tokenYtMintAddress: PublicKey;
92
+ tokenLpMintAddress: PublicKey;
93
+ poolPtTokenAccount: PublicKey;
94
+ poolYtTokenAccount: PublicKey;
95
+ vaultSyTokenAccount: PublicKey;
96
+ vaultPtTokenAccount: PublicKey;
97
+ vaultYtTokenAccount: PublicKey;
98
+ vaultLpTokenAccount: PublicKey;
99
+ feeLpTokenAccount: PublicKey;
100
+ marketAddress1: PublicKey;
101
+ marketAddress2: PublicKey;
102
+ marketAddress3: PublicKey;
103
+ marketAddress4: PublicKey;
104
+ marketAddress5: PublicKey;
105
+ marketAddress6: PublicKey;
106
+ marketAddress7: PublicKey;
107
+ };
108
+ export declare const marketStruct: BeetStruct<Market, Partial<Market>>;
109
+ export type TradeInfo = {
110
+ volume: BigNumber;
111
+ tradeInfo1: BigNumber;
112
+ tradeInfo2: BigNumber;
113
+ tradeInfo3: BigNumber;
114
+ tradeInfo4: BigNumber;
115
+ tradeInfo5: BigNumber;
116
+ };
117
+ export declare const tradeInfoStruct: BeetStruct<TradeInfo, Partial<TradeInfo>>;
118
+ export type StakeInfo = {
119
+ stakePtAmount: BigNumber;
120
+ stakePtTime: BigNumber;
121
+ stakePtPriceSy: BigNumber;
122
+ stakePtPricePt: BigNumber;
123
+ stakeYtAmount: BigNumber;
124
+ stakeYtTime: BigNumber;
125
+ stakeYtPriceSy: BigNumber;
126
+ stakeYtPriceYt: BigNumber;
127
+ stakeLpAmount: BigNumber;
128
+ stakeLpTime: BigNumber;
129
+ stakeLpPriceSy: BigNumber;
130
+ staleInfo1: BigNumber;
131
+ staleInfo2: BigNumber;
132
+ staleInfo3: BigNumber;
133
+ staleInfo4: BigNumber;
134
+ staleInfo5: BigNumber;
135
+ };
136
+ export declare const stakeInfoStruct: BeetStruct<StakeInfo, Partial<StakeInfo>>;
137
+ export type SandglassAccount = {
138
+ buffer: Buffer;
139
+ bumpSeed: number;
140
+ marketAccount: PublicKey;
141
+ userAddress: PublicKey;
142
+ tradeInfo: TradeInfo;
143
+ stakeInfo: StakeInfo;
144
+ sandglassAddress1: PublicKey;
145
+ sandglassAddress2: PublicKey;
146
+ sandglassAddress3: PublicKey;
147
+ sandglassAddress4: PublicKey;
148
+ sandglassAddress5: PublicKey;
149
+ };
150
+ export declare const sandglassAccountStruct: BeetStruct<SandglassAccount, Partial<SandglassAccount>>;
@@ -0,0 +1,144 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sandglassAccountStruct = exports.stakeInfoStruct = exports.tradeInfoStruct = exports.marketStruct = exports.poolConfigStruct = exports.feesStruct = exports.freezeStruct = exports.marketConfigStruct = exports.marketInfoStruct = 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.marketInfoStruct = new beet_1.BeetStruct([
8
+ ['vaultSyAmount', solana_1.u64],
9
+ ['vaultPtAmount', solana_1.u64],
10
+ ['vaultYtAmount', solana_1.u64],
11
+ ['vaultLpAmount', solana_1.u64],
12
+ ['volume', solana_1.u64],
13
+ ['feeTrade', solana_1.u64],
14
+ ['feePlatform', solana_1.u64],
15
+ ['feeTradeVolume', solana_1.u64],
16
+ ['feePlatformVolume', solana_1.u64],
17
+ ['infoTemp1', solana_1.u64],
18
+ ['infoTemp2', solana_1.u64],
19
+ ['infoTemp3', solana_1.u64],
20
+ ['infoTemp4', solana_1.u64],
21
+ ], (args) => args);
22
+ exports.marketConfigStruct = new beet_1.BeetStruct([
23
+ ['priceBase', solana_1.u64],
24
+ ['startTime', solana_1.u64],
25
+ ['startPrice', solana_1.u64],
26
+ ['startEpoch', solana_1.u64],
27
+ ['startLpValue', solana_1.u64],
28
+ ['endTime', solana_1.u64],
29
+ ['marketEndPrice', solana_1.u64],
30
+ ['marketApy', solana_1.u64],
31
+ ['updateSkipTime', solana_1.u64],
32
+ ['lastUpdateEpoch', solana_1.u64],
33
+ ['marketSolPrice', solana_1.u64],
34
+ ['lastUpdateTime', solana_1.u64],
35
+ ['marketConfig1', solana_1.u64],
36
+ ['marketConfig2', solana_1.u64],
37
+ ['marketConfig3', solana_1.u64],
38
+ ['marketConfig4', solana_1.u64],
39
+ ['marketConfig5', solana_1.u64],
40
+ ['marketConfig6', solana_1.u64],
41
+ ['marketConfig7', solana_1.u64],
42
+ ], (args) => args);
43
+ exports.freezeStruct = new beet_1.BeetStruct([
44
+ ['market', beet_1.u8],
45
+ ['mint', beet_1.u8],
46
+ ['redeem', beet_1.u8],
47
+ ['trade', beet_1.u8],
48
+ ['deposi', beet_1.u8],
49
+ ['withdr', beet_1.u8],
50
+ ], (args) => args);
51
+ exports.feesStruct = new beet_1.BeetStruct([
52
+ ['feeDenominator', solana_1.u64],
53
+ ['tradeFeeNumerator', solana_1.u64],
54
+ ['platformFeeNumerator', solana_1.u64],
55
+ ['yieldFeeNumerator', solana_1.u64],
56
+ ['feeNumerator1', solana_1.u64],
57
+ ['feeNumerator2', solana_1.u64],
58
+ ], (args) => args);
59
+ exports.poolConfigStruct = new beet_1.BeetStruct([
60
+ ['fees', exports.feesStruct],
61
+ ['configDenominator', solana_1.u64],
62
+ ['leverage', solana_1.u64],
63
+ ['poolConfig8', solana_1.u64],
64
+ ['poolConfig9', solana_1.u64],
65
+ ['spreadReduce', solana_1.u64],
66
+ ['feeTimeExp', solana_1.u64],
67
+ ['depositCapPt', solana_1.u64],
68
+ ['poolConfig1', solana_1.u64],
69
+ ['poolConfig2', solana_1.u64],
70
+ ['poolConfig3', solana_1.u64],
71
+ ['poolConfig4', solana_1.u64],
72
+ ['poolConfig5', solana_1.u64],
73
+ ['poolConfig6', solana_1.u64],
74
+ ['poolConfig7', solana_1.u64],
75
+ ], (args) => args);
76
+ exports.marketStruct = new beet_1.BeetStruct([
77
+ ['buffer', (0, solana_1.blob)(8)],
78
+ ['bumpSeed', beet_1.u8],
79
+ ['freeze', exports.freezeStruct],
80
+ ['marketSigner', beet_solana_1.publicKey],
81
+ ['tokenProgram', beet_solana_1.publicKey],
82
+ ['marketInfo', exports.marketInfoStruct],
83
+ ['marketConfig', exports.marketConfigStruct],
84
+ ['poolConfig', exports.poolConfigStruct],
85
+ ['oracleAccount', beet_solana_1.publicKey],
86
+ ['tokenSyMintAddress', beet_solana_1.publicKey],
87
+ ['tokenPtMintAddress', beet_solana_1.publicKey],
88
+ ['tokenYtMintAddress', beet_solana_1.publicKey],
89
+ ['tokenLpMintAddress', beet_solana_1.publicKey],
90
+ ['poolPtTokenAccount', beet_solana_1.publicKey],
91
+ ['poolYtTokenAccount', beet_solana_1.publicKey],
92
+ ['vaultSyTokenAccount', beet_solana_1.publicKey],
93
+ ['vaultPtTokenAccount', beet_solana_1.publicKey],
94
+ ['vaultYtTokenAccount', beet_solana_1.publicKey],
95
+ ['vaultLpTokenAccount', beet_solana_1.publicKey],
96
+ ['feeLpTokenAccount', beet_solana_1.publicKey],
97
+ ['marketAddress1', beet_solana_1.publicKey],
98
+ ['marketAddress2', beet_solana_1.publicKey],
99
+ ['marketAddress3', beet_solana_1.publicKey],
100
+ ['marketAddress4', beet_solana_1.publicKey],
101
+ ['marketAddress5', beet_solana_1.publicKey],
102
+ ['marketAddress6', beet_solana_1.publicKey],
103
+ ['marketAddress7', beet_solana_1.publicKey],
104
+ ], (args) => args);
105
+ exports.tradeInfoStruct = new beet_1.BeetStruct([
106
+ ['volume', solana_1.u64],
107
+ ['tradeInfo1', solana_1.u64],
108
+ ['tradeInfo2', solana_1.u64],
109
+ ['tradeInfo3', solana_1.u64],
110
+ ['tradeInfo4', solana_1.u64],
111
+ ['tradeInfo5', solana_1.u64],
112
+ ], (args) => args);
113
+ exports.stakeInfoStruct = new beet_1.BeetStruct([
114
+ ['stakePtAmount', solana_1.u64],
115
+ ['stakePtTime', solana_1.i64],
116
+ ['stakePtPriceSy', solana_1.u64],
117
+ ['stakePtPricePt', solana_1.u64],
118
+ ['stakeYtAmount', solana_1.u64],
119
+ ['stakeYtTime', solana_1.i64],
120
+ ['stakeYtPriceSy', solana_1.u64],
121
+ ['stakeYtPriceYt', solana_1.u64],
122
+ ['stakeLpAmount', solana_1.u64],
123
+ ['stakeLpTime', solana_1.i64],
124
+ ['stakeLpPriceSy', solana_1.u64],
125
+ ['staleInfo1', solana_1.u64],
126
+ ['staleInfo2', solana_1.u64],
127
+ ['staleInfo3', solana_1.u64],
128
+ ['staleInfo4', solana_1.u64],
129
+ ['staleInfo5', solana_1.u64],
130
+ ], (args) => args);
131
+ exports.sandglassAccountStruct = new beet_1.BeetStruct([
132
+ ['buffer', (0, solana_1.blob)(8)],
133
+ ['bumpSeed', beet_1.u8],
134
+ ['marketAccount', beet_solana_1.publicKey],
135
+ ['userAddress', beet_solana_1.publicKey],
136
+ ['tradeInfo', exports.tradeInfoStruct],
137
+ ['stakeInfo', exports.stakeInfoStruct],
138
+ ['sandglassAddress1', beet_solana_1.publicKey],
139
+ ['sandglassAddress2', beet_solana_1.publicKey],
140
+ ['sandglassAddress3', beet_solana_1.publicKey],
141
+ ['sandglassAddress4', beet_solana_1.publicKey],
142
+ ['sandglassAddress5', beet_solana_1.publicKey],
143
+ ], (args) => args);
144
+ //# sourceMappingURL=structs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sandglass/structs.ts"],"names":[],"mappings":";;;AAAA,oDAA2D;AAC3D,kEAA6D;AAG7D,+CAAoD;AAkBvC,QAAA,gBAAgB,GAAG,IAAI,iBAAU,CAC5C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A,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,UAAU,EAAE,SAAE,CAAC;IAChB,CAAC,eAAe,EAAE,uBAAS,CAAC;IAC5B,CAAC,aAAa,EAAE,uBAAS,CAAC;IAC1B,CAAC,WAAW,EAAE,uBAAe,CAAC;IAC9B,CAAC,WAAW,EAAE,uBAAe,CAAC;IAC9B,CAAC,mBAAmB,EAAE,uBAAS,CAAC;IAChC,CAAC,mBAAmB,EAAE,uBAAS,CAAC;IAChC,CAAC,mBAAmB,EAAE,uBAAS,CAAC;IAChC,CAAC,mBAAmB,EAAE,uBAAS,CAAC;IAChC,CAAC,mBAAmB,EAAE,uBAAS,CAAC;CACjC,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAwB,CACnC,CAAC"}
@@ -0,0 +1,7 @@
1
+ export type MarketInfo = {
2
+ pubkey: string;
3
+ ytMint: string;
4
+ ptMint: string;
5
+ lpMint: string;
6
+ syMint: string;
7
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sandglass/types.ts"],"names":[],"mappings":""}
@@ -54,30 +54,30 @@ function sushiV3PairToUniV2(pair) {
54
54
  }
55
55
  function getV3PairsAddresses(url, length = 300) {
56
56
  return __awaiter(this, void 0, void 0, function* () {
57
- const query = (0, graphql_request_1.gql) `
58
- {
59
- pools(
60
- orderBy: totalValueLockedUSD
61
- first: ${length}
62
- orderDirection: desc
63
- where: { volumeUSD_not: "0", liquidity_not: "0" }
64
- ) {
65
- id
66
- token0Price
67
- token1Price
68
- liquidity
69
- token0 {
70
- id
71
- totalSupply
72
- decimals
73
- }
74
- token1 {
75
- id
76
- totalSupply
77
- decimals
78
- }
79
- }
80
- }
57
+ const query = (0, graphql_request_1.gql) `
58
+ {
59
+ pools(
60
+ orderBy: totalValueLockedUSD
61
+ first: ${length}
62
+ orderDirection: desc
63
+ where: { volumeUSD_not: "0", liquidity_not: "0" }
64
+ ) {
65
+ id
66
+ token0Price
67
+ token1Price
68
+ liquidity
69
+ token0 {
70
+ id
71
+ totalSupply
72
+ decimals
73
+ }
74
+ token1 {
75
+ id
76
+ totalSupply
77
+ decimals
78
+ }
79
+ }
80
+ }
81
81
  `;
82
82
  const res = yield (0, graphql_request_1.default)(url, query);
83
83
  const pools = res.pools;
@@ -0,0 +1,3 @@
1
+ import { Fetcher } from '../../Fetcher';
2
+ declare const fetcher: Fetcher;
3
+ export default fetcher;