diff --git a/data/apps/exchange_accounts.cfg b/data/apps/exchange_accounts.cfg new file mode 100644 index 0000000..3af29bf --- /dev/null +++ b/data/apps/exchange_accounts.cfg @@ -0,0 +1,57 @@ +@var DatabaseHost=cryptoval1.cvtt.vpn +# @var DatabaseHost=cryptoval1.sheynin.home +{ + "__DUMMY__": {} + # ----------------------------- A + , "ALPACA_PROD01": { + "exchange": "ALPACA_PROD", + "credentials_key": "ALPACA_PROD" + } + , "ALPACA_SIM": { + "exchange": "ALPACA_SIM", + "credentials_key": "ALPACA_PROD" + } + , "ALPACA_SNDBX01": { + "exchange": "ALPACA_SNDBX", + "credentials_key": "ALPACA_SANDBOX" + } + # ---------------------------- B + , "BITSTAMP_ACCT": { + "exchange": "BITSTAMP", + } + , "BNBSPOT_ACCT": { + "exchange": "BNBSPOT" + } + , "BNBFUT01": { + "exchange": "BNBFUT" + } + , "BNBFUT02": { + "exchange": "BNBFUT-2" + } + + , "BNBSPOT_US01": { + "exchange": "BNBSPOT_US" + } + , "COINBASE_PROD01": { + "exchange": "COINBASE_AT" + } + , "COINBASE_SIM": { + "exchange_id": "COINBASE_SIM" + } + # ---------------------------- G + , "GEMINI01": { + "exchange": "GEMINI" + } + , "GEMINI-SNDBX01": { + "exchange": "GEMINI-SNDBX" + } + # ---------------------------- K + , "KRAKEN01": { + "exchange": "KRAKEN" + } + # ---------------------------- O + , "OKX01": { + "exchange": "OKX" + } +} + diff --git a/data/apps/tests/get_positions.cfg b/data/apps/tests/get_positions.cfg index b943b9b..dede7d6 100644 --- a/data/apps/tests/get_positions.cfg +++ b/data/apps/tests/get_positions.cfg @@ -2,6 +2,7 @@ "__DUMMY__": null , "exchanges_settings": { + "COINBASE_AT": { "accounting": { "enabled": true diff --git a/data/refdata/exchanges.cfg b/data/refdata/exchanges.cfg index 04480f5..12c8a2c 100644 --- a/data/refdata/exchanges.cfg +++ b/data/refdata/exchanges.cfg @@ -125,112 +125,6 @@ } } } - , "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"] - } - } - } # ---------------------------- B , "BITSTAMP": { "exchange_id": "BITSTAMP" @@ -298,16 +192,6 @@ } } - , "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" - } - } , "BNBSPOT_US": { "exchange_id": "BNBSPOT_US" , "name": "Binance.US" @@ -361,38 +245,6 @@ , "ws_url": ["WSS", "wss://ws-feed.exchange.coinbase.com"] } } - , "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" - } - - } , "COINBASE_SIM": { "exchange_id": "COINBASE" , "name": "Coinbase Advanced Trade (Simulation)" @@ -504,48 +356,6 @@ , "REST": {} } } - # ---------------------------- 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"] - # } - # } # ---------------------------- O , "OKX": { "exchange_id": "OKX" @@ -564,3 +374,192 @@ } } + # , "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"] + # } + # }