This commit is contained in:
Cryptoval Trading Technologies 2024-02-09 23:37:26 +00:00
parent 60c520f803
commit 312aa0b227
11 changed files with 408 additions and 53 deletions

View File

@ -1,18 +1,20 @@
@var CONFIG_SVC_HOST=cloud16.cvtt.vpn
@var ResultPath=/tmp
{
"refdata": @inc=http://${CONFIG_SVC_HOST}:6789/refdata/refdata
, "redis": @inc=http://${CONFIG_SVC_HOST}:6789/apps/redis
, "cvttcomm": {
"type": "redis"
, "redis_settings": "localhost"
# , "redis_settings": "localhost"
, "redis_settings": "cloud17"
}
, "books": {
"CVTT_BK01": {}
}
, "backtest": {
"__dummy__": null"total_value"
, "exchanges_settings": {
"exchanges_settings": {
"*": {
"mkt_data": {
"enabled": true
@ -34,8 +36,8 @@
, "credentials_key": "TSDB_MD_CVTTDATA_RO"
}
# , "interval": "4 hours"
, "interval": "1 hour"
, "from_time": "2023-12-28 02:00:00"
, "interval": "3 hours"
, "from_time": "2024-02-01 03:00:00"
}
, "initial_positions": {
"COINBASE": {
@ -52,10 +54,15 @@
, "pricing_method": "BY_MKT_TRD_PRICE_BY_ORDER"
# , "presubscribe_md_types": ["BOOK_TOP", "TRADES"]
}
, "result": {
"repository": "${ResultPath}/backtest_results.json"
, "db_file": "${ResultPath}/%T.backtest.db"
}
}
# --------------------------------------------------------------------
, "trader": {
"app_channel": "TRDR"
"app_channel": "TRDR" active_exchanges_: str
, "is_short_allowed": false
, "algo": "TRDALGO_001"
, "exchanges_settings": {
@ -107,6 +114,7 @@
"app_channel": "QUANT"
# , "strategy": "CVTT_QST001"
, "strategy": "VWAP001"
, "strategies": {
"CVTT_QST001": {
"class": "cvttpy.trading.strategies.test_strat.SeesawTestStrategy"
@ -123,6 +131,7 @@
, "cred_key": "TSDB_MD_CVTTDATA_RO"
, "data_type": "OHLCV"
}
, "publish_details": true
}
}
}
@ -173,7 +182,8 @@
}
, "trading_recorder": {
# "format": "CSV"
"format": "TSDB"
# "format": "TSDB"
"format": "SQLite"
, "csv_settings": {
"order_events_file_path": "%T.order_events.csv"
"position_events_file_path": "%T.position_events.csv"
@ -187,6 +197,10 @@
, "trade_events_table": "backtest.trading_trades"
, "trading_md_summary_table": "backtest.trading_md"
}
, "sqlite_settings": {
# "file_name": "/tmp/%T.cvtt_backtest.db"
"file_name": "/tmp/cvtt_backtest.db"
}
}
}

204
data/apps/cvtt_prod.cfg Normal file
View File

@ -0,0 +1,204 @@
@var CONFIG_SVC_HOST=cloud16.cvtt.vpn
@var ResultPath=/tmp
{
"refdata": @inc=http://${CONFIG_SVC_HOST}:6789/refdata/refdata
, "redis": @inc=http://${CONFIG_SVC_HOST}:6789/apps/redis
, "cvttcomm": {
"type": "redis"
# , "redis_settings": "localhost"
, "redis_settings": "cvtt-prod"
}
, "books": {
"CVTT_BK01": {}
}
# , "backtest": {
# "exchanges_settings": {
# "*": {
# "mkt_data": {
# "enabled": true
# , "streaming": true
# }
# ,"order_entry": {
# "enabled": true
# , "streaming": true
# }
# ,"accounting": {
# "enabled": true
# , "streaming": false
# }
# }
# }
# , "source": {
# "database": {
# "class": "cvttpy.tools.db.timescale.tsdb_client.TimescaleDbClient"
# , "credentials_key": "TSDB_MD_CVTTDATA_RO"
# }
# # , "interval": "4 hours"
# , "interval": "3 hours"
# , "from_time": "2023-12-28 03:00:00"
# }
# , "initial_positions": {
# "COINBASE": {
# "BTC": 0
# , "USD": 1000.0
# }
# }
# , "simulation": {
# "speed_factor": 0.0
# }
# , "execution": {
# "top_only": true
# ,"min_order_age_sec": 0.1
# , "pricing_method": "BY_MKT_TRD_PRICE_BY_ORDER"
# # , "presubscribe_md_types": ["BOOK_TOP", "TRADES"]
# }
# , "result": {
# "repository": "${ResultPath}/backtest_results.json"
# , "db_file": "${ResultPath}/%T.backtest.db"
# }
# }
# --------------------------------------------------------------------
, "trader": {
"app_channel": "TRDR" active_exchanges_: str
, "is_short_allowed": false
, "algo": "TRDALGO_001"
, "exchanges_settings": {
"COINBASE_AT": {
"mkt_data": {
"enabled": true
, "streaming": true
},
}
}
, "algos": {
"TRDALGO_001": {
"class": "cvttpy.trading.algos.simple.SimpleTradingAlgo"
, "params": {}
}
}
, "trading_pos_diff_pct_trigger": 10.0
, "trading_depth": {
"BTC": 0.001
# "BTC": 0.1
}
}
# --------------------------------------------------------------------
"executor": {
"app_channel": "EXEC"
, "exchanges_settings": {
"COINBASE_AT": {
"order_entry": {
"enabled": true
, "streaming": true
},
"mkt_data": {
"enabled": false
, "streaming": false
},
"accounting": {
"enabled": false
, "streaming": false
}
, "credentials_key": {
"read_only": "COINBASE_ADV_RO"
, "trade": "COINBASE_ADV_TRD"
}
}
}
}
# --------------------------------------------------------------------
, "quant": {
"app_channel": "QUANT"
# , "strategy": "CVTT_QST001"
, "strategy": "VWAP001"
, "strategies": {
"CVTT_QST001": {
"class": "cvttpy.trading.strategies.test_strat.SeesawTestStrategy"
, "params": {
"dummy": "dummy"
}
}
, "VWAP001": {
"class": "cvttpy.trading.strategies.vwap_strat.VWAP001"
, "params": {
"vwap_interval": "1 hour"
, "hist_md_database": {
"class": "cvttpy.tools.db.timescale.tsdb_client.TimescaleDbClient"
, "cred_key": "TSDB_MD_CVTTDATA_RO"
, "data_type": "OHLCV"
}
}
}
}
, "exchanges_settings": {
"COINBASE_AT": {
"mkt_data": {
"enabled": true
, "streaming": true
},
}
}
}
# --------------------------------------------------------------------
, "risk_manager": {
"app_channel": "RMGR"
, "books": {
"CVTT_BK01": {}
}
, "db": {
"positions_table": "prod.cvtt_positions"
, "cred_key": {
"write": "TSDB_TRD_CVTTDATA"
, "read_only": "TSDB_TRD_CVTTDATA"
}
}
, "positions": {
"load_interval_sec": 10.0
, "to_store_zero_positions": false
, "to_save_unchanged_positions": false
}
, "publish_value_interval": 10.0
, "exchanges_settings": {
"COINBASE_AT": {
"mkt_data": {
"enabled": true
, "streaming": true
},
"accounting": {
"enabled": true
, "streaming": false
}
, "credentials_key": {
"trade": "COINBASE_ADV"
, "read_only": "COINBASE_ADV_RO"
}
}
}
}
, "trading_recorder": {
# "format": "CSV"
# "format": "TSDB"
"format": "SQLite"
, "csv_settings": {
"order_events_file_path": "%T.order_events.csv"
"position_events_file_path": "%T.position_events.csv"
}
, "tsdb_settings": {
"db": {
"class": "cvttpy.tools.db.timescale.tsdb_client.TimescaleDbClient"
, "cred_key": "TSDB_TRD_CVTTDATA_DB_TEST"
}
, "order_events_table": "backtest.trading_orders"
, "trade_events_table": "backtest.trading_trades"
, "trading_md_summary_table": "backtest.trading_md"
}
, "sqlite_settings": {
# "file_name": "/tmp/%T.cvtt_backtest.db"
"file_name": "/tmp/cvtt_backtest.db"
}
}
}

View File

@ -18,19 +18,19 @@
, "status_channel": "Status-CVTT"
}
, "data_checks": {
# "BNBFUT-1": {
# "tables": ["bnbfut.md_booktops"]
# , "exchange_id": "BNBFUT"
# , "instruments": ["PERP-BTC-USDT"]
# , "threshold_sec": 15.0
# }
# , "BNBFUT-2": {
# "tables": ["bnbfut.md_trades"]
# , "exchange_id": "BNBFUT"
# , "instruments": ["PERP-BTC-USDT"]
# , "threshold_sec": 15.0
# }
"BNBSPOT-1": {
"BNBFUT-1": {
"tables": ["bnbfut.md_booktops"]
, "exchange_id": "BNBFUT"
, "instruments": ["PERP-BTC-USDT"]
, "threshold_sec": 15.0
}
, "BNBFUT-2": {
"tables": ["bnbfut.md_trades"]
, "exchange_id": "BNBFUT"
, "instruments": ["PERP-BTC-USDT"]
, "threshold_sec": 15.0
}
, "BNBSPOT-1": {
"tables": ["bnbspot.md_booktops"]
, "exchange_id": "BNBSPOT"
, "instruments": ["PAIR-BTC-USDT"]

View File

@ -0,0 +1,54 @@
{
"check_interval_sec": 10.0
, "status_report_interval_sec": 3600.0
, "after_alert_interval_sec": 180.0 #
, "db": {
"CLD21": {
"class": "cvttpy.tools.db.timescale.tsdb_client.TimescaleDbClient"
, "cred_key": "TSDB_MD_CLD21_RO"
}
}
, "mmost": {
"cred_key": "MATTERMOST"
, "alert_channel": "Alerts-CVTT"
, "status_channel": "Status-CVTT"
}
, "data_checks": {
"BNBFUT-1": {
"tables": ["bnbfut.md_booktops"]
, "exchange_id": "BNBFUT"
, "instruments": ["PERP-BTC-USDT"]
, "threshold_sec": 30.0
}
, "BNBFUT-2": {
"tables": ["bnbfut.md_trades"]
, "exchange_id": "BNBFUT"
, "instruments": ["PERP-BTC-USDT"]
, "threshold_sec": 30.0
}
, "BNBSPOT-1": {
"tables": ["bnbspot.md_booktops"]
, "exchange_id": "BNBSPOT"
, "instruments": ["PAIR-BTC-USDT"]
, "threshold_sec": 30.0
}
, "BNBSPOT-2": {
"tables": ["bnbspot.md_trades"]
, "exchange_id": "BNBSPOT"
, "instruments": ["PAIR-BTC-USDT"]
, "threshold_sec": 30.0
}
, "COINBASE-1": {
"tables": ["coinbase.md_booktops"]
, "exchange_id": "COINBASE"
, "instruments": ["PAIR-BTC-USD"]
, "threshold_sec": 30.0
}
, "COINBASE-2": {
"tables": ["coinbase.md_trades"]
, "exchange_id": "COINBASE"
, "instruments": ["PAIR-BTC-USD"]
, "threshold_sec": 30.0
}
}
}

View File

@ -4,11 +4,6 @@
"md_recorder": {
"db": {
"class": "cvttpy.tools.db.timescale.tsdb_client.TimescaleDbClient"
, "connect": {
"host": "cvttdata.cvtt.vpn"
, "port": 5432
, "database": "coinbase"
}
}
, "flush_interval_sec": 0.5
@ -33,7 +28,7 @@
, "PAIR-ETH-USDT": ["TRADES", "BOOK_TOP"]
, "PAIR-LTC-USDT": ["TRADES", "BOOK_TOP"]
, "PAIR-XRP-USDT": ["TRADES", "BOOK_TOP"]
, "PAIR-USDT-USD": ["TRADES", "BOOK_TOP"]
, "PAIR-USDC-USDT": ["TRADES", "BOOK_TOP"]
}
, "tables": {
"trades": "bnbspot.md_trades"
@ -57,6 +52,7 @@
# ----------------------------------
, "refdata": @inc=http://${CONFIG_SVC_HOST}:6789/refdata/refdata
, "redis": @inc=http://${CONFIG_SVC_HOST}:6789/apps/redis
, "exchanges_settings": {
"COINBASE_AT": {
"order_entry": {

View File

@ -14,4 +14,14 @@
, "read_timeout" : 0.01
, "ping_timeout_secs": 2.0
}
, "cvttdata": {
"url": "redis://cvttdata.cvtt.vpn"
, "read_timeout" : 0.01
, "ping_timeout_secs": 2.0
}
, "cvtt-prod": {
"url": "redis://cvtt-prod-01.cvtt.vpn"
, "read_timeout" : 0.01
, "ping_timeout_secs": 2.0
}
}

View File

@ -3,17 +3,23 @@
"__DUMMY__": null
, "exchanges_settings": {
"CVTT_COINBASE": {
"COINBASE_AT": {
"accounting": {
"enabled": true
, "streaming": false
}
, "credentials_key": {
"read_only": "COINBASE_ADV_RO"
}
, "CVTT_COINBASE_LOCAL": {
}
, "ALPACA_SNDBX": {
"accounting": {
"enabled": true
, "streaming": false
}
, "credentials_key": {
"read_only": "ALPACA_SANDBOX"
}
}
}
, "refdata": @inc=http://${CONFIG_SVC_HOST}:6789/refdata/refdata

View File

@ -0,0 +1,19 @@
@var CONFIG_SVC_HOST=cloud16.cvtt.vpn
{
"__DUMMY__": null
, "exchanges_settings": {
"COINBASE_AT": {
"accounting": {
"enabled": true
, "streaming": false
}
, "credentials_key": {
"read_only": "COINBASE_ADV_RO"
}
}
}
, "refdata": @inc=http://${CONFIG_SVC_HOST}:6789/refdata/refdata
, "redis": @inc=http://${CONFIG_SVC_HOST}:6789/apps/redis
}

View File

@ -1,11 +1,19 @@
{
"__DUMMY__": {}
# ---------------------------------------------
, "ALPACA": {
"instruments": {
"STOCK-AAPL": {
"md_symbol": "AAPL",
"trade_symbol": "AAPL"
}
, "STOCK-IBM": {
"md_symbol": "IBM",
"trade_symbol": "IBM"
}
}
}
, "BNBSPOT": {
# "aliases": [
# "BNBSPOT-MD",
# "BNBS-TST"
# ],
"instruments": {
"PAIR-AAVE-BUSD": {
"md_symbol": "AAVEBUSD",
@ -91,9 +99,9 @@
"md_symbol": "UNIBUSD",
"trade_symbol": "UNIBUSD"
},
"PAIR-USDT-USD": {
"md_symbol": "USDTUSD",
"trade_symbol": "USDTUSD"
"PAIR-USDC-USDT": {
"md_symbol": "USDCUSDT",
"trade_symbol": "USDCUSDT"
},
"PAIR-XRP-BTC": {
"md_symbol": "XRPBTC",

View File

@ -2,7 +2,37 @@
# @var DatabaseHost=cryptoval1.sheynin.home
{
"__DUMMY__": {}
# ---------------------- C
# ---------------------- A
, "ALPACA_SNDBX": {
"exchange_id": "ALPACA"
, "name": "Alpaca Trading"
, "type": "EQUITY"
, "cred_key": "ALPACA_SANDBOX"
, "order_entry": {
"class": "cvttpy.exchanges.alpaca.connector.AlpacaOrderEntryClient"
}
, "mktdata" : {
"class": "cvttpy.exchanges.alpaca.mkt_data.AlpacaStockFeed"
, "reconnect_secs": 2.0
# , "ws_url": ["WSS", "wss://stream.data.alpaca.markets/v2/sip"]
, "ws_url": ["WSS", "wss://stream.data.alpaca.markets/v2/iex"]
, "REST": {
}
}
, "accounting": {
"class": "cvttpy.exchanges.alpaca.account.AlpacaAccounting"
, "REST": {
"balances_url": ["GET", "https://paper-api.alpaca.markets/v2/positions"]
, "account_info": ["GET", "https://paper-api.alpaca.markets/v2/account"]
}
}
}
# ---------------------- B
, "BNBSPOT": {
"exchange_id": "BNBSPOT"
, "name": "Binance Spot"

View File

@ -247,7 +247,7 @@
"PAIR-USDC-USDT": {
"base_asset": "USDC",
"quote_asset": "USDT",
"quantity_precision": "1",
"quantity_precision": "0.01",
"price_tick": 0.0001
},
"PAIR-USDT-USD": {
@ -409,63 +409,77 @@
"quote_asset": "USDT",
"quantity_precision": "1",
"price_tick": 0.00001
},
}
# --- PERP-S
"PERP-SOL-BUSD": {
, "PERP-SOL-BUSD": {
"base_asset": "SOL",
"quote_asset": "BUSD",
"quantity_precision": "0.01",
"price_tick": 0.01
},
}
# --- PERP-U
"PERP-UNI-BUSD": {
, "PERP-UNI-BUSD": {
"base_asset": "UNI",
"quote_asset": "BUSD",
"quantity_precision": "0.01",
"price_tick": 0.01
},
}
# ****************************************************
# PERPCs (coin-margined)
# ****************************************************
# --- PERPC-B
"PERPC-BTC-USD": {
, "PERPC-BTC-USD": {
"base_asset": "BTC",
"quote_asset": "USD",
"quantity_precision": "1",
"price_tick": 0.1
},
}
# --- PERPC-D
"PERPC-DOGE-USD": {
, "PERPC-DOGE-USD": {
"base_asset": "DOGE",
"quote_asset": "USDT",
"quantity_precision": "1",
"price_tick": 0.000001
},
}
# --- PERPC-E
"PERPC-ETH-USD": {
, "PERPC-ETH-USD": {
"base_asset": "ETH",
"quote_asset": "USD",
"quantity_precision": "1",
"price_tick": 0.01
},
}
# --- PERPC-L
"PERPC-LINK-USD": {
, "PERPC-LINK-USD": {
"base_asset": "LINK",
"quote_asset": "USDT",
"quantity_precision": "1",
"price_tick": 0.001
},
"PERPC-LTC-USD": {
}
, "PERPC-LTC-USD": {
"base_asset": "LTC",
"quote_asset": "USDT",
"quantity_precision": "1",
"price_tick": 0.01
},
}
# --- PERPC-M
"PERPC-MATIC-USD": {
, "PERPC-MATIC-USD": {
"base_asset": "MATIC",
"quote_asset": "USDT",
"quantity_precision": "1",
"price_tick": 0.0001
}
# ------------------- STOCKS
, "STOCK-AAPL": {
"base_asset": "EQT.AAPL"
, "quote_asset": "USD"
, "quantity_precision": "1"
, "price_tick": 0.01
}
, "STOCK-IBM": {
"base_asset": "EQT.IBM"
, "quote_asset": "USD"
, "quantity_precision": "1"
, "price_tick": 0.01
}
}