From a53b8bbe3848823b3a1dfeb6c7bb5069c4ad2208 Mon Sep 17 00:00:00 2001 From: Cryptoval Trading Technologies Date: Tue, 23 Jun 2026 00:29:01 +0000 Subject: [PATCH] 20260623 --- .../backfill/ohlcv_backfill.cfg | 26 ++ data/apps/microservices/cvtt_musvc.cfg | 342 ++++++++++++++++++ data/apps/stat_pairs/models/vecm.cfg | 6 + data/apps/stat_pairs/stat_pair_quant.cfg | 52 +++ data/apps/stat_pairs/stat_pairs_selector.cfg | 191 ++++++++++ 5 files changed, 617 insertions(+) create mode 100644 data/apps/md/ohlcv_recorder/backfill/ohlcv_backfill.cfg create mode 100644 data/apps/microservices/cvtt_musvc.cfg create mode 100644 data/apps/stat_pairs/models/vecm.cfg create mode 100644 data/apps/stat_pairs/stat_pair_quant.cfg create mode 100644 data/apps/stat_pairs/stat_pairs_selector.cfg diff --git a/data/apps/md/ohlcv_recorder/backfill/ohlcv_backfill.cfg b/data/apps/md/ohlcv_recorder/backfill/ohlcv_backfill.cfg new file mode 100644 index 0000000..0ae6c23 --- /dev/null +++ b/data/apps/md/ohlcv_recorder/backfill/ohlcv_backfill.cfg @@ -0,0 +1,26 @@ +{ + "refdata": @inc=http://@env{CONFIG_SERVICE}/refdata/refdata + "md_history_depth_hrs": 36, + "to_fill_entire_depth": false, # consider a gap if entire depth is empty, if False - warn and ignore + "beacon_instruments": { + "COINBASE_AT": [ + "PAIR-ADA-USD", + "PAIR-AVAX-USD", + "PAIR-BCH-USD", + "PAIR-BNB-USD", + "PAIR-BTC-USD", + "PAIR-DOGE-USD", + "PAIR-DOT-USD", + "PAIR-ETH-USD", + "PAIR-HBAR-USD", + "PAIR-LINK-USD", + "PAIR-LTC-USD", + "PAIR-SHIB-USD", + "PAIR-SOL-USD", + "PAIR-SUI-USD", + "PAIR-XLM-USD", + "PAIR-XRP-USD" + ], + } +} + diff --git a/data/apps/microservices/cvtt_musvc.cfg b/data/apps/microservices/cvtt_musvc.cfg new file mode 100644 index 0000000..66b33e2 --- /dev/null +++ b/data/apps/microservices/cvtt_musvc.cfg @@ -0,0 +1,342 @@ +@var GLOBAL_CHANNEL_PREFIX=CVTT_MU + +{ + "refdata": @inc=http://@env{CONFIG_SERVICE}/refdata/refdata # tetsetraefafd + , "comm": @inc=http://@env{CONFIG_SERVICE}/apps/common/comm + , "algos": @inc=http://@env{CONFIG_SERVICE}/apps/common/algos + , "risk_strategies": @inc=http://@env{CONFIG_SERVICE}/apps/common/risk_strategies + + , "pubsub_settings": "@env{PUBSUB_SETTINGS_CONFIG_KEY}" + , "cache_settings": "@env{CACHE_SETTINGS_CONFIG_KEY}" + , "md_cache_settings": "@env{MD_CACHE_SETTINGS_CONFIG_KEY}" + # , "db_cred_key": "@env{DB_CREDENTIALS_KEY}" + + , "global_channel_prefix": ${GLOBAL_CHANNEL_PREFIX} + + , "alerts": { + "channel": "${GLOBAL_CHANNEL_PREFIX}.ALERT", + "ttl_days": 7 + } + , "consolidated_log": { + "channel": "${GLOBAL_CHANNEL_PREFIX}.CLOG", + "ttl_minutes": 60, + "pruners": ["FRONT_GATEWAY"] # these MuSvcs prune log to TTL + } + , "accounting_gateway": { + "name": "ACCT_GATEWAY", + "app_status_channel": "${GLOBAL_CHANNEL_PREFIX}.ACCT_GW.APP_STATUS" + , "channel_prefix": "${GLOBAL_CHANNEL_PREFIX}.ACCT_GW." + , "exchanges_settings": { + "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" + } + } + } + # , "exchanges": ["COINBASE_AT"] # DEPRECATED R E M O V E + , "connectors": { + "simulated": true, + "exchanges": ["COINBASE_AT"] + } + } + , "bookkeeper": { + "name": "BOOKKEEPER", + "app_status_channel": "${GLOBAL_CHANNEL_PREFIX}.BKPR.APP_STATUS" + , "channel_prefix": "${GLOBAL_CHANNEL_PREFIX}.BKPR." + , "db": { + "server_type": "timescale", + "cred_key": "TSDB-CLD32-TESTER-DIRECT" + } + , "use_cache": true + } + , "front_gateway": { + "name": "FRONT_GATEWAY", + "app_status_channel": "${GLOBAL_CHANNEL_PREFIX}.FRONT_GW.APP_STATUS" + , "api": { + "REST": { + "port": @env{FRONT_GATEWAY_REST_PORT}, + "base_url": ["POST", "http://localhost:@env{FRONT_GATEWAY_REST_PORT}"] + } + } + , "musvc_peers": { + # enable/disable peer proxy + "bookkeeper": true + , "pricer": true + , "trader": true + , "risk_manager": true + , "market_data_gateway": true + } + , "supported_apps": [ + "STAT_PAIRS_SELECTOR", + "STAT_PAIR_QUANT" + ] + , "app_hb_interval_sec": 15 + } + , "market_data_gateway": { + "name": "MD_GATEWAY", + "app_status_channel": "${GLOBAL_CHANNEL_PREFIX}.MD_GW.APP_STATUS" + , "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." + # , "exchanges": ["COINBASE_AT"] # DEPRECATED R E M O V E + , "connectors": { + "simulated": false, + "exchanges": ["COINBASE_AT"] + } + , "reset_md_cache_on_start": true + } + , "ohlcv_recorder": { + "name": "OHLCV_RECORDER", + "app_status_channel": "${GLOBAL_CHANNEL_PREFIX}.OHLCV_RECORDER_STATUS" + , "historical_md": { + "db": { + # "cred_key": "TSDB-CLD32-TESTER-DCKR-CMPS" + # "cred_key": "TSDB-CLD32-TESTER-DIRECT" + "cred_key": "@env{DB_CREDENTIALS_KEY}" + } + , "trades_recording": { # unconditional trades recording for 1min aggregates + "flush_interval_sec": 5.0 + , "prune": { + "max_days": 7 + } + , "threshold_recording_lag_sec": 15 + , "instrument_timeout_sec": 119 + , "instruments": [ + { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-ADA-USD" + } + , { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-AVAX-USD" + } + , { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-BCH-USD" + } + , { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-BNB-USD" + } + , { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-BTC-USD" + } + , { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-DOGE-USD" + } + , { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-DOT-USD" + } + , { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-ETH-USD" + } + , { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-HBAR-USD" + } + , { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-LINK-USD" + } + , { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-LTC-USD" + } + , { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-SHIB-USD" + } + , { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-SOL-USD" + } + , { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-SUI-USD" + } + , { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-XLM-USD" + } + , { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-XRP-USD" + } + ] + } + } + } + , "order_entry_gateway": { + "name": "OE_GATEWAY", + "app_status_channel": "${GLOBAL_CHANNEL_PREFIX}.OE_GW.APP_STATUS" + , "exchanges_settings": { + "COINBASE_AT": { + "mkt_data": { + "enabled": false + , "streaming": false + }, + "order_entry": { + "enabled": true + , "streaming": true + }, + "accounting": { + "enabled": true + , "streaming": false + } + "credentials_key": { + "read_only": "COINBASE_ADV_RO" + } + } + } + , "channel_prefix": "${GLOBAL_CHANNEL_PREFIX}.OE_GW." + # , "exchanges": ["COINBASE_AT"] # DEPRECATED R E M O V E + , "connectors": { + "simulated": true, + "exchanges": ["COINBASE_AT"] + } + # "debug_mode": { # used when '--debug_mode' + # "partial_fill_wait_sec": 3600.0, + # "full_fill_wait_sec": 3600.0 + # } + } + , "pricer": { + "name": "PRICER", + "app_status_channel": "${GLOBAL_CHANNEL_PREFIX}.PXER.APP_STATUS" + , "channel_prefix": "${GLOBAL_CHANNEL_PREFIX}.PXER." + , "historical_md": { + "db": { + # "cred_key": "TSDB-CLD32-PROD-OHLCV-DIRECT-RO" + # "cred_key": "TSDB-CLD32-TESTER-DCKR-CMPS" + # "cred_key": "TSDB-CLD32-TESTER-DIRECT-RO" + "cred_key": "@env{DB_CREDENTIALS_KEY}" + } + , "enable_mda_recording": false # RO account is used + } + , "pre-subscribe": { + "interval_sec": 60 + , "history_depth_hours": 48 + , "instruments": [ + { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-ADA-USD" + }, + { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-AVAX-USD" + }, + { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-BCH-USD" + }, + { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-BNB-USD" + }, + { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-BTC-USD" + }, + { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-DOGE-USD" + }, + { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-DOT-USD" + }, + { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-ETH-USD" + }, + { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-HBAR-USD" + }, + { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-LINK-USD" + }, + { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-LTC-USD" + }, + { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-SHIB-USD" + }, + { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-SOL-USD" + }, + { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-SUI-USD" + }, + { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-XLM-USD" + }, + { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-XRP-USD" + } + ] + + } + } + , "risk_manager": { + "name": "RISK_MGR", + "app_status_channel": "${GLOBAL_CHANNEL_PREFIX}.RMGR.APP_STATUS" + , "channel_prefix": "${GLOBAL_CHANNEL_PREFIX}.RMGR." + , "revalue_interval_sec": 10.5 + } + , "trader": { + "name": "TRADER", + "app_status_channel": "${GLOBAL_CHANNEL_PREFIX}.TRADER.APP_STATUS" + , "channel_prefix": "${GLOBAL_CHANNEL_PREFIX}.TRADER." + + # ----------------------------------- + # moved to the algos.cfg for TgtPos Algo + # ----------------------------------- + # , "pos_diff_pct_trigger": 10.0 + + # ----------------------------------- + # moved to the book_config (db) + # ----------------------------------- + # , "trading_depth": { + # "BTC": 0.001 + # # "BTC": 0.1 + # } + + } +} \ No newline at end of file diff --git a/data/apps/stat_pairs/models/vecm.cfg b/data/apps/stat_pairs/models/vecm.cfg new file mode 100644 index 0000000..330adbe --- /dev/null +++ b/data/apps/stat_pairs/models/vecm.cfg @@ -0,0 +1,6 @@ +{ + "model_class": "cvttpy_apps.apps.stat_pairs.lib.models.VECMModel" + , "model_name": "VECM-2H" + , "stat_model_price": "close" + , "training_window_hours": 2 +} \ No newline at end of file diff --git a/data/apps/stat_pairs/stat_pair_quant.cfg b/data/apps/stat_pairs/stat_pair_quant.cfg new file mode 100644 index 0000000..835cd6e --- /dev/null +++ b/data/apps/stat_pairs/stat_pair_quant.cfg @@ -0,0 +1,52 @@ +{ + "refdata": @inc=http://@env{CONFIG_SERVICE}/refdata/refdata + + "app_name": "@env{APP_NAME}", + "app_type": "STAT_PAIR_QUANT", + + # =========== API ============ + "api": { + "REST": { + "host": @env{SP_QUANT_REST_HOST} + , "port": @env{SP_QUANT_REST_PORT} + , "proto": "http" + } + }, + + "interval_sec": 60, + "loop_interval_sec": 60.0, + + # ====== Model ======= + "model": @inc=http://@env{CONFIG_SERVICE}/apps/stat_pairs/models/vecm + + # ====== Instrument Validation ======= + , "instrument_validation": { + "market_data_sufficiency": { + "maximum_gap_size": "5.0%", + "maximum_data_missing": "20.0%", + "maximum_latency_sec": 30 + } + }, + # ====== Trading Analysis ======= + "analysis": { + "entry_diseq": 2.0, + "exit_diseq": 0.5, + "full_entry_diseq": 3.0, + "min_target_strength": 0.4, + "mode": "beta-aware" + }, + # ====== Front Gateway ========== + "cvtt_fgw": { + "REST": { + "base_url": "@env{FGW_BASE_URL}", + "endpoints": { + "register": ["POST", "/app_register"] + "app_list": ["GET", "/app_list"] + "heartbeat": ["GET", "/app_hb"], + "md_history": ["POST", "/md_summary"], + "trading_instructions": ["POST", "/trading_instructions"], + } + } + } + +} \ No newline at end of file diff --git a/data/apps/stat_pairs/stat_pairs_selector.cfg b/data/apps/stat_pairs/stat_pairs_selector.cfg new file mode 100644 index 0000000..31ad1ea --- /dev/null +++ b/data/apps/stat_pairs/stat_pairs_selector.cfg @@ -0,0 +1,191 @@ +{ + "refdata": @inc=http://@env{CONFIG_SERVICE}/refdata/refdata + + # "app_name": "STAT_PAIR_SELECTOR-TST", + "app_name": "@env{APP_NAME}" + "app_type": "STAT_PAIRS_SELECTOR" + + , "interval_sec": 60 + , "history_depth_hours": 26 + + , "rerun_interval": 300 + + , "model": @inc=http://@env{CONFIG_SERVICE}/apps/stat_pairs/models/vecm + , "instrument_validation": { + "market_data_sufficiency": { + "maximum_gap_size": "2.0%", + "maximum_data_missing": "20.0%" + } + } + , "mr_evaluation": { + "mr_speed_tau": 60, + "stationarity_pvalue_max": 0.05, + "stability_window": 360, + "stability_step": 60, + "stability_sensitivity": 0.5, + "score_weights": { + "speed": 0.3 + , "stationarity": 0.4 + , "stability": 0.3 + }, + "warnings_marks": { + "stationarity": 0.3 + "stability": 0.3 + }, + "total_score_weights": { + "liquidity": 0.5, + "mr_geometric": 0.5, + "mr_arithmetic": 0 + } + } + , "cvtt_fgw": { + "REST": { + # "base_url": "http://cld32-tester.cvtt.vpn:23456", + "base_url": "@env{FGW_BASE_URL}", + "endpoints": { + "register": ["POST", "/app_register"] + "heartbeat": ["GET", "/app_hb"], + "md_history": ["POST", "/md_summary"] + }, + }, + } + , "api": { + "REST": { + "host": @env{PAIR_SELECTOR_REST_HOST} + , "port": @env{PAIR_SELECTOR_REST_PORT} + , "proto": "http" + } + } + # ====== Instruments ======= + , "instruments": [ + { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-ADA-USD" + }, + { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-AVAX-USD" + }, + { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-BCH-USD" + }, + { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-BNB-USD" + }, + { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-BTC-USD" + }, + { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-DOGE-USD" + }, + { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-DOT-USD" + }, + { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-ETH-USD" + }, + { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-HBAR-USD" + }, + { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-LINK-USD" + }, + { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-LTC-USD" + }, + { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-SHIB-USD" + }, + { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-SOL-USD" + }, + { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-SUI-USD" + }, + { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-XLM-USD" + }, + { + "exch_acct": "COINBASE_AT" + , "instrument_id": "PAIR-XRP-USD" + } + # ===================================================================== + # { + # "exch_acct": "BNBSPOT" + # , "instrument_id": "PAIR-ADA-USDT" + # } + # , { + # "exch_acct": "BNBSPOT" + # , "instrument_id": "PAIR-AVAX-USDT" + # } + # , { + # "exch_acct": "BNBSPOT" + # , "instrument_id": "PAIR-BCH-USDT" + # } + # , { + # "exch_acct": "BNBSPOT" + # , "instrument_id": "PAIR-BNB-USDT" + # } + # , { + # "exch_acct": "BNBSPOT" + # , "instrument_id": "PAIR-BTC-USDT" + # } + # , { + # "exch_acct": "BNBSPOT" + # , "instrument_id": "PAIR-DOGE-USDT" + # } + # , { + # "exch_acct": "BNBSPOT" + # , "instrument_id": "PAIR-DOT-USDT" + # } + # , { + # "exch_acct": "BNBSPOT" + # , "instrument_id": "PAIR-ETH-USDT" + # } + # , { + # "exch_acct": "BNBSPOT" + # , "instrument_id": "PAIR-HBAR-USDT" + # } + # , { + # "exch_acct": "BNBSPOT" + # , "instrument_id": "PAIR-LINK-USDT" + # } + # , { + # "exch_acct": "BNBSPOT" + # , "instrument_id": "PAIR-LTC-USDT" + # } + # , { + # "exch_acct": "BNBSPOT" + # , "instrument_id": "PAIR-SHIB-USDT" + # } + # , { + # "exch_acct": "BNBSPOT" + # , "instrument_id": "PAIR-SOL-USDT" + # } + # , { + # "exch_acct": "BNBSPOT" + # , "instrument_id": "PAIR-SUI-USDT" + # } + # , { + # "exch_acct": "BNBSPOT" + # , "instrument_id": "PAIR-XLM-USDT" + # } + # , { + # "exch_acct": "BNBSPOT" + # , "instrument_id": "PAIR-XRP-USDT" + # } + ] +} \ No newline at end of file