개요
The ORDER_PRIORITY stream provides normalized priority-fee order events from Hyperliquid transaction data. It emits one JSON event per priority order action, derived from both mempool transactions and confirmed block data.
하천 유형: ORDER_PRIORITY
API 이용 가능 여부: gRPC API 전용
권수: Variable - Depends on priority-fee order activity
Use ORDER_PRIORITY when you want to observe priority-fee order flow without parsing raw MEMPOOL_TXS 또는 전체 블록/replica_cmds payloads yourself. This stream is an order-flow stream, not an order book stream.
이 스트림은 다음과 같은 경우에 유용합니다:
- Priority-Fee Monitoring - Track orders with priority fees in real-time
- Fee Analysis - Analyze priority fee patterns across different markets
- Order Flow Intelligence - Understand priority order submission patterns
- Pre-Confirmation Visibility - See priority orders from mempool before block inclusion
- Confirmation Tracking - Monitor execution outcomes for priority orders
데이터 출처
The ORDER_PRIORITY stream derives events from two sources:
| 출처 | 설명 | 추가 필드 |
|---|---|---|
| mempool_txs | Pre-consensus priority activity from the mempool. Events are not finalized and may be rejected, reordered, or absent from the finalized chain. | first_seen_time, tx_hash, nonce, cloid |
| replica_cmds | 완료된 거래 처리를 나타내는 확인된 블록 데이터. | 블록 번호, 블록 시간, 번들 인덱스, 결과 |
Priority Detection
Priority orders are detected when an order action contains the grouping field with a priority fee value:
"grouping": { "p": 10000 }
Priority Fee Values
그 p value represents the priority fee, and its range depends on the network and order type.
Testnet IOC values are expressed in basis points (bps):
| p Value | Basis Points | 참고 사항 |
|---|---|---|
| 10000 | 1 bp | Base unit (p = 10000 means 1 bp) |
| 80000 | 8 bps | Minimum for testnet IOC priority fees |
| 1000000 | 100 bps | Maximum for testnet IOC priority fees |
Mainnet values look very different from the testnet IOC range. Note the units when comparing: p is a raw integer interpreted as the fraction p / 100,000,000, so 1 bp equals a raw p ~의 10000, and the 8-100 bps testnet IOC range corresponds to raw p values of 80000 ~에 1000000. Priority activity on mainnet is predominantly ALO orders carrying far smaller raw p values, typically between 1 and roughly 400 (about 0.04 bp at the upper end), often in per-user ladders as orders compete for queue position. A much smaller share of mainnet priority orders are IOC, and those can carry larger p values (raw values above 10000 observed), though still well below the testnet 8-100 bps band in observed traffic.
Per the official Hyperliquid priority fee documentation, ALO orders placed at the same price level within a T = 400 ms window are sorted in decreasing order of priority rate, and ALO priority fees are deducted at order placement from the undelegated staking balance, converted to HYPE using the spot mark price.
On testnet:
- IOC priority fees support the 8-100 bps range
- ALO orders support priority fees
- Within the 8-100 bps IOC range, priority fees are used as a sorting mechanism for orders received at a similar time and have the same mempool prioritization effect
ALO priority affects queue position after L1 execution and does not provide the same mempool-prioritization behavior as IOC priority.
Mainnet and testnet both support the gRPC stream types. Actual events, and the observed p ranges, depend on the priority activity occurring on the selected network.
이벤트 구조
멤풀 이벤트
{
"type": "order",
"source": "mempool_txs",
"first_seen_time": "2026-06-02T13:48:49.578877529",
"tx_hash": "0x...",
"signed_action_index": 0,
"order_index": 0,
"asset_id": 0,
"market_type": "perp",
"coin": "BTC",
"cloid": "0x...",
"p": 10000,
"side": "buy",
"px": "100000",
"sz": "0.001",
"tif": "Ioc",
"reduce_only": false,
"nonce": 1780408128806
}
확인된 이벤트 (replica_cmds 소스)
{
"type": "order",
"source": "replica_cmds",
"block_number": 581285917,
"block_time": "2026-06-02T13:48:49.626754186",
"bundle_index": 0,
"asset_id": 0,
"market_type": "perp",
"coin": "BTC",
"p": 10000,
"side": "buy",
"px": "100000",
"sz": "0.001",
"tif": "Ioc",
"reduce_only": false,
"outcome": "filled"
}
응답 필드
| 분야 | 유형 | 설명 |
|---|---|---|
| 유형 | 문자열 | Event type: "order" |
| 출처 | 문자열 | 데이터 출처: “mempool_txs”(합의 전) 또는 “replica_cmds”(확정) |
| 첫_확인_시간 | 문자열 | (mempool_txs 전용) 멤풀에서 처음 감지된 시점의 ISO 8601 타임스탬프 |
| tx_hash | 문자열 | (mempool_txs only) Transaction hash (0x-prefixed) |
| signed_action_index | 숫자 | (mempool_txs 전용) 트랜잭션 내 서명된 액션의 인덱스 |
| order_index | 숫자 | (mempool_txs only) Index of the order within the action |
| 블록 번호 | 숫자 | (replica_cmds only) Block number where the order was confirmed |
| block_time | 문자열 | (replica_cmds 전용) 블록의 ISO 8601 타임스탬프 |
| 번들 인덱스 | 숫자 | (replica_cmds 전용) 블록 내 번들의 인덱스 |
| asset_id | 숫자 | Numerical asset/coin ID |
| market_type | 문자열 | Market type (e.g., "perp") |
| 동전 | 문자열 | Trading pair symbol (e.g., "BTC", "ETH") |
| cloid | 문자열 | (optional) Client order ID |
| p | 숫자 | Raw priority fee value, interpreted as the fraction p / 100,000,000 (10000 = 1 bp). Testnet IOC orders use 80000-1000000 (8-100 bps); mainnet ALO orders carry far smaller values, typically 1 to ~400 (up to ~0.04 bp) |
| 측면 | 문자열 | Order side: "buy" or "sell" |
| px | 문자열 | Order price |
| sz | 문자열 | Order size |
| tif | 문자열 | Time in force: "Ioc" (Immediate or Cancel) or "Alo" (Add Liquidity Only) |
| reduce_only | 부울 | Whether the order can only reduce an existing position |
| 논스 | 숫자 | (mempool_txs only) Transaction nonce |
| 사용자 | 문자열 | (optional) User address |
| 방송인 | 문자열 | (optional) Broadcaster address |
| 결과 | 문자열 | (replica_cmds only) Execution outcome (e.g., "filled") |
ALO Priority Orders
Add Liquidity Only (ALO) priority orders have tif set to "Alo":
{
"tif": "Alo"
}
필터링
The ORDER_PRIORITY stream supports standard gRPC field filtering. Useful fields:
| 분야 | 예시 값 | 설명 |
|---|---|---|
| 출처 | mempool_txs, replica_cmds | 데이터 소스별로 필터링 |
| 유형 | order | 이벤트 유형별로 필터링 |
| 동전 | BTC, ETH, SOL | Filter by trading pair |
| market_type | perp | Filter by market type |
| asset_id | 0, 1, 2 | Filter by asset ID |
| p | 10000, 80000, 1000000 | Filter by priority fee value |
| 측면 | buy, sell | Filter by order side |
| tif | Ioc, Alo | Filter by time in force |
| 결과 | filled | Filter by execution outcome (replica_cmds only) |
| 사용자 | 0x... | Filter by user address |
| 방송인 | 0x... | Filter by broadcaster address |
| tx_hash | 0x... | Filter by transaction hash |
| 블록 번호 | 581285917 | Filter by block number |
필터 예시
// Get BTC priority orders only
filters: {
"coin": FilterValues { values: ["BTC"] }
}
// Get IOC priority orders from mempool
filters: {
"source": FilterValues { values: ["mempool_txs"] },
"tif": FilterValues { values: ["Ioc"] }
}
// Get filled priority orders from confirmed blocks
filters: {
"source": FilterValues { values: ["replica_cmds"] },
"outcome": FilterValues { values: ["filled"] }
}
// Get high-value priority fees (8+ bps)
filters: {
"p": FilterValues { values: ["80000", "100000", "500000", "1000000"] }
}
필터링에 대한 자세한 내용은 ‘스트림 필터링 가이드’를 참조하십시오.
권장 사용법
For low-latency order-flow monitoring:
ORDER_PRIORITY + source=mempool_txs
For confirmation and reconciliation:
ORDER_PRIORITY + source=replica_cmds
고객은 과거 기록을 검색해야 할 경우 이벤트를 영구 저장해야 합니다. StreamData는 실시간 스트림이므로, 자체적으로는 과거 기록 재생을 지원하지 않습니다.
gRPC
파이썬 예제
import grpc
import json
from pb import streaming_pb2, streaming_pb2_grpc
GRPC_ENDPOINT = 'your-endpoint.hype-mainnet.quiknode.pro:10000'
AUTH_TOKEN = 'your-auth-token'
def stream_order_priority():
credentials = grpc.ssl_channel_credentials()
channel = grpc.secure_channel(
GRPC_ENDPOINT,
credentials,
options=[
('grpc.max_receive_message_length', 100 * 1024 * 1024),
]
)
stub = streaming_pb2_grpc.StreamingStub(channel)
metadata = [('x-token', AUTH_TOKEN)]
def request_generator():
# Subscribe to ORDER_PRIORITY with filters
subscribe_request = streaming_pb2.SubscribeRequest()
subscribe_request.subscribe.stream_type = streaming_pb2.StreamType.ORDER_PRIORITY
subscribe_request.subscribe.filters["coin"].values.extend(["BTC", "ETH"])
subscribe_request.subscribe.filters["tif"].values.append("Ioc")
yield subscribe_request
# Keep connection alive with periodic pings
while True:
time.sleep(30)
ping_request = streaming_pb2.SubscribeRequest()
ping_request.ping.timestamp = int(time.time() * 1000)
yield ping_request
stream = stub.StreamData(request_generator(), metadata=metadata)
for response in stream:
if response.HasField('data'):
data = json.loads(response.data.data)
print(f"Priority Order Event")
print(f"Source: {data.get('source')}")
print(f"Coin: {data.get('coin')}")
print(f"Priority Fee (p): {data.get('p')} ({data.get('p', 0) / 10000} bps)")
print(f"Side: {data.get('side')}")
print(f"Price: {data.get('px')}")
print(f"Size: {data.get('sz')}")
print(f"TIF: {data.get('tif')}")
if data.get('source') == 'replica_cmds':
print(f"Outcome: {data.get('outcome')}")
print(f"Block: {data.get('block_number')}")
print("---")
if __name__ == "__main__":
stream_order_priority()
JavaScript/Node.js 예제
const grpc = require('@grpc/grpc-js');
const protoLoader = require('@grpc/proto-loader');
const GRPC_ENDPOINT = 'your-endpoint.hype-mainnet.quiknode.pro:10000';
const AUTH_TOKEN = 'your-auth-token';
// Load proto file
const packageDefinition = protoLoader.loadSync('streaming.proto');
const proto = grpc.loadPackageDefinition(packageDefinition).hyperliquid;
// Create channel with credentials
const credentials = grpc.credentials.createSsl();
const client = new proto.Streaming(GRPC_ENDPOINT, credentials);
const metadata = new grpc.Metadata();
metadata.add('x-token', AUTH_TOKEN);
// Subscribe to ORDER_PRIORITY
const call = client.StreamData(metadata);
call.on('data', (response) => {
if (response.data) {
const data = JSON.parse(response.data.data);
console.log(`Priority Order Event`);
console.log(`Source: ${data.source}`);
console.log(`Coin: ${data.coin}`);
console.log(`Priority Fee (p): ${data.p} (${data.p / 10000} bps)`);
console.log(`Side: ${data.side}`);
console.log(`Price: ${data.px}`);
console.log(`Size: ${data.sz}`);
console.log(`TIF: ${data.tif}`);
if (data.source === 'replica_cmds') {
console.log(`Outcome: ${data.outcome}`);
console.log(`Block: ${data.block_number}`);
}
console.log('---');
}
});
call.on('error', (error) => {
console.error('Stream error:', error);
});
// Send subscription with filters
call.write({
subscribe: {
stream_type: 9, // ORDER_PRIORITY
filters: {
coin: { values: ['BTC', 'ETH'] },
tif: { values: ['Ioc'] }
}
}
});
// Send periodic pings
setInterval(() => {
call.write({
ping: { timestamp: Date.now() }
});
}, 30000);
중요 사항
- Derived Stream - ORDER_PRIORITY is a derived stream that normalizes data from MEMPOOL_TXS and BLOCKS, saving you from parsing raw payloads
- Not an Order Book - This stream provides priority order metadata, not order book state
- 이중 출처 - 이벤트는 멥풀(합의 전)과 확정된 블록(합의 후) 모두에서 발생합니다.
- Network-Specific Ranges - The 8-100 bps IOC range applies to testnet and corresponds to raw
pvalues of 80000-1000000 (10000 = 1 bp); on mainnet, priority activity is primarily ALO orders with far smaller rawpvalues, typically between 1 and ~400 (up to ~0.04 bp) - 압축 - 대역폭 효율성을 높이기 위해 gRPC zstd 압축을 활성화하는 것을 고려해 보세요.
관련 Streams
- GOSSIP_PRIORITY - Gossip/read-priority bid events
- MEMPOOL_TXS - Raw mempool transactions (source data for pre-consensus priority events)
- BLOCKS - Raw blockchain data (source data for confirmed priority events)
- ORDERS - Order lifecycle events
- TRADES - Executed trades
gRPC 설정에 대한 자세한 내용은 gRPC 문서를 참조하십시오.