@clonegod/ttd-bsc-common 3.1.67 → 3.1.68

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.
@@ -122,11 +122,14 @@ class PoolStateInitializer {
122
122
  const [sqrtPriceX96, tick, protocolFee, lpFee] = slot0Result;
123
123
  const [currency0, currency1, hooks, poolManager, fee, parameters] = poolKeyInfo;
124
124
  const { tickSpacing } = decodeParameters(parameters);
125
+ const DYNAMIC_FEE_FLAG = 0x800000;
126
+ const isDynamic = Number(fee) === DYNAMIC_FEE_FLAG;
127
+ const effectiveLpFeePpm = isDynamic ? Number(lpFee) : Number(fee);
125
128
  const state = {
126
129
  address: poolKey,
127
130
  token0: currency0.toLowerCase ? currency0.toLowerCase() : currency0,
128
131
  token1: currency1.toLowerCase ? currency1.toLowerCase() : currency1,
129
- feeRateBps: (Number(lpFee) + Number(protocolFee)) / 100,
132
+ feeRateBps: (effectiveLpFeePpm + Number(protocolFee)) / 100,
130
133
  feeRatePpm: Number(fee),
131
134
  tickSpacing,
132
135
  tick: Number(tick),
@@ -199,8 +199,9 @@ class AbstractDexTrade extends ttd_core_1.AbastrcatTrade {
199
199
  trace.set('gasType', mainGasFields.type === 2 ? 'EIP1559' : 'Legacy');
200
200
  trace.set('tip', transfer_amount_gwei);
201
201
  const only_bundle = order_msg.is_dex_maker;
202
- await this.transactionSender.sendTransaction(signedMainTx, tipTxMap, order_trace_id, pair, only_bundle, trace);
203
202
  trace.mark('sent');
203
+ await this.transactionSender.sendTransaction(signedMainTx, tipTxMap, order_trace_id, pair, only_bundle, trace);
204
+ trace.mark('send_complete');
204
205
  trace.flush();
205
206
  context._execution_marks = trace.getAbsoluteMarks();
206
207
  context._execution_start_time = trace.getStartTime();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clonegod/ttd-bsc-common",
3
- "version": "3.1.67",
3
+ "version": "3.1.68",
4
4
  "description": "BSC common library",
5
5
  "license": "UNLICENSED",
6
6
  "main": "dist/index.js",
@@ -14,7 +14,7 @@
14
14
  "push": "npm run build && npm publish"
15
15
  },
16
16
  "dependencies": {
17
- "@clonegod/ttd-core": "3.1.57",
17
+ "@clonegod/ttd-core": "3.1.58",
18
18
  "axios": "1.15.0",
19
19
  "dotenv": "^16.4.7",
20
20
  "ethers": "^5.8.0",