@t2000/sdk 0.17.4 → 0.17.5

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.
package/dist/index.cjs CHANGED
@@ -3366,6 +3366,10 @@ var AutoInvestManager = class {
3366
3366
  this.save();
3367
3367
  }
3368
3368
  };
3369
+ var LOW_LIQUIDITY_ASSETS = /* @__PURE__ */ new Set(["GOLD"]);
3370
+ function defaultSlippage(asset) {
3371
+ return LOW_LIQUIDITY_ASSETS.has(asset) ? 0.05 : 0.03;
3372
+ }
3369
3373
  var DEFAULT_CONFIG_DIR = path.join(os.homedir(), ".t2000");
3370
3374
  var T2000 = class _T2000 extends eventemitter3.EventEmitter {
3371
3375
  keypair;
@@ -4281,7 +4285,7 @@ To sell investment: t2000 invest sell ${params.amount} ${fromAsset}`,
4281
4285
  from: "USDC",
4282
4286
  to: params.asset,
4283
4287
  amount: params.usdAmount,
4284
- maxSlippage: params.maxSlippage ?? 0.03,
4288
+ maxSlippage: params.maxSlippage ?? defaultSlippage(params.asset),
4285
4289
  _bypassInvestmentGuard: true
4286
4290
  });
4287
4291
  if (swapResult.toAmount === 0) {
@@ -4382,7 +4386,7 @@ To sell investment: t2000 invest sell ${params.amount} ${fromAsset}`,
4382
4386
  from: params.asset,
4383
4387
  to: "USDC",
4384
4388
  amount: sellAmountAsset,
4385
- maxSlippage: params.maxSlippage ?? 0.03,
4389
+ maxSlippage: params.maxSlippage ?? defaultSlippage(params.asset),
4386
4390
  _bypassInvestmentGuard: true
4387
4391
  });
4388
4392
  const price = swapResult.toAmount / sellAmountAsset;