@sonarwatch/portfolio-plugins 0.11.222 → 0.11.224

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -2,10 +2,18 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
- ## [0.11.222](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.221...plugins-0.11.222) (2024-05-28)
5
+ ## [0.11.224](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.223...plugins-0.11.224) (2024-05-29)
6
6
 
7
7
 
8
8
 
9
+ ## [0.11.223](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.222...plugins-0.11.223) (2024-05-29)
10
+
11
+
12
+
13
+ ## [0.11.222](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.221...plugins-0.11.222) (2024-05-28)
14
+
15
+
16
+
9
17
  ## [0.11.221](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.220...plugins-0.11.221) (2024-05-28)
10
18
 
11
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonarwatch/portfolio-plugins",
3
- "version": "0.11.222",
3
+ "version": "0.11.224",
4
4
  "type": "commonjs",
5
5
  "generators": "./generators.json",
6
6
  "dependencies": {
@@ -42,7 +42,7 @@
42
42
  "web3-v1": "npm:web3@^1.5.0"
43
43
  },
44
44
  "peerDependencies": {
45
- "@sonarwatch/portfolio-core": "0.11.222"
45
+ "@sonarwatch/portfolio-core": "0.11.224"
46
46
  },
47
47
  "main": "./src/index.js",
48
48
  "types": "./src/index.d.ts"
@@ -16,6 +16,9 @@ const solana_1 = require("../../utils/solana");
16
16
  const structs_1 = require("./structs");
17
17
  const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
18
18
  const client = (0, clients_1.getClientSolana)();
19
+ const usdcTokenPrice = yield cache.getTokenPrice(constants_1.usdcMint, portfolio_core_1.NetworkId.solana);
20
+ if (!usdcTokenPrice)
21
+ return;
19
22
  const accounts = yield (0, solana_1.getParsedProgramAccounts)(client, structs_1.swapStruct, constants_1.ammPid, [
20
23
  {
21
24
  dataSize: structs_1.swapStruct.byteSize,
@@ -23,8 +26,20 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
23
26
  ]);
24
27
  if (accounts.length === 0)
25
28
  return;
29
+ // Markets
30
+ const marketAddresses = accounts.map((a) => a.market);
31
+ const marketAccounts = (yield (0, solana_1.getParsedMultipleAccountsInfo)(client, structs_1.marketStruct, marketAddresses)).filter((a) => a !== null);
32
+ const marketAccountsMap = new Map();
33
+ marketAccounts.forEach((a) => {
34
+ marketAccountsMap.set(a.pubkey.toString(), a);
35
+ });
36
+ // Token Swap
26
37
  const tokenSwapAddresses = accounts.map((a) => a.underlyingSwap);
27
38
  const tokenSwapAccounts = (yield (0, solana_1.getParsedMultipleAccountsInfo)(client, structs_1.tokenSwapStruct, tokenSwapAddresses)).filter((a) => a !== null);
39
+ const tokenSwapAccountsMap = new Map();
40
+ tokenSwapAccounts.forEach((a) => {
41
+ tokenSwapAccountsMap.set(a.pubkey.toString(), a);
42
+ });
28
43
  // Token accounts
29
44
  const tokenAccountAddresses = tokenSwapAccounts
30
45
  .map((a) => [a.tokenAccountA, a.tokenAccountB])
@@ -47,41 +62,51 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
47
62
  return;
48
63
  mintAccountsMap.set(a.pubkey.toString(), a);
49
64
  });
50
- const tokenPrices = yield cache.getTokenPricesAsMap(tokenSwapAccounts.map((a) => a.tokenPool.toString()), portfolio_core_1.NetworkId.solana);
51
65
  const sources = [];
