diff --git a/data/admin/docker_images.cfg b/data/admin/docker_images.cfg index 1726bdd..dff9fc5 100644 --- a/data/admin/docker_images.cfg +++ b/data/admin/docker_images.cfg @@ -24,12 +24,12 @@ "based_on_project": "cvttpy" # "additional_projects": [] } - , "Market Data Recorder": { - "image_name": "md_recorder", - "docker_dev_path": "market_data/md_recorder", - "based_on_project": "cvttpy" - "additional_projects": ["ops"] - } + # , "Market Data Recorder": { + # "image_name": "md_recorder", + # "docker_dev_path": "market_data/md_recorder", + # "based_on_project": "cvttpy" + # "additional_projects": ["ops"] + # } , "MD Rec MONITOR": { "image_name": "md_recorder_monitor", "docker_dev_path": "market_data/md_recorder_monitor", diff --git a/data/apps/exchange_accounts.cfg b/data/apps/__DEPRECATED__/exchange_accounts.cfg similarity index 100% rename from data/apps/exchange_accounts.cfg rename to data/apps/__DEPRECATED__/exchange_accounts.cfg diff --git a/data/apps/common/comm.cfg b/data/apps/common/comm.cfg index c3ef7c8..444ae5d 100644 --- a/data/apps/common/comm.cfg +++ b/data/apps/common/comm.cfg @@ -20,32 +20,8 @@ , "read_timeout" : 0.01 , "ping_timeout_secs": 2.0 } - , "cvttdata": { - "url": "redis://cvttdata.cvtt.vpn" - , "type": "redis" - , "read_timeout" : 0.01 - , "ping_timeout_secs": 2.0 - } - , "cvtt-testserver": { - "url": "redis://cvtt-testserver.cvtt.vpn" - , "type": "redis" - , "read_timeout" : 0.01 - , "ping_timeout_secs": 2.0 - } - , "cvtt-prod-eqty-01": { - "url": "redis://cvtt-prod-eqty-01.cvtt.vpn" - , "type": "redis" - , "read_timeout" : 0.01 - , "ping_timeout_secs": 2.0 - } - , "cvtt-prod-03": { - "url": "redis://cvtt-prod-03.cvtt.vpn" - , "type": "redis" - , "read_timeout" : 0.01 - , "ping_timeout_secs": 2.0 - } - , "cvtt-prod-eqty-01": { - "url": "redis://cvtt-prod-eqty-01.cvtt.vpn" + , "cvtt-prod-01": { + "url": "redis://cvtt-prod-01.cvtt.vpn:16379" , "type": "redis" , "read_timeout" : 0.01 , "ping_timeout_secs": 2.0 diff --git a/data/apps/cvtt_musvc.cfg b/data/apps/cvtt_musvc.cfg new file mode 100644 index 0000000..bcb5325 --- /dev/null +++ b/data/apps/cvtt_musvc.cfg @@ -0,0 +1,153 @@ +@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_AT" + , "BNBSPOT" + , "BNBFUT" + , "KRAKEN" + , "BITSTAMP" + , "OKX" + , "GEMINI" + , "ALPACA_SNDBX" + ] + } + , "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": [ + "ALPACA_SNDBX" + ] + } + , "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": [ + "ALPACA_SNDBX", "COINBASE_AT" + ] + } + , "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/refdata/exchange_instruments.cfg b/data/refdata/exchange_instruments.cfg index 51e673c..c0c39c6 100644 --- a/data/refdata/exchange_instruments.cfg +++ b/data/refdata/exchange_instruments.cfg @@ -435,7 +435,8 @@ , "quantity_precision": "0.00001" } } - } , "OKX": { + } + , "OKX": { "instruments": { # --- PAIRs "PAIR-BTC-USDT": { diff --git a/data/refdata/exchanges.cfg b/data/refdata/exchanges.cfg index 12c8a2c..e51f950 100644 --- a/data/refdata/exchanges.cfg +++ b/data/refdata/exchanges.cfg @@ -83,7 +83,7 @@ , "ALPACA_SNDBX": { # https://docs.alpaca.markets/reference/ "exchange_id": "ALPACA" - , "name": "Alpaca Trading" + , "name": "Alpaca Trading" , "type": "EQUITY" , "cred_key": "ALPACA_SANDBOX" @@ -101,7 +101,7 @@ , "ws_url": ["WSS", "wss://paper-api.alpaca.markets/stream"] } , "mktdata" : { - "class": "cvttpy.exchanges.alpaca.mkt_data.AlpacaStockFeed" + "class": "cvttpy.exchanges.alpaca.mkt_data.AlpacaMdFeed" , "reconnect_secs": 2.0 # , "ws_url": ["WSS", "wss://stream.data.alpaca.markets/v2/sip"] @@ -141,31 +141,13 @@ , "ws_url": ["WSS", "wss://ws.bitstamp.net"] } } - , "BNBSPOT": { - "exchange_id": "BNBSPOT" - , "name": "Binance Spot" - , "type": "SPOT" - - , "mktdata" : { - "class": "cvttpy.exchanges.binance.spot.mkt_data.BnbSpotMultiWsFeed" - , "max_connections": 10 - , "reconnect_secs": 2.0 - - - , "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"], - } - } - } , "BNBFUT": { "exchange_id": "BNBFUT" , "name": "Binance Futures USD-M" , "type": "FUTURES" , "mktdata" : { - "class": "cvttpy.exchanges.binance.futures.mkt_data.BnbFutMultiWsFeed" + "class": "cvttpy.exchanges.binance.futures.mkt_data.BnbFutMktDataFeed" , "max_connections": 10 , "reconnect_secs": 2.0 @@ -177,28 +159,32 @@ } } } - , "BNBFUT-2": { - "exchange_id": "BNBFUT" - , "name": "Binance Futures USD-M" - , "type": "FUTURES" + + , "BNBSPOT": { + "exchange_id": "BNBSPOT" + , "name": "Binance Spot" + , "type": "SPOT" , "mktdata" : { - "class": "cvttpy.exchanges.binance.futures.mkt_data.BinanceFuturesFeedWs2" + "class": "cvttpy.exchanges.binance.spot.mkt_data.BnbSpotMktDataFeed" , "max_connections": 10 , "reconnect_secs": 2.0 - , "ws_timeout_secs": 0.0001 - , "ws_url": ["WSS", "wss://fstream.binance.com/ws"] + + , "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"], + } } } - , "BNBSPOT_US": { "exchange_id": "BNBSPOT_US" , "name": "Binance.US" , "type": "SPOT" , "mktdata" : { - "class": "cvttpy.exchanges.binance.spot.mkt_data.BinanceSpotFeed" + "class": "cvttpy.exchanges.binance.spot.mkt_data.BnbSpotMktDataFeed" , "reconnect_secs": 10 , "ws_url": ["WSS", "wss://stream.binance.us:9443/ws"] @@ -236,7 +222,7 @@ } , "mktdata" : { - "class": "cvttpy.exchanges.coinbase.spot.mkt_data.CoinbaseMultiWsFeed" + "class": "cvttpy.exchanges.coinbase.spot.mkt_data.CoinbaseMdFeed" , "reconnect_secs": 2 , "max_connections": 10 @@ -292,7 +278,6 @@ , "ws_url": ["WSS" , "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"] @@ -304,6 +289,7 @@ # , "margin_url": ["POST", "https://api.gemini.com/v1/margin"] # } } + , "GEMINI-SNDBX": { # https://docs.gemini.com/rest-api "exchange_id": "GEMINI" @@ -363,7 +349,7 @@ , "type": "SPOT" , "mktdata" : { - "class": "cvttpy.exchanges.okx.mkt_data.OkxMultiWsFeed" + "class": "cvttpy.exchanges.okx.mkt_data.OkxMdFeed" , "max_connections": 10 , "reconnect_secs": 2.0 @@ -373,193 +359,3 @@ } } } - - # , "BNBFUT-BT-FEED": { - # "exchange_id": "BNBFUT" - # , "name": "Binance Futures USD-M" - # , "type": "FUTURES" - - # , "mktdata" : { - # "class": "cvttpy.exchanges.book_top_feed.mkt_data.BookTopFeedClient" - # , "mmap_file": "/tmp/BNBFUT.MD.dat" - # } - # } - # , "COINBASE_AT-MDPORTAL": { - # "exchange_id": "COINBASE" - # , "name": "Coinbase Advanced Trade" - # , "type": "SPOT" - - # , "order_entry": { - # "class": "cvttpy.exchanges.coinbase.spot.oe_client.CoinbaseSpotOEClient" - - # , "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"] - # } - - # , "accounting": { - # "class": "cvttpy.exchanges.coinbase.spot.account.CoinbaseSpotAccounting" - - # , "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" : { - # "class": "cvttpy.exchanges.proxies.md_portal_clnt.mkt_data.MktDataPortalFeed" - # , "portal_name": "MD_PORTAL_COINBS_01" - # } - # } - # , "ALPACA_SNDBX-MDPORTAL": { - # # https://docs.alpaca.markets/reference/ - # "exchange_id": "ALPACA" - # , "name": "Alpaca Trading" - # , "type": "EQUITY" - - # , "cred_key": "ALPACA_SANDBOX" - - # , "order_entry": { - # "class": "cvttpy.exchanges.alpaca.oe_client.AlpacaOrderEntryClient" - - # , "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"] - # } - # , "ws_url": ["WSS", "wss://paper-api.alpaca.markets/stream"] - # } - # , "mktdata" : { - # "class": "cvttpy.exchanges.proxies.md_portal_clnt.mkt_data.MktDataPortalFeed" - # , "portal_name": "MD_PORTAL_ALPACA_SNDBX" - - # # allow direct REST requests - # , "REST": { - # "hist_md_bars": ["GET", "https://data.alpaca.markets/v2/stocks/bars"] - # , "latest_trade": ["GET", "https://data.alpaca.markets/v2/stocks/{symbol}/trades/latest"] - # , "hist_md_quotes": ["GET", "https://data.alpaca.markets/v2/stocks/quotes"] - # , "hist_md_trades": ["GET", "https://data.alpaca.markets/v2/stocks/trades"] - # } - # } - # , "accounting": { - # "class": "cvttpy.exchanges.alpaca.account.AlpacaAccounting" - - # , "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"] - # } - # } - # } - # , "ALPACA-MD-REST-ONLY": { - # # https://docs.alpaca.markets/reference/ - # "exchange_id": "ALPACA" - # , "name": "Alpaca Trading" - # , "type": "EQUITY" - - # , "cred_key": "ALPACA_SANDBOX" - - # , "order_entry": { - # } - # , "mktdata" : { - # "class": "cvttpy.exchanges.alpaca.mkt_data.AlpacaStockFeed" - - # , "REST": { - # "hist_md_bars": ["GET", "https://data.alpaca.markets/v2/stocks/bars"] - # , "latest_trade": ["GET", "https://data.alpaca.markets/v2/stocks/{symbol}/trades/latest"] - # , "hist_md_quotes": ["GET", "https://data.alpaca.markets/v2/stocks/quotes"] - # , "hist_md_trades": ["GET", "https://data.alpaca.markets/v2/stocks/trades"] - # } - # } - # , "accounting": { - # } - # } - # , "ALPACA_SNDBX-MDP-03": { - # # https://docs.alpaca.markets/reference/ - # "exchange_id": "ALPACA" - # , "name": "Alpaca Trading" - # , "type": "EQUITY" - - # , "cred_key": "ALPACA_SANDBOX" - - # , "order_entry": { - # "class": "cvttpy.exchanges.alpaca.oe_client.AlpacaOrderEntryClient" - - # , "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"] - # } - # , "ws_url": ["WSS", "wss://paper-api.alpaca.markets/stream"] - # } - # , "mktdata" : { - # "class": "cvttpy.exchanges.proxies.md_portal_clnt.mkt_data.MktDataPortalFeed" - # , "portal_name": "MD_PORTAL_ALPACA_03" - - # , "REST": { - # "hist_md_bars": ["GET", "https://data.alpaca.markets/v2/stocks/bars"] - # , "latest_trade": ["GET", "https://data.alpaca.markets/v2/stocks/{symbol}/trades/latest"] - # , "hist_md_quotes": ["GET", "https://data.alpaca.markets/v2/stocks/quotes"] - # , "hist_md_trades": ["GET", "https://data.alpaca.markets/v2/stocks/trades"] - # } - # } - # , "accounting": { - # "class": "cvttpy.exchanges.alpaca.account.AlpacaAccounting" - - # , "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"] - # } - # } - # } - # ---------------------------- M - # , "MD_PORTAL_ALPACA_SNDBX": { - # "exchange_id": "MD_PORTAL" - # , "name": "MD Portal (proxy)" - # , "type": "PROXY" - - # , "mktdata" : { - # "class": "cvttpy.exchanges.proxies.md_portal_clnt.mkt_data.MktDataPortalFeed" - # , "comm_settings": "/comm/pubsub/redis/cvtt-prod-eqty-01" - # , "channel_prefix": "MD_ALPACA_SNDBX" - # } - # } - # , "MD_GATEWAY": { - # "exchange_id": "MD_GATEWAY" - # , "name": "MD Portal (proxy)" - # , "type": "PROXY" - - # , "mktdata" : { - # "class": "cvttpy.exchanges.proxies.md_gateway_clnt.mkt_data.MktDataGatewayFeed" - # } - # } - # , "MD_PORTAL_ALPACA_03": { - # "exchange_id": "MD_PORTAL" - # , "name": "MD Portal (proxy)" - # , "type": "PROXY" - - # , "mktdata" : { - # "class": "cvttpy.exchanges.proxies.md_portal_clnt.mkt_data.MktDataPortalFeed" - # , "comm_settings": "/comm/pubsub/redis/cvtt-prod-03" - # , "channel_prefix": "MD_ALPACA_03" - # } - # } - # , "MARKET_SIMULATOR": { - # "exchange_id": "MARKET_SIMULATOR" - # , "name": "Market Simulator" - # , "type": "SIM" - - # , "mktdata" : { - # "class": "cvttpy.exchanges.mkt_simulator.md_client.MktSimMdClientFeed" - # "ws_url": ["WS", "ws://localhost:8080/ws"] - # } - # }