Slick Sim
0.10.1
Exchange simulator that shadows real venues for risk-free strategy testing
Loading...
Searching...
No Matches
hyperliquid_trade_encoder.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <
common/market_data.hpp
>
4
#include <
common/messages.hpp
>
5
#include <nlohmann/json.hpp>
6
7
namespace
slick::sim::md_publisher
{
8
9
// Encoders for Hyperliquid's `trades` channel, kept free of the socket layer so
10
// the wire shape can be tested without standing up a WebSocket server.
11
//
12
// {"channel":"trades","data":[
13
// {"coin":"ETH","side":"B","px":"3000.5","sz":"1.25","time":<ms>,
14
// "hash":"0x0","tid":<id>}]}
15
//
16
// `side` is the aggressor: "B" for a buy, "A" otherwise. The simulator has no
17
// on-chain transaction to reference, so `hash` is always the literal "0x0".
18
20
nlohmann::json
encode_trade_message
(
const
char
* coin,
const
TradeSummary& summary);
21
24
nlohmann::json
encode_trade_message
(
const
char
* coin,
const
MDTrade* trades, uint32_t num_trades);
25
26
}
// end namespace slick::sim::md_publisher
market_data.hpp
messages.hpp
slick::sim::md_publisher
Definition
market_data_publisher.hpp:8
slick::sim::md_publisher::encode_trade_message
json encode_trade_message(const char *coin, const TradeSummary &summary)
One executed trade.
Definition
hyperliquid_trade_encoder.cpp:34
venues
hyperliquid
hyperliquid_trade_encoder.hpp
Generated by
1.15.0