秋田预测市场 · Discord 审计

Priority Gas 订单排序机制讨论

2026-06-23 · Hyperliquid · 7 条相关讨论

zh 2026-06-23 14:32:45

i want to understand how priority gas works in detail https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/priority-fees#order-write-priority looking at replica_cmds in the node data, i see that an order without priorityGas is ordered before an order with priorityGas within the same signed_actions

i want to understand how priority gas works in detail https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/priority-fees#order-write-priority looking at replica_cmds in the node data, i see that an order without priorityGas is ordered before an order with priorityGas within the same signed_actions

zh 2026-06-23 14:33:50

``` { "signature": { "r": "0x7c02611a1ae77d71e5bf106c74190a38d921341c78668eee03c20ae60dd2b393", "s": "0x497728db7d20acd5f707ffd911236e053f353d40a9716cf82b3f83de898ddef5", "v": 28 }, "vaultAddress": "0x9690bcfc1639abff887c8fb62b48ab787b2dba3f", "action": { "type": "order", "orders": [ { "a": 4, "b": true, "p": "0.1315", "s": "760.5", "r": false, "t": { "limit": { "tif": "Ioc" } }, "c": "0x00000000000000001782125391714074" } ], "grouping": "na" }, "nonce": 1782125391714 }, ```

``` { "signature": { "r": "0x7c02611a1ae77d71e5bf106c74190a38d921341c78668eee03c20ae60dd2b393", "s": "0x497728db7d20acd5f707ffd911236e053f353d40a9716cf82b3f83de898ddef5", "v": 28 }, "vaultAddress": "0x9690bcfc1639abff887c8fb62b48ab787b2dba3f", "action": { "type": "order", "orders": [ { "a": 4, "b": true, "p": "0.1315", "s": "760.5", "r": false, "t": { "limit": { "tif": "Ioc" } }, "c": "0x00000000000000001782125391714074" } ], "grouping": "na" }, "nonce": 1782125391714 }, ```

zh 2026-06-23 14:35:07

``` { "signature": { "r": "0x276e32b4ac01b877000baeeae883a0c00b63b384d6180f437ac6edf818289638", "s": "0x7a21043ce5c166a6841d2be08be1c0c46d8703fd04ae740305c329a3bb16f966", "v": 28 }, "vaultAddress": "0x01783e91d31c69633153c2aadbf9b7901049d03a", "action": { "type": "order", "orders": [ { "a": 4, "b": true, "p": "0.13227", "s": "596.3", "r": false, "t": { "limit": { "tif": "Ioc" } }, "c": "0x8d40d25a1bd40ff84bec49486eecfa07" } ], "grouping": { "p": 15000 } }, "nonce": 1782125391727 }, ```

``` { "signature": { "r": "0x276e32b4ac01b877000baeeae883a0c00b63b384d6180f437ac6edf818289638", "s": "0x7a21043ce5c166a6841d2be08be1c0c46d8703fd04ae740305c329a3bb16f966", "v": 28 }, "vaultAddress": "0x01783e91d31c69633153c2aadbf9b7901049d03a", "action": { "type": "order", "orders": [ { "a": 4, "b": true, "p": "0.13227", "s": "596.3", "r": false, "t": { "limit": { "tif": "Ioc" } }, "c": "0x8d40d25a1bd40ff84bec49486eecfa07" } ], "grouping": { "p": 15000 } }, "nonce": 1782125391727 }, ```

zh 2026-06-23 14:36:10

