Slick Sim 0.10.1
Exchange simulator that shadows real venues for risk-free strategy testing
Loading...
Searching...
No Matches
slick::sim::order_gateway::coinbase Namespace Reference

Enumerations

enum class  RoutingEffect { Learn , Forget , Ignore }
 What an execution report means for the order-id -> symbol routing table. More...

Functions

constexpr RoutingEffect routing_effect (OrderStatus status)
 Terminal reports retire routing.
std::string dump_json (const json &value)
 nlohmann's dump() throws on invalid UTF-8.
std::string_view to_coinbase_string (TimeInForce tif)
json to_json (const Order &order)

Enumeration Type Documentation

◆ RoutingEffect

What an execution report means for the order-id -> symbol routing table.

Enumerator
Learn 

The order exists: remember which symbol its id belongs to.

Forget 

The order is gone: drop its routing.

Ignore 

Says nothing about routing.

Definition at line 12 of file coinbase_common.hpp.

Function Documentation

◆ dump_json()

std::string slick::sim::order_gateway::coinbase::dump_json ( const json & value)
inline

nlohmann's dump() throws on invalid UTF-8.

These payloads include client ids and reject/cancel text copied from fixed-size wire fields. Invalid bytes could throw inside a uWebSockets callback and stop the gateway loop thread. Replace them to keep the JSON well formed.

Definition at line 49 of file coinbase_common.hpp.

◆ routing_effect()

RoutingEffect slick::sim::order_gateway::coinbase::routing_effect ( OrderStatus status)
constexpr

Terminal reports retire routing.

A REJECTED new order has no order id, so there is nothing to forget. A REJECTED amendment or cancel names an order that is still working; forgetting its routing prevented later cancels and amendments. Classify every status explicitly so new statuses require a decision here.

Definition at line 22 of file coinbase_common.hpp.

References slick::sim::ACCEPTED_FOR_BIDDING, slick::sim::CALCULATED, slick::sim::CANCELED, slick::sim::DONE_FOR_DAY, slick::sim::EXPIRED, slick::sim::FILLED, Forget, Ignore, Learn, slick::sim::NEW, slick::sim::PARTIALLY_FILLED, slick::sim::PENDING_CANCEL, slick::sim::PENDING_NEW, slick::sim::PENDING_REPLACE, slick::sim::REJECTED, slick::sim::REPLACED, slick::sim::STOPPED, and slick::sim::SUSPENDED.

◆ to_coinbase_string()

std::string_view slick::sim::order_gateway::coinbase::to_coinbase_string ( TimeInForce tif)
inline

◆ to_json()