From ee9d93b5ad5f87a25873cf26ebee1578d5d04e0a Mon Sep 17 00:00:00 2001 From: Cryptoval Trading Technologies Date: Tue, 13 May 2025 15:55:49 +0000 Subject: [PATCH] separate folder for simulation, standardized REST and WS settings --- data/apps/cvtt_musvc_sim.cfg | 128 ---------- data/apps/simulation/cvtt_simtest.cfg | 349 +++++++++++++++++++++++++ data/refdata/exchanges.cfg | 350 ++++++++++++++++++++------ 3 files changed, 625 insertions(+), 202 deletions(-) delete mode 100644 data/apps/cvtt_musvc_sim.cfg create mode 100644 data/apps/simulation/cvtt_simtest.cfg diff --git a/data/apps/cvtt_musvc_sim.cfg b/data/apps/cvtt_musvc_sim.cfg deleted file mode 100644 index adbe656..0000000 --- a/data/apps/cvtt_musvc_sim.cfg +++ /dev/null @@ -1,128 +0,0 @@ -@var COORDINATOR_REST_PORT=23456 -@var COORDINATOR_WS_PORT=12345 - -@var GLOBAL_CHANNEL_PREFIX=CVTT_MU - -{ - "refdata": @inc=http://@env{CONFIG_SERVICE}/refdata/refdata - , "comm": @inc=http://@env{CONFIG_SERVICE}/apps/common/comm - , "algos": @inc=http://@env{CONFIG_SERVICE}/apps/common/algos - , "strategies": @inc=http://@env{CONFIG_SERVICE}/apps/common/strategies - , "risk_strategies": @inc=http://@env{CONFIG_SERVICE}/apps/common/risk_strategies - - , "comm_settings": @env{CONFIG_COMM_SETTINGS} - , "global_channel_prefix": ${GLOBAL_CHANNEL_PREFIX} - - , "coordinator": { - "api": { - "REST": { - "port": ${COORDINATOR_REST_PORT}, - "base_url": ["POST", "http://localhost:${COORDINATOR_REST_PORT}"] - } - , "WS": { - "url": "ws://localhost:${COORDINATOR_WS_PORT}/ws" - } - } - } - , "market_data_gateway": { - "exchanges_settings": { - "*": { - "mkt_data": { - "enabled": true - , "streaming": true - }, - "order_entry": { - "enabled": false - , "streaming": false - }, - "accounting": { - "enabled": false - , "streaming": false - }, - }, - } - , "channel_prefix": "${GLOBAL_CHANNEL_PREFIX}.MD_GW" - , "app_status_channel": "${GLOBAL_CHANNEL_PREFIX}.MD_GW_APP_STATUS" - , "exchanges": [ - "COINBASE_SIM" - ] - } - , "order_entry_gateway": { - "exchanges_settings": { - "COINBASE_SIM": { - "mkt_data": { - "enabled": false - , "streaming": false - }, - "order_entry": { - "enabled": true - , "streaming": true - }, - "accounting": { - "enabled": false - , "streaming": false - } - # , "credentials_key": { - # "read_only": "ALPACA_SANDBOX" - # , "trade": "ALPACA_SANDBOX" - # } - } - } - , "channel_prefix": "${GLOBAL_CHANNEL_PREFIX}.OE_GW" - , "app_status_channel": "${GLOBAL_CHANNEL_PREFIX}.OE_GW_APP_STATUS" - , "exchanges": [ - "ALPACA_SNDBX" - ] - } - , "accounting_gateway": { - "exchanges_settings": { - "COINBASE_SIM": { - "mkt_data": { - "enabled": false - , "streaming": false - }, - "order_entry": { - "enabled": false - , "streaming": false - }, - "accounting": { - "enabled": true - , "streaming": false - } - # , "credentials_key": { - # "read_only": "COINBASE_ADV_RO" - # } - }, - } - , "channel_prefix": "${GLOBAL_CHANNEL_PREFIX}.ACCT_GW" - , "app_status_channel": "${GLOBAL_CHANNEL_PREFIX}.ACCT_GW_APP_STATUS" - , "exchanges": [ - "COINBASE_SIM" - ] - } - , "quant": { - "channel_prefix": "${GLOBAL_CHANNEL_PREFIX}.QUANT" - , "app_status_channel": "${GLOBAL_CHANNEL_PREFIX}.QUANT_MUSVC_STATUS" - } - , "trader": { - "channel_prefix": "${GLOBAL_CHANNEL_PREFIX}.TRADER" - , "app_status_channel": "${GLOBAL_CHANNEL_PREFIX}.TRADER_MUSVC_STATUS" - } - , "bookkeeper": { - "channel_prefix": "${GLOBAL_CHANNEL_PREFIX}.BKPR" - , "app_status_channel": "${GLOBAL_CHANNEL_PREFIX}.BKPR_MUSVC_STATUS" - , "db": { - "server_type": "timescale", - "cred_key": "TSDB_TRADING_CVTT_TESTDB" - } - } - , "risk_manager": { - "channel_prefix": "${GLOBAL_CHANNEL_PREFIX}.RMGR" - , "app_status_channel": "${GLOBAL_CHANNEL_PREFIX}.RMGR_MUSVC_STATUS" - , "revalue_interval_sec": 10.5 - } - , "pricer": { - "channel_prefix": "${GLOBAL_CHANNEL_PREFIX}.PXER" - , "app_status_channel": "${GLOBAL_CHANNEL_PREFIX}.PXER_MUSVC_STATUS" - } -} \ No newline at end of file diff --git a/data/apps/simulation/cvtt_simtest.cfg b/data/apps/simulation/cvtt_simtest.cfg new file mode 100644 index 0000000..41d88c4 --- /dev/null +++ b/data/apps/simulation/cvtt_simtest.cfg @@ -0,0 +1,349 @@ +@var COORDINATOR_HOST=localhost +@var COORDINATOR_REST_PORT=28001 +@var COORDINATOR_WS_PORT=28002 + +@var GLOBAL_CHANNEL_PREFIX=CVTT_MU_SIM + +@var SIM_HOST=localhost +@var SIM_DATA_DIR=/home/oleg/develop/simulation/data + +@var SIM_MD_WS_PORT=28080 +@var SIM_OE_WS_PORT=28081 +@var SIM_OE_REST_PORT=28082 +@var SIM_AC_REST_PORT=28083 + + +{ + # --------------------------------------- + "__dummy__": null + # --------------------------------------- + # Overwriting "exchanges" part in "refdata" + # "refdata": @inc=http://@env{CONFIG_SERVICE}/refdata/refdata + "refdata": { + "assets": @inc=http://@env{CONFIG_SERVICE}/refdata/assets , + "instruments": @inc=http://@env{CONFIG_SERVICE}/refdata/instruments , + "exchange_instruments": @inc=http://@env{CONFIG_SERVICE}/refdata/exchange_instruments , + "dynamic_instrument_exchanges": ["ALPACA"], + "exchanges": { + "SIM_COINBASE": { + "exchange_id": "COINBASE", + "name": "Coinbase Advanced Trade (Simulation)", + "type": "SPOT", + + "mktdata" : { + "class": "cvttpy.exchanges.mkt_simulator.md_client.MktSimMdClientFeed" + "api": @pathptr=simulation/market_simulator/market_data/api + }, + "order_entry": { + "class": "cvttpy.exchanges.mkt_simulator.oe_client.MarketSimulatorOEClient" + "api": @ptrpath=simulation/market_simulator/order_entry/api + }, + "accounting": { + "class": "cvttpy.exchanges.mkt_simulator.acct_client.MktSimAccounting" + "api": @ptrpath=simulation/market_simulator/accounting/api + }, + }, + "SIM_ALPACA": { + "exchange_id": "ALPACA", + "name": "Alpaca Trading", + "type": "EQUITY", + + "mktdata" : { + "class": "cvttpy.exchanges.mkt_simulator.md_client.MktSimMdClientFeed" + "config_key": "simulation/market_simulator/market_data/api" + }, + "order_entry": { + "class": "cvttpy.exchanges.mkt_simulator.oe_client.MarketSimulatorOEClient" + "config_key": "simulation/market_simulator/order_entry/api" + }, + "accounting": { + "class": "cvttpy.exchanges.mkt_simulator.acct_client.MktSimAccounting" + "config_key": "simulation/market_simulator/accounting/api" + } + }, + } + }, + "comm": @inc=http://@env{CONFIG_SERVICE}/apps/common/comm , + "algos": @inc=http://@env{CONFIG_SERVICE}/apps/common/algos , + "strategies": @inc=http://@env{CONFIG_SERVICE}/apps/common/strategies , + "risk_strategies": @inc=http://@env{CONFIG_SERVICE}/apps/common/risk_strategies , + + "comm_settings": "@env{CONFIG_COMM_SETTINGS}", + "global_channel_prefix": "${GLOBAL_CHANNEL_PREFIX}", + + "simulation": { + # "speed_factor": 1.0, + "speed_factor": 0.0 + , "time_events_interval_ms": 0 + , "simtime_file": "${SIM_DATA_DIR}/simtime.bin" + , "expected_consumers": [ + "md_gateway", + "mkt_gateway_tester" + "coordinator", + # "oe_gateway", + # "acct_gateway", + # "quant", + # "trader", + # "bookkeeper", + # "risk_manager", + # "pricer" + ] + , "consumer_timeout_sec": 30.0 + + , "market_simulator" : { + "initial_positions": { + "exchange": "COINBASE", + "assets": { + "BTC": 0.5 + , "ETH": 0.0 + , "USD": 10_000.0 + } + } + , "market_data": { + "sources": [ + { + "loader_class": "cvttpy.trading.mkt_data.time_series.loaders.sqlite_loader.SqliteMdLoader" + , "file_name": "${SIM_DATA_DIR}/20250422.CNBS.BTC_USD.db" + , "table_name": "md_trades" + , "columns": [ + "tstamp" + , "tstamp_ns as tm" # must have tm for DataFrame + , "tstamp_ns as local_time_ns" # must have for simrunner + , "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.mkt_data.time_series.loaders.tsdb_loader.TimescaleTSLoader" + # , "credentials_key": "TSDB_MD_CVTTDATA_RO" + # , "interval": ${INTERVAL} + # , "from_time": ${FROM_TIME} #"2024-10-03 09:00:00" + # , "exchange_id": "COINBASE" + # , "instruments": ["PAIR-BTC-USD"] + # , "md_type": "BOOK_TOP" + # , "table_name": "coinbase.md_booktops" + # , "columns": [ + # "time", + # "local_time_ns", + # "exchange_id", + # "instrument_id", + # "bid_price", + # "bid_quantity", + # "ask_price", + # "ask_quantity", + # "'BT' as type", + # ] + # , "time_column": "time" + # } + ] + , "api": { + "web_socket": { + "url": "ws://${SIM_HOST}:${SIM_MD_WS_PORT}/ws" + } + } + } + , "order_entry": { + "execution": { + "execute_on": ["BOOK_TOP", "TRADES"] + "top_only": true + ,"min_order_age_sec": 0.1 + , "pricing_method": "BY_MKT_TRD_PRICE_BY_TRADE" + + , "short_sale_allowed": false + , "fee_schedule": { + "taker_fee_rate": 0.006 + "maker_fee_rate": 0.004 + } + # , "presubscribe_md_types": ["BOOK_TOP", "TRADES"] + } + , "api": { + "web_socket": { + "url": "ws://${SIM_HOST}:${SIM_OE_WS_PORT}/ws" + } + , "REST": { + "port": ${SIM_OE_REST_PORT}, + "base_url": "http://${SIM_HOST}:${SIM_OE_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"] + } + } + } + } + , "accounting": { + "api": { + "REST": { + "port": ${SIM_AC_REST_PORT}, + "base_url": "http://${SIM_HOST}:${SIM_AC_REST_PORT}", + "endpoints": { + "positions": ["GET", "/positions"] + "trades": ["GET", "/trades"] + + } + + } + } + } + } + , "external_participants": [ + { + "class": "cvttpy.apps.trading_simulator.participants.external_strategy.ExternalStrategySim" + "params": { + "reader": { + "source": "file://${SIM_DATA_DIR}/trading_instructions.json" + } + "listener": { + "book_id": "TESTBK_COINBS_01", + "strategy_id": "DUMMY_STRATEGY" + } + } + } + ] + } + + , "coordinator": { + "api": { + "REST": { + "port": ${COORDINATOR_REST_PORT}, + "base_url": ["POST", "http://${COORDINATOR_HOST}:${COORDINATOR_REST_PORT}"], + } + , "WS": { + "url": "ws://${COORDINATOR_HOST}:${COORDINATOR_WS_PORT}/ws" + } + } + } + , "market_data_gateway": { + "exchanges_settings": { + "*": { + "mkt_data": { + "enabled": true + , "streaming": true + }, + "order_entry": { + "enabled": false + , "streaming": false + }, + "accounting": { + "enabled": false + , "streaming": false + }, + }, + } + , "channel_prefix": "${GLOBAL_CHANNEL_PREFIX}.MD_GW" + , "app_status_channel": "${GLOBAL_CHANNEL_PREFIX}.MD_GW_APP_STATUS" + , "exchanges": [ + "SIM_COINBASE" + ], + "presubscribe": [ + "COINBASE:PAIR-BTC-USD" + ] + } + , "order_entry_gateway": { + "exchanges_settings": { + "ALPACA_SNDBX": { + "mkt_data": { + "enabled": false + , "streaming": false + }, + "order_entry": { + "enabled": true + , "streaming": true + }, + "accounting": { + "enabled": false + , "streaming": false + } + , "credentials_key": { + "read_only": "ALPACA_SANDBOX" + , "trade": "ALPACA_SANDBOX" + } + } + } + , "channel_prefix": "${GLOBAL_CHANNEL_PREFIX}.OE_GW" + , "app_status_channel": "${GLOBAL_CHANNEL_PREFIX}.OE_GW_APP_STATUS" + , "exchanges": [ + "SIM_COINBASE" + ] + } + , "accounting_gateway": { + "exchanges_settings": { + "ALPACA_SNDBX": { + "mkt_data": { + "enabled": false + , "streaming": false + }, + "order_entry": { + "enabled": false + , "streaming": false + }, + "accounting": { + "enabled": true + , "streaming": false + } + , "credentials_key": { + "read_only": "ALPACA_SANDBOX" + , "trade": "ALPACA_SANDBOX" + } + }, + "COINBASE_AT": { + "mkt_data": { + "enabled": false + , "streaming": false + }, + "order_entry": { + "enabled": false + , "streaming": false + }, + "accounting": { + "enabled": true + , "streaming": false + } + , "credentials_key": { + "read_only": "COINBASE_ADV_RO" + } + } + } + , "channel_prefix": "${GLOBAL_CHANNEL_PREFIX}.ACCT_GW" + , "app_status_channel": "${GLOBAL_CHANNEL_PREFIX}.ACCT_GW_APP_STATUS" + , "exchanges": [ + "SIM_COINBASE" + ] + } + , "quant": { + "channel_prefix": "${GLOBAL_CHANNEL_PREFIX}.QUANT" + , "app_status_channel": "${GLOBAL_CHANNEL_PREFIX}.QUANT_MUSVC_STATUS" + } + , "trader": { + "channel_prefix": "${GLOBAL_CHANNEL_PREFIX}.TRADER" + , "app_status_channel": "${GLOBAL_CHANNEL_PREFIX}.TRADER_MUSVC_STATUS" + } + , "bookkeeper": { + "channel_prefix": "${GLOBAL_CHANNEL_PREFIX}.BKPR" + , "app_status_channel": "${GLOBAL_CHANNEL_PREFIX}.BKPR_MUSVC_STATUS" + , "db": { + "server_type": "timescale", + "cred_key": "TSDB_TRADING_CVTT_TESTDB" + } + } + , "risk_manager": { + "channel_prefix": "${GLOBAL_CHANNEL_PREFIX}.RMGR" + , "app_status_channel": "${GLOBAL_CHANNEL_PREFIX}.RMGR_MUSVC_STATUS" + , "revalue_interval_sec": 10.5 + } + , "pricer": { + "channel_prefix": "${GLOBAL_CHANNEL_PREFIX}.PXER" + , "app_status_channel": "${GLOBAL_CHANNEL_PREFIX}.PXER_MUSVC_STATUS" + } +} diff --git a/data/refdata/exchanges.cfg b/data/refdata/exchanges.cfg index e51f950..0773cbd 100644 --- a/data/refdata/exchanges.cfg +++ b/data/refdata/exchanges.cfg @@ -14,6 +14,7 @@ , "order_entry": { "class": "cvttpy.exchanges.alpaca.oe_client.AlpacaOrderEntryClient" + # D E P R E C A T E D , "REST": { "submit_order_url": ["POST", "https://api.alpaca.markets/v2/orders"] , "orders_url": ["GET", "https://api.alpaca.markets/v2/orders"] @@ -22,12 +23,26 @@ , "cancel_all_url": ["DELETE", "https://api.alpaca.markets/v2/orders"] } , "ws_url": ["WSS", "wss://api.alpaca.markets/stream"] + # D E P R E C A T E D + + , "api": { + "web_socket": { + "url": "wss://api.alpaca.markets/stream" + } + , "REST": { + "submit_order_url": ["POST", "https://api.alpaca.markets/v2/orders"] + , "orders_url": ["GET", "https://api.alpaca.markets/v2/orders"] + , "order_status": ["GET", "https://api.alpaca.markets/v2/orders/{order_id}"] + , "cancel_order_url": ["DELETE", "https://api.alpaca.markets/v2/orders/{order_id}"] + , "cancel_all_url": ["DELETE", "https://api.alpaca.markets/v2/orders"] + } + } } , "mktdata" : { "class": "cvttpy.exchanges.alpaca.mkt_data.AlpacaStockFeed" , "reconnect_secs": 2.0 - # , "ws_url": ["WSS", "wss://stream.data.alpaca.markets/v2/sip"] + # D E P R E C A T E D , "ws_url": ["WSS", "wss://stream.data.alpaca.markets/v2/iex"] , "REST": { "hist_md_bars": ["GET", "https://data.alpaca.markets/v2/stocks/bars"] @@ -37,46 +52,40 @@ , "assets": ["GET", "https://api.alpaca.markets/v2/assets"] # , "assets": ["GET", "https://data.alpaca.markets/v2/assets"] } + # D E P R E C A T E D + + , "api": { + "web_socket": { + # "wss://stream.data.alpaca.markets/v2/sip" + "url": "wss://stream.data.alpaca.markets/v2/iex" + } + , "REST": { + "hist_md_bars": ["GET", "https://data.alpaca.markets/v2/stocks/bars"] + , "hist_md_quotes": ["GET", "https://data.alpaca.markets/v2/stocks/quotes"] + , "hist_md_trades": ["GET", "https://data.alpaca.markets/v2/stocks/trades"] + , "latest_trade": ["GET", "https://data.alpaca.markets/v2/stocks/{symbol}/trades/latest"] + , "assets": ["GET", "https://api.alpaca.markets/v2/assets"] + # , "assets": ["GET", "https://data.alpaca.markets/v2/assets"] + } + } } , "accounting": { "class": "cvttpy.exchanges.alpaca.acct_client.AlpacaAccounting" + # D E P R E C A T E D , "REST": { "balances_url": ["GET", "https://api.alpaca.markets/v2/positions"] , "account_info_url": ["GET", "https://api.alpaca.markets/v2/account"] , "trades_url": ["GET", "https://api.alpaca.markets/v2/account/activities/FILL"] } - } - } - , "ALPACA_SIM": { - # https://docs.alpaca.markets/reference/ - "exchange_id": "ALPACA" - , "name": "Alpaca Trading" - , "type": "EQUITY" + # D E P R E C A T E D - - , "mktdata" : { - "class": "cvttpy.exchanges.mkt_simulator.md_client.MktSimMdClientFeed" - "ws_url": ["WS", "ws://localhost:10180/ws"] - } - - , "order_entry": { - "class": "cvttpy.exchanges.mkt_simulator.oe_client.MarketSimulatorOEClient" - - , "REST": { - "new_order_url": ["POST", "http://localhost:10182/order"] - , "cancel_order_url": ["POST", "http://localhost:10182/cancel"] - , "cancel_all_url": ["POST", "http://localhost:10182/cancel_all"] - , "open_orders_url": ["GET", "http://localhost:10182/open_orders"] - , "order_status_url": ["GET", "http://localhost:10182/order_status"] - }, - "ws_url": ["WSS", "ws://localhost:10181/ws"] - } - , "accounting": { - "class": "cvttpy.exchanges.mkt_simulator.acct_client.MktSimAccounting" - , "REST": { - "positions_url": ["GET", "http://localhost:10083/positions"] - , "trades_url": ["GET", "http://localhost:10083/trades"] + , "api": { + "REST": { + "balances_url": ["GET", "https://api.alpaca.markets/v2/positions"] + , "account_info_url": ["GET", "https://api.alpaca.markets/v2/account"] + , "trades_url": ["GET", "https://api.alpaca.markets/v2/account/activities/FILL"] + } } } } @@ -91,6 +100,7 @@ , "order_entry": { "class": "cvttpy.exchanges.alpaca.oe_client.AlpacaOrderEntryClient" + # D E P R E C A T E D , "REST": { "submit_order_url": ["POST", "https://paper-api.alpaca.markets/v2/orders"] , "orders_url": ["GET", "https://paper-api.alpaca.markets/v2/orders"] @@ -99,11 +109,26 @@ , "cancel_all_url": ["DELETE", "https://paper-api.alpaca.markets/v2/orders"] } , "ws_url": ["WSS", "wss://paper-api.alpaca.markets/stream"] + # D E P R E C A T E D + + , "api": { + "web_socket": { + "url": "wss://paper-api.alpaca.markets/stream" + } + , "REST": { + "submit_order_url": ["POST", "https://paper-api.alpaca.markets/v2/orders"] + , "orders_url": ["GET", "https://paper-api.alpaca.markets/v2/orders"] + , "order_status": ["GET", "https://paper-api.alpaca.markets/v2/orders/{order_id}"] + , "cancel_order_url": ["DELETE", "https://paper-api.alpaca.markets/v2/orders/{order_id}"] + , "cancel_all_url": ["DELETE", "https://paper-api.alpaca.markets/v2/orders"] + } + } } , "mktdata" : { "class": "cvttpy.exchanges.alpaca.mkt_data.AlpacaMdFeed" , "reconnect_secs": 2.0 + # D E P R E C A T E D # , "ws_url": ["WSS", "wss://stream.data.alpaca.markets/v2/sip"] , "ws_url": ["WSS", "wss://stream.data.alpaca.markets/v2/iex"] , "REST": { @@ -114,15 +139,39 @@ , "assets": ["GET", "https://paper-api.alpaca.markets/v2/assets"] # , "assets": ["GET", "https://data.alpaca.markets/v2/assets"] } + # D E P R E C A T E D + + , "api": { + "web_socket": { + "url": "wss://stream.data.alpaca.markets/v2/iex" + } + , "REST": { + "hist_md_bars": ["GET", "https://data.alpaca.markets/v2/stocks/bars"] + , "hist_md_quotes": ["GET", "https://data.alpaca.markets/v2/stocks/quotes"] + , "hist_md_trades": ["GET", "https://data.alpaca.markets/v2/stocks/trades"] + , "latest_trade": ["GET", "https://data.alpaca.markets/v2/stocks/{symbol}/trades/latest"] + , "assets": ["GET", "https://paper-api.alpaca.markets/v2/assets"] + } + } } , "accounting": { "class": "cvttpy.exchanges.alpaca.acct_client.AlpacaAccounting" + # D E P R E C A T E D , "REST": { "balances_url": ["GET", "https://paper-api.alpaca.markets/v2/positions"] , "account_info_url": ["GET", "https://paper-api.alpaca.markets/v2/account"] , "trades_url": ["GET", "https://paper-api.alpaca.markets/v2/account/activities/FILL"] } + # D E P R E C A T E D + + , "api": { + "REST": { + "balances_url": ["GET", "https://paper-api.alpaca.markets/v2/positions"] + , "account_info_url": ["GET", "https://paper-api.alpaca.markets/v2/account"] + , "trades_url": ["GET", "https://paper-api.alpaca.markets/v2/account/activities/FILL"] + } + } } } # ---------------------------- B @@ -138,7 +187,15 @@ "class": "cvttpy.exchanges.bitstamp.mkt_data.BitstampMdFeed" , "reconnect_secs": 2 + # D E P R E C A T E D , "ws_url": ["WSS", "wss://ws.bitstamp.net"] + # D E P R E C A T E D + + , "api": { + "web_socket": { + "url": "wss://ws.bitstamp.net" + } + } } } , "BNBFUT": { @@ -151,12 +208,23 @@ , "max_connections": 10 , "reconnect_secs": 2.0 + # D E P R E C A T E D , "ws_url": ["WSS", "wss://fstream.binance.com/ws"] - , "REST": { # https://fapi.binance.com/fapi/v1/depth?symbol=BNBBTC&limit=1000 "depth_snapshot_url": ["GET", "https://fapi.binance.com/fapi/v1/depth"], } + # D E P R E C A T E D + + , "api": { + "web_socket": { + "url": "wss://fstream.binance.com/ws" + } + , "REST": { + # https://fapi.binance.com/fapi/v1/depth?symbol=BNBBTC&limit=1000 + "depth_snapshot_url": ["GET", "https://fapi.binance.com/fapi/v1/depth"], + } + } } } @@ -171,11 +239,24 @@ , "reconnect_secs": 2.0 + # D E P R E C A T E D , "ws_url": ["WSS", "wss://stream.binance.com/ws"] , "REST": { # https://api.binance.com/api/v3/depth?symbol=BNBBTC&limit=1000 "depth_snapshot_url": ["GET", "https://api.binance.com/api/v3/depth"], } + # D E P R E C A T E D + + , "api": { + "web_socket": { + "url": "wss://stream.binance.com/ws" + } + , "REST": { + # https://api.binance.com/api/v3/depth?symbol=BNBBTC&limit=1000 + "depth_snapshot_url": ["GET", "https://api.binance.com/api/v3/depth"], + } + } + } } , "BNBSPOT_US": { @@ -187,12 +268,23 @@ "class": "cvttpy.exchanges.binance.spot.mkt_data.BnbSpotMktDataFeed" , "reconnect_secs": 10 + # D E P R E C A T E D , "ws_url": ["WSS", "wss://stream.binance.us:9443/ws"] - , "REST": { # https://api.binance.com/api/v3/depth?symbol=BNBBTC&limit=1000 "depth_snapshot_url": ["GET", "https://api.binance.com/api/v3/depth"], } + # D E P R E C A T E D + + , "api": { + "web_socket": { + "url": "wss://stream.binance.us:9443/ws" + } + , "REST": { + # https://api.binance.com/api/v3/depth?symbol=BNBBTC&limit=1000 + "depth_snapshot_url": ["GET", "https://api.binance.com/api/v3/depth"], + } + } } } , "COINBASE_AT": { @@ -203,22 +295,45 @@ , "order_entry": { "class": "cvttpy.exchanges.coinbase.spot.oe_client.CoinbaseSpotOEClient" + # D E P R E C A T E D + , "ws_url": ["WSS", "wss://advanced-trade-ws.coinbase.com"] , "REST": { "open_orders_url": ["GET", "https://api.coinbase.com/api/v3/brokerage/orders/historical/batch"] , "submit_order_url": ["POST", "https://api.coinbase.com/api/v3/brokerage/orders"] , "cancel_order_url": ["POST", "https://api.coinbase.com/api/v3/brokerage/orders/batch_cancel"] } - , "ws_url": ["WSS", "wss://advanced-trade-ws.coinbase.com"] + # D E P R E C A T E D + + , "api": { + "web_socket": { + "url": "wss://advanced-trade-ws.coinbase.com" + } + , "REST": { + "open_orders_url": ["GET", "https://api.coinbase.com/api/v3/brokerage/orders/historical/batch"] + , "submit_order_url": ["POST", "https://api.coinbase.com/api/v3/brokerage/orders"] + , "cancel_order_url": ["POST", "https://api.coinbase.com/api/v3/brokerage/orders/batch_cancel"] + } + } } , "accounting": { "class": "cvttpy.exchanges.coinbase.spot.account.CoinbaseSpotAccounting" + # D E P R E C A T E D , "REST": { "balances_url": ["GET", "https://api.coinbase.com/api/v3/brokerage/accounts"] , "get_trades_url": ["GET", "https://api.coinbase.com/api/v3/brokerage/orders/historical/fills"] , "get_transactions_url": ["GET", "https://api.coinbase.com/api/v3/brokerage/transaction_summary"] } + # D E P R E C A T E D + + , "api": { + "REST": { + "balances_url": ["GET", "https://api.coinbase.com/api/v3/brokerage/accounts"] + , "get_trades_url": ["GET", "https://api.coinbase.com/api/v3/brokerage/orders/historical/fills"] + , "get_transactions_url": ["GET", "https://api.coinbase.com/api/v3/brokerage/transaction_summary"] + } + } } , "mktdata" : { @@ -228,37 +343,14 @@ , "max_connections": 10 , "price_throttle": true + # D E P R E C A T E D , "ws_url": ["WSS", "wss://ws-feed.exchange.coinbase.com"] - } - } - , "COINBASE_SIM": { - "exchange_id": "COINBASE" - , "name": "Coinbase Advanced Trade (Simulation)" - , "type": "SPOT" + # D E P R E C A T E D - - , "mktdata" : { - "class": "cvttpy.exchanges.mkt_simulator.md_client.MktSimMdClientFeed" - "ws_url": ["WS", "ws://localhost:8080/ws"] - } - - , "order_entry": { - "class": "cvttpy.exchanges.mkt_simulator.oe_client.MarketSimulatorOEClient" - - , "REST": { - "new_order_url": ["POST", "http://localhost:8181/order"] - , "cancel_order_url": ["POST", "http://localhost:8181/cancel"] - , "cancel_all_url": ["POST", "http://localhost:8181/cancel_all"] - , "open_orders_url": ["GET", "http://localhost:8181/open_orders"] - , "order_status_url": ["GET", "http://localhost:8181/order_status"] - }, - "ws_url": ["WSS", "ws://localhost:8180/ws"] - } - , "accounting": { - "class": "cvttpy.exchanges.mkt_simulator.acct_client.MktSimAccounting" - , "REST": { - "positions_url": ["GET", "http://localhost:8182/positions"] - , "trades_url": ["GET", "http://localhost:8182/trades"] + , "api": { + "web_socket": { + "url": "wss://ws-feed.exchange.coinbase.com" + } } } } @@ -276,18 +368,16 @@ "class": "cvttpy.exchanges.gemini.mkt_data.GeminiMdFeed" , "reconnect_secs": 1 + # D E P R E C A T E D , "ws_url": ["WSS" , "wss://api.gemini.com/v2/marketdata"] + # D E P R E C A T E D + + , "api": { + "web_socket": { + "url": "wss://api.gemini.com/v2/marketdata" + } + } } - # , "REST": { - # "open_orders_url": ["POST", "https://api.gemini.com/v1/orders"] - # , "order_status_url": ["POST", "https://api.gemini.com/v1/order/status"] - # , "cancel_all_url": ["POST", "https://api.gemini.com/v1/order/cancel/all"] - # , "balances_url": ["POST", "https://api.gemini.com/v1/balances"] - # , "positions_url": ["POST", "https://api.gemini.com/v1/positions"] - # , "trades_url": ["POST", "https://api.gemini.com/v1/mytrades"] - # , "symbol_url": ["GET", "https://api.gemini.com/v1/symbols/details"] - # , "margin_url": ["POST", "https://api.gemini.com/v1/margin"] - # } } , "GEMINI-SNDBX": { @@ -303,18 +393,34 @@ "class": "cvttpy.exchanges.gemini.mkt_data.GeminiMdFeed" , "reconnect_secs": 1 + # D E P R E C A T E D , "ws_url": ["WSS" , "wss://api.sandbox.gemini.com/v2/marketdata"] + # D E P R E C A T E D + + , "api": { + "web_socket": { + "url": "wss://api.sandbox.gemini.com/v2/marketdata" + } + } } , "order_entry": { + # D E P R E C A T E D "REST": { "order_status_url": ["POST", "https://api.sandbox.gemini.com/v1/order/status"] , "cancel_all_url": ["POST", "https://api.sandbox.gemini.com/v1/order/cancel/all"] } + # D E P R E C A T E D - + , "api": { + "REST": { + "order_status_url": ["POST", "https://api.sandbox.gemini.com/v1/order/status"] + , "cancel_all_url": ["POST", "https://api.sandbox.gemini.com/v1/order/cancel/all"] + } + } } , "accounting": { "class": "cvttpy.exchanges.gemini.account.GeminiExchAccounting" + # D E P R E C A T E D , "REST": { "open_orders_url": ["POST", "https://api.sandbox.gemini.com/v1/orders"] , "order_status_url": ["POST", "https://api.sandbox.gemini.com/v1/order/status"] @@ -324,6 +430,19 @@ , "symbol_url": ["GET", "https://api.sandbox.gemini.com/v1/symbols/details"] , "margin_url": ["POST", "https://api.sandbox.gemini.com/v1/margin"] } + # D E P R E C A T E D + + , "api": { + "REST": { + "open_orders_url": ["POST", "https://api.sandbox.gemini.com/v1/orders"] + , "order_status_url": ["POST", "https://api.sandbox.gemini.com/v1/order/status"] + , "balances_url": ["POST", "https://api.sandbox.gemini.com/v1/balances"] + , "positions_url": ["POST", "https://api.sandbox.gemini.com/v1/positions"] + , "trades_url": ["POST", "https://api.sandbox.gemini.com/v1/mytrades"] + , "symbol_url": ["GET", "https://api.sandbox.gemini.com/v1/symbols/details"] + , "margin_url": ["POST", "https://api.sandbox.gemini.com/v1/margin"] + } + } } } # ---------------------------- K @@ -338,8 +457,17 @@ , "reconnect_secs": 2.0 + # D E P R E C A T E D , "ws_url": ["WSS", "wss://ws.kraken.com/v2"] , "REST": {} + # D E P R E C A T E D + + , "api": { + "web_socket": { + "url": "wss://ws.kraken.com/v2" + } + , "REST": {} + } } } # ---------------------------- O @@ -354,8 +482,82 @@ , "reconnect_secs": 2.0 + # D E P R E C A T E D , "ws_url": ["WSS", "wss://ws.okx.com:8443/ws/v5/public"] , "REST": {} + # D E P R E C A T E D + + , "api": { + "web_socket": { + "url": "wss://ws.okx.com:8443/ws/v5/public" + } + , "REST": {} + } } } } + + # , "ALPACA_SIM": { + # # https://docs.alpaca.markets/reference/ + # "exchange_id": "ALPACA" + # , "name": "Alpaca Trading" + # , "type": "EQUITY" + + + # , "mktdata" : { + # "class": "cvttpy.exchanges.mkt_simulator.md_client.MktSimMdClientFeed" + # "ws_url": ["WS", "ws://localhost:10180/ws"] + # } + + # , "order_entry": { + # "class": "cvttpy.exchanges.mkt_simulator.oe_client.MarketSimulatorOEClient" + + # , "REST": { + # "new_order_url": ["POST", "http://localhost:10182/order"] + # , "cancel_order_url": ["POST", "http://localhost:10182/cancel"] + # , "cancel_all_url": ["POST", "http://localhost:10182/cancel_all"] + # , "open_orders_url": ["GET", "http://localhost:10182/open_orders"] + # , "order_status_url": ["GET", "http://localhost:10182/order_status"] + # }, + # "ws_url": ["WSS", "ws://localhost:10181/ws"] + # } + # , "accounting": { + # "class": "cvttpy.exchanges.mkt_simulator.acct_client.MktSimAccounting" + # , "REST": { + # "positions_url": ["GET", "http://localhost:10083/positions"] + # , "trades_url": ["GET", "http://localhost:10083/trades"] + # } + # } + # } + + # , "COINBASE_SIM": { + # "exchange_id": "COINBASE" + # , "name": "Coinbase Advanced Trade (Simulation)" + # , "type": "SPOT" + + + # , "mktdata" : { + # "class": "cvttpy.exchanges.mkt_simulator.md_client.MktSimMdClientFeed" + # "ws_url": ["WS", "ws://localhost:8080/ws"] + # } + + # , "order_entry": { + # "class": "cvttpy.exchanges.mkt_simulator.oe_client.MarketSimulatorOEClient" + + # , "REST": { + # "new_order_url": ["POST", "http://localhost:8181/order"] + # , "cancel_order_url": ["POST", "http://localhost:8181/cancel"] + # , "cancel_all_url": ["POST", "http://localhost:8181/cancel_all"] + # , "open_orders_url": ["GET", "http://localhost:8181/open_orders"] + # , "order_status_url": ["GET", "http://localhost:8181/order_status"] + # }, + # "ws_url": ["WSS", "ws://localhost:8180/ws"] + # } + # , "accounting": { + # "class": "cvttpy.exchanges.mkt_simulator.acct_client.MktSimAccounting" + # , "REST": { + # "positions_url": ["GET", "http://localhost:8182/positions"] + # , "trades_url": ["GET", "http://localhost:8182/trades"] + # } + # } + # }