@clonegod/ttd-sol-common 1.0.80 → 1.0.81

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.
@@ -41,6 +41,7 @@ function create_solana_trade_runtime(connection, trade_runtime, pool_info) {
41
41
  return solana_trade_runtime;
42
42
  }
43
43
  function get_priority_fee_and_tip(trade_strategy) {
44
+ let tip_ratio = trade_strategy.tip_ratio;
44
45
  let priority_fee = 0;
45
46
  let tip_amount = 0;
46
47
  let total_gas = calculate_gas_fee(trade_strategy);
@@ -53,8 +54,7 @@ function get_priority_fee_and_tip(trade_strategy) {
53
54
  tip_amount = total_gas;
54
55
  }
55
56
  else if (trade_strategy.broadcast_type === 'mixed') {
56
- let tip_ratio = trade_strategy.tip_ratio;
57
- if (Number.isNaN(tip_ratio) || tip_ratio <= 0) {
57
+ if (Number.isNaN(tip_ratio) || Number.isFinite(tip_ratio) || tip_ratio < 0 || tip_ratio > 1) {
58
58
  tip_ratio = 0.3;
59
59
  }
60
60
  tip_amount = Math.ceil(total_gas * tip_ratio);
@@ -62,6 +62,7 @@ function get_priority_fee_and_tip(trade_strategy) {
62
62
  }
63
63
  return {
64
64
  total_gas,
65
+ tip_ratio,
65
66
  priority_fee,
66
67
  tip_amount
67
68
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clonegod/ttd-sol-common",
3
- "version": "1.0.80",
3
+ "version": "1.0.81",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "types/index.d.ts",