and also in the `node_fills_streaming` , i see that the order without priorityGas got filled earlier in the same block, at a better price ``` {"local_time":"2026-06-22T10:49:52.402505694","block_time":"2026-06-22T10:49:52.237493239","block_number":1045130015,"events":[["0x9690bcfc1639abff887c8fb62b48ab787b2dba3f",{"coin":"DYDX","px":"0.13148","sz":"20.3","side":"B","time":1782125392237,"startPosition":"0.0","dir":"Open Long","closedPnl":"0.0","hash":"0x6a56239d388009ef6bcf043e4b6b1f01c5003b82d38328c10e1eceeff783e3da","oid":475946260613,"crossed":true,"fee":"0.00096","tid":190362296014640,"cloid":"0x00000000000000001782125391714074","feeToken":"USDC","twapId":null}]]} {"local_time":"2026-06-22T10:49:52.402714701","block_time":"2026-06-22T10:49:52.237493239","block_number":1045130015,"events":[["0x01783e91d31c69633153c2aadbf9b7901049d03a",{"coin":"DYDX","px":"0.13184","sz":"596.3","side":"B","time":1782125392237,"startPosition":"-146017.4","dir":"Close Short","closedPnl":"-2.915907","hash":"0x82d0876e8533d162844a043e4b6b1f01c8009f542036f034269932c14437ab4d","oid":475946260616,"crossed":true,"fee":"0.023388","tid":688498078254054,"cloid":"0x8d40d25a1bd40ff84bec49486eecfa07","feeToken":"USDC","twapId":null,"priorityGas":"0.00017451"}]]} ``` since higher priority fee orders are prioritised, wouldnt the higher priority order always be ahead in the bundle/block?

and also in the `node_fills_streaming` , i see that the order without priorityGas got filled earlier in the same block, at a better price ``` {"local_time":"2026-06-22T10:49:52.402505694","block_time":"2026-06-22T10:49:52.237493239","block_number":1045130015,"events":[["0x9690bcfc1639abff887c8fb62b48ab787b2dba3f",{"coin":"DYDX","px":"0.13148","sz":"20.3","side":"B","time":1782125392237,"startPosition":"0.0","dir":"Open Long","closedPnl":"0.0","hash":"0x6a56239d388009ef6bcf043e4b6b1f01c5003b82d38328c10e1eceeff783e3da","oid":475946260613,"crossed":true,"fee":"0.00096","tid":190362296014640,"cloid":"0x00000000000000001782125391714074","feeToken":"USDC","twapId":null}]]} {"local_time":"2026-06-22T10:49:52.402714701","block_time":"2026-06-22T10:49:52.237493239","block_number":1045130015,"events":[["0x01783e91d31c69633153c2aadbf9b7901049d03a",{"coin":"DYDX","px":"0.13184","sz":"596.3","side":"B","time":1782125392237,"startPosition":"-146017.4","dir":"Close Short","closedPnl":"-2.915907","hash":"0x82d0876e8533d162844a043e4b6b1f01c8009f542036f034269932c14437ab4d","oid":475946260616,"crossed":true,"fee":"0.023388","tid":688498078254054,"cloid":"0x8d40d25a1bd40ff84bec49486eecfa07","feeToken":"USDC","twapId":null,"priorityGas":"0.00017451"}]]} ``` since higher priority fee orders are prioritised, wouldnt the higher priority order always be ahead in the bundle/block?

LemoNade 2026-06-23 14:50:33

what makes you think any order with higher priority fee should get filled earlier than an order without one? say the latter was submitted ahead of the first order

what makes you think any order with higher priority fee should get filled earlier than an order without one? say the latter was submitted ahead of the first order

_jay.gee 2026-06-23 15:00:23

Priority gas affects when the order is included in the block, not the ordering in the block. You can benchmark the end to end latency using priority fee to measure it's effect.

Priority gas affects when the order is included in the block, not the ordering in the block. You can benchmark the end to end latency using priority fee to measure it's effect.

zh 2026-06-23 16:01:07

Just to clarify, does a higher priority fee move an order up the inclusion queue by some amount, rather than orders strictly ranked by priority fee (i.e., highest fee first)?

Just to clarify, does a higher priority fee move an order up the inclusion queue by some amount, rather than orders strictly ranked by priority fee (i.e., highest fee first)?