dexbot 1.3.3 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analysis/chart_utils.d.ts +11 -9
- package/dist/analysis/chart_utils.d.ts.map +1 -1
- package/dist/analysis/chart_utils.js +21 -16
- package/dist/analysis/chart_utils.js.map +1 -1
- package/dist/analysis/math_utils.d.ts +4 -13
- package/dist/analysis/math_utils.d.ts.map +1 -1
- package/dist/analysis/math_utils.js +16 -18
- package/dist/analysis/math_utils.js.map +1 -1
- package/dist/analysis/tradingview/tradingview_uplot_chart_generator.d.ts +3 -7
- package/dist/analysis/tradingview/tradingview_uplot_chart_generator.d.ts.map +1 -1
- package/dist/analysis/tradingview/tradingview_uplot_chart_generator.js +38 -34
- package/dist/analysis/tradingview/tradingview_uplot_chart_generator.js.map +1 -1
- package/dist/analysis/trend_detection/hurst_analyzer.d.ts +1 -4
- package/dist/analysis/trend_detection/hurst_analyzer.d.ts.map +1 -1
- package/dist/analysis/trend_detection/hurst_analyzer.js +10 -7
- package/dist/analysis/trend_detection/hurst_analyzer.js.map +1 -1
- package/dist/analysis/trend_detection/kalman_trend_analyzer.d.ts +6 -6
- package/dist/analysis/trend_detection/kalman_trend_analyzer.d.ts.map +1 -1
- package/dist/analysis/trend_detection/kalman_trend_analyzer.js +23 -15
- package/dist/analysis/trend_detection/kalman_trend_analyzer.js.map +1 -1
- package/dist/analysis/trend_detection/kalman_velocity_smoothing.d.ts +12 -13
- package/dist/analysis/trend_detection/kalman_velocity_smoothing.d.ts.map +1 -1
- package/dist/analysis/trend_detection/kalman_velocity_smoothing.js +16 -16
- package/dist/analysis/trend_detection/kalman_velocity_smoothing.js.map +1 -1
- package/dist/analysis/trend_detection/permutation_entropy_analyzer.d.ts +1 -4
- package/dist/analysis/trend_detection/permutation_entropy_analyzer.d.ts.map +1 -1
- package/dist/analysis/trend_detection/permutation_entropy_analyzer.js +10 -7
- package/dist/analysis/trend_detection/permutation_entropy_analyzer.js.map +1 -1
- package/dist/bot.d.ts.map +1 -1
- package/dist/bot.js +6 -13
- package/dist/bot.js.map +1 -1
- package/dist/credential-daemon.d.ts.map +1 -1
- package/dist/credential-daemon.js +21 -22
- package/dist/credential-daemon.js.map +1 -1
- package/dist/dexbot.d.ts.map +1 -1
- package/dist/dexbot.js +16 -15
- package/dist/dexbot.js.map +1 -1
- package/dist/market_adapter/ama_signal_runner.d.ts +1 -1
- package/dist/market_adapter/ama_signal_runner.d.ts.map +1 -1
- package/dist/market_adapter/ama_signal_runner.js +8 -20
- package/dist/market_adapter/ama_signal_runner.js.map +1 -1
- package/dist/market_adapter/candle_utils.d.ts +2 -10
- package/dist/market_adapter/candle_utils.d.ts.map +1 -1
- package/dist/market_adapter/candle_utils.js +7 -8
- package/dist/market_adapter/candle_utils.js.map +1 -1
- package/dist/market_adapter/core/asymmetric_bounds.d.ts +12 -7
- package/dist/market_adapter/core/asymmetric_bounds.d.ts.map +1 -1
- package/dist/market_adapter/core/asymmetric_bounds.js +4 -5
- package/dist/market_adapter/core/asymmetric_bounds.js.map +1 -1
- package/dist/market_adapter/core/config_normalizers.d.ts +4 -9
- package/dist/market_adapter/core/config_normalizers.d.ts.map +1 -1
- package/dist/market_adapter/core/config_normalizers.js +9 -9
- package/dist/market_adapter/core/config_normalizers.js.map +1 -1
- package/dist/market_adapter/core/kibana_candles.d.ts +16 -20
- package/dist/market_adapter/core/kibana_candles.d.ts.map +1 -1
- package/dist/market_adapter/core/kibana_candles.js +16 -15
- package/dist/market_adapter/core/kibana_candles.js.map +1 -1
- package/dist/market_adapter/core/kibana_client.d.ts +8 -11
- package/dist/market_adapter/core/kibana_client.d.ts.map +1 -1
- package/dist/market_adapter/core/kibana_client.js +13 -11
- package/dist/market_adapter/core/kibana_client.js.map +1 -1
- package/dist/market_adapter/core/kibana_market_candles.d.ts +5 -12
- package/dist/market_adapter/core/kibana_market_candles.d.ts.map +1 -1
- package/dist/market_adapter/core/kibana_market_candles.js +12 -21
- package/dist/market_adapter/core/kibana_market_candles.js.map +1 -1
- package/dist/market_adapter/core/market_adapter_service.d.ts +75 -53
- package/dist/market_adapter/core/market_adapter_service.d.ts.map +1 -1
- package/dist/market_adapter/core/market_adapter_service.js +102 -98
- package/dist/market_adapter/core/market_adapter_service.js.map +1 -1
- package/dist/market_adapter/core/strategies/ama.d.ts +21 -1
- package/dist/market_adapter/core/strategies/ama.d.ts.map +1 -1
- package/dist/market_adapter/core/strategies/ama.js +10 -10
- package/dist/market_adapter/core/strategies/ama.js.map +1 -1
- package/dist/market_adapter/core/strategies/ama_slope_model.d.ts +7 -11
- package/dist/market_adapter/core/strategies/ama_slope_model.d.ts.map +1 -1
- package/dist/market_adapter/core/strategies/ama_slope_model.js +23 -30
- package/dist/market_adapter/core/strategies/ama_slope_model.js.map +1 -1
- package/dist/market_adapter/core/strategies/atr/calculator.d.ts +5 -4
- package/dist/market_adapter/core/strategies/atr/calculator.d.ts.map +1 -1
- package/dist/market_adapter/core/strategies/atr/calculator.js +5 -3
- package/dist/market_adapter/core/strategies/atr/calculator.js.map +1 -1
- package/dist/market_adapter/core/strategies/collateral_manager.d.ts +4 -7
- package/dist/market_adapter/core/strategies/collateral_manager.d.ts.map +1 -1
- package/dist/market_adapter/core/strategies/collateral_manager.js +5 -4
- package/dist/market_adapter/core/strategies/collateral_manager.js.map +1 -1
- package/dist/market_adapter/core/strategies/regime_gate.d.ts +11 -19
- package/dist/market_adapter/core/strategies/regime_gate.d.ts.map +1 -1
- package/dist/market_adapter/core/strategies/regime_gate.js +22 -22
- package/dist/market_adapter/core/strategies/regime_gate.js.map +1 -1
- package/dist/market_adapter/index.d.ts +24 -2
- package/dist/market_adapter/index.d.ts.map +1 -1
- package/dist/market_adapter/index.js +82 -56
- package/dist/market_adapter/index.js.map +1 -1
- package/dist/market_adapter/inputs/fetch_cex_synthetic_data.js +26 -37
- package/dist/market_adapter/inputs/fetch_cex_synthetic_data.js.map +1 -1
- package/dist/market_adapter/inputs/fetch_lp_data.d.ts +4 -12
- package/dist/market_adapter/inputs/fetch_lp_data.d.ts.map +1 -1
- package/dist/market_adapter/inputs/fetch_lp_data.js +100 -66
- package/dist/market_adapter/inputs/fetch_lp_data.js.map +1 -1
- package/dist/market_adapter/inputs/kibana_source.d.ts +4 -9
- package/dist/market_adapter/inputs/kibana_source.d.ts.map +1 -1
- package/dist/market_adapter/inputs/kibana_source.js +17 -18
- package/dist/market_adapter/inputs/kibana_source.js.map +1 -1
- package/dist/market_adapter/interval_utils.d.ts +1 -4
- package/dist/market_adapter/interval_utils.d.ts.map +1 -1
- package/dist/market_adapter/interval_utils.js +2 -3
- package/dist/market_adapter/interval_utils.js.map +1 -1
- package/dist/market_adapter/log_format.d.ts +1 -9
- package/dist/market_adapter/log_format.d.ts.map +1 -1
- package/dist/market_adapter/log_format.js +7 -8
- package/dist/market_adapter/log_format.js.map +1 -1
- package/dist/market_adapter/lp_chart_core.d.ts +1 -4
- package/dist/market_adapter/lp_chart_core.d.ts.map +1 -1
- package/dist/market_adapter/lp_chart_core.js +22 -20
- package/dist/market_adapter/lp_chart_core.js.map +1 -1
- package/dist/market_adapter/lp_chart_runner.d.ts +13 -24
- package/dist/market_adapter/lp_chart_runner.d.ts.map +1 -1
- package/dist/market_adapter/lp_chart_runner.js +58 -56
- package/dist/market_adapter/lp_chart_runner.js.map +1 -1
- package/dist/market_adapter/lp_chart_strategy_loader.d.ts +4 -17
- package/dist/market_adapter/lp_chart_strategy_loader.d.ts.map +1 -1
- package/dist/market_adapter/lp_chart_strategy_loader.js +36 -36
- package/dist/market_adapter/lp_chart_strategy_loader.js.map +1 -1
- package/dist/market_adapter/market_adapter.d.ts +51 -72
- package/dist/market_adapter/market_adapter.d.ts.map +1 -1
- package/dist/market_adapter/market_adapter.js +227 -192
- package/dist/market_adapter/market_adapter.js.map +1 -1
- package/dist/market_adapter/merge_lp_data.js +17 -16
- package/dist/market_adapter/merge_lp_data.js.map +1 -1
- package/dist/market_adapter/test_helpers.d.ts +9 -13
- package/dist/market_adapter/test_helpers.d.ts.map +1 -1
- package/dist/market_adapter/test_helpers.js +14 -14
- package/dist/market_adapter/test_helpers.js.map +1 -1
- package/dist/market_adapter/utils/adapter_client.d.ts +6 -14
- package/dist/market_adapter/utils/adapter_client.d.ts.map +1 -1
- package/dist/market_adapter/utils/adapter_client.js +16 -15
- package/dist/market_adapter/utils/adapter_client.js.map +1 -1
- package/dist/market_adapter/utils/atomic_write.d.ts +2 -5
- package/dist/market_adapter/utils/atomic_write.d.ts.map +1 -1
- package/dist/market_adapter/utils/atomic_write.js +5 -5
- package/dist/market_adapter/utils/atomic_write.js.map +1 -1
- package/dist/market_adapter/utils/chain.d.ts +19 -21
- package/dist/market_adapter/utils/chain.d.ts.map +1 -1
- package/dist/market_adapter/utils/chain.js +15 -16
- package/dist/market_adapter/utils/chain.js.map +1 -1
- package/dist/market_adapter/utils/data_discovery.d.ts +1 -4
- package/dist/market_adapter/utils/data_discovery.d.ts.map +1 -1
- package/dist/market_adapter/utils/data_discovery.js +10 -10
- package/dist/market_adapter/utils/data_discovery.js.map +1 -1
- package/dist/market_adapter/utils/dynamic_grid_snapshot.d.ts +1 -6
- package/dist/market_adapter/utils/dynamic_grid_snapshot.d.ts.map +1 -1
- package/dist/market_adapter/utils/dynamic_grid_snapshot.js +14 -14
- package/dist/market_adapter/utils/dynamic_grid_snapshot.js.map +1 -1
- package/dist/market_adapter/utils/file_lock.d.ts +1 -7
- package/dist/market_adapter/utils/file_lock.d.ts.map +1 -1
- package/dist/market_adapter/utils/file_lock.js +21 -25
- package/dist/market_adapter/utils/file_lock.js.map +1 -1
- package/dist/market_adapter/utils/native_history.d.ts +12 -12
- package/dist/market_adapter/utils/native_history.d.ts.map +1 -1
- package/dist/market_adapter/utils/native_history.js +15 -15
- package/dist/market_adapter/utils/native_history.js.map +1 -1
- package/dist/market_adapter/utils/paths.d.ts +2 -4
- package/dist/market_adapter/utils/paths.d.ts.map +1 -1
- package/dist/market_adapter/utils/paths.js +6 -5
- package/dist/market_adapter/utils/paths.js.map +1 -1
- package/dist/modules/account_bots.d.ts +7 -8
- package/dist/modules/account_bots.d.ts.map +1 -1
- package/dist/modules/account_bots.js +92 -114
- package/dist/modules/account_bots.js.map +1 -1
- package/dist/modules/account_orders.d.ts +5 -9
- package/dist/modules/account_orders.d.ts.map +1 -1
- package/dist/modules/account_orders.js +69 -32
- package/dist/modules/account_orders.js.map +1 -1
- package/dist/modules/authority_resolver.d.ts +32 -1
- package/dist/modules/authority_resolver.d.ts.map +1 -1
- package/dist/modules/authority_resolver.js +18 -12
- package/dist/modules/authority_resolver.js.map +1 -1
- package/dist/modules/bitshares-native/chain_client.d.ts +3 -8
- package/dist/modules/bitshares-native/chain_client.d.ts.map +1 -1
- package/dist/modules/bitshares-native/chain_client.js +21 -16
- package/dist/modules/bitshares-native/chain_client.js.map +1 -1
- package/dist/modules/bitshares-native/crypto/ecc.browser.d.ts +21 -29
- package/dist/modules/bitshares-native/crypto/ecc.browser.d.ts.map +1 -1
- package/dist/modules/bitshares-native/crypto/ecc.browser.js +72 -38
- package/dist/modules/bitshares-native/crypto/ecc.browser.js.map +1 -1
- package/dist/modules/bitshares-native/crypto/ecc.d.ts +9 -36
- package/dist/modules/bitshares-native/crypto/ecc.d.ts.map +1 -1
- package/dist/modules/bitshares-native/crypto/ecc.js +40 -83
- package/dist/modules/bitshares-native/crypto/ecc.js.map +1 -1
- package/dist/modules/bitshares-native/crypto/ecc_selector.d.ts +14 -1
- package/dist/modules/bitshares-native/crypto/ecc_selector.d.ts.map +1 -1
- package/dist/modules/bitshares-native/crypto/ecc_selector.js +5 -3
- package/dist/modules/bitshares-native/crypto/ecc_selector.js.map +1 -1
- package/dist/modules/bitshares-native/index.d.ts +10 -2
- package/dist/modules/bitshares-native/index.d.ts.map +1 -1
- package/dist/modules/bitshares-native/index.js +68 -31
- package/dist/modules/bitshares-native/index.js.map +1 -1
- package/dist/modules/bitshares-native/lru_cache.d.ts +1 -4
- package/dist/modules/bitshares-native/lru_cache.d.ts.map +1 -1
- package/dist/modules/bitshares-native/lru_cache.js +6 -3
- package/dist/modules/bitshares-native/lru_cache.js.map +1 -1
- package/dist/modules/bitshares-native/resolvers.d.ts +3 -6
- package/dist/modules/bitshares-native/resolvers.d.ts.map +1 -1
- package/dist/modules/bitshares-native/resolvers.js +11 -9
- package/dist/modules/bitshares-native/resolvers.js.map +1 -1
- package/dist/modules/bitshares-native/serial/chain_constants.d.ts +53 -55
- package/dist/modules/bitshares-native/serial/chain_constants.d.ts.map +1 -1
- package/dist/modules/bitshares-native/serial/chain_constants.js +28 -27
- package/dist/modules/bitshares-native/serial/chain_constants.js.map +1 -1
- package/dist/modules/bitshares-native/serial/index.d.ts +5 -9
- package/dist/modules/bitshares-native/serial/index.d.ts.map +1 -1
- package/dist/modules/bitshares-native/serial/index.js +46 -12
- package/dist/modules/bitshares-native/serial/index.js.map +1 -1
- package/dist/modules/bitshares-native/serial/operations.d.ts +102 -100
- package/dist/modules/bitshares-native/serial/operations.d.ts.map +1 -1
- package/dist/modules/bitshares-native/serial/operations.js +473 -471
- package/dist/modules/bitshares-native/serial/operations.js.map +1 -1
- package/dist/modules/bitshares-native/serial/serializer.d.ts +2 -7
- package/dist/modules/bitshares-native/serial/serializer.d.ts.map +1 -1
- package/dist/modules/bitshares-native/serial/serializer.js +8 -3
- package/dist/modules/bitshares-native/serial/serializer.js.map +1 -1
- package/dist/modules/bitshares-native/serial/types.d.ts +26 -41
- package/dist/modules/bitshares-native/serial/types.d.ts.map +1 -1
- package/dist/modules/bitshares-native/serial/types.js +76 -42
- package/dist/modules/bitshares-native/serial/types.js.map +1 -1
- package/dist/modules/bitshares-native/signing_client.d.ts +1 -5
- package/dist/modules/bitshares-native/signing_client.d.ts.map +1 -1
- package/dist/modules/bitshares-native/signing_client.js +49 -11
- package/dist/modules/bitshares-native/signing_client.js.map +1 -1
- package/dist/modules/bitshares-native/subscriptions.d.ts +1 -4
- package/dist/modules/bitshares-native/subscriptions.d.ts.map +1 -1
- package/dist/modules/bitshares-native/subscriptions.js +47 -84
- package/dist/modules/bitshares-native/subscriptions.js.map +1 -1
- package/dist/modules/bitshares-native/transport.d.ts +1 -8
- package/dist/modules/bitshares-native/transport.d.ts.map +1 -1
- package/dist/modules/bitshares-native/transport.js +22 -15
- package/dist/modules/bitshares-native/transport.js.map +1 -1
- package/dist/modules/bitshares-native/tx/builder.d.ts +3 -8
- package/dist/modules/bitshares-native/tx/builder.d.ts.map +1 -1
- package/dist/modules/bitshares-native/tx/builder.js +61 -23
- package/dist/modules/bitshares-native/tx/builder.js.map +1 -1
- package/dist/modules/bitshares-native/tx/tx_cache.d.ts +1 -8
- package/dist/modules/bitshares-native/tx/tx_cache.d.ts.map +1 -1
- package/dist/modules/bitshares-native/tx/tx_cache.js +21 -17
- package/dist/modules/bitshares-native/tx/tx_cache.js.map +1 -1
- package/dist/modules/bitshares_client.d.ts +12 -23
- package/dist/modules/bitshares_client.d.ts.map +1 -1
- package/dist/modules/bitshares_client.js +109 -56
- package/dist/modules/bitshares_client.js.map +1 -1
- package/dist/modules/bot_settings.d.ts +1 -13
- package/dist/modules/bot_settings.d.ts.map +1 -1
- package/dist/modules/bot_settings.js +34 -34
- package/dist/modules/bot_settings.js.map +1 -1
- package/dist/modules/bots_file_lock.d.ts +3 -9
- package/dist/modules/bots_file_lock.d.ts.map +1 -1
- package/dist/modules/bots_file_lock.js +8 -9
- package/dist/modules/bots_file_lock.js.map +1 -1
- package/dist/modules/chain_keys.d.ts +7 -39
- package/dist/modules/chain_keys.d.ts.map +1 -1
- package/dist/modules/chain_keys.js +126 -90
- package/dist/modules/chain_keys.js.map +1 -1
- package/dist/modules/chain_orders.d.ts +46 -52
- package/dist/modules/chain_orders.d.ts.map +1 -1
- package/dist/modules/chain_orders.js +152 -104
- package/dist/modules/chain_orders.js.map +1 -1
- package/dist/modules/config.d.ts +50 -57
- package/dist/modules/config.d.ts.map +1 -1
- package/dist/modules/config.js +28 -24
- package/dist/modules/config.js.map +1 -1
- package/dist/modules/constants.d.ts +492 -494
- package/dist/modules/constants.d.ts.map +1 -1
- package/dist/modules/constants.js +69 -39
- package/dist/modules/constants.js.map +1 -1
- package/dist/modules/cr_planner.d.ts +1 -13
- package/dist/modules/cr_planner.d.ts.map +1 -1
- package/dist/modules/cr_planner.js +28 -28
- package/dist/modules/cr_planner.js.map +1 -1
- package/dist/modules/credential_policy.d.ts +18 -33
- package/dist/modules/credential_policy.d.ts.map +1 -1
- package/dist/modules/credential_policy.js +114 -87
- package/dist/modules/credential_policy.js.map +1 -1
- package/dist/modules/credential_runtime.d.ts +11 -21
- package/dist/modules/credential_runtime.d.ts.map +1 -1
- package/dist/modules/credential_runtime.js +40 -40
- package/dist/modules/credential_runtime.js.map +1 -1
- package/dist/modules/credential_session_cache.d.ts +8 -8
- package/dist/modules/credential_session_cache.d.ts.map +1 -1
- package/dist/modules/credential_session_cache.js +41 -8
- package/dist/modules/credential_session_cache.js.map +1 -1
- package/dist/modules/credit_runtime.d.ts +51 -316
- package/dist/modules/credit_runtime.d.ts.map +1 -1
- package/dist/modules/credit_runtime.js +257 -183
- package/dist/modules/credit_runtime.js.map +1 -1
- package/dist/modules/crypto/browser_provider.js +6 -6
- package/dist/modules/crypto/browser_provider.js.map +1 -1
- package/dist/modules/crypto/index.d.ts.map +1 -1
- package/dist/modules/crypto/index.js +2 -0
- package/dist/modules/crypto/index.js.map +1 -1
- package/dist/modules/crypto/sync.js +3 -3
- package/dist/modules/crypto/sync.js.map +1 -1
- package/dist/modules/dexbot_class.d.ts +262 -81
- package/dist/modules/dexbot_class.d.ts.map +1 -1
- package/dist/modules/dexbot_class.js +156 -123
- package/dist/modules/dexbot_class.js.map +1 -1
- package/dist/modules/dexbot_cow_runtime.d.ts +12 -9
- package/dist/modules/dexbot_cow_runtime.d.ts.map +1 -1
- package/dist/modules/dexbot_cow_runtime.js +132 -60
- package/dist/modules/dexbot_cow_runtime.js.map +1 -1
- package/dist/modules/dexbot_credential_client.d.ts +5 -11
- package/dist/modules/dexbot_credential_client.d.ts.map +1 -1
- package/dist/modules/dexbot_credential_client.js +32 -30
- package/dist/modules/dexbot_credential_client.js.map +1 -1
- package/dist/modules/dexbot_fill_runtime.d.ts +5 -20
- package/dist/modules/dexbot_fill_runtime.d.ts.map +1 -1
- package/dist/modules/dexbot_fill_runtime.js +55 -116
- package/dist/modules/dexbot_fill_runtime.js.map +1 -1
- package/dist/modules/dexbot_maintenance_runtime.d.ts +12 -12
- package/dist/modules/dexbot_maintenance_runtime.d.ts.map +1 -1
- package/dist/modules/dexbot_maintenance_runtime.js +55 -45
- package/dist/modules/dexbot_maintenance_runtime.js.map +1 -1
- package/dist/modules/dexbot_startup_runtime.d.ts +2 -6
- package/dist/modules/dexbot_startup_runtime.d.ts.map +1 -1
- package/dist/modules/dexbot_startup_runtime.js +115 -79
- package/dist/modules/dexbot_startup_runtime.js.map +1 -1
- package/dist/modules/dexbot_state_recovery.d.ts +11 -24
- package/dist/modules/dexbot_state_recovery.d.ts.map +1 -1
- package/dist/modules/dexbot_state_recovery.js +62 -28
- package/dist/modules/dexbot_state_recovery.js.map +1 -1
- package/dist/modules/fund_registry.d.ts +1 -13
- package/dist/modules/fund_registry.d.ts.map +1 -1
- package/dist/modules/fund_registry.js +23 -21
- package/dist/modules/fund_registry.js.map +1 -1
- package/dist/modules/general_settings.d.ts +3 -7
- package/dist/modules/general_settings.d.ts.map +1 -1
- package/dist/modules/general_settings.js +15 -14
- package/dist/modules/general_settings.js.map +1 -1
- package/dist/modules/graceful_shutdown.d.ts +1 -6
- package/dist/modules/graceful_shutdown.d.ts.map +1 -1
- package/dist/modules/graceful_shutdown.js +19 -16
- package/dist/modules/graceful_shutdown.js.map +1 -1
- package/dist/modules/key_store.d.ts.map +1 -1
- package/dist/modules/key_store.js +53 -19
- package/dist/modules/key_store.js.map +1 -1
- package/dist/modules/launcher/bot_supervisor.d.ts +23 -66
- package/dist/modules/launcher/bot_supervisor.d.ts.map +1 -1
- package/dist/modules/launcher/bot_supervisor.js +115 -107
- package/dist/modules/launcher/bot_supervisor.js.map +1 -1
- package/dist/modules/launcher/child_env.d.ts +2 -5
- package/dist/modules/launcher/child_env.d.ts.map +1 -1
- package/dist/modules/launcher/child_env.js +4 -4
- package/dist/modules/launcher/child_env.js.map +1 -1
- package/dist/modules/launcher/credential_bootstrap.d.ts +4 -8
- package/dist/modules/launcher/credential_bootstrap.d.ts.map +1 -1
- package/dist/modules/launcher/credential_bootstrap.js +30 -26
- package/dist/modules/launcher/credential_bootstrap.js.map +1 -1
- package/dist/modules/launcher/credential_daemon.d.ts +8 -15
- package/dist/modules/launcher/credential_daemon.d.ts.map +1 -1
- package/dist/modules/launcher/credential_daemon.js +72 -41
- package/dist/modules/launcher/credential_daemon.js.map +1 -1
- package/dist/modules/launcher/credential_secret.d.ts +1 -4
- package/dist/modules/launcher/credential_secret.d.ts.map +1 -1
- package/dist/modules/launcher/credential_secret.js +36 -4
- package/dist/modules/launcher/credential_secret.js.map +1 -1
- package/dist/modules/launcher/foreign_cred_daemon.d.ts +32 -1
- package/dist/modules/launcher/foreign_cred_daemon.d.ts.map +1 -1
- package/dist/modules/launcher/foreign_cred_daemon.js +25 -28
- package/dist/modules/launcher/foreign_cred_daemon.js.map +1 -1
- package/dist/modules/launcher/headless_password.d.ts +1 -4
- package/dist/modules/launcher/headless_password.d.ts.map +1 -1
- package/dist/modules/launcher/headless_password.js +11 -11
- package/dist/modules/launcher/headless_password.js.map +1 -1
- package/dist/modules/launcher/launch_modes.d.ts +15 -14
- package/dist/modules/launcher/launch_modes.d.ts.map +1 -1
- package/dist/modules/launcher/launch_modes.js +8 -8
- package/dist/modules/launcher/launch_modes.js.map +1 -1
- package/dist/modules/launcher/market_adapter_runtime.d.ts +10 -19
- package/dist/modules/launcher/market_adapter_runtime.d.ts.map +1 -1
- package/dist/modules/launcher/market_adapter_runtime.js +33 -33
- package/dist/modules/launcher/market_adapter_runtime.js.map +1 -1
- package/dist/modules/launcher/market_adapter_watchdog.d.ts +10 -17
- package/dist/modules/launcher/market_adapter_watchdog.d.ts.map +1 -1
- package/dist/modules/launcher/market_adapter_watchdog.js +42 -38
- package/dist/modules/launcher/market_adapter_watchdog.js.map +1 -1
- package/dist/modules/launcher/monolithic_runtime.d.ts +28 -57
- package/dist/modules/launcher/monolithic_runtime.d.ts.map +1 -1
- package/dist/modules/launcher/monolithic_runtime.js +135 -108
- package/dist/modules/launcher/monolithic_runtime.js.map +1 -1
- package/dist/modules/launcher/runtime_entry.d.ts +5 -10
- package/dist/modules/launcher/runtime_entry.d.ts.map +1 -1
- package/dist/modules/launcher/runtime_entry.js +14 -14
- package/dist/modules/launcher/runtime_entry.js.map +1 -1
- package/dist/modules/launcher/status_reporting.d.ts +17 -37
- package/dist/modules/launcher/status_reporting.d.ts.map +1 -1
- package/dist/modules/launcher/status_reporting.js +35 -34
- package/dist/modules/launcher/status_reporting.js.map +1 -1
- package/dist/modules/launcher/supervisor_control.d.ts +1 -4
- package/dist/modules/launcher/supervisor_control.d.ts.map +1 -1
- package/dist/modules/launcher/supervisor_control.js +9 -4
- package/dist/modules/launcher/supervisor_control.js.map +1 -1
- package/dist/modules/logger.d.ts +3 -1
- package/dist/modules/logger.d.ts.map +1 -1
- package/dist/modules/logger.js +38 -28
- package/dist/modules/logger.js.map +1 -1
- package/dist/modules/market_adapter_whitelist.d.ts +2 -10
- package/dist/modules/market_adapter_whitelist.d.ts.map +1 -1
- package/dist/modules/market_adapter_whitelist.js +18 -16
- package/dist/modules/market_adapter_whitelist.js.map +1 -1
- package/dist/modules/node_health_cache.d.ts +2 -12
- package/dist/modules/node_health_cache.d.ts.map +1 -1
- package/dist/modules/node_health_cache.js +24 -24
- package/dist/modules/node_health_cache.js.map +1 -1
- package/dist/modules/node_manager.d.ts +1 -1
- package/dist/modules/node_manager.d.ts.map +1 -1
- package/dist/modules/node_manager.js +44 -38
- package/dist/modules/node_manager.js.map +1 -1
- package/dist/modules/order/accounting.d.ts +12 -12
- package/dist/modules/order/accounting.d.ts.map +1 -1
- package/dist/modules/order/accounting.js +111 -76
- package/dist/modules/order/accounting.js.map +1 -1
- package/dist/modules/order/async_lock.d.ts +1 -2
- package/dist/modules/order/async_lock.d.ts.map +1 -1
- package/dist/modules/order/async_lock.js +4 -4
- package/dist/modules/order/async_lock.js.map +1 -1
- package/dist/modules/order/export.d.ts +8 -14
- package/dist/modules/order/export.d.ts.map +1 -1
- package/dist/modules/order/export.js +77 -42
- package/dist/modules/order/export.js.map +1 -1
- package/dist/modules/order/format.d.ts +17 -22
- package/dist/modules/order/format.d.ts.map +1 -1
- package/dist/modules/order/format.js +25 -31
- package/dist/modules/order/format.js.map +1 -1
- package/dist/modules/order/grid.d.ts +18 -104
- package/dist/modules/order/grid.d.ts.map +1 -1
- package/dist/modules/order/grid.js +246 -188
- package/dist/modules/order/grid.js.map +1 -1
- package/dist/modules/order/grid_reconcile.d.ts +8 -8
- package/dist/modules/order/grid_reconcile.d.ts.map +1 -1
- package/dist/modules/order/grid_reconcile.js +24 -23
- package/dist/modules/order/grid_reconcile.js.map +1 -1
- package/dist/modules/order/grid_reconcile_internal.d.ts +224 -1
- package/dist/modules/order/grid_reconcile_internal.d.ts.map +1 -1
- package/dist/modules/order/grid_reconcile_internal.js +145 -72
- package/dist/modules/order/grid_reconcile_internal.js.map +1 -1
- package/dist/modules/order/index.d.ts +1 -1
- package/dist/modules/order/index.d.ts.map +1 -1
- package/dist/modules/order/index.js +42 -7
- package/dist/modules/order/index.js.map +1 -1
- package/dist/modules/order/logger.d.ts +6 -16
- package/dist/modules/order/logger.d.ts.map +1 -1
- package/dist/modules/order/logger.js +76 -53
- package/dist/modules/order/logger.js.map +1 -1
- package/dist/modules/order/logger_state.d.ts +4 -4
- package/dist/modules/order/logger_state.d.ts.map +1 -1
- package/dist/modules/order/logger_state.js +3 -1
- package/dist/modules/order/logger_state.js.map +1 -1
- package/dist/modules/order/manager.d.ts +160 -37
- package/dist/modules/order/manager.d.ts.map +1 -1
- package/dist/modules/order/manager.js +166 -128
- package/dist/modules/order/manager.js.map +1 -1
- package/dist/modules/order/processed_fill_store.d.ts +6 -10
- package/dist/modules/order/processed_fill_store.d.ts.map +1 -1
- package/dist/modules/order/processed_fill_store.js +10 -9
- package/dist/modules/order/processed_fill_store.js.map +1 -1
- package/dist/modules/order/strategy.d.ts +3 -3
- package/dist/modules/order/strategy.d.ts.map +1 -1
- package/dist/modules/order/strategy.js +29 -27
- package/dist/modules/order/strategy.js.map +1 -1
- package/dist/modules/order/sync_engine.d.ts +9 -19
- package/dist/modules/order/sync_engine.d.ts.map +1 -1
- package/dist/modules/order/sync_engine.js +176 -126
- package/dist/modules/order/sync_engine.js.map +1 -1
- package/dist/modules/order/utils/math.d.ts +55 -85
- package/dist/modules/order/utils/math.d.ts.map +1 -1
- package/dist/modules/order/utils/math.js +155 -88
- package/dist/modules/order/utils/math.js.map +1 -1
- package/dist/modules/order/utils/order.d.ts +27 -72
- package/dist/modules/order/utils/order.d.ts.map +1 -1
- package/dist/modules/order/utils/order.js +144 -105
- package/dist/modules/order/utils/order.js.map +1 -1
- package/dist/modules/order/utils/system.d.ts +74 -44
- package/dist/modules/order/utils/system.d.ts.map +1 -1
- package/dist/modules/order/utils/system.js +188 -149
- package/dist/modules/order/utils/system.js.map +1 -1
- package/dist/modules/order/utils/validate.d.ts +21 -43
- package/dist/modules/order/utils/validate.d.ts.map +1 -1
- package/dist/modules/order/utils/validate.js +140 -109
- package/dist/modules/order/utils/validate.js.map +1 -1
- package/dist/modules/order/working_grid.d.ts +1 -4
- package/dist/modules/order/working_grid.d.ts.map +1 -1
- package/dist/modules/order/working_grid.js +9 -7
- package/dist/modules/order/working_grid.js.map +1 -1
- package/dist/modules/path_api.js +2 -2
- package/dist/modules/path_api.js.map +1 -1
- package/dist/modules/paths.d.ts +50 -56
- package/dist/modules/paths.d.ts.map +1 -1
- package/dist/modules/paths.js +66 -57
- package/dist/modules/paths.js.map +1 -1
- package/dist/modules/process_discovery.d.ts +1 -1
- package/dist/modules/process_discovery.d.ts.map +1 -1
- package/dist/modules/process_discovery.js +7 -7
- package/dist/modules/process_discovery.js.map +1 -1
- package/dist/modules/runtime.d.ts +1 -1
- package/dist/modules/runtime.d.ts.map +1 -1
- package/dist/modules/runtime.js +4 -4
- package/dist/modules/runtime.js.map +1 -1
- package/dist/modules/runtime_settings.d.ts +1 -0
- package/dist/modules/runtime_settings.d.ts.map +1 -1
- package/dist/modules/runtime_settings.js +15 -10
- package/dist/modules/runtime_settings.js.map +1 -1
- package/dist/modules/settings_merge.d.ts +1 -4
- package/dist/modules/settings_merge.d.ts.map +1 -1
- package/dist/modules/settings_merge.js +2 -1
- package/dist/modules/settings_merge.js.map +1 -1
- package/dist/modules/storage/browser_adapter.d.ts +7 -3
- package/dist/modules/storage/browser_adapter.d.ts.map +1 -1
- package/dist/modules/storage/browser_adapter.js +2 -0
- package/dist/modules/storage/browser_adapter.js.map +1 -1
- package/dist/modules/storage/index.d.ts +2 -2
- package/dist/modules/storage/index.d.ts.map +1 -1
- package/dist/modules/storage/index.js +2 -5
- package/dist/modules/storage/index.js.map +1 -1
- package/dist/modules/storage/node_adapter.d.ts +3 -3
- package/dist/modules/storage/node_adapter.d.ts.map +1 -1
- package/dist/modules/storage/node_adapter.js +9 -7
- package/dist/modules/storage/node_adapter.js.map +1 -1
- package/dist/modules/storage/types.d.ts +13 -10
- package/dist/modules/storage/types.d.ts.map +1 -1
- package/dist/modules/types.d.ts +0 -2
- package/dist/modules/types.d.ts.map +1 -1
- package/dist/modules/utils/base58check.d.ts +1 -9
- package/dist/modules/utils/base58check.d.ts.map +1 -1
- package/dist/modules/utils/base58check.js +14 -16
- package/dist/modules/utils/base58check.js.map +1 -1
- package/dist/modules/utils/build_dir.d.ts +2 -5
- package/dist/modules/utils/build_dir.d.ts.map +1 -1
- package/dist/modules/utils/build_dir.js +6 -3
- package/dist/modules/utils/build_dir.js.map +1 -1
- package/dist/modules/utils/errors.d.ts +2 -0
- package/dist/modules/utils/errors.d.ts.map +1 -0
- package/dist/modules/utils/errors.js +12 -0
- package/dist/modules/utils/errors.js.map +1 -0
- package/dist/modules/utils/fs_utils.d.ts +1 -8
- package/dist/modules/utils/fs_utils.d.ts.map +1 -1
- package/dist/modules/utils/fs_utils.js +8 -3
- package/dist/modules/utils/fs_utils.js.map +1 -1
- package/dist/modules/utils/math_utils.d.ts +2 -6
- package/dist/modules/utils/math_utils.d.ts.map +1 -1
- package/dist/modules/utils/math_utils.js +6 -2
- package/dist/modules/utils/math_utils.js.map +1 -1
- package/dist/modules/validate_profiles.d.ts +1 -11
- package/dist/modules/validate_profiles.d.ts.map +1 -1
- package/dist/modules/validate_profiles.js +25 -27
- package/dist/modules/validate_profiles.js.map +1 -1
- package/dist/pm2.d.ts +7 -6
- package/dist/pm2.d.ts.map +1 -1
- package/dist/pm2.js +132 -106
- package/dist/pm2.js.map +1 -1
- package/dist/scripts/analyze-git.d.ts.map +1 -1
- package/dist/scripts/analyze-git.js +15 -11
- package/dist/scripts/analyze-git.js.map +1 -1
- package/dist/scripts/analyze-orders.d.ts +146 -1
- package/dist/scripts/analyze-orders.d.ts.map +1 -1
- package/dist/scripts/analyze-orders.js +81 -105
- package/dist/scripts/analyze-orders.js.map +1 -1
- package/dist/scripts/diagnose-pool-history.d.ts.map +1 -1
- package/dist/scripts/diagnose-pool-history.js +9 -8
- package/dist/scripts/diagnose-pool-history.js.map +1 -1
- package/dist/scripts/divergence-calc.d.ts.map +1 -1
- package/dist/scripts/divergence-calc.js +11 -8
- package/dist/scripts/divergence-calc.js.map +1 -1
- package/dist/scripts/fix-err-message.d.ts +3 -0
- package/dist/scripts/fix-err-message.d.ts.map +1 -0
- package/dist/scripts/fix-err-message.js +198 -0
- package/dist/scripts/fix-err-message.js.map +1 -0
- package/dist/scripts/generate_lp_chart.d.ts +2 -9
- package/dist/scripts/generate_lp_chart.d.ts.map +1 -1
- package/dist/scripts/generate_lp_chart.js +14 -10
- package/dist/scripts/generate_lp_chart.js.map +1 -1
- package/dist/scripts/generate_mainnet_corpus_report.js +4 -4
- package/dist/scripts/generate_mainnet_corpus_report.js.map +1 -1
- package/dist/scripts/generate_market_adapter_whitelist.d.ts +17 -1
- package/dist/scripts/generate_market_adapter_whitelist.d.ts.map +1 -1
- package/dist/scripts/generate_market_adapter_whitelist.js +23 -20
- package/dist/scripts/generate_market_adapter_whitelist.js.map +1 -1
- package/dist/scripts/migrate_bot_keys.d.ts +1 -4
- package/dist/scripts/migrate_bot_keys.d.ts.map +1 -1
- package/dist/scripts/migrate_bot_keys.js +48 -124
- package/dist/scripts/migrate_bot_keys.js.map +1 -1
- package/dist/scripts/native_release_gates.d.ts.map +1 -1
- package/dist/scripts/native_release_gates.js +18 -14
- package/dist/scripts/native_release_gates.js.map +1 -1
- package/dist/scripts/print_grid.js +1 -1
- package/dist/scripts/print_grid.js.map +1 -1
- package/dist/scripts/run-tests.js +1 -0
- package/dist/scripts/run-tests.js.map +1 -1
- package/dist/scripts/runner.d.ts +1 -11
- package/dist/scripts/runner.d.ts.map +1 -1
- package/dist/scripts/runner.js +21 -19
- package/dist/scripts/runner.js.map +1 -1
- package/dist/scripts/test-credit-renewal.d.ts.map +1 -1
- package/dist/scripts/test-credit-renewal.js +2 -1
- package/dist/scripts/test-credit-renewal.js.map +1 -1
- package/dist/scripts/update.d.ts.map +1 -1
- package/dist/scripts/update.js +85 -79
- package/dist/scripts/update.js.map +1 -1
- package/dist/scripts/validate_bots.js +2 -2
- package/dist/scripts/validate_bots.js.map +1 -1
- package/dist/unlock.d.ts +4 -17
- package/dist/unlock.d.ts.map +1 -1
- package/dist/unlock.js +141 -108
- package/dist/unlock.js.map +1 -1
- package/package.json +1 -1
- package/dist/analysis/ama_fitting/analyze_ama_price_changes.d.ts +0 -3
- package/dist/analysis/ama_fitting/analyze_ama_price_changes.d.ts.map +0 -1
- package/dist/analysis/ama_fitting/analyze_ama_price_changes.js +0 -149
- package/dist/analysis/ama_fitting/analyze_ama_price_changes.js.map +0 -1
- package/dist/analysis/ama_fitting/analyze_lambda_vs_slow.d.ts +0 -3
- package/dist/analysis/ama_fitting/analyze_lambda_vs_slow.d.ts.map +0 -1
- package/dist/analysis/ama_fitting/analyze_lambda_vs_slow.js +0 -387
- package/dist/analysis/ama_fitting/analyze_lambda_vs_slow.js.map +0 -1
- package/dist/analysis/ama_fitting/calibrate_convergence_er.d.ts +0 -3
- package/dist/analysis/ama_fitting/calibrate_convergence_er.d.ts.map +0 -1
- package/dist/analysis/ama_fitting/calibrate_convergence_er.js +0 -200
- package/dist/analysis/ama_fitting/calibrate_convergence_er.js.map +0 -1
- package/dist/analysis/ama_fitting/fetch_lp_candles.d.ts +0 -3
- package/dist/analysis/ama_fitting/fetch_lp_candles.d.ts.map +0 -1
- package/dist/analysis/ama_fitting/fetch_lp_candles.js +0 -212
- package/dist/analysis/ama_fitting/fetch_lp_candles.js.map +0 -1
- package/dist/analysis/ama_fitting/generate_unified_comparison_chart.d.ts +0 -31
- package/dist/analysis/ama_fitting/generate_unified_comparison_chart.d.ts.map +0 -1
- package/dist/analysis/ama_fitting/generate_unified_comparison_chart.js +0 -249
- package/dist/analysis/ama_fitting/generate_unified_comparison_chart.js.map +0 -1
- package/dist/analysis/ama_fitting/optimizer_high_resolution.d.ts +0 -2
- package/dist/analysis/ama_fitting/optimizer_high_resolution.d.ts.map +0 -1
- package/dist/analysis/ama_fitting/optimizer_high_resolution.js +0 -782
- package/dist/analysis/ama_fitting/optimizer_high_resolution.js.map +0 -1
- package/dist/analysis/analyze_derivatives.d.ts +0 -95
- package/dist/analysis/analyze_derivatives.d.ts.map +0 -1
- package/dist/analysis/analyze_derivatives.js +0 -295
- package/dist/analysis/analyze_derivatives.js.map +0 -1
- package/dist/analysis/analyze_dynamic_weight.d.ts +0 -14
- package/dist/analysis/analyze_dynamic_weight.d.ts.map +0 -1
- package/dist/analysis/analyze_dynamic_weight.js +0 -207
- package/dist/analysis/analyze_dynamic_weight.js.map +0 -1
- package/dist/analysis/analyze_kalman.d.ts +0 -13
- package/dist/analysis/analyze_kalman.d.ts.map +0 -1
- package/dist/analysis/analyze_kalman.js +0 -123
- package/dist/analysis/analyze_kalman.js.map +0 -1
- package/dist/analysis/analyze_regime.d.ts +0 -20
- package/dist/analysis/analyze_regime.d.ts.map +0 -1
- package/dist/analysis/analyze_regime.js +0 -139
- package/dist/analysis/analyze_regime.js.map +0 -1
- package/dist/analysis/analyze_regime_windows.d.ts +0 -19
- package/dist/analysis/analyze_regime_windows.d.ts.map +0 -1
- package/dist/analysis/analyze_regime_windows.js +0 -413
- package/dist/analysis/analyze_regime_windows.js.map +0 -1
- package/dist/analysis/analyze_risk_profile.d.ts +0 -3
- package/dist/analysis/analyze_risk_profile.d.ts.map +0 -1
- package/dist/analysis/analyze_risk_profile.js +0 -159
- package/dist/analysis/analyze_risk_profile.js.map +0 -1
- package/dist/analysis/analyze_trade_heatmap.d.ts +0 -3
- package/dist/analysis/analyze_trade_heatmap.d.ts.map +0 -1
- package/dist/analysis/analyze_trade_heatmap.js +0 -367
- package/dist/analysis/analyze_trade_heatmap.js.map +0 -1
- package/dist/analysis/analyze_volatility.d.ts +0 -22
- package/dist/analysis/analyze_volatility.d.ts.map +0 -1
- package/dist/analysis/analyze_volatility.js +0 -172
- package/dist/analysis/analyze_volatility.js.map +0 -1
- package/dist/analysis/bot_fitting/backtest_ama_sweep.d.ts +0 -99
- package/dist/analysis/bot_fitting/backtest_ama_sweep.d.ts.map +0 -1
- package/dist/analysis/bot_fitting/backtest_ama_sweep.js +0 -804
- package/dist/analysis/bot_fitting/backtest_ama_sweep.js.map +0 -1
- package/dist/analysis/bot_fitting/backtest_bot_fitting.d.ts +0 -2
- package/dist/analysis/bot_fitting/backtest_bot_fitting.d.ts.map +0 -1
- package/dist/analysis/bot_fitting/backtest_bot_fitting.js +0 -347
- package/dist/analysis/bot_fitting/backtest_bot_fitting.js.map +0 -1
- package/dist/analysis/bot_fitting/shared_utils.d.ts +0 -15
- package/dist/analysis/bot_fitting/shared_utils.d.ts.map +0 -1
- package/dist/analysis/bot_fitting/shared_utils.js +0 -48
- package/dist/analysis/bot_fitting/shared_utils.js.map +0 -1
- package/dist/analysis/bot_key_utils.d.ts +0 -22
- package/dist/analysis/bot_key_utils.d.ts.map +0 -1
- package/dist/analysis/bot_key_utils.js +0 -162
- package/dist/analysis/bot_key_utils.js.map +0 -1
- package/dist/analysis/bot_usage/discover_bot_accounts.d.ts +0 -3
- package/dist/analysis/bot_usage/discover_bot_accounts.d.ts.map +0 -1
- package/dist/analysis/bot_usage/discover_bot_accounts.js +0 -498
- package/dist/analysis/bot_usage/discover_bot_accounts.js.map +0 -1
- package/dist/analysis/bot_usage/kibana_bot_queries.d.ts +0 -546
- package/dist/analysis/bot_usage/kibana_bot_queries.d.ts.map +0 -1
- package/dist/analysis/bot_usage/kibana_bot_queries.js +0 -427
- package/dist/analysis/bot_usage/kibana_bot_queries.js.map +0 -1
- package/dist/analysis/derivative_chart_generator.d.ts +0 -18
- package/dist/analysis/derivative_chart_generator.d.ts.map +0 -1
- package/dist/analysis/derivative_chart_generator.js +0 -896
- package/dist/analysis/derivative_chart_generator.js.map +0 -1
- package/dist/analysis/price_sources.d.ts +0 -34
- package/dist/analysis/price_sources.d.ts.map +0 -1
- package/dist/analysis/price_sources.js +0 -103
- package/dist/analysis/price_sources.js.map +0 -1
- package/dist/analysis/trade_profitability.d.ts +0 -115
- package/dist/analysis/trade_profitability.d.ts.map +0 -1
- package/dist/analysis/trade_profitability.js +0 -1247
- package/dist/analysis/trade_profitability.js.map +0 -1
- package/dist/analysis/tradingview/analyze_tradingview.d.ts +0 -36
- package/dist/analysis/tradingview/analyze_tradingview.d.ts.map +0 -1
- package/dist/analysis/tradingview/analyze_tradingview.js +0 -172
- package/dist/analysis/tradingview/analyze_tradingview.js.map +0 -1
- package/dist/analysis/trend_detection/derivative_analyzer.d.ts +0 -250
- package/dist/analysis/trend_detection/derivative_analyzer.d.ts.map +0 -1
- package/dist/analysis/trend_detection/derivative_analyzer.js +0 -903
- package/dist/analysis/trend_detection/derivative_analyzer.js.map +0 -1
- package/dist/analysis/trend_detection/dynamic_weight_chart_generator.d.ts +0 -6
- package/dist/analysis/trend_detection/dynamic_weight_chart_generator.d.ts.map +0 -1
- package/dist/analysis/trend_detection/dynamic_weight_chart_generator.js +0 -1450
- package/dist/analysis/trend_detection/dynamic_weight_chart_generator.js.map +0 -1
- package/dist/analysis/trend_detection/kalman_chart_generator.d.ts +0 -6
- package/dist/analysis/trend_detection/kalman_chart_generator.d.ts.map +0 -1
- package/dist/analysis/trend_detection/kalman_chart_generator.js +0 -408
- package/dist/analysis/trend_detection/kalman_chart_generator.js.map +0 -1
- package/dist/analysis/trend_detection/regime_chart_generator.d.ts +0 -6
- package/dist/analysis/trend_detection/regime_chart_generator.d.ts.map +0 -1
- package/dist/analysis/trend_detection/regime_chart_generator.js +0 -345
- package/dist/analysis/trend_detection/regime_chart_generator.js.map +0 -1
- package/dist/analysis/trend_detection/tests/test_kalman_trend.d.ts +0 -2
- package/dist/analysis/trend_detection/tests/test_kalman_trend.d.ts.map +0 -1
- package/dist/analysis/trend_detection/tests/test_kalman_trend.js +0 -130
- package/dist/analysis/trend_detection/tests/test_kalman_trend.js.map +0 -1
- package/dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.d.ts +0 -2
- package/dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.d.ts.map +0 -1
- package/dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.js +0 -38
- package/dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.js.map +0 -1
- package/dist/analysis/trend_detection/volatility_chart_generator.d.ts +0 -6
- package/dist/analysis/trend_detection/volatility_chart_generator.d.ts.map +0 -1
- package/dist/analysis/trend_detection/volatility_chart_generator.js +0 -732
- package/dist/analysis/trend_detection/volatility_chart_generator.js.map +0 -1
|
@@ -14,17 +14,31 @@
|
|
|
14
14
|
* tsx scripts/analyze-orders.ts # terminal output
|
|
15
15
|
* tsx scripts/analyze-orders.ts --export # standalone HTML report
|
|
16
16
|
*/
|
|
17
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
+
};
|
|
17
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
exports.DYNAMIC_WEIGHT_EPSILON = exports.DYNAMIC_GRID_SNAPSHOT_MAX_AGE_MS = exports.colors = void 0;
|
|
22
|
+
exports.resolveAmaKey = resolveAmaKey;
|
|
23
|
+
exports.isAmaGridPrice = isAmaGridPrice;
|
|
24
|
+
exports.readDynamicGridSnapshot = readDynamicGridSnapshot;
|
|
25
|
+
exports.buildDynamicWeightInfo = buildDynamicWeightInfo;
|
|
26
|
+
exports.formatWeightLine = formatWeightLine;
|
|
27
|
+
exports.getRawWeightValues = getRawWeightValues;
|
|
28
|
+
exports.analyzeOrder = analyzeOrder;
|
|
29
|
+
exports.formatAnalysis = formatAnalysis;
|
|
30
|
+
exports.generateHtmlReport = generateHtmlReport;
|
|
31
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
32
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
33
|
+
const format_1 = require("../modules/order/format");
|
|
34
|
+
const order_1 = require("../modules/order/utils/order");
|
|
35
|
+
const constants_1 = require("../modules/constants");
|
|
36
|
+
const paths_1 = require("../modules/paths");
|
|
37
|
+
const market_adapter_whitelist_1 = require("../modules/market_adapter_whitelist");
|
|
38
|
+
const fs_utils_1 = require("../modules/utils/fs_utils");
|
|
39
|
+
const errors_1 = require("../modules/utils/errors");
|
|
40
|
+
const ORDERS_DIR = paths_1.PATHS.ORDERS_DIR;
|
|
41
|
+
const BOTS_CONFIG = paths_1.PATHS.PROFILES.BOTS_JSON;
|
|
28
42
|
// Color codes for terminal output
|
|
29
43
|
const colors = {
|
|
30
44
|
reset: '\x1b[0m',
|
|
@@ -36,6 +50,7 @@ const colors = {
|
|
|
36
50
|
cyan: '\x1b[38;5;87m', // bright cyan
|
|
37
51
|
gray: '\x1b[38;5;246m' // medium grey (lighter than bright black)
|
|
38
52
|
};
|
|
53
|
+
exports.colors = colors;
|
|
39
54
|
// Partial block characters for weight visualization (0-8 eighths height)
|
|
40
55
|
const partialBlocks = ['', '▁', '▂', '▃', '▄', '▅', '▆', '▇', '█'];
|
|
41
56
|
// Maximum age (ms) for a dynamic grid snapshot to be considered "recently available".
|
|
@@ -44,11 +59,13 @@ const partialBlocks = ['', '▁', '▂', '▃', '▄', '▅', '▆', '▇', '█
|
|
|
44
59
|
// full cycles of drift (one missed cycle + slack for slow processing) before falling
|
|
45
60
|
// back to the static-only display, so the live colors track the actual adapter
|
|
46
61
|
// cadence rather than a hand-tuned timeout.
|
|
47
|
-
const DYNAMIC_GRID_SNAPSHOT_MAX_AGE_MS = 2 * MARKET_ADAPTER.RUNTIME_DEFAULTS.pollSeconds * 1000;
|
|
62
|
+
const DYNAMIC_GRID_SNAPSHOT_MAX_AGE_MS = 2 * constants_1.MARKET_ADAPTER.RUNTIME_DEFAULTS.pollSeconds * 1000;
|
|
63
|
+
exports.DYNAMIC_GRID_SNAPSHOT_MAX_AGE_MS = DYNAMIC_GRID_SNAPSHOT_MAX_AGE_MS;
|
|
48
64
|
// Tolerance (absolute weight delta) for treating the two live weights as equal
|
|
49
65
|
// when picking a color. Half a percentage point avoids noisy green/red flicker
|
|
50
66
|
// when the dynamic weight sits exactly on the static baseline.
|
|
51
67
|
const DYNAMIC_WEIGHT_EPSILON = 0.005;
|
|
68
|
+
exports.DYNAMIC_WEIGHT_EPSILON = DYNAMIC_WEIGHT_EPSILON;
|
|
52
69
|
// Bar width configuration (single source of truth)
|
|
53
70
|
const BAR_WIDTH = 51;
|
|
54
71
|
// Header width: prefix width (11 chars for " Slots: ") + bar width
|
|
@@ -100,17 +117,17 @@ function resolveAmaKey(config) {
|
|
|
100
117
|
if (!/^ama(?:[1-4])?$/.test(gridPrice))
|
|
101
118
|
return null;
|
|
102
119
|
if (gridPrice === 'ama')
|
|
103
|
-
return MARKET_ADAPTER.DEFAULT_AMA_KEY;
|
|
120
|
+
return constants_1.MARKET_ADAPTER.DEFAULT_AMA_KEY;
|
|
104
121
|
return gridPrice.toUpperCase();
|
|
105
122
|
}
|
|
106
123
|
function readDynamicGridSnapshot(botKey) {
|
|
107
124
|
if (!botKey)
|
|
108
125
|
return null;
|
|
109
126
|
try {
|
|
110
|
-
const filePath =
|
|
111
|
-
if (!
|
|
127
|
+
const filePath = node_path_1.default.join(ORDERS_DIR, `${botKey}.dynamicgrid.json`);
|
|
128
|
+
if (!node_fs_1.default.existsSync(filePath))
|
|
112
129
|
return null;
|
|
113
|
-
const data = readJSON(filePath);
|
|
130
|
+
const data = (0, fs_utils_1.readJSON)(filePath);
|
|
114
131
|
return data && typeof data === 'object' ? data : null;
|
|
115
132
|
}
|
|
116
133
|
catch (e) {
|
|
@@ -153,7 +170,7 @@ function computeAsymmetricBoundsPrices(centerPrice, minPrice, maxPrice, trend, a
|
|
|
153
170
|
function buildDynamicWeightInfo(botKey, config) {
|
|
154
171
|
if (!isAmaGridPrice(config))
|
|
155
172
|
return null;
|
|
156
|
-
const whitelistFlags = getWhitelistFlags(botKey);
|
|
173
|
+
const whitelistFlags = (0, market_adapter_whitelist_1.getWhitelistFlags)(botKey);
|
|
157
174
|
if (whitelistFlags.ama !== true)
|
|
158
175
|
return null;
|
|
159
176
|
const snapshot = readDynamicGridSnapshot(botKey);
|
|
@@ -234,8 +251,8 @@ function buildDynamicWeightInfo(botKey, config) {
|
|
|
234
251
|
function isRealGridOrder(order) {
|
|
235
252
|
if (!order || typeof order !== 'object')
|
|
236
253
|
return false;
|
|
237
|
-
const hasRealState = order.state === ORDER_STATES.ACTIVE || order.state === ORDER_STATES.PARTIAL;
|
|
238
|
-
const hasRealType = order.type === ORDER_TYPES.BUY || order.type === ORDER_TYPES.SELL;
|
|
254
|
+
const hasRealState = order.state === constants_1.ORDER_STATES.ACTIVE || order.state === constants_1.ORDER_STATES.PARTIAL;
|
|
255
|
+
const hasRealType = order.type === constants_1.ORDER_TYPES.BUY || order.type === constants_1.ORDER_TYPES.SELL;
|
|
239
256
|
const hasOrderId = typeof order.orderId === 'string' && order.orderId.trim().length > 0;
|
|
240
257
|
return hasRealState
|
|
241
258
|
&& hasRealType
|
|
@@ -253,7 +270,7 @@ function getRealGridOrders(botData) {
|
|
|
253
270
|
* @returns {Date} Modification time
|
|
254
271
|
*/
|
|
255
272
|
function getModifiedTime(filePath) {
|
|
256
|
-
return
|
|
273
|
+
return node_fs_1.default.statSync(filePath).mtime;
|
|
257
274
|
}
|
|
258
275
|
/**
|
|
259
276
|
* formatPercent: Convert decimal to percentage string
|
|
@@ -287,7 +304,7 @@ function formatCurrency(value) {
|
|
|
287
304
|
return formatCurrency(value * 1e15) + 'f';
|
|
288
305
|
if (abs >= 1e-18)
|
|
289
306
|
return formatCurrency(value * 1e18) + 'a';
|
|
290
|
-
return formatPrice6(value);
|
|
307
|
+
return (0, format_1.formatPrice6)(value);
|
|
291
308
|
}
|
|
292
309
|
let intDigits = Math.floor(Math.log10(abs)) + 1;
|
|
293
310
|
if (abs < 1)
|
|
@@ -357,15 +374,8 @@ function stripColorCodes(str) {
|
|
|
357
374
|
* @param {number} width - Target visual width
|
|
358
375
|
* @returns {string} Padded string with original colors preserved
|
|
359
376
|
*/
|
|
360
|
-
function padStringCentered(str, width) {
|
|
361
|
-
const visualLen = stripColorCodes(str).length;
|
|
362
|
-
const totalPad = Math.max(0, width - visualLen);
|
|
363
|
-
const padLeft = Math.ceil(totalPad / 2);
|
|
364
|
-
const padRight = Math.floor(totalPad / 2);
|
|
365
|
-
return ' '.repeat(padLeft) + str + ' '.repeat(padRight);
|
|
366
|
-
}
|
|
367
377
|
// Load bot configurations
|
|
368
|
-
const botsConfig = readJSON(BOTS_CONFIG).bots;
|
|
378
|
+
const botsConfig = (0, fs_utils_1.readJSON)(BOTS_CONFIG).bots;
|
|
369
379
|
function getConfiguredBotConfig(botKey, botData) {
|
|
370
380
|
const meta = botData?.meta || {};
|
|
371
381
|
return botsConfig.find((bot, index) => {
|
|
@@ -375,7 +385,7 @@ function getConfiguredBotConfig(botKey, botData) {
|
|
|
375
385
|
}) || null;
|
|
376
386
|
}
|
|
377
387
|
function getOrderFileCandidate(fileName) {
|
|
378
|
-
const filePath =
|
|
388
|
+
const filePath = node_path_1.default.join(ORDERS_DIR, fileName);
|
|
379
389
|
if (!fileName.endsWith('.json')) {
|
|
380
390
|
return { include: false, reason: 'not a JSON file', report: false };
|
|
381
391
|
}
|
|
@@ -384,10 +394,10 @@ function getOrderFileCandidate(fileName) {
|
|
|
384
394
|
}
|
|
385
395
|
let data;
|
|
386
396
|
try {
|
|
387
|
-
data = readJSON(filePath);
|
|
397
|
+
data = (0, fs_utils_1.readJSON)(filePath);
|
|
388
398
|
}
|
|
389
399
|
catch (error) {
|
|
390
|
-
return { include: false, reason: `invalid JSON: ${error
|
|
400
|
+
return { include: false, reason: `invalid JSON: ${(0, errors_1.getErrorMessage)(error)}`, report: true, name: fileName };
|
|
391
401
|
}
|
|
392
402
|
if (!hasOrderGrid(data)) {
|
|
393
403
|
return { include: false, reason: 'not a persisted order grid', report: true, name: fileName };
|
|
@@ -407,17 +417,17 @@ function getOrderFileCandidate(fileName) {
|
|
|
407
417
|
}
|
|
408
418
|
// Get all order files sorted by modified date
|
|
409
419
|
function getOrderFiles() {
|
|
410
|
-
const candidates =
|
|
420
|
+
const candidates = node_fs_1.default.readdirSync(ORDERS_DIR).map(getOrderFileCandidate);
|
|
411
421
|
const files = candidates
|
|
412
|
-
.filter(candidate => candidate.include)
|
|
413
|
-
.map(f => ({
|
|
422
|
+
.filter((candidate) => candidate.include)
|
|
423
|
+
.map((f) => ({
|
|
414
424
|
...f,
|
|
415
425
|
mtime: getModifiedTime(f.path)
|
|
416
426
|
}))
|
|
417
|
-
.sort((a, b) => b.mtime - a.mtime);
|
|
427
|
+
.sort((a, b) => b.mtime.getTime() - a.mtime.getTime());
|
|
418
428
|
return {
|
|
419
429
|
files,
|
|
420
|
-
skippedCandidates: candidates.filter(candidate => !candidate.include && candidate.report)
|
|
430
|
+
skippedCandidates: candidates.filter((candidate) => !candidate.include && candidate.report)
|
|
421
431
|
};
|
|
422
432
|
}
|
|
423
433
|
/**
|
|
@@ -460,13 +470,13 @@ function analyzeOrder(botData, config, botKey) {
|
|
|
460
470
|
* and optional spread slots. Separation enables independent analysis.
|
|
461
471
|
*/
|
|
462
472
|
const boundaryIdx = botData.boundaryIdx;
|
|
463
|
-
const buySlots = grid.filter((s, i) => i <= boundaryIdx && s.type === ORDER_TYPES.BUY);
|
|
464
|
-
const sellSlots = grid.filter((s, i) => i > boundaryIdx && s.type === ORDER_TYPES.SELL);
|
|
465
|
-
const spreadSlots = grid.filter(s => s.type === ORDER_TYPES.SPREAD);
|
|
466
|
-
const activeBuySlots = buySlots.filter(s => s.state === ORDER_STATES.ACTIVE || s.state === ORDER_STATES.PARTIAL);
|
|
467
|
-
const virtualBuySlots = buySlots.filter(s => s.state === ORDER_STATES.VIRTUAL);
|
|
468
|
-
const activeSellSlots = sellSlots.filter(s => s.state === ORDER_STATES.ACTIVE || s.state === ORDER_STATES.PARTIAL);
|
|
469
|
-
const virtualSellSlots = sellSlots.filter(s => s.state === ORDER_STATES.VIRTUAL);
|
|
473
|
+
const buySlots = grid.filter((s, i) => i <= boundaryIdx && s.type === constants_1.ORDER_TYPES.BUY);
|
|
474
|
+
const sellSlots = grid.filter((s, i) => i > boundaryIdx && s.type === constants_1.ORDER_TYPES.SELL);
|
|
475
|
+
const spreadSlots = grid.filter((s) => s.type === constants_1.ORDER_TYPES.SPREAD);
|
|
476
|
+
const activeBuySlots = buySlots.filter((s) => s.state === constants_1.ORDER_STATES.ACTIVE || s.state === constants_1.ORDER_STATES.PARTIAL);
|
|
477
|
+
const virtualBuySlots = buySlots.filter((s) => s.state === constants_1.ORDER_STATES.VIRTUAL);
|
|
478
|
+
const activeSellSlots = sellSlots.filter((s) => s.state === constants_1.ORDER_STATES.ACTIVE || s.state === constants_1.ORDER_STATES.PARTIAL);
|
|
479
|
+
const virtualSellSlots = sellSlots.filter((s) => s.state === constants_1.ORDER_STATES.VIRTUAL);
|
|
470
480
|
/**
|
|
471
481
|
* Best Prices Identification
|
|
472
482
|
* bestBuySlot: Highest buy price (at boundary, closest to market)
|
|
@@ -474,7 +484,7 @@ function analyzeOrder(botData, config, botKey) {
|
|
|
474
484
|
* The spread between these is the "real" spread of the grid
|
|
475
485
|
*/
|
|
476
486
|
const bestBuySlot = grid[boundaryIdx];
|
|
477
|
-
const bestSellSlot = grid.slice(boundaryIdx + 1).find(s => s.type === ORDER_TYPES.SELL);
|
|
487
|
+
const bestSellSlot = grid.slice(boundaryIdx + 1).find((s) => s.type === constants_1.ORDER_TYPES.SELL);
|
|
478
488
|
/**
|
|
479
489
|
* Real Spread Calculation
|
|
480
490
|
* Formula: (bestSellPrice - bestBuyPrice) / bestBuyPrice
|
|
@@ -509,8 +519,8 @@ function analyzeOrder(botData, config, botKey) {
|
|
|
509
519
|
// Analyze how funds are distributed across slots
|
|
510
520
|
const distribution = analyzeDistribution(buySlots, sellSlots, bestBuySlot, bestSellSlot);
|
|
511
521
|
// Calculate grid extremes and market price
|
|
512
|
-
const gridMinPrice = grid.length > 0 ? Math.min(...grid.map(s => s.price)) : null;
|
|
513
|
-
const gridMaxPrice = grid.length > 0 ? Math.max(...grid.map(s => s.price)) : null;
|
|
522
|
+
const gridMinPrice = grid.length > 0 ? Math.min(...grid.map((s) => s.price)) : null;
|
|
523
|
+
const gridMaxPrice = grid.length > 0 ? Math.max(...grid.map((s) => s.price)) : null;
|
|
514
524
|
const marketPrice = bestBuySlot && bestSellSlot
|
|
515
525
|
? (bestBuySlot.price + bestSellSlot.price) / 2
|
|
516
526
|
: null;
|
|
@@ -547,7 +557,7 @@ function analyzeOrder(botData, config, botKey) {
|
|
|
547
557
|
target: targetSpread,
|
|
548
558
|
diff: spreadDiff,
|
|
549
559
|
// Pass if within 0.1% of target (or null if no config to compare)
|
|
550
|
-
pass: config ? Math.abs(spreadDiff) < 0.001 : null
|
|
560
|
+
pass: config ? Math.abs(spreadDiff ?? 0) < 0.001 : null
|
|
551
561
|
},
|
|
552
562
|
// Increment consistency metrics
|
|
553
563
|
increment: incrementCheck,
|
|
@@ -566,8 +576,8 @@ function analyzeOrder(botData, config, botKey) {
|
|
|
566
576
|
virtualBuy: virtualBuySlots.length,
|
|
567
577
|
activeSell: activeSellSlots.length,
|
|
568
578
|
virtualSell: virtualSellSlots.length,
|
|
569
|
-
partialBuy: buySlots.filter(s => s.state === ORDER_STATES.PARTIAL).length,
|
|
570
|
-
partialSell: sellSlots.filter(s => s.state === ORDER_STATES.PARTIAL).length
|
|
579
|
+
partialBuy: buySlots.filter((s) => s.state === constants_1.ORDER_STATES.PARTIAL).length,
|
|
580
|
+
partialSell: sellSlots.filter((s) => s.state === constants_1.ORDER_STATES.PARTIAL).length
|
|
571
581
|
},
|
|
572
582
|
// Slot data for weight visualization
|
|
573
583
|
slotData: {
|
|
@@ -603,8 +613,8 @@ function computeGridRangeScalingDisplay(config, dynamicWeight) {
|
|
|
603
613
|
const centerPrice = dynamicWeight.amaCenterPrice;
|
|
604
614
|
let minPrice, maxPrice;
|
|
605
615
|
try {
|
|
606
|
-
minPrice = resolveConfiguredPriceBound(config && config.minPrice, undefined, centerPrice, 'min');
|
|
607
|
-
maxPrice = resolveConfiguredPriceBound(config && config.maxPrice, undefined, centerPrice, 'max');
|
|
616
|
+
minPrice = (0, order_1.resolveConfiguredPriceBound)(config && config.minPrice, undefined, centerPrice, 'min');
|
|
617
|
+
maxPrice = (0, order_1.resolveConfiguredPriceBound)(config && config.maxPrice, undefined, centerPrice, 'max');
|
|
608
618
|
}
|
|
609
619
|
catch (_) {
|
|
610
620
|
return null;
|
|
@@ -660,7 +670,7 @@ function computeGridRangeScalingDisplay(config, dynamicWeight) {
|
|
|
660
670
|
*/
|
|
661
671
|
function checkGeometricIncrement(grid, targetIncrement) {
|
|
662
672
|
// Filter out spread slots (only analyze regular buy/sell slots)
|
|
663
|
-
const slots = grid.filter(s => s.type !== 'spread');
|
|
673
|
+
const slots = grid.filter((s) => s.type !== 'spread');
|
|
664
674
|
// Need at least 2 slots to calculate increment
|
|
665
675
|
if (slots.length < 2) {
|
|
666
676
|
return { pass: null, avgIncrement: 0, consistent: true, target: targetIncrement };
|
|
@@ -757,13 +767,6 @@ function calculateGridFunds(buySlots, sellSlots, bestBuySlot, bestSellSlot) {
|
|
|
757
767
|
* @param {number} deltaValue - The delta percentage value
|
|
758
768
|
* @returns {string} Color code
|
|
759
769
|
*/
|
|
760
|
-
function getDeltaColor(deltaValue) {
|
|
761
|
-
if (deltaValue < 10)
|
|
762
|
-
return colors.buy; // green
|
|
763
|
-
if (deltaValue <= 20)
|
|
764
|
-
return colors.spread; // yellow
|
|
765
|
-
return colors.sell; // red
|
|
766
|
-
}
|
|
767
770
|
/**
|
|
768
771
|
* createDistributionBar: Create a horizontal bar chart showing BUY/SELL/spread distribution
|
|
769
772
|
* Differentiates between active (dark) and virtual (light) slots
|
|
@@ -807,11 +810,11 @@ function createDistributionBar(counts) {
|
|
|
807
810
|
if (sum !== barWidth) {
|
|
808
811
|
let diff = barWidth - sum;
|
|
809
812
|
const sections = [
|
|
810
|
-
{ name: 'activeBuyWidth', get: () => activeBuyWidth, set: v => { activeBuyWidth = v; } },
|
|
811
|
-
{ name: 'virtualBuyWidth', get: () => virtualBuyWidth, set: v => { virtualBuyWidth = v; } },
|
|
812
|
-
{ name: 'spreadWidth', get: () => spreadWidth, set: v => { spreadWidth = v; } },
|
|
813
|
-
{ name: 'activeSellWidth', get: () => activeSellWidth, set: v => { activeSellWidth = v; } },
|
|
814
|
-
{ name: 'virtualSellWidth', get: () => virtualSellWidth, set: v => { virtualSellWidth = v; } }
|
|
813
|
+
{ name: 'activeBuyWidth', get: () => activeBuyWidth, set: (v) => { activeBuyWidth = v; } },
|
|
814
|
+
{ name: 'virtualBuyWidth', get: () => virtualBuyWidth, set: (v) => { virtualBuyWidth = v; } },
|
|
815
|
+
{ name: 'spreadWidth', get: () => spreadWidth, set: (v) => { spreadWidth = v; } },
|
|
816
|
+
{ name: 'activeSellWidth', get: () => activeSellWidth, set: (v) => { activeSellWidth = v; } },
|
|
817
|
+
{ name: 'virtualSellWidth', get: () => virtualSellWidth, set: (v) => { virtualSellWidth = v; } }
|
|
815
818
|
];
|
|
816
819
|
while (diff > 0) {
|
|
817
820
|
const target = sections
|
|
@@ -822,7 +825,7 @@ function createDistributionBar(counts) {
|
|
|
822
825
|
}
|
|
823
826
|
while (diff < 0) {
|
|
824
827
|
const target = sections
|
|
825
|
-
.filter(section => section.get() > 0)
|
|
828
|
+
.filter((section) => section.get() > 0)
|
|
826
829
|
.sort((a, b) => b.get() - a.get())[0];
|
|
827
830
|
if (!target)
|
|
828
831
|
break;
|
|
@@ -894,7 +897,7 @@ function createWeightSide(orders, activeColor, virtualColor, sideWidth) {
|
|
|
894
897
|
return virtualColor + ' '.repeat(sideWidth) + colors.reset;
|
|
895
898
|
}
|
|
896
899
|
// Get sizes and find max for THIS SIDE only (independent scaling)
|
|
897
|
-
const sizes = orders.map(o => o.size || 0);
|
|
900
|
+
const sizes = orders.map((o) => o.size || 0);
|
|
898
901
|
const maxSize = Math.max(...sizes);
|
|
899
902
|
if (maxSize === 0) {
|
|
900
903
|
return virtualColor + '░'.repeat(sideWidth) + colors.reset;
|
|
@@ -916,14 +919,14 @@ function createWeightSide(orders, activeColor, virtualColor, sideWidth) {
|
|
|
916
919
|
const nearestIdx = Math.round(startPos);
|
|
917
920
|
groupOrders.push(orders[Math.min(nearestIdx, orders.length - 1)]);
|
|
918
921
|
}
|
|
919
|
-
const groupSizes = groupOrders.map(o => o.size || 0);
|
|
922
|
+
const groupSizes = groupOrders.map((o) => o.size || 0);
|
|
920
923
|
// Calculate arithmetic average of sizes in this group
|
|
921
924
|
const avgSize = groupSizes.reduce((a, b) => a + b, 0) / groupSizes.length;
|
|
922
925
|
// Normalize to max on THIS SIDE (1-8, minimum 1 for visibility)
|
|
923
926
|
const ratio = avgSize / maxSize;
|
|
924
927
|
const blockHeight = Math.max(1, Math.round(ratio * 8));
|
|
925
928
|
// ACTIVE and PARTIAL slots are both real on-chain orders in this analysis.
|
|
926
|
-
const hasLiveOrder = groupOrders.some(o => o.state === ORDER_STATES.ACTIVE || o.state === ORDER_STATES.PARTIAL);
|
|
929
|
+
const hasLiveOrder = groupOrders.some((o) => o.state === constants_1.ORDER_STATES.ACTIVE || o.state === constants_1.ORDER_STATES.PARTIAL);
|
|
927
930
|
const color = hasLiveOrder ? activeColor : virtualColor;
|
|
928
931
|
compressedWeights.push(color + partialBlocks[blockHeight] + colors.reset);
|
|
929
932
|
}
|
|
@@ -1188,8 +1191,8 @@ function formatAnalysis(analysis) {
|
|
|
1188
1191
|
buyValues.push(analysis.botFunds.buy);
|
|
1189
1192
|
sellValues.push(analysis.botFunds.sell);
|
|
1190
1193
|
}
|
|
1191
|
-
const maxBuyWidth = Math.max(...buyValues.map(v => stripColorCodes(v).length));
|
|
1192
|
-
const maxSellWidth = Math.max(...sellValues.map(v => stripColorCodes(v).length));
|
|
1194
|
+
const maxBuyWidth = Math.max(...buyValues.map((v) => stripColorCodes(v).length));
|
|
1195
|
+
const maxSellWidth = Math.max(...sellValues.map((v) => stripColorCodes(v).length));
|
|
1193
1196
|
lines.push(` Active: ${(buyActual + '/' + buyTarget).padEnd(maxBuyWidth)} ${colors.buy}buy${colors.reset} | ${(sellActual + '/' + sellTarget).padEnd(maxSellWidth)} ${colors.sell}sell${colors.reset}`);
|
|
1194
1197
|
lines.push(``);
|
|
1195
1198
|
const weightLine = formatWeightLine(analysis.weightDistribution, analysis.dynamicWeight, maxBuyWidth, maxSellWidth);
|
|
@@ -1255,7 +1258,6 @@ function formatAnalysis(analysis) {
|
|
|
1255
1258
|
const barEnd = spreadSection + sellBarWidth;
|
|
1256
1259
|
// Position items right-aligned at section boundaries, with minimum 1 space gap
|
|
1257
1260
|
// Buy item: right-align to buySection
|
|
1258
|
-
const buyPriceSpacing1 = Math.max(1, buySection - buyPriceVisualLen);
|
|
1259
1261
|
// Spread item: positioned to center in spread zone
|
|
1260
1262
|
const spreadMid = buySection + spreadBarWidth / 2;
|
|
1261
1263
|
const midPriceSpacing1 = Math.max(1, Math.round(spreadMid - midPriceVisualLen / 2) - buyPriceVisualLen);
|
|
@@ -1263,7 +1265,6 @@ function formatAnalysis(analysis) {
|
|
|
1263
1265
|
const sellPriceSpacing2 = Math.max(1, barEnd - sellPriceVisualLen - buyPriceVisualLen - midPriceVisualLen - midPriceSpacing1);
|
|
1264
1266
|
lines.push(`${pricePrefix}${buyPrice}${' '.repeat(midPriceSpacing1)}${midPrice}${' '.repeat(Math.max(1, sellPriceSpacing2))}${sellPrice}`);
|
|
1265
1267
|
// Same logic for slots line
|
|
1266
|
-
const buyLabelSpacing1 = Math.max(1, buySection - buyLabelVisualLen);
|
|
1267
1268
|
const spreadMidLabel = buySection + spreadBarWidth / 2;
|
|
1268
1269
|
const spreadLabelSpacing1 = Math.max(1, Math.round(spreadMidLabel - spreadLabelVisualLen / 2) - buyLabelVisualLen);
|
|
1269
1270
|
const sellLabelSpacing2 = Math.max(1, barEnd - sellLabelVisualLen - buyLabelVisualLen - spreadLabelVisualLen - spreadLabelSpacing1);
|
|
@@ -1286,17 +1287,6 @@ function formatAnalysis(analysis) {
|
|
|
1286
1287
|
* Δ 0% = perfectly balanced (slots match funds)
|
|
1287
1288
|
* Δ 20% = significant imbalance (e.g., 40% slots but 60% funds)
|
|
1288
1289
|
*/
|
|
1289
|
-
const buySlotPct = analysis.distribution.slots.buyPercent.toFixed(1);
|
|
1290
|
-
const buyFundPct = analysis.distribution.funds.buyPercent.toFixed(1);
|
|
1291
|
-
const sellSlotPct = analysis.distribution.slots.sellPercent.toFixed(1);
|
|
1292
|
-
const sellFundPct = analysis.distribution.funds.sellPercent.toFixed(1);
|
|
1293
|
-
const buyMatch = analysis.distribution.match.buyDiff.toFixed(1);
|
|
1294
|
-
const sellMatch = analysis.distribution.match.sellDiff.toFixed(1);
|
|
1295
|
-
// Calculate spread slot percentage (totalSlots already calculated above)
|
|
1296
|
-
const spreadSlotPct = totalSlots > 0 ? ((analysis.slots.spread / totalSlots) * 100).toFixed(1) : '0.0';
|
|
1297
|
-
// Recalculate buy/sell percentages to include spread in total
|
|
1298
|
-
const buySlotPctWithSpread = totalSlots > 0 ? ((analysis.slots.buy / totalSlots) * 100).toFixed(1) : '0.0';
|
|
1299
|
-
const sellSlotPctWithSpread = totalSlots > 0 ? ((analysis.slots.sell / totalSlots) * 100).toFixed(1) : '0.0';
|
|
1300
1290
|
const { bar: slotDistBar, buyWidth: slotDistBuyWidth } = createDistributionBar({
|
|
1301
1291
|
activeBuy: analysis.slots.activeBuy,
|
|
1302
1292
|
virtualBuy: analysis.slots.virtualBuy,
|
|
@@ -1416,7 +1406,7 @@ function generateHtmlReport(analyses) {
|
|
|
1416
1406
|
.replace(/>/g, '>')
|
|
1417
1407
|
.replace(/"/g, '"');
|
|
1418
1408
|
let colorOpen = false;
|
|
1419
|
-
return escaped.replace(/\x1b\[[0-9;]*m/g, code => {
|
|
1409
|
+
return escaped.replace(/\x1b\[[0-9;]*m/g, (code) => {
|
|
1420
1410
|
let close = '';
|
|
1421
1411
|
if (colorOpen) {
|
|
1422
1412
|
colorOpen = false;
|
|
@@ -1431,7 +1421,7 @@ function generateHtmlReport(analyses) {
|
|
|
1431
1421
|
return close + html;
|
|
1432
1422
|
}) + (colorOpen ? '</span>' : '');
|
|
1433
1423
|
}
|
|
1434
|
-
const reports = analyses.map(a => ansiToHtml(formatAnalysis(a))).join('\n');
|
|
1424
|
+
const reports = analyses.map((a) => ansiToHtml(formatAnalysis(a))).join('\n');
|
|
1435
1425
|
const html = `<!DOCTYPE html>
|
|
1436
1426
|
<html lang="en">
|
|
1437
1427
|
<head>
|
|
@@ -1464,9 +1454,9 @@ function generateHtmlReport(analyses) {
|
|
|
1464
1454
|
<div class="summary">Total: ${analyses.length} analyzed</div>
|
|
1465
1455
|
</body>
|
|
1466
1456
|
</html>`;
|
|
1467
|
-
const outPath =
|
|
1468
|
-
|
|
1469
|
-
console.log(`\n📄 Order Analysis: ${'./' +
|
|
1457
|
+
const outPath = node_path_1.default.resolve('order-analysis.html');
|
|
1458
|
+
node_fs_1.default.writeFileSync(outPath, html, 'utf-8');
|
|
1459
|
+
console.log(`\n📄 Order Analysis: ${'./' + node_path_1.default.relative(process.cwd(), outPath)}`);
|
|
1470
1460
|
}
|
|
1471
1461
|
function main() {
|
|
1472
1462
|
const exportHtml = process.argv.includes('--export');
|
|
@@ -1494,7 +1484,7 @@ function main() {
|
|
|
1494
1484
|
files.forEach((file, index) => {
|
|
1495
1485
|
try {
|
|
1496
1486
|
// Parse order file JSON
|
|
1497
|
-
const orderData = readJSON(file.path);
|
|
1487
|
+
const orderData = (0, fs_utils_1.readJSON)(file.path);
|
|
1498
1488
|
// Per-bot file: data is the bot's entry directly (no bots wrapper)
|
|
1499
1489
|
if (!orderData || !orderData.meta || !Array.isArray(orderData.grid)) {
|
|
1500
1490
|
throw new Error('Not a persisted order grid');
|
|
@@ -1526,7 +1516,7 @@ function main() {
|
|
|
1526
1516
|
}
|
|
1527
1517
|
catch (error) {
|
|
1528
1518
|
// Log error but continue processing other files
|
|
1529
|
-
console.error(`\n❌ Error processing ${file.name}: ${error
|
|
1519
|
+
console.error(`\n❌ Error processing ${file.name}: ${(0, errors_1.getErrorMessage)(error)}`);
|
|
1530
1520
|
skipped++;
|
|
1531
1521
|
}
|
|
1532
1522
|
});
|
|
@@ -1537,7 +1527,7 @@ function main() {
|
|
|
1537
1527
|
if (skippedCandidates.length > 0) {
|
|
1538
1528
|
console.log('');
|
|
1539
1529
|
console.log(`${colors.cyan}${'='.repeat(HEADER_WIDTH)}${colors.reset}`);
|
|
1540
|
-
skippedCandidates.forEach(candidate => {
|
|
1530
|
+
skippedCandidates.forEach((candidate) => {
|
|
1541
1531
|
console.log(`${colors.gray}Skipped ${candidate.name}: ${candidate.reason}${colors.reset}`);
|
|
1542
1532
|
skipped++;
|
|
1543
1533
|
});
|
|
@@ -1551,18 +1541,4 @@ function main() {
|
|
|
1551
1541
|
if (require.main === module) {
|
|
1552
1542
|
main();
|
|
1553
1543
|
}
|
|
1554
|
-
module.exports = {
|
|
1555
|
-
resolveAmaKey,
|
|
1556
|
-
isAmaGridPrice,
|
|
1557
|
-
readDynamicGridSnapshot,
|
|
1558
|
-
buildDynamicWeightInfo,
|
|
1559
|
-
formatWeightLine,
|
|
1560
|
-
getRawWeightValues,
|
|
1561
|
-
analyzeOrder,
|
|
1562
|
-
formatAnalysis,
|
|
1563
|
-
generateHtmlReport,
|
|
1564
|
-
colors,
|
|
1565
|
-
DYNAMIC_GRID_SNAPSHOT_MAX_AGE_MS,
|
|
1566
|
-
DYNAMIC_WEIGHT_EPSILON,
|
|
1567
|
-
};
|
|
1568
1544
|
//# sourceMappingURL=analyze-orders.js.map
|