From f512abe2715150d3a6210fe37a79f991f6f8f2a5 Mon Sep 17 00:00:00 2001 From: Cryptoval Trading Technologies Date: Tue, 15 Oct 2024 23:37:40 +0000 Subject: [PATCH] progress with mkt simulator --- data/apps/research/mkt_simulator.cfg | 4 +-- data/refdata/exchanges.cfg | 50 +++++++++++++++++++--------- 2 files changed, 37 insertions(+), 17 deletions(-) diff --git a/data/apps/research/mkt_simulator.cfg b/data/apps/research/mkt_simulator.cfg index abd700d..a50f50e 100644 --- a/data/apps/research/mkt_simulator.cfg +++ b/data/apps/research/mkt_simulator.cfg @@ -106,8 +106,8 @@ , "short_sale_allowed": false , "fee_schedule": { - "taker_fee": 0.006 - "maker_fee": 0.004 + "taker_fee_rate": 0.006 + "maker_fee_rate": 0.004 } # , "presubscribe_md_types": ["BOOK_TOP", "TRADES"] } diff --git a/data/refdata/exchanges.cfg b/data/refdata/exchanges.cfg index db88a1b..2cd7b21 100644 --- a/data/refdata/exchanges.cfg +++ b/data/refdata/exchanges.cfg @@ -12,7 +12,7 @@ , "cred_key": "ALPACA_SANDBOX" , "order_entry": { - "class": "cvttpy.exchanges.alpaca.connector.AlpacaOrderEntryClient" + "class": "cvttpy.exchanges.alpaca.oe_client.AlpacaOrderEntryClient" , "REST": { "submit_order_url": ["POST", "https://paper-api.alpaca.markets/v2/orders"] @@ -57,7 +57,7 @@ , "cred_key": "ALPACA_SANDBOX" , "order_entry": { - "class": "cvttpy.exchanges.alpaca.connector.AlpacaOrderEntryClient" + "class": "cvttpy.exchanges.alpaca.oe_client.AlpacaOrderEntryClient" , "REST": { "submit_order_url": ["POST", "https://paper-api.alpaca.markets/v2/orders"] @@ -122,7 +122,7 @@ , "cred_key": "ALPACA_SANDBOX" , "order_entry": { - "class": "cvttpy.exchanges.alpaca.connector.AlpacaOrderEntryClient" + "class": "cvttpy.exchanges.alpaca.oe_client.AlpacaOrderEntryClient" , "REST": { "submit_order_url": ["POST", "https://paper-api.alpaca.markets/v2/orders"] @@ -254,7 +254,7 @@ , "type": "SPOT" , "order_entry": { - "class": "cvttpy.exchanges.coinbase.spot.connector.CoinbaseSpotRestExchConnector" + "class": "cvttpy.exchanges.coinbase.spot.oe_client.CoinbaseSpotOEClient" , "REST": { "open_orders_url": ["GET", "https://api.coinbase.com/api/v3/brokerage/orders/historical/batch"] @@ -290,7 +290,7 @@ , "type": "SPOT" , "order_entry": { - "class": "cvttpy.exchanges.coinbase.spot.connector.CoinbaseSpotRestExchConnector" + "class": "cvttpy.exchanges.coinbase.spot.oe_client.CoinbaseSpotOEClient" , "REST": { "open_orders_url": ["GET", "https://api.coinbase.com/api/v3/brokerage/orders/historical/batch"] @@ -323,9 +323,29 @@ , "mktdata" : { - "class": "cvttpy.exchanges.mkt_simulator.mkt_data.MktSimMdClientFeed" + "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"] + } + } } # ---------------------------- G , "GEMINI": { @@ -430,16 +450,16 @@ , "channel_prefix": "MD_ALPACA_03" } } - , "MARKET_SIMULATOR": { - "exchange_id": "MARKET_SIMULATOR" - , "name": "Market Simulator" - , "type": "SIM" + # , "MARKET_SIMULATOR": { + # "exchange_id": "MARKET_SIMULATOR" + # , "name": "Market Simulator" + # , "type": "SIM" - , "mktdata" : { - "class": "cvttpy.exchanges.mkt_simulator.mkt_data.MktSimMdClientFeed" - "ws_url": ["WS", "ws://localhost:8080/ws"] - } - } + # , "mktdata" : { + # "class": "cvttpy.exchanges.mkt_simulator.md_client.MktSimMdClientFeed" + # "ws_url": ["WS", "ws://localhost:8080/ws"] + # } + # } # ---------------------------- O , "OKX": { "exchange_id": "OKX"