@strkfarm/sdk 1.0.46 → 1.0.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -51477,7 +51477,9 @@ var strkfarm_risk_engine = (() => {
51477
51477
  console.log(
51478
51478
  `EkuboCLVault: getCurrentPrice: blockIdentifier: ${blockIdentifier}, sqrtRatio: ${sqrtRatio}, ${priceInfo.sqrt_ratio.toString()}`
51479
51479
  );
51480
- const price = sqrtRatio * sqrtRatio;
51480
+ const token0Info = await Global.getTokenInfoFromAddr(poolKey.token0);
51481
+ const token1Info = await Global.getTokenInfoFromAddr(poolKey.token1);
51482
+ const price = sqrtRatio * sqrtRatio * 10 ** token0Info.decimals / 10 ** token1Info.decimals;
51481
51483
  const tick = _EkuboCLVault.priceToTick(
51482
51484
  price,
51483
51485
  true,
@@ -15271,7 +15271,9 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
15271
15271
  console.log(
15272
15272
  `EkuboCLVault: getCurrentPrice: blockIdentifier: ${blockIdentifier}, sqrtRatio: ${sqrtRatio}, ${priceInfo.sqrt_ratio.toString()}`
15273
15273
  );
15274
- const price = sqrtRatio * sqrtRatio;
15274
+ const token0Info = await Global.getTokenInfoFromAddr(poolKey.token0);
15275
+ const token1Info = await Global.getTokenInfoFromAddr(poolKey.token1);
15276
+ const price = sqrtRatio * sqrtRatio * 10 ** token0Info.decimals / 10 ** token1Info.decimals;
15275
15277
  const tick = _EkuboCLVault.priceToTick(
15276
15278
  price,
15277
15279
  true,
package/dist/index.js CHANGED
@@ -15385,7 +15385,9 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
15385
15385
  console.log(
15386
15386
  `EkuboCLVault: getCurrentPrice: blockIdentifier: ${blockIdentifier}, sqrtRatio: ${sqrtRatio}, ${priceInfo.sqrt_ratio.toString()}`
15387
15387
  );
15388
- const price = sqrtRatio * sqrtRatio;
15388
+ const token0Info = await Global.getTokenInfoFromAddr(poolKey.token0);
15389
+ const token1Info = await Global.getTokenInfoFromAddr(poolKey.token1);
15390
+ const price = sqrtRatio * sqrtRatio * 10 ** token0Info.decimals / 10 ** token1Info.decimals;
15389
15391
  const tick = _EkuboCLVault.priceToTick(
15390
15392
  price,
15391
15393
  true,
package/dist/index.mjs CHANGED
@@ -15320,7 +15320,9 @@ var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
15320
15320
  console.log(
15321
15321
  `EkuboCLVault: getCurrentPrice: blockIdentifier: ${blockIdentifier}, sqrtRatio: ${sqrtRatio}, ${priceInfo.sqrt_ratio.toString()}`
15322
15322
  );
15323
- const price = sqrtRatio * sqrtRatio;
15323
+ const token0Info = await Global.getTokenInfoFromAddr(poolKey.token0);
15324
+ const token1Info = await Global.getTokenInfoFromAddr(poolKey.token1);
15325
+ const price = sqrtRatio * sqrtRatio * 10 ** token0Info.decimals / 10 ** token1Info.decimals;
15324
15326
  const tick = _EkuboCLVault.priceToTick(
15325
15327
  price,
15326
15328
  true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strkfarm/sdk",
3
- "version": "1.0.46",
3
+ "version": "1.0.47",
4
4
  "description": "STRKFarm TS SDK (Meant for our internal use, but feel free to use it)",
5
5
  "typings": "dist/index.d.ts",
6
6
  "types": "dist/index.d.ts",
@@ -589,7 +589,9 @@ export class EkuboCLVault extends BaseStrategy<
589
589
  console.log(
590
590
  `EkuboCLVault: getCurrentPrice: blockIdentifier: ${blockIdentifier}, sqrtRatio: ${sqrtRatio}, ${priceInfo.sqrt_ratio.toString()}`
591
591
  );
592
- const price = sqrtRatio * sqrtRatio;
592
+ const token0Info = await Global.getTokenInfoFromAddr(poolKey.token0);
593
+ const token1Info = await Global.getTokenInfoFromAddr(poolKey.token1);
594
+ const price = sqrtRatio * sqrtRatio * (10 ** token0Info.decimals) / ( 10 ** token1Info.decimals);
593
595
  const tick = EkuboCLVault.priceToTick(
594
596
  price,
595
597
  true,
@@ -1740,5 +1742,3 @@ export const EkuboCLVaultStrategies: IStrategyMetadata<CLVaultStrategySettings>[
1740
1742
  // },
1741
1743
  ];
1742
1744
 
1743
-
1744
- // 0x65b6a3ae00e7343ca8b2463d81401716c6581c18336206f31085c06a7d63936