52
- for (let i = 0; i < tokenSwapAccounts.length; i++) {
53
- const acc = tokenSwapAccounts[i];
54
- const poolMint = mintAccountsMap.get(acc.tokenPool.toString());
66
+ for (let i = 0; i < accounts.length; i++) {
67
+ const acc = accounts[i];
68
+ const tsAcc = tokenSwapAccountsMap.get(acc.underlyingSwap.toString());
69
+ const marketAcc = marketAccountsMap.get(acc.market.toString());
70
+ if (!marketAcc || !tsAcc)
71
+ continue;
72
+ const poolMint = mintAccountsMap.get(tsAcc.tokenPool.toString());
55
73
  if (!poolMint)
56
74
  continue;
57
- const mintA = mintAccountsMap.get(acc.mintA.toString());
58
- const mintB = mintAccountsMap.get(acc.mintB.toString());
75
+ const mintA = mintAccountsMap.get(tsAcc.mintA.toString());
76
+ const mintB = mintAccountsMap.get(tsAcc.mintB.toString());
59
77
  if (!mintA || !mintB)
60
78
  continue;
61
- const tokenAccountA = tokenAccountsMap.get(acc.tokenAccountA.toString());
62
- const tokenAccountB = tokenAccountsMap.get(acc.tokenAccountB.toString());
79
+ const tokenAccountA = tokenAccountsMap.get(tsAcc.tokenAccountA.toString());
80
+ const tokenAccountB = tokenAccountsMap.get(tsAcc.tokenAccountB.toString());
63
81
  if (!tokenAccountA || !tokenAccountB)
64
82
  continue;
65
83
  if (tokenAccountA.amount.isZero())
66
84
  continue;
67
85
  if (tokenAccountB.amount.isZero())
68
86
  continue;
69
- const tokenPrice = tokenPrices.get(acc.tokenPool.toString());
70
- if (!tokenPrice)
71
- continue;
72
- const totalAmount = tokenAccountA.amount.plus(tokenAccountB.amount);
73
- const priceA = totalAmount
74
- .plus(tokenAccountA.amount)
75
- .div(totalAmount)
76
- .minus(1)
77
- .times(tokenPrice === null || tokenPrice === void 0 ? void 0 : tokenPrice.price)
87
+ let shareA = tokenAccountB.amount
88
+ .div(tokenAccountA.amount.plus(tokenAccountB.amount))
89
+ .times(usdcTokenPrice.price)
78
90
  .toNumber();
79
- const priceB = totalAmount
80
- .plus(tokenAccountB.amount)
81
- .div(totalAmount)
82
- .minus(1)
83
- .times(tokenPrice === null || tokenPrice === void 0 ? void 0 : tokenPrice.price)
91
+ let shareB = tokenAccountA.amount
92
+ .div(tokenAccountA.amount.plus(tokenAccountB.amount))
93
+ .times(usdcTokenPrice.price)
84
94
  .toNumber();
95
+ if (marketAcc.outcome === structs_1.Outcome.Yes) {
96
+ shareA = 1;
97
+ shareB = 0;
98
+ }
99
+ if (marketAcc.outcome === structs_1.Outcome.No) {
100
+ shareA = 0;
101
+ shareB = 1;
102
+ }
103
+ if (marketAcc.outcome === structs_1.Outcome.Invalid) {
104
+ shareA = 0.5;
105
+ shareB = 0.5;
106
+ }
107
+ const liquidityNameA = mintA.pubkey.toString() === marketAcc.yesToken.toString()
108
+ ? 'Bet - YES'
109
+ : 'Bet - NO';
85
110
  const sourceA = {
86
111
  address: mintA.pubkey.toString(),
87
112
  decimals: mintA.decimals,
@@ -90,10 +115,22 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
90
115
  platformId: constants_1.platformId,
91
116
  timestamp: Date.now(),
92
117
  elementName: 'Hedgehog AMM',
93
- liquidityName: 'Bet - YES',
118
+ liquidityName: liquidityNameA,
94
119
  weight: 1,
95
- price: priceA,
120
+ price: shareA * usdcTokenPrice.price,
121
+ underlyings: [
122
+ {
123
+ address: constants_1.usdcMint,
124
+ amountPerLp: shareA,
125
+ decimals: constants_1.usdcDecimals,
126
+ networkId: portfolio_core_1.NetworkId.solana,
127
+ price: usdcTokenPrice.price,
128
+ },
129
+ ],
96
130
  };
131
+ const liquidityNameB = mintB.pubkey.toString() === marketAcc.yesToken.toString()
132
+ ? 'Bet - YES'
133
+ : 'Bet - NO';
97
134
  const sourceB = {
98
135
  address: mintB.pubkey.toString(),
99
136
  decimals: mintB.decimals,
@@ -102,9 +139,18 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
102
139
  platformId: constants_1.platformId,
103
140
  timestamp: Date.now(),
104
141
  elementName: 'Hedgehog AMM',
105
- liquidityName: 'Bet - YES',
142
+ liquidityName: liquidityNameB,
106
143
  weight: 1,
107
- price: priceB,
144
+ price: shareB * usdcTokenPrice.price,
145
+ underlyings: [
146
+ {
147
+ address: constants_1.usdcMint,
148
+ amountPerLp: shareB,
149
+ decimals: constants_1.usdcDecimals,
150
+ networkId: portfolio_core_1.NetworkId.solana,
151
+ price: usdcTokenPrice.price,
152
+ },
153
+ ],
108
154
  };
109
155
  sources.push(sourceA, sourceB);
110
156
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ammJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/hedgehog/ammJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAyE;AAGzE,2CAAiD;AACjD,iDAAsD;AACtD,+CAQ4B;AAC5B,uCAAmE;AAEnE,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,QAAQ,GAAG,MAAM,IAAA,iCAAwB,EAAC,MAAM,EAAE,oBAAU,EAAE,kBAAM,EAAE;QAC1E;YACE,QAAQ,EAAE,oBAAU,CAAC,QAAQ;SAC9B;KACF,CAAC,CAAC;IACH,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAClC,MAAM,kBAAkB,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC;IACjE,MAAM,iBAAiB,GAAG,CACxB,MAAM,IAAA,sCAA6B,EACjC,MAAM,EACN,yBAAe,EACf,kBAAkB,CACnB,CACF,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,CAA+B,CAAC;IAE1D,iBAAiB;IACjB,MAAM,qBAAqB,GAAG,iBAAiB;SAC5C,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC,CAAC,aAAa,CAAC,CAAC;SAC9C,IAAI,EAAE,CAAC;IACV,MAAM,aAAa,GAAG,MAAM,IAAA,sCAA6B,EACvD,MAAM,EACN,2BAAkB,EAClB,qBAAqB,CACtB,CAAC;IACF,MAAM,gBAAgB,GAA6C,IAAI,GAAG,EAAE,CAAC;IAC7E,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;QAC1B,IAAI,CAAC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jC,CAAC;IAED,MAAM,KAAK,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AACF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,MAAM;IACvB,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -4,3 +4,5 @@ export declare const platformId = "hedgehog";
4
4
  export declare const platform: Platform;
5
5
  export declare const ammPid: PublicKey;
6
6
  export declare const swapPid: PublicKey;
7
+ export declare const usdcMint = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";
8
+ export declare const usdcDecimals = 6;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.swapPid = exports.ammPid = exports.platform = exports.platformId = void 0;
3
+ exports.usdcDecimals = exports.usdcMint = exports.swapPid = exports.ammPid = exports.platform = exports.platformId = void 0;
4
4
  const web3_js_1 = require("@solana/web3.js");
5
5
  exports.platformId = 'hedgehog';
6
6
  exports.platform = {
@@ -13,4 +13,6 @@ exports.platform = {
13
13
  };
14
14
  exports.ammPid = new web3_js_1.PublicKey('Hr4whNgXr3yZsJvx3TVSwfsFgXuSEPB1xKmvgrtLhsrM');
15
15
  exports.swapPid = new web3_js_1.PublicKey('2ZznCMfx2XP43zaPw9R9wKnjXWiEeEexyhdBPv3UqDtD');
16
+ exports.usdcMint = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v';
17
+ exports.usdcDecimals = 6;
16
18
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/hedgehog/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,UAAU,CAAC;AACxB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,kBAAkB;IACxB,KAAK,EAAE,iDAAiD;IACxD,OAAO,EAAE,0BAA0B;IACnC,OAAO,EAAE,oCAAoC;IAC7C,qEAAqE;CACtE,CAAC;AACW,QAAA,MAAM,GAAG,IAAI,mBAAS,CACjC,8CAA8C,CAC/C,CAAC;AACW,QAAA,OAAO,GAAG,IAAI,mBAAS,CAClC,8CAA8C,CAC/C,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/hedgehog/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,UAAU,CAAC;AACxB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,kBAAkB;IACxB,KAAK,EAAE,iDAAiD;IACxD,OAAO,EAAE,0BAA0B;IACnC,OAAO,EAAE,oCAAoC;IAC7C,qEAAqE;CACtE,CAAC;AACW,QAAA,MAAM,GAAG,IAAI,mBAAS,CACjC,8CAA8C,CAC/C,CAAC;AACW,QAAA,OAAO,GAAG,IAAI,mBAAS,CAClC,8CAA8C,CAC/C,CAAC;AACW,QAAA,QAAQ,GAAG,8CAA8C,CAAC;AAC1D,QAAA,YAAY,GAAG,CAAC,CAAC"}
@@ -2,15 +2,21 @@
2
2
  import { BeetStruct } from '@metaplex-foundation/beet';
3
3
  import { PublicKey } from '@solana/web3.js';
4
4
  import BigNumber from 'bignumber.js';
5
+ export declare enum Outcome {
6
+ Open = 0,
7
+ Yes = 1,
8
+ No = 2,
9
+ Invalid = 3
10
+ }
5
11
  export type Swap = {
6
12
  buffer: Buffer;
13
+ market: PublicKey;
7
14
  underlyingSwap: PublicKey;
8
15
  creator: PublicKey;
9
16
  fees: Buffer;
10
17
  index: BigNumber;
11
18
  volume: BigNumber;
12
19
  nonce: number;
13
- padding: Buffer;
14
20
  };
15
21
  export declare const swapStruct: BeetStruct<Swap, Partial<Swap>>;
16
22
  export type TokenSwap = {
@@ -19,11 +25,11 @@ export type TokenSwap = {
19
25
  isInitialized: number;
20
26
  bumpSeed: number;
21
27
  tokenProgramId: PublicKey;
22
- mintA: PublicKey;
23
- mintB: PublicKey;
24
- tokenPool: PublicKey;
25
28
  tokenAccountA: PublicKey;
26
29
  tokenAccountB: PublicKey;
30
+ tokenPool: PublicKey;
31
+ mintA: PublicKey;
32
+ mintB: PublicKey;
27
33
  feeAccount: PublicKey;
28
34
  tradeFeeNumerator: BigNumber;
29
35
  tradeFeeDenominator: BigNumber;
@@ -38,3 +44,30 @@ export type TokenSwap = {
38
44
  swapGuardian: PublicKey;
39
45
  };
40
46
  export declare const tokenSwapStruct: BeetStruct<TokenSwap, Partial<TokenSwap>>;
47
+ export type StoredRatio = {
48
+ numer: BigNumber;
49
+ denom: BigNumber;
50
+ };
51
+ export declare const storedRatioStruct: BeetStruct<StoredRatio, Partial<StoredRatio>>;
52
+ export type Market = {
53
+ buffer: Buffer;
54
+ creator: PublicKey;
55
+ yesToken: PublicKey;
56
+ noToken: PublicKey;
57
+ quoteToken: PublicKey;
58
+ marketCollateral: PublicKey;
59
+ feeAccount: PublicKey;
60
+ nonce: number;
61
+ expiryTs: BigNumber;
62
+ creationTs: BigNumber;
63
+ outcomeTs: BigNumber;
64
+ resolutionDelay: number;
65
+ index: BigNumber;
66
+ info: Buffer;
67
+ fees: Buffer;
68
+ outcome: Outcome;
69
+ flags: number;
70
+ redeemOracleForInvalid: PublicKey;
71
+ redeemRatioForInvalid: StoredRatio;
72
+ };
73
+ export declare const marketStruct: BeetStruct<Market, Partial<Market>>;
@@ -1,30 +1,36 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.tokenSwapStruct = exports.swapStruct = void 0;
3
+ exports.marketStruct = exports.storedRatioStruct = exports.tokenSwapStruct = exports.swapStruct = exports.Outcome = void 0;
4
4
  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
+ var Outcome;
8
+ (function (Outcome) {
9
+ Outcome[Outcome["Open"] = 0] = "Open";
10
+ Outcome[Outcome["Yes"] = 1] = "Yes";
11
+ Outcome[Outcome["No"] = 2] = "No";
12
+ Outcome[Outcome["Invalid"] = 3] = "Invalid";
13
+ })(Outcome || (exports.Outcome = Outcome = {}));
7
14
  exports.swapStruct = new beet_1.BeetStruct([
8
15
  ['buffer', (0, solana_1.blob)(8)],
16
+ ['market', beet_solana_1.publicKey],
9
17
  ['underlyingSwap', beet_solana_1.publicKey],
10
18
  ['creator', beet_solana_1.publicKey],
11
19
  ['fees', (0, solana_1.blob)(12)],
12
20
  ['index', solana_1.u64],
13
21
  ['volume', solana_1.u128],
14
22
  ['nonce', beet_1.u8],
15
- ['padding', (0, solana_1.blob)(32)],
16
23
  ], (args) => args);
17
24
  exports.tokenSwapStruct = new beet_1.BeetStruct([
18
- ['buffer', (0, solana_1.blob)(5)],
19
25
  ['version', beet_1.u8],
20
26
  ['isInitialized', beet_1.u8],
21
27
  ['bumpSeed', beet_1.u8],
22
28
  ['tokenProgramId', beet_solana_1.publicKey],
23
- ['mintA', beet_solana_1.publicKey],
24
- ['mintB', beet_solana_1.publicKey],
25
- ['tokenPool', beet_solana_1.publicKey],
26
29
  ['tokenAccountA', beet_solana_1.publicKey],
27
30
  ['tokenAccountB', beet_solana_1.publicKey],
31
+ ['tokenPool', beet_solana_1.publicKey],
32
+ ['mintA', beet_solana_1.publicKey],
33
+ ['mintB', beet_solana_1.publicKey],
28
34
  ['feeAccount', beet_solana_1.publicKey],
29
35
  ['tradeFeeNumerator', solana_1.u64],
30
36
  ['tradeFeeDenominator', solana_1.u64],
@@ -38,4 +44,29 @@ exports.tokenSwapStruct = new beet_1.BeetStruct([
38
44
  ['curveParameters', (0, solana_1.blob)(32)],
39
45
  ['swapGuardian', beet_solana_1.publicKey],
40
46
  ], (args) => args);
47
+ exports.storedRatioStruct = new beet_1.BeetStruct([
48
+ ['numer', solana_1.u64],
49
+ ['denom', solana_1.u128],
50
+ ], (args) => args);
51
+ exports.marketStruct = new beet_1.BeetStruct([
52
+ ['buffer', (0, solana_1.blob)(8)],
53
+ ['creator', beet_solana_1.publicKey],
54
+ ['yesToken', beet_solana_1.publicKey],
55
+ ['noToken', beet_solana_1.publicKey],
56
+ ['quoteToken', beet_solana_1.publicKey],
57
+ ['marketCollateral', beet_solana_1.publicKey],
58
+ ['feeAccount', beet_solana_1.publicKey],
59
+ ['nonce', beet_1.u8],
60
+ ['expiryTs', solana_1.u64],
61
+ ['creationTs', solana_1.u64],
62
+ ['outcomeTs', solana_1.u64],
63
+ ['resolutionDelay', beet_1.u32],
64
+ ['index', solana_1.u64],
65
+ ['info', (0, solana_1.blob)(402)],
66
+ ['fees', (0, solana_1.blob)(4)],
67
+ ['outcome', beet_1.u8],
68
+ ['flags', beet_1.u8],
69
+ ['redeemOracleForInvalid', beet_solana_1.publicKey],
70
+ ['redeemRatioForInvalid', exports.storedRatioStruct],
71
+ ], (args) => args);
41
72
  //# sourceMappingURL=structs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/hedgehog/structs.ts"],"names":[],"mappings":";;;AAAA,oDAA2D;AAC3D,kEAA6D;AAG7D,+CAAqD;AAaxC,QAAA,UAAU,GAAG,IAAI,iBAAU,CACtC;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,gBAAgB,EAAE,uBAAS,CAAC;IAC7B,CAAC,SAAS,EAAE,uBAAS,CAAC;IACtB,CAAC,MAAM,EAAE,IAAA,aAAI,EAAC,EAAE,CAAC,CAAC;IAClB,CAAC,OAAO,EAAE,YAAG,CAAC;IACd,CAAC,QAAQ,EAAE,aAAI,CAAC;IAChB,CAAC,OAAO,EAAE,SAAE,CAAC;IACb,CAAC,SAAS,EAAE,IAAA,aAAI,EAAC,EAAE,CAAC,CAAC;CACtB,EACD,CAA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,CAAC;CAC7C,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAc,CACzB,CAAC"}
@@ -52,12 +52,12 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
52
52
  if (claimStatus)
53
53
  continue;
54
54
  const proof = proofs[j];
55
- const { decimals, mint } = eligibleAirdrops[j];
55
+ const { decimals, mint, claimStarts } = eligibleAirdrops[j];
56
56
  const tokenPrice = tokenPriceById.get(mint);
57
57
  const amount = new bignumber_js_1.default(proof.amount)
58
58
  .dividedBy(Math.pow(10, decimals))
59
59
  .toNumber();
60
- const asset = (0, tokenPriceToAssetToken_1.default)(mint, amount, portfolio_core_1.NetworkId.solana, tokenPrice, undefined, { isClaimable: true });
60
+ const asset = (0, tokenPriceToAssetToken_1.default)(mint, amount, portfolio_core_1.NetworkId.solana, tokenPrice, undefined, { lockedUntil: claimStarts });
61
61
  assets.push(asset);
62
62
  }
63
63
  if (assets.length === 0)
@@ -1 +1 @@
1
- {"version":3,"file":"allocationsFetcher.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/launchpad/allocationsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AACpC,kDAA6C;AAE7C,gEAAqC;AAGrC,oDAAyD;AAEzD,wCAA+C;AAC/C,wGAAgF;AAChF,uCAA8C;AAC9C,2CAA+E;AAC/E,kDAAsE;AAEtE,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,WAAW,GACf,MAAM,OAAO,CAAC,GAAG,CACf,wBAAY,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACxB,IAAI,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;YACnC,OAAO,eAAK;iBACT,GAAG,CAAC,GAAG,qBAAS,IAAI,IAAI,CAAC,IAAI,IAAI,KA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AAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"allocationsFetcher.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/launchpad/allocationsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AACpC,kDAA6C;AAE7C,gEAAqC;AAGrC,oDAAyD;AAEzD,wCAA+C;AAC/C,wGAAgF;AAChF,uCAA8C;AAC9C,2CAA+E;AAC/E,kDAAsE;AAEtE,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,WAAW,GACf,MAAM,OAAO,CAAC,GAAG,CACf,wBAAY,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACxB,IAAI,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;YACnC,OAAO,eAAK;iBACT,GAAG,CAAC,GAAG,qBAAS,IAAI,IAAI,CAAC,IAAI,IAAI,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iBAC5D,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;QACvB,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CACH,CAAC;IAEJ,MAAM,gBAAgB,GAAkB,EAAE,CAAC;IAC3C,MAAM,MAAM,GAAyB,EAAE,CAAC;IACxC,MAAM,aAAa,GAAgB,EAAE,CAAC;IACtC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC5C,MAAM,KAAK,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;QAC7B,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,IAAI;YAAE,SAAS;QAEpC,gBAAgB,CAAC,I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A,gCAAsB,EAClC,IAAI,EACJ,MAAM,EACN,0BAAS,CAAC,MAAM,EAChB,UAAU,EACV,SAAS,EACT,EAAE,WAAW,EAAE,WAAW,EAAE,CAC7B,CAAC;QAEF,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEnC,OAAO;QACL;YACE,IAAI,EAAE,qCAAoB,CAAC,QAAQ;YACnC,KAAK,EAAE,SAAS;YAChB,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAV,sBAAU;YACV,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE;gBACJ,MAAM;aACP;YACD,KAAK,EAAE,IAAA,+BAAc,EAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SAC1D;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,aAAa;IAC9B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -10,6 +10,7 @@ export declare const merkleApi = "https://worker.jup.ag/jup-claim-proof";
10
10
  export type AirdropInfo = {
11
11
  mint: string;
12
12
  decimals: number;
13
+ claimStarts?: number;
13
14
  claimUntilTs: number;
14
15
  distributorProgram: string;
15
16
  };
@@ -40,5 +40,12 @@ exports.airdropsInfo = [
40
40
  claimUntilTs: 1714435200000,
41
41
  distributorProgram: 'DiSLRwcSFvtwvMWSs7ubBMvYRaYNYupa76ZSuYLe6D7j',
42
42
  },
43
+ {
44
+ mint: 'UPTx1d24aBWuRgwxVnFmX4gNraj3QGFzL3QqBgxtWQG',
45
+ decimals: 9,
46
+ claimUntilTs: 1719878400000,
47
+ claimStarts: 1717077600000,
48
+ distributorProgram: 'DiSLRwcSFvtwvMWSs7ubBMvYRaYNYupa76ZSuYLe6D7j',
49
+ },
43
50
  ];
44
51
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/launchpad/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,mBAAmB,CAAC;AACjC,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,mBAAmB;IACzB,KAAK,EAAE,+CAA+C;IACtD,OAAO,EAAE,qBAAqB;IAC9B,OAAO,EAAE,qCAAqC;CAC/C,CAAC;AAEW,QAAA,aAAa,GAAG,IAAI,mBAAS,CACxC,6CAA6C,CAC9C,CAAC;AACW,QAAA,YAAY,GAAG,IAAI,mBAAS,CACvC,8CAA8C,CAC/C,CAAC;AACW,QAAA,OAAO,GAAG,6CAA6C,CAAC;AACxD,QAAA,WAAW,GAAG,CAAC,CAAC;AAEhB,QAAA,SAAS,GAAG,uCAAuC,CAAC;AAQpD,QAAA,YAAY,GAAkB;IACzC;QACE,IAAI,EAAE,6CAA6C;QACnD,QAAQ,EAAE,CAAC;QACX,YAAY,EAAE,aAAa;QAC3B,kBAAkB,EAAE,6CAA6C;KAClE;IACD;QACE,IAAI,EAAE,6CAA6C;QACnD,QAAQ,EAAE,CAAC;QACX,YAAY,EAAE,aAAa;QAC3B,kBAAkB,EAAE,8CAA8C;KACnE;IACD;QACE,IAAI,EAAE,6CAA6C;QACnD,QAAQ,EAAE,CAAC;QACX,YAAY,EAAE,aAAa;QAC3B,kBAAkB,EAAE,8CAA8C;KACnE;IACD;QACE,IAAI,EAAE,6CAA6C;QACnD,QAAQ,EAAE,CAAC;QACX,YAAY,EAAE,aAAa;QAC3B,kBAAkB,EAAE,8CAA8C;KACnE;CACF,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/launchpad/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,mBAAmB,CAAC;AACjC,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,mBAAmB;IACzB,KAAK,EAAE,+CAA+C;IACtD,OAAO,EAAE,qBAAqB;IAC9B,OAAO,EAAE,qCAAqC;CAC/C,CAAC;AAEW,QAAA,aAAa,GAAG,IAAI,mBAAS,CACxC,6CAA6C,CAC9C,CAAC;AACW,QAAA,YAAY,GAAG,IAAI,mBAAS,CACvC,8CAA8C,CAC/C,CAAC;AACW,QAAA,OAAO,GAAG,6CAA6C,CAAC;AACxD,QAAA,WAAW,GAAG,CAAC,CAAC;AAEhB,QAAA,SAAS,GAAG,uCAAuC,CAAC;AASpD,QAAA,YAAY,GAAkB;IACzC;QACE,IAAI,EAAE,6CAA6C;QACnD,QAAQ,EAAE,CAAC;QACX,YAAY,EAAE,aAAa;QAC3B,kBAAkB,EAAE,6CAA6C;KAClE;IACD;QACE,IAAI,EAAE,6CAA6C;QACnD,QAAQ,EAAE,CAAC;QACX,YAAY,EAAE,aAAa;QAC3B,kBAAkB,EAAE,8CAA8C;KACnE;IACD;QACE,IAAI,EAAE,6CAA6C;QACnD,QAAQ,EAAE,CAAC;QACX,YAAY,EAAE,aAAa;QAC3B,kBAAkB,EAAE,8CAA8C;KACnE;IACD;QACE,IAAI,EAAE,6CAA6C;QACnD,QAAQ,EAAE,CAAC;QACX,YAAY,EAAE,aAAa;QAC3B,kBAAkB,EAAE,8CAA8C;KACnE;IACD;QACE,IAAI,EAAE,6CAA6C;QACnD,QAAQ,EAAE,CAAC;QACX,YAAY,EAAE,aAAa;QAC3B,WAAW,EAAE,aAAa;QAC1B,kBAAkB,EAAE,8CAA8C;KACnE;CACF,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Fetcher } from '../../Fetcher';
2
+ declare const fetcher: Fetcher;
3
+ export default fetcher;
@@ -0,0 +1,179 @@
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 getOwnedObjects_1 = require("../../utils/sui/getOwnedObjects");
19
+ const clients_1 = require("../../utils/clients");
20
+ const multiGetObjects_1 = require("../../utils/sui/multiGetObjects");
21
+ const helper_1 = require("./helper");
22
+ const tokenAmountFromLiquidity_1 = require("../../utils/clmm/tokenAmountFromLiquidity");
23
+ const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
24
+ const multiDynamicFieldObjects_1 = require("../../utils/sui/multiDynamicFieldObjects");
25
+ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
26
+ var _a;
27
+ const client = (0, clients_1.getClientSui)();
28
+ const vaultNftPositionObjects = yield (0, getOwnedObjects_1.getOwnedObjects)(client, owner, {
29
+ filter: {
30
+ Package: constants_1.vaultPackageId,
31
+ },
32
+ options: {
33
+ showContent: true,
34
+ showType: true,
35
+ },
36
+ });
37
+ const vaultsStrat = new Set();
38
+ const vaultsInfoByStrat = new Map();
39
+ vaultNftPositionObjects.forEach((pos) => {
40
+ var _a;
41
+ if ((_a = pos.data) === null || _a === void 0 ? void 0 : _a.content) {
42
+ vaultsStrat.add(pos.data.content.fields.strategy_id);
43
+ const vaultsInfo = vaultsInfoByStrat.get(pos.data.content.fields.strategy_id);
44
+ if (vaultsInfo) {
45
+ vaultsInfo.push(pos.data.content.fields.id.id);
46
+ }
47
+ else {
48
+ vaultsInfoByStrat.set(pos.data.content.fields.strategy_id, [
49
+ pos.data.content.fields.id.id,
50
+ ]);
51
+ }
52
+ }
53
+ });
54
+ const vaultStratObjects = yield (0, multiGetObjects_1.multiGetObjects)(client, Array.from(vaultsStrat), {
55
+ showContent: true,
56
+ });
57
+ const vaultStratById = new Map();
58
+ const vaultsStratIds = [];
59
+ const poolIds = [];
60
+ vaultStratObjects.forEach((vault) => {
61
+ var _a;
62
+ if ((_a = vault.data) === null || _a === void 0 ? void 0 : _a.content) {
63
+ const vaultsInfo = vaultsInfoByStrat.get(vault.data.objectId);
64
+ if (vaultsInfo) {
65
+ vaultsInfoByStrat.set(vault.data.content.fields.vaults.fields.id.id, vaultsInfo);
66
+ vaultsInfoByStrat.delete(vault.data.objectId);
67
+ }
68
+ vaultStratById.set(vault.data.objectId, vault.data.content.fields);
69
+ vaultsStratIds.push(vault.data.content.fields.vaults.fields.id.id);
70
+ poolIds.push(vault.data.content.fields.clmm_pool_id);
71
+ }
72
+ });
73
+ const pools = yield cache.getItems(poolIds, {
74
+ prefix: constants_1.clmmPoolsPrefix,
75
+ networkId: portfolio_core_1.NetworkId.sui,
76
+ });
77
+ const poolsById = new Map();
78
+ pools.forEach((pool) => {
79
+ if (pool) {
80
+ poolsById.set(pool.objectId, pool);
81
+ }
82
+ });
83
+ const promises = [];
84
+ for (const strat of vaultsInfoByStrat.keys()) {
85
+ const vaultsInfo = vaultsInfoByStrat.get(strat);
86
+ if (!vaultsInfo)
87
+ continue;
88
+ promises.push((0, multiDynamicFieldObjects_1.multiDynamicFieldObjects)(client, {
89
+ parentId: strat,
90
+ type: '0x2::object::ID',
91
+ values: vaultsInfo,
92
+ }));
93
+ }
94
+ const vaultsInfoObj = (yield Promise.all(promises)).flat();
95
+ const vaultInfoById = new Map();
96
+ const coins = new Set();
97
+ vaultsInfoObj.forEach((vault) => {
98
+ var _a;
99
+ if ((_a = vault.data) === null || _a === void 0 ? void 0 : _a.content) {
100
+ vaultInfoById.set(vault.data.objectId, vault.data.content.fields);
101
+ coins.add((0, portfolio_core_1.formatMoveTokenAddress)(vault.data.content.fields.value.fields.value.fields.coin_a_type_name
102
+ .fields.name));
103
+ coins.add((0, portfolio_core_1.formatMoveTokenAddress)(vault.data.content.fields.value.fields.value.fields.coin_b_type_name
104
+ .fields.name));
105
+ }
106
+ });
107
+ const tokenPriceById = yield cache.getTokenPricesAsMap(Array.from(coins), portfolio_core_1.NetworkId.sui);
108
+ const clmmPositions = vaultsInfoObj
109
+ .map((vault) => {
110
+ var _a, _b;
111
+ return ((_b = (_a = vault.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields.value.fields.value.fields.base_clmm_position_id) || [];
112
+ })
113
+ .flat();
114
+ const clmmPositionsObjects = yield (0, multiGetObjects_1.multiGetObjects)(client, clmmPositions, {
115
+ showContent: true,
116
+ });
117
+ const clmmPositionById = new Map();
118
+ clmmPositionsObjects.forEach((vault) => {
119
+ var _a, _b;
120
+ if (!((_a = vault.data) === null || _a === void 0 ? void 0 : _a.content))
121
+ return;
122
+ clmmPositionById.set((_b = vault.data) === null || _b === void 0 ? void 0 : _b.objectId, vault.data.content.fields);
123
+ });
124
+ const assets = [];
125
+ let totalLiquidityValue = 0;
126
+ for (const vaultInfoObject of vaultsInfoObj) {
127
+ if (!((_a = vaultInfoObject.data) === null || _a === void 0 ? void 0 : _a.content))
128
+ continue;
129
+ const vaultInfo = vaultInfoObject.data.content.fields.value.fields.value.fields;
130
+ const pool = vaultStratById.get(vaultInfo.strategy_id);
131
+ const clmmPosition = clmmPositionById.get(vaultInfo.base_clmm_position_id);
132
+ if (!pool || !clmmPosition)
133
+ continue;
134
+ const { tokenAmountA, tokenAmountB } = (0, tokenAmountFromLiquidity_1.getTokenAmountsFromLiquidity)(new bignumber_js_1.default(clmmPosition.liquidity), (0, helper_1.bitsToNumber)(vaultInfo.base_last_tick_index.fields.bits), (0, helper_1.bitsToNumber)(clmmPosition.tick_lower_index.fields.bits), (0, helper_1.bitsToNumber)(clmmPosition.tick_upper_index.fields.bits), false);
135
+ const coinA = (0, portfolio_core_1.formatMoveTokenAddress)(vaultInfo.coin_a_type_name.fields.name);
136
+ const coinB = (0, portfolio_core_1.formatMoveTokenAddress)(vaultInfo.coin_b_type_name.fields.name);
137
+ const tokenPriceA = tokenPriceById.get(coinA);
138
+ const tokenPriceB = tokenPriceById.get(coinB);
139
+ if (!tokenPriceA || !tokenPriceB)
140
+ continue;
141
+ const assetTokenA = (0, tokenPriceToAssetToken_1.default)(coinA, tokenAmountA.dividedBy(Math.pow(10, tokenPriceA.decimals)).toNumber(), portfolio_core_1.NetworkId.sui, tokenPriceA);
142
+ const assetTokenB = (0, tokenPriceToAssetToken_1.default)(coinB, tokenAmountB.dividedBy(Math.pow(10, tokenPriceB.decimals)).toNumber(), portfolio_core_1.NetworkId.sui, tokenPriceB);
143
+ if (!assetTokenA ||
144
+ !assetTokenB ||
145
+ assetTokenA.value === null ||
146
+ assetTokenB.value === null)
147
+ continue;
148
+ const value = assetTokenA.value + assetTokenB.value;
149
+ assets.push({
150
+ assets: [assetTokenA, assetTokenB],
151
+ assetsValue: value,
152
+ rewardAssets: [],
153
+ rewardAssetsValue: 0,
154
+ value,
155
+ yields: [],
156
+ });
157
+ totalLiquidityValue += value;
158
+ }
159
+ return [
160
+ {
161
+ type: portfolio_core_1.PortfolioElementType.liquidity,
162
+ networkId: portfolio_core_1.NetworkId.sui,
163
+ platformId: constants_1.platformId,
164
+ label: 'LiquidityPool',
165
+ name: 'Vault',
166
+ value: totalLiquidityValue,
167
+ data: {
168
+ liquidities: assets,
169
+ },
170
+ },
171
+ ];
172
+ });
173
+ const fetcher = {
174
+ id: `${constants_1.platformId}-clmm-vault`,
175
+ networkId: portfolio_core_1.NetworkId.sui,
176
+ executor,
177
+ };
178
+ exports.default = fetcher;
179
+ //# sourceMappingURL=clmmVaultFetcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clmmVaultFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/turbos/clmmVaultFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AACpC,gEAAqC;AAGrC,2CAA0E;AAC1E,qEAAkE;AAClE,iDAAmD;AAQnD,qEAAkE;AAClE,qCAAwC;AACxC,wFAAyF;AACzF,qGAA6E;AAC7E,uFAAoF;AAEpF,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,MAAM,uBAAuB,GAAG,MAAM,IAAA,iCAAe,EACnD,MAAM,EACN,KAAK,EACL;QACE,MAAM,EAAE;YACN,OAAO,EAAE,0BAAc;SACxB;QACD,OAAO,EAAE;YACP,WAAW,EAAE,IAAI;YACjB,QAAQ,EAAE,IAAI;SACf;KACF,CACF,CAAC;IAEF,MAAM,WAAW,GAAgB,IAAI,GAAG,EAAE,CAAC;IAC3C,MAAM,iBAAiB,GAA0B,IAAI,GAAG,EAAE,CAAC;IAC3D,uBAAuB,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;;QACtC,IAAI,MAAA,GAAG,CAAC,IAAI,0CAAE,OAAO,EAAE,CAAC;YACtB,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;YACrD,MAAM,UAAU,GAAG,iBAAiB,CAAC,GAAG,CACtC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,CACpC,CAAC;YACF,IAAI,UAAU,EAAE,CAAC;gBACf,UAAU,CAAC,IAA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AAE,0BAAS,CAAC,GAAG;YACxB,UAAU,EAAV,sBAAU;YACV,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,mBAAmB;YAC1B,IAAI,EAAE;gBACJ,WAAW,EAAE,MAAM;aACpB;SACF;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,aAAa;IAC9B,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -81,7 +81,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
81
81
  const pool = poolsById.get(nftPosition.pool_id);
82
82
  if (!pool)
83
83
  continue;
84
- const { tokenAmountA, tokenAmountB } = (0, tokenAmountFromLiquidity_1.getTokenAmountsFromLiquidity)(new bignumber_js_1.default(clmmPosition.liquidity), (0, helper_1.bitsToNumber)(pool.tick_current_index), (0, helper_1.bitsToNumber)(clmmPosition.tick_lower_index), (0, helper_1.bitsToNumber)(clmmPosition.tick_upper_index), false);
84
+ const { tokenAmountA, tokenAmountB } = (0, tokenAmountFromLiquidity_1.getTokenAmountsFromLiquidity)(new bignumber_js_1.default(clmmPosition.liquidity), (0, helper_1.bitsToNumber)(pool.tick_current_index.fields.bits), (0, helper_1.bitsToNumber)(clmmPosition.tick_lower_index.fields.bits), (0, helper_1.bitsToNumber)(clmmPosition.tick_upper_index.fields.bits), false);
85
85
  // TODO : améliorer le problème du 0x000002::sui::SUI + manque de 0x
86
86
  const coinA = (0, helper_1.formatForNative)(`0x${nftPosition.coin_type_a.fields.name}`);
87
87
  const coinB = (0, helper_1.formatForNative)(`0x${nftPosition.coin_type_b.fields.name}`);
@@ -1 +1 @@
1
- {"version":3,"file":"clmmsPositionsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/turbos/clmmsPositionsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;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GAAG,EACb,WAAW,CACZ,CAAC;QACF,IACE,CAAC,WAAW;YACZ,CAAC,WAAW;YACZ,WAAW,CAAC,KAAK,KAAK,IAAI;YAC1B,WAAW,CAAC,KAAK,KAAK,IAAI;YAE1B,SAAS;QACX,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC;QACpD,MAAM,CAAC,IAAI,CAAC;YACV,MAAM,EAAE,CAAC,WAAW,EAAE,WAAW,CAAC;YAClC,WAAW,EAAE,KAAK;YAClB,YAAY,EAAE,EAAE;YAChB,iBAAiB,EAAE,CAAC;YACpB,KAAK;YACL,MAAM,EAAE,EAAE;SACX,CAAC,CAAC;QACH,mBAAmB,IAAI,KAAK,CAAC;IAC/B,CAAC;IACD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEnC,OAAO;QACL;YACE,IAAI,EAAE,qCAAoB,CAAC,SAAS;YACpC,SAAS,EAAE,0BAAS,CAAC,GAAG;YACxB,UAAU,EAAV,sBAAU;YACV,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,CAAC,cAAc,CAAC;YACtB,KAAK,EAAE,mBAAmB;YAC1B,IAAI,EAAE;gBACJ,WAAW,EAAE,MAAM;aACpB;SACF;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,kBAAkB;IACnC,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"clmmsPositionsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/turbos/clmmsPositionsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AACpC,gEAAqC;AAGrC,2CAKqB;AACrB,iDAAmD;AAEnD,wFAAyF;AACzF,qGAA6E;AAC7E,qCAAyD;AACzD,qEAAkE;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Z,CAAC,WAAW;YACZ,WAAW,CAAC,KAAK,KAAK,IAAI;YAC1B,WAAW,CAAC,KAAK,KAAK,IAAI;YAE1B,SAAS;QACX,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC;QACpD,MAAM,CAAC,IAAI,CAAC;YACV,MAAM,EAAE,CAAC,WAAW,EAAE,WAAW,CAAC;YAClC,WAAW,EAAE,KAAK;YAClB,YAAY,EAAE,EAAE;YAChB,iBAAiB,EAAE,CAAC;YACpB,KAAK;YACL,MAAM,EAAE,EAAE;SACX,CAAC,CAAC;QACH,mBAAmB,IAAI,KAAK,CAAC;IAC/B,CAAC;IACD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEnC,OAAO;QACL;YACE,IAAI,EAAE,qCAAoB,CAAC,SAAS;YACpC,SAAS,EAAE,0BAAS,CAAC,GAAG;YACxB,UAAU,EAAV,sBAAU;YACV,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,CAAC,cAAc,CAAC;YACtB,KAAK,EAAE,mBAAmB;YAC1B,IAAI,EAAE;gBACJ,WAAW,EAAE,MAAM;aACpB;SACF;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,kBAAkB;IACnC,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -5,3 +5,4 @@ export declare const clmmPoolsPrefix = "turbos-clmmPools";
5
5
  export declare const poolTableId = "0x08984ed8705f44b6403705dc248896e56ab7961447820ae29be935ce0d32198b";
6
6
  export declare const packageIdOriginal = "0x91bfbc386a41afcfd9b2533058d7e915a1d3829089cc268ff4333d54d6339ca1";
7
7
  export declare const clmmNftType = "0x91bfbc386a41afcfd9b2533058d7e915a1d3829089cc268ff4333d54d6339ca1::position_nft::TurbosPositionNFT";
8
+ export declare const vaultPackageId = "0x0a0d6e83196f523bb0623187d789ce602d1f63b3e7baa02b580df7ff0ccd17e0";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.clmmNftType = exports.packageIdOriginal = exports.poolTableId = exports.clmmPoolsPrefix = exports.platform = exports.platformId = void 0;
3
+ exports.vaultPackageId = exports.clmmNftType = exports.packageIdOriginal = exports.poolTableId = exports.clmmPoolsPrefix = exports.platform = exports.platformId = void 0;
4
4
  exports.platformId = 'turbos';
5
5
  exports.platform = {
6
6
  id: exports.platformId,
@@ -13,4 +13,5 @@ exports.clmmPoolsPrefix = `${exports.platformId}-clmmPools`;
13
13
  exports.poolTableId = '0x08984ed8705f44b6403705dc248896e56ab7961447820ae29be935ce0d32198b';
14
14
  exports.packageIdOriginal = '0x91bfbc386a41afcfd9b2533058d7e915a1d3829089cc268ff4333d54d6339ca1';
15
15
  exports.clmmNftType = `${exports.packageIdOriginal}::position_nft::TurbosPositionNFT`;
16
+ exports.vaultPackageId = '0x0a0d6e83196f523bb0623187d789ce602d1f63b3e7baa02b580df7ff0ccd17e0';
16
17
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/turbos/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,QAAQ,CAAC;AACtB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,8CAA8C;IACrD,WAAW,EAAE,QAAQ;IACrB,OAAO,EAAE,6BAA6B;CACvC,CAAC;AACW,QAAA,eAAe,GAAG,GAAG,kBAAU,YAAY,CAAC;AAE5C,QAAA,WAAW,GACtB,oEAAoE,CAAC;AAE1D,QAAA,iBAAiB,GAC5B,oEAAoE,CAAC;AAE1D,QAAA,WAAW,GAAG,GAAG,yBAAiB,mCAAmC,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/turbos/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,QAAQ,CAAC;AACtB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,8CAA8C;IACrD,WAAW,EAAE,QAAQ;IACrB,OAAO,EAAE,6BAA6B;CACvC,CAAC;AACW,QAAA,eAAe,GAAG,GAAG,kBAAU,YAAY,CAAC;AAE5C,QAAA,WAAW,GACtB,oEAAoE,CAAC;AAE1D,QAAA,iBAAiB,GAC5B,oEAAoE,CAAC;AAE1D,QAAA,WAAW,GAAG,GAAG,yBAAiB,mCAAmC,CAAC;AAEtE,QAAA,cAAc,GACzB,oEAAoE,CAAC"}
@@ -1,8 +1,8 @@
1
- import { Bits, Pool, PoolFields, Types } from './types';
1
+ import { Pool, PoolFields, Types } from './types';
2
2
  import { ObjectResponse } from '../../utils/sui/types';
3
3
  export declare function parsePoolType(type: string, length: 2): [string, string];
4
4
  export declare function parsePoolType(type: string, length: 3): Types;
5
5
  export declare function parsePoolType(type: string): string[];
6
6
  export declare function parsePool(pool: ObjectResponse<PoolFields>): Pool;
7
7
  export declare function formatForNative(coin: string): string;
8
- export declare function bitsToNumber(bits: Bits): number;
8
+ export declare function bitsToNumber(bits: number): number;
@@ -30,7 +30,7 @@ function formatForNative(coin) {
30
30
  }
31
31
  exports.formatForNative = formatForNative;
32
32
  function bitsToNumber(bits) {
33
- return (0, helpers_1.asIntN)(BigInt(bits.fields.bits));
33
+ return (0, helpers_1.asIntN)(BigInt(bits));
34
34
  }
35
35
  exports.bitsToNumber = bitsToNumber;
36
36
  //# sourceMappingURL=helper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helper.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/turbos/helper.ts"],"names":[],"mappings":";;;AACA,8CAA0C;AAM1C,SAAgB,aAAa,C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AFD,oCAEC"}
@@ -6,8 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.fetchers = exports.jobs = exports.platforms = void 0;
7
7
  const poolsJob_1 = __importDefault(require("./poolsJob"));
8
8
  const clmmsPositionsFetcher_1 = __importDefault(require("./clmmsPositionsFetcher"));
9
+ const clmmVaultFetcher_1 = __importDefault(require("./clmmVaultFetcher"));
9
10
  const constants_1 = require("./constants");
10
11
  exports.platforms = [constants_1.platform];
11
12
  exports.jobs = [poolsJob_1.default];
12
- exports.fetchers = [clmmsPositionsFetcher_1.default];
13
+ exports.fetchers = [clmmsPositionsFetcher_1.default, clmmVaultFetcher_1.default];
13
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/turbos/index.ts"],"names":[],"mappings":";;;;;;AAGA,0DAAkC;AAClC,oFAA0D;AAC1D,2CAAuC;AAE1B,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,kBAAQ,CAAC,CAAC;AACzB,QAAA,QAAQ,GAAc,CAAC,+BAAmB,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/turbos/index.ts"],"names":[],"mappings":";;;;;;AAGA,0DAAkC;AAClC,oFAA0D;AAC1D,0EAAkD;AAClD,2CAAuC;AAE1B,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,kBAAQ,CAAC,CAAC;AACzB,QAAA,QAAQ,GAAc,CAAC,+BAAmB,EAAE,0BAAgB,CAAC,CAAC"}
@@ -101,3 +101,136 @@ export type PositionTick = {
101
101
  feeGrowthOutsideB: BigNumber;
102
102
  rewardGrowthsOutside: [BigNumber, BigNumber, BigNumber];
103
103
  };
104
+ export type VaultPositionNFT = {
105
+ coin_a_type_name: CoinTypeName;
106
+ coin_b_type_name: CoinTypeName;
107
+ description: string;
108
+ id: ID;
109
+ index: string;
110
+ name: string;
111
+ strategy_id: string;
112
+ url: string;
113
+ };
114
+ export type CoinTypeName = {
115
+ fields: Fields;
116
+ type: string;
117
+ };
118
+ export type Fields = {
119
+ name: string;
120
+ };
121
+ export type ID = {
122
+ id: string;
123
+ };
124
+ export type VaultStrategy = {
125
+ accounts: Accounts;
126
+ base_tick_step_minimum: number;
127
+ clmm_pool_id: string;
128
+ coin_a_type_name: TypeName;
129
+ coin_b_type_name: TypeName;
130
+ default_base_rebalance_percentage: number;
131
+ default_limit_rebalance_percentage: number;
132
+ effective_tick_lower: EffectiveTick;
133
+ effective_tick_upper: EffectiveTick;
134
+ fee_type_name: TypeName;
135
+ id: ID;
136
+ image_url: string;
137
+ limit_tick_step_minimum: number;
138
+ management_fee_rate: string;
139
+ performance_fee_rate: string;
140
+ protocol_fees: Accounts;
141
+ rewarders: any[];
142
+ status: number;
143
+ tick_spacing: number;
144
+ total_share: string;
145
+ vault_index: string;
146
+ vaults: Vaults;
147
+ };
148
+ export type Accounts = {
149
+ fields: AccountsFields;
150
+ type: string;
151
+ };
152
+ export type AccountsFields = {
153
+ id: ID;
154
+ size: string;
155
+ };
156
+ export type TypeName = {
157
+ fields: CoinATypeNameFields;
158
+ type: string;
159
+ };
160
+ export type CoinATypeNameFields = {
161
+ name: string;
162
+ };
163
+ export type EffectiveTick = {
164
+ fields: EffectiveTickLowerFields;
165
+ type: string;
166
+ };
167
+ export type EffectiveTickLowerFields = {
168
+ bits: number;
169
+ };
170
+ export type Vaults = {
171
+ fields: VaultsFields;
172
+ type: string;
173
+ };
174
+ export type VaultsFields = {
175
+ head: string;
176
+ id: ID;
177
+ size: string;
178
+ tail: string;
179
+ };
180
+ export type VaultInfo = {
181
+ id: ID;
182
+ name: string;
183
+ value: UsersInfo;
184
+ };
185
+ export type UsersInfo = {
186
+ fields: UsersInfoPagination;
187
+ type: string;
188
+ };
189
+ export type UsersInfoPagination = {
190
+ next: null;
191
+ prev: string;
192
+ value: UserInfo;
193
+ };
194
+ export type UserInfo = {
195
+ fields: UserPositionFields;
196
+ type: string;
197
+ };
198
+ export type UserPositionFields = {
199
+ base_clmm_position_id: string;
200
+ base_last_tick_index: Index;
201
+ base_liquidity: string;
202
+ base_lower_index: Index;
203
+ base_rebalance_threshold: number;
204
+ base_tick_step: number;
205
+ base_upper_index: Index;
206
+ coin_a_type_name: CoinTypeName;
207
+ coin_b_type_name: CoinTypeName;
208
+ limit_clmm_position_id: string;
209
+ limit_last_tick_index: Index;
210
+ limit_liquidity: string;
211
+ limit_lower_index: Index;
212
+ limit_rebalance_threshold: number;
213
+ limit_tick_step: number;
214
+ limit_upper_index: Index;
215
+ management_fee_rate: null;
216
+ performance_fee_rate: null;
217
+ rewards: Rewards;
218
+ share: string;
219
+ sqrt_price: string;
220
+ strategy_id: string;
221
+ vault_id: string;
222
+ };
223
+ export type Index = {
224
+ fields: BaseLastTickIndexFields;
225
+ type: string;
226
+ };
227
+ export type BaseLastTickIndexFields = {
228
+ bits: number;
229
+ };
230
+ export type Rewards = {
231
+ fields: RewardsFields;
232
+ type: string;
233
+ };
234
+ export type RewardsFields = {
235
+ contents: any[];
236
+ };