This commit is contained in:
Cryptoval Trading Technologies
2026-04-02 01:57:01 +00:00
parent 6e4937d078
commit 965953fb93
2 changed files with 186 additions and 0 deletions
+74
View File
@@ -0,0 +1,74 @@
# ===============================================================================
# REAL TIME SIMULATOR
# (no Market Data)
# ===============================================================================
# Environment setting example
# SIM_ORDER_ENTRY_WS_PORT=28081
# SIM_ORDER_ENTRY_REST_PORT=28082
# SIM_ACCOUNTING_REST_PORT=28083
# simulation/market_simulator -> "" (root)
{
"initial_positions": {
"exchange": "COINBASE",
"assets": {
"BTC": 0.1,
"ETH": 5.0,
"USD": 10000.0
}
},
"market_data": {
# NOT USED HERE. Use Direct Market data via MDGW
}
"order_entry": {
"api": {
"web_socket": {
"url": "ws://localhost:@env{SIM_ORDER_ENTRY_WS_PORT}/ws"
},
"REST": {
"port": @env{SIM_ORDER_ENTRY_REST_PORT},
"base_url": "http://localhost:@env{SIM_ORDER_ENTRY_REST_PORT}",
"endpoints": {
"new_order": ["POST", "/order"],
"cancel_order": ["POST", "/cancel"],
"cancel_all": ["POST", "/cancel_all"],
"open_orders": ["GET", "/open_orders"],
"order_status": ["GET", "/order_status"]
}
}
},
"execution": {
"fast": { # formerly known as --debug_mode in OEGW; use --fast_exec_mode in CL
"partial_fill_wait_sec": 3600.0,
"full_fill_wait_sec": 3600.0,
"fee_rate": 0.006
},
"on_market_data": { ## DEFAULT METHOD
"md_exch_acct": "COINBASE_AT",
"execute_on": [
"BOOK_TOP",
"TRADES"
],
"top_only": true,
"pricing_method": "BY_MKT_TRD_PRICE_BY_TRADE",
"min_order_age_sec": 0.1,
"fee_schedule": {
"taker_fee_rate": 0.006,
"maker_fee_rate": 0.004
}
}
},
},
"accounting": {
"api": {
"REST": {
"port": @env{SIM_ACCOUNTING_REST_PORT},
"base_url": "http://localhost:@env{SIM_ACCOUNTING_REST_PORT}",
"endpoints": {
"positions": ["GET", "/positions"],
"trades": ["GET", "/trades"]
}
}
}
}
}
@@ -0,0 +1,112 @@
{
"simulation": {
"market_simulator": {
"initial_positions": {
"exchange": "COINBASE",
"assets": {
"BTC": 0.1,
"ETH": 5.0,
"USD": 10000.0
}
},
"market_data": {
"sources": [
{
"loader_class": "cvttpy_trading.trading.mkt_data.time_series.loaders.sqlite_loader.SqliteMdLoader",
"file_name": "/path/to/market_data.db",
"table_name": "md_trades",
"columns": [
"tstamp",
"tstamp_ns as tm",
"tstamp_ns as local_time_ns",
"exchange_id",
"instrument_id",
"px as price",
"qty as quantity",
"trade_id",
"condition as aggressor_side",
"condition as taker_side"
],
"time_column": "tstamp",
"exchange_id": "COINBASE",
"instruments": [
"PAIR-BTC-USD"
],
"md_type": "TRADES"
},
{
"loader_class": "cvttpy_trading.trading.mkt_data.time_series.loaders.sqlite_loader.SqliteMdLoader",
"file_name": "/path/to/market_data.db",
"table_name": "md_booktops",
"columns": [
"tstamp",
"tstamp_ns as tm",
"tstamp_ns as local_time_ns",
"exchange_id",
"instrument_id",
"bid_price",
"bid_quantity",
"ask_price",
"ask_quantity"
],
"time_column": "tstamp",
"exchange_id": "COINBASE",
"instruments": [
"PAIR-BTC-USD"
],
"md_type": "BOOK_TOP"
}
],
"api": {
"web_socket": {
"url": "ws://localhost:28080/ws"
}
}
},
"order_entry": {
"execution": {
"execute_on": [
"BOOK_TOP",
"TRADES"
],
"top_only": true,
"pricing_method": "BY_MKT_TRD_PRICE_BY_TRADE",
"min_order_age_sec": 0.1,
"fee_schedule": {
"taker_fee_rate": 0.006,
"maker_fee_rate": 0.004
}
},
"api": {
"web_socket": {
"url": "ws://localhost:28081/ws"
},
"REST": {
"port": 28082,
"base_url": "http://localhost:28082",
"endpoints": {
"new_order": ["POST", "/order"],
"cancel_order": ["POST", "/cancel"],
"cancel_all": ["POST", "/cancel_all"],
"open_orders": ["GET", "/open_orders"],
"order_status": ["GET", "/order_status"]
}
}
}
},
"accounting": {
"api": {
"REST": {
"port": 28083,
"base_url": "http://localhost:28083",
"endpoints": {
"positions": ["GET", "/positions"],
"trades": ["GET", "/trades"]
}
}
}
}
}
}
}