dexbot 1.1.10
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/LICENSE +21 -0
- package/README.md +287 -0
- package/claw/README.md +513 -0
- package/claw/scripts/memu_runner.py +385 -0
- package/claw/skills/bitshares-guide/SKILL.md +14 -0
- package/claw/skills/bitshares-guide/references/example-skill-shells.md +18 -0
- package/claw/skills/bitshares-guide/references/presentation-patterns.md +19 -0
- package/claw/skills/bitshares-guide/references/scope-guardrails.md +9 -0
- package/claw/skills/launcher-ops/SKILL.md +18 -0
- package/claw/skills/launcher-ops/references/launcher-workflow.md +23 -0
- package/claw/skills/margin-trading/SKILL.md +23 -0
- package/claw/skills/margin-trading/references/honest-asset-list.md +74 -0
- package/claw/skills/margin-trading/references/honest-assets.md +44 -0
- package/claw/skills/margin-trading/references/position-management.md +203 -0
- package/claw/skills/margin-trading/references/trading-concepts.md +80 -0
- package/claw/skills/memu-memory/SKILL.md +218 -0
- package/claw/skills/shared/references/js-automation-overview.md +24 -0
- package/claw/skills/shared/references/safety-and-staleness.md +11 -0
- package/claw/skills/shared/references/skill-boundaries.md +17 -0
- package/claw/skills/trend-detection/SKILL.md +33 -0
- package/claw/skills/trend-detection/agents/openai.yaml +3 -0
- package/claw/skills/trend-detection/references/service.md +45 -0
- package/dist/analysis/ama_fitting/analyze_ama_price_changes.d.ts +3 -0
- package/dist/analysis/ama_fitting/analyze_ama_price_changes.d.ts.map +1 -0
- package/dist/analysis/ama_fitting/analyze_ama_price_changes.js +149 -0
- package/dist/analysis/ama_fitting/analyze_ama_price_changes.js.map +1 -0
- package/dist/analysis/ama_fitting/analyze_lambda_vs_slow.d.ts +3 -0
- package/dist/analysis/ama_fitting/analyze_lambda_vs_slow.d.ts.map +1 -0
- package/dist/analysis/ama_fitting/analyze_lambda_vs_slow.js +387 -0
- package/dist/analysis/ama_fitting/analyze_lambda_vs_slow.js.map +1 -0
- package/dist/analysis/ama_fitting/calibrate_convergence_er.d.ts +3 -0
- package/dist/analysis/ama_fitting/calibrate_convergence_er.d.ts.map +1 -0
- package/dist/analysis/ama_fitting/calibrate_convergence_er.js +200 -0
- package/dist/analysis/ama_fitting/calibrate_convergence_er.js.map +1 -0
- package/dist/analysis/ama_fitting/fetch_lp_candles.d.ts +3 -0
- package/dist/analysis/ama_fitting/fetch_lp_candles.d.ts.map +1 -0
- package/dist/analysis/ama_fitting/fetch_lp_candles.js +212 -0
- package/dist/analysis/ama_fitting/fetch_lp_candles.js.map +1 -0
- package/dist/analysis/ama_fitting/generate_unified_comparison_chart.d.ts +31 -0
- package/dist/analysis/ama_fitting/generate_unified_comparison_chart.d.ts.map +1 -0
- package/dist/analysis/ama_fitting/generate_unified_comparison_chart.js +249 -0
- package/dist/analysis/ama_fitting/generate_unified_comparison_chart.js.map +1 -0
- package/dist/analysis/ama_fitting/optimizer_high_resolution.d.ts +2 -0
- package/dist/analysis/ama_fitting/optimizer_high_resolution.d.ts.map +1 -0
- package/dist/analysis/ama_fitting/optimizer_high_resolution.js +782 -0
- package/dist/analysis/ama_fitting/optimizer_high_resolution.js.map +1 -0
- package/dist/analysis/analyze_derivatives.d.ts +95 -0
- package/dist/analysis/analyze_derivatives.d.ts.map +1 -0
- package/dist/analysis/analyze_derivatives.js +295 -0
- package/dist/analysis/analyze_derivatives.js.map +1 -0
- package/dist/analysis/analyze_dynamic_weight.d.ts +14 -0
- package/dist/analysis/analyze_dynamic_weight.d.ts.map +1 -0
- package/dist/analysis/analyze_dynamic_weight.js +208 -0
- package/dist/analysis/analyze_dynamic_weight.js.map +1 -0
- package/dist/analysis/analyze_kalman.d.ts +13 -0
- package/dist/analysis/analyze_kalman.d.ts.map +1 -0
- package/dist/analysis/analyze_kalman.js +123 -0
- package/dist/analysis/analyze_kalman.js.map +1 -0
- package/dist/analysis/analyze_regime.d.ts +20 -0
- package/dist/analysis/analyze_regime.d.ts.map +1 -0
- package/dist/analysis/analyze_regime.js +139 -0
- package/dist/analysis/analyze_regime.js.map +1 -0
- package/dist/analysis/analyze_regime_windows.d.ts +19 -0
- package/dist/analysis/analyze_regime_windows.d.ts.map +1 -0
- package/dist/analysis/analyze_regime_windows.js +413 -0
- package/dist/analysis/analyze_regime_windows.js.map +1 -0
- package/dist/analysis/analyze_risk_profile.d.ts +3 -0
- package/dist/analysis/analyze_risk_profile.d.ts.map +1 -0
- package/dist/analysis/analyze_risk_profile.js +159 -0
- package/dist/analysis/analyze_risk_profile.js.map +1 -0
- package/dist/analysis/analyze_trade_heatmap.d.ts +3 -0
- package/dist/analysis/analyze_trade_heatmap.d.ts.map +1 -0
- package/dist/analysis/analyze_trade_heatmap.js +367 -0
- package/dist/analysis/analyze_trade_heatmap.js.map +1 -0
- package/dist/analysis/analyze_volatility.d.ts +22 -0
- package/dist/analysis/analyze_volatility.d.ts.map +1 -0
- package/dist/analysis/analyze_volatility.js +172 -0
- package/dist/analysis/analyze_volatility.js.map +1 -0
- package/dist/analysis/bot_fitting/backtest_ama_sweep.d.ts +99 -0
- package/dist/analysis/bot_fitting/backtest_ama_sweep.d.ts.map +1 -0
- package/dist/analysis/bot_fitting/backtest_ama_sweep.js +804 -0
- package/dist/analysis/bot_fitting/backtest_ama_sweep.js.map +1 -0
- package/dist/analysis/bot_fitting/backtest_bot_fitting.d.ts +2 -0
- package/dist/analysis/bot_fitting/backtest_bot_fitting.d.ts.map +1 -0
- package/dist/analysis/bot_fitting/backtest_bot_fitting.js +347 -0
- package/dist/analysis/bot_fitting/backtest_bot_fitting.js.map +1 -0
- package/dist/analysis/bot_fitting/shared_utils.d.ts +15 -0
- package/dist/analysis/bot_fitting/shared_utils.d.ts.map +1 -0
- package/dist/analysis/bot_fitting/shared_utils.js +48 -0
- package/dist/analysis/bot_fitting/shared_utils.js.map +1 -0
- package/dist/analysis/bot_key_utils.d.ts +16 -0
- package/dist/analysis/bot_key_utils.d.ts.map +1 -0
- package/dist/analysis/bot_key_utils.js +61 -0
- package/dist/analysis/bot_key_utils.js.map +1 -0
- package/dist/analysis/bot_usage/discover_bot_accounts.d.ts +3 -0
- package/dist/analysis/bot_usage/discover_bot_accounts.d.ts.map +1 -0
- package/dist/analysis/bot_usage/discover_bot_accounts.js +498 -0
- package/dist/analysis/bot_usage/discover_bot_accounts.js.map +1 -0
- package/dist/analysis/bot_usage/kibana_bot_queries.d.ts +546 -0
- package/dist/analysis/bot_usage/kibana_bot_queries.d.ts.map +1 -0
- package/dist/analysis/bot_usage/kibana_bot_queries.js +427 -0
- package/dist/analysis/bot_usage/kibana_bot_queries.js.map +1 -0
- package/dist/analysis/chart_utils.d.ts +13 -0
- package/dist/analysis/chart_utils.d.ts.map +1 -0
- package/dist/analysis/chart_utils.js +142 -0
- package/dist/analysis/chart_utils.js.map +1 -0
- package/dist/analysis/derivative_chart_generator.d.ts +18 -0
- package/dist/analysis/derivative_chart_generator.d.ts.map +1 -0
- package/dist/analysis/derivative_chart_generator.js +896 -0
- package/dist/analysis/derivative_chart_generator.js.map +1 -0
- package/dist/analysis/math_utils.d.ts +35 -0
- package/dist/analysis/math_utils.d.ts.map +1 -0
- package/dist/analysis/math_utils.js +121 -0
- package/dist/analysis/math_utils.js.map +1 -0
- package/dist/analysis/price_sources.d.ts +34 -0
- package/dist/analysis/price_sources.d.ts.map +1 -0
- package/dist/analysis/price_sources.js +103 -0
- package/dist/analysis/price_sources.js.map +1 -0
- package/dist/analysis/trade_profitability.d.ts +115 -0
- package/dist/analysis/trade_profitability.d.ts.map +1 -0
- package/dist/analysis/trade_profitability.js +1247 -0
- package/dist/analysis/trade_profitability.js.map +1 -0
- package/dist/analysis/tradingview/analyze_tradingview.d.ts +38 -0
- package/dist/analysis/tradingview/analyze_tradingview.d.ts.map +1 -0
- package/dist/analysis/tradingview/analyze_tradingview.js +212 -0
- package/dist/analysis/tradingview/analyze_tradingview.js.map +1 -0
- package/dist/analysis/tradingview/tradingview_uplot_chart_generator.d.ts +9 -0
- package/dist/analysis/tradingview/tradingview_uplot_chart_generator.d.ts.map +1 -0
- package/dist/analysis/tradingview/tradingview_uplot_chart_generator.js +1717 -0
- package/dist/analysis/tradingview/tradingview_uplot_chart_generator.js.map +1 -0
- package/dist/analysis/trend_detection/derivative_analyzer.d.ts +250 -0
- package/dist/analysis/trend_detection/derivative_analyzer.d.ts.map +1 -0
- package/dist/analysis/trend_detection/derivative_analyzer.js +903 -0
- package/dist/analysis/trend_detection/derivative_analyzer.js.map +1 -0
- package/dist/analysis/trend_detection/dynamic_weight_chart_generator.d.ts +6 -0
- package/dist/analysis/trend_detection/dynamic_weight_chart_generator.d.ts.map +1 -0
- package/dist/analysis/trend_detection/dynamic_weight_chart_generator.js +1449 -0
- package/dist/analysis/trend_detection/dynamic_weight_chart_generator.js.map +1 -0
- package/dist/analysis/trend_detection/hurst_analyzer.d.ts +42 -0
- package/dist/analysis/trend_detection/hurst_analyzer.d.ts.map +1 -0
- package/dist/analysis/trend_detection/hurst_analyzer.js +159 -0
- package/dist/analysis/trend_detection/hurst_analyzer.js.map +1 -0
- package/dist/analysis/trend_detection/kalman_chart_generator.d.ts +6 -0
- package/dist/analysis/trend_detection/kalman_chart_generator.d.ts.map +1 -0
- package/dist/analysis/trend_detection/kalman_chart_generator.js +408 -0
- package/dist/analysis/trend_detection/kalman_chart_generator.js.map +1 -0
- package/dist/analysis/trend_detection/kalman_trend_analyzer.d.ts +103 -0
- package/dist/analysis/trend_detection/kalman_trend_analyzer.d.ts.map +1 -0
- package/dist/analysis/trend_detection/kalman_trend_analyzer.js +229 -0
- package/dist/analysis/trend_detection/kalman_trend_analyzer.js.map +1 -0
- package/dist/analysis/trend_detection/kalman_velocity_smoothing.d.ts +34 -0
- package/dist/analysis/trend_detection/kalman_velocity_smoothing.d.ts.map +1 -0
- package/dist/analysis/trend_detection/kalman_velocity_smoothing.js +89 -0
- package/dist/analysis/trend_detection/kalman_velocity_smoothing.js.map +1 -0
- package/dist/analysis/trend_detection/permutation_entropy_analyzer.d.ts +39 -0
- package/dist/analysis/trend_detection/permutation_entropy_analyzer.d.ts.map +1 -0
- package/dist/analysis/trend_detection/permutation_entropy_analyzer.js +132 -0
- package/dist/analysis/trend_detection/permutation_entropy_analyzer.js.map +1 -0
- package/dist/analysis/trend_detection/regime_chart_generator.d.ts +6 -0
- package/dist/analysis/trend_detection/regime_chart_generator.d.ts.map +1 -0
- package/dist/analysis/trend_detection/regime_chart_generator.js +345 -0
- package/dist/analysis/trend_detection/regime_chart_generator.js.map +1 -0
- package/dist/analysis/trend_detection/tests/test_kalman_trend.d.ts +2 -0
- package/dist/analysis/trend_detection/tests/test_kalman_trend.d.ts.map +1 -0
- package/dist/analysis/trend_detection/tests/test_kalman_trend.js +130 -0
- package/dist/analysis/trend_detection/tests/test_kalman_trend.js.map +1 -0
- package/dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.d.ts +2 -0
- package/dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.d.ts.map +1 -0
- package/dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.js +38 -0
- package/dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.js.map +1 -0
- package/dist/analysis/trend_detection/volatility_chart_generator.d.ts +6 -0
- package/dist/analysis/trend_detection/volatility_chart_generator.d.ts.map +1 -0
- package/dist/analysis/trend_detection/volatility_chart_generator.js +732 -0
- package/dist/analysis/trend_detection/volatility_chart_generator.js.map +1 -0
- package/dist/bot.d.ts +49 -0
- package/dist/bot.d.ts.map +1 -0
- package/dist/bot.js +221 -0
- package/dist/bot.js.map +1 -0
- package/dist/credential-daemon.d.ts +64 -0
- package/dist/credential-daemon.d.ts.map +1 -0
- package/dist/credential-daemon.js +987 -0
- package/dist/credential-daemon.js.map +1 -0
- package/dist/dexbot.d.ts +87 -0
- package/dist/dexbot.d.ts.map +1 -0
- package/dist/dexbot.js +1222 -0
- package/dist/dexbot.js.map +1 -0
- package/dist/market_adapter/ama_signal_runner.d.ts +3 -0
- package/dist/market_adapter/ama_signal_runner.d.ts.map +1 -0
- package/dist/market_adapter/ama_signal_runner.js +175 -0
- package/dist/market_adapter/ama_signal_runner.js.map +1 -0
- package/dist/market_adapter/candle_utils.d.ts +57 -0
- package/dist/market_adapter/candle_utils.d.ts.map +1 -0
- package/dist/market_adapter/candle_utils.js +252 -0
- package/dist/market_adapter/candle_utils.js.map +1 -0
- package/dist/market_adapter/core/asymmetric_bounds.d.ts +20 -0
- package/dist/market_adapter/core/asymmetric_bounds.d.ts.map +1 -0
- package/dist/market_adapter/core/asymmetric_bounds.js +88 -0
- package/dist/market_adapter/core/asymmetric_bounds.js.map +1 -0
- package/dist/market_adapter/core/config_normalizers.d.ts +10 -0
- package/dist/market_adapter/core/config_normalizers.d.ts.map +1 -0
- package/dist/market_adapter/core/config_normalizers.js +24 -0
- package/dist/market_adapter/core/config_normalizers.js.map +1 -0
- package/dist/market_adapter/core/kibana_candles.d.ts +74 -0
- package/dist/market_adapter/core/kibana_candles.d.ts.map +1 -0
- package/dist/market_adapter/core/kibana_candles.js +249 -0
- package/dist/market_adapter/core/kibana_candles.js.map +1 -0
- package/dist/market_adapter/core/kibana_client.d.ts +27 -0
- package/dist/market_adapter/core/kibana_client.d.ts.map +1 -0
- package/dist/market_adapter/core/kibana_client.js +120 -0
- package/dist/market_adapter/core/kibana_client.js.map +1 -0
- package/dist/market_adapter/core/kibana_market_candles.d.ts +143 -0
- package/dist/market_adapter/core/kibana_market_candles.d.ts.map +1 -0
- package/dist/market_adapter/core/kibana_market_candles.js +170 -0
- package/dist/market_adapter/core/kibana_market_candles.js.map +1 -0
- package/dist/market_adapter/core/market_adapter_service.d.ts +210 -0
- package/dist/market_adapter/core/market_adapter_service.d.ts.map +1 -0
- package/dist/market_adapter/core/market_adapter_service.js +2328 -0
- package/dist/market_adapter/core/market_adapter_service.js.map +1 -0
- package/dist/market_adapter/core/strategies/ama.d.ts +2 -0
- package/dist/market_adapter/core/strategies/ama.d.ts.map +1 -0
- package/dist/market_adapter/core/strategies/ama.js +138 -0
- package/dist/market_adapter/core/strategies/ama.js.map +1 -0
- package/dist/market_adapter/core/strategies/ama_slope_model.d.ts +50 -0
- package/dist/market_adapter/core/strategies/ama_slope_model.d.ts.map +1 -0
- package/dist/market_adapter/core/strategies/ama_slope_model.js +143 -0
- package/dist/market_adapter/core/strategies/ama_slope_model.js.map +1 -0
- package/dist/market_adapter/core/strategies/atr/calculator.d.ts +12 -0
- package/dist/market_adapter/core/strategies/atr/calculator.d.ts.map +1 -0
- package/dist/market_adapter/core/strategies/atr/calculator.js +47 -0
- package/dist/market_adapter/core/strategies/atr/calculator.js.map +1 -0
- package/dist/market_adapter/core/strategies/collateral_manager.d.ts +32 -0
- package/dist/market_adapter/core/strategies/collateral_manager.d.ts.map +1 -0
- package/dist/market_adapter/core/strategies/collateral_manager.js +68 -0
- package/dist/market_adapter/core/strategies/collateral_manager.js.map +1 -0
- package/dist/market_adapter/core/strategies/regime_gate.d.ts +66 -0
- package/dist/market_adapter/core/strategies/regime_gate.d.ts.map +1 -0
- package/dist/market_adapter/core/strategies/regime_gate.js +189 -0
- package/dist/market_adapter/core/strategies/regime_gate.js.map +1 -0
- package/dist/market_adapter/index.d.ts +10 -0
- package/dist/market_adapter/index.d.ts.map +1 -0
- package/dist/market_adapter/index.js +71 -0
- package/dist/market_adapter/index.js.map +1 -0
- package/dist/market_adapter/inputs/fetch_cex_synthetic_data.d.ts +3 -0
- package/dist/market_adapter/inputs/fetch_cex_synthetic_data.d.ts.map +1 -0
- package/dist/market_adapter/inputs/fetch_cex_synthetic_data.js +1165 -0
- package/dist/market_adapter/inputs/fetch_cex_synthetic_data.js.map +1 -0
- package/dist/market_adapter/inputs/fetch_lp_data.d.ts +54 -0
- package/dist/market_adapter/inputs/fetch_lp_data.d.ts.map +1 -0
- package/dist/market_adapter/inputs/fetch_lp_data.js +743 -0
- package/dist/market_adapter/inputs/fetch_lp_data.js.map +1 -0
- package/dist/market_adapter/inputs/kibana_source.d.ts +68 -0
- package/dist/market_adapter/inputs/kibana_source.d.ts.map +1 -0
- package/dist/market_adapter/inputs/kibana_source.js +143 -0
- package/dist/market_adapter/inputs/kibana_source.js.map +1 -0
- package/dist/market_adapter/interval_utils.d.ts +6 -0
- package/dist/market_adapter/interval_utils.d.ts.map +1 -0
- package/dist/market_adapter/interval_utils.js +14 -0
- package/dist/market_adapter/interval_utils.js.map +1 -0
- package/dist/market_adapter/log_format.d.ts +16 -0
- package/dist/market_adapter/log_format.d.ts.map +1 -0
- package/dist/market_adapter/log_format.js +72 -0
- package/dist/market_adapter/log_format.js.map +1 -0
- package/dist/market_adapter/lp_chart_core.d.ts +6 -0
- package/dist/market_adapter/lp_chart_core.d.ts.map +1 -0
- package/dist/market_adapter/lp_chart_core.js +874 -0
- package/dist/market_adapter/lp_chart_core.js.map +1 -0
- package/dist/market_adapter/lp_chart_runner.d.ts +135 -0
- package/dist/market_adapter/lp_chart_runner.d.ts.map +1 -0
- package/dist/market_adapter/lp_chart_runner.js +337 -0
- package/dist/market_adapter/lp_chart_runner.js.map +1 -0
- package/dist/market_adapter/lp_chart_strategy_loader.d.ts +23 -0
- package/dist/market_adapter/lp_chart_strategy_loader.d.ts.map +1 -0
- package/dist/market_adapter/lp_chart_strategy_loader.js +169 -0
- package/dist/market_adapter/lp_chart_strategy_loader.js.map +1 -0
- package/dist/market_adapter/market_adapter.d.ts +133 -0
- package/dist/market_adapter/market_adapter.d.ts.map +1 -0
- package/dist/market_adapter/market_adapter.js +1331 -0
- package/dist/market_adapter/market_adapter.js.map +1 -0
- package/dist/market_adapter/merge_lp_data.d.ts +3 -0
- package/dist/market_adapter/merge_lp_data.d.ts.map +1 -0
- package/dist/market_adapter/merge_lp_data.js +125 -0
- package/dist/market_adapter/merge_lp_data.js.map +1 -0
- package/dist/market_adapter/test_helpers.d.ts +14 -0
- package/dist/market_adapter/test_helpers.d.ts.map +1 -0
- package/dist/market_adapter/test_helpers.js +22 -0
- package/dist/market_adapter/test_helpers.js.map +1 -0
- package/dist/market_adapter/utils/adapter_client.d.ts +20 -0
- package/dist/market_adapter/utils/adapter_client.d.ts.map +1 -0
- package/dist/market_adapter/utils/adapter_client.js +88 -0
- package/dist/market_adapter/utils/adapter_client.js.map +1 -0
- package/dist/market_adapter/utils/atomic_write.d.ts +9 -0
- package/dist/market_adapter/utils/atomic_write.d.ts.map +1 -0
- package/dist/market_adapter/utils/atomic_write.js +13 -0
- package/dist/market_adapter/utils/atomic_write.js.map +1 -0
- package/dist/market_adapter/utils/chain.d.ts +50 -0
- package/dist/market_adapter/utils/chain.d.ts.map +1 -0
- package/dist/market_adapter/utils/chain.js +196 -0
- package/dist/market_adapter/utils/chain.js.map +1 -0
- package/dist/market_adapter/utils/data_discovery.d.ts +6 -0
- package/dist/market_adapter/utils/data_discovery.d.ts.map +1 -0
- package/dist/market_adapter/utils/data_discovery.js +35 -0
- package/dist/market_adapter/utils/data_discovery.js.map +1 -0
- package/dist/market_adapter/utils/dynamic_grid_snapshot.d.ts +15 -0
- package/dist/market_adapter/utils/dynamic_grid_snapshot.d.ts.map +1 -0
- package/dist/market_adapter/utils/dynamic_grid_snapshot.js +60 -0
- package/dist/market_adapter/utils/dynamic_grid_snapshot.js.map +1 -0
- package/dist/market_adapter/utils/file_lock.d.ts +19 -0
- package/dist/market_adapter/utils/file_lock.d.ts.map +1 -0
- package/dist/market_adapter/utils/file_lock.js +191 -0
- package/dist/market_adapter/utils/file_lock.js.map +1 -0
- package/dist/market_adapter/utils/native_history.d.ts +19 -0
- package/dist/market_adapter/utils/native_history.d.ts.map +1 -0
- package/dist/market_adapter/utils/native_history.js +172 -0
- package/dist/market_adapter/utils/native_history.js.map +1 -0
- package/dist/market_adapter/utils/paths.d.ts +5 -0
- package/dist/market_adapter/utils/paths.d.ts.map +1 -0
- package/dist/market_adapter/utils/paths.js +7 -0
- package/dist/market_adapter/utils/paths.js.map +1 -0
- package/dist/modules/account_bots.d.ts +112 -0
- package/dist/modules/account_bots.d.ts.map +1 -0
- package/dist/modules/account_bots.js +1259 -0
- package/dist/modules/account_bots.js.map +1 -0
- package/dist/modules/account_orders.d.ts +273 -0
- package/dist/modules/account_orders.d.ts.map +1 -0
- package/dist/modules/account_orders.js +662 -0
- package/dist/modules/account_orders.js.map +1 -0
- package/dist/modules/authority_resolver.d.ts +2 -0
- package/dist/modules/authority_resolver.d.ts.map +1 -0
- package/dist/modules/authority_resolver.js +231 -0
- package/dist/modules/authority_resolver.js.map +1 -0
- package/dist/modules/bitshares-native/chain_client.d.ts +38 -0
- package/dist/modules/bitshares-native/chain_client.d.ts.map +1 -0
- package/dist/modules/bitshares-native/chain_client.js +322 -0
- package/dist/modules/bitshares-native/chain_client.js.map +1 -0
- package/dist/modules/bitshares-native/crypto/ecc.browser.d.ts +59 -0
- package/dist/modules/bitshares-native/crypto/ecc.browser.d.ts.map +1 -0
- package/dist/modules/bitshares-native/crypto/ecc.browser.js +456 -0
- package/dist/modules/bitshares-native/crypto/ecc.browser.js.map +1 -0
- package/dist/modules/bitshares-native/crypto/ecc.d.ts +66 -0
- package/dist/modules/bitshares-native/crypto/ecc.d.ts.map +1 -0
- package/dist/modules/bitshares-native/crypto/ecc.js +557 -0
- package/dist/modules/bitshares-native/crypto/ecc.js.map +1 -0
- package/dist/modules/bitshares-native/crypto/ecc_selector.d.ts +2 -0
- package/dist/modules/bitshares-native/crypto/ecc_selector.d.ts.map +1 -0
- package/dist/modules/bitshares-native/crypto/ecc_selector.js +20 -0
- package/dist/modules/bitshares-native/crypto/ecc_selector.js.map +1 -0
- package/dist/modules/bitshares-native/index.d.ts +3 -0
- package/dist/modules/bitshares-native/index.d.ts.map +1 -0
- package/dist/modules/bitshares-native/index.js +32 -0
- package/dist/modules/bitshares-native/index.js.map +1 -0
- package/dist/modules/bitshares-native/resolvers.d.ts +40 -0
- package/dist/modules/bitshares-native/resolvers.d.ts.map +1 -0
- package/dist/modules/bitshares-native/resolvers.js +161 -0
- package/dist/modules/bitshares-native/resolvers.js.map +1 -0
- package/dist/modules/bitshares-native/serial/chain_constants.d.ts +56 -0
- package/dist/modules/bitshares-native/serial/chain_constants.d.ts.map +1 -0
- package/dist/modules/bitshares-native/serial/chain_constants.js +92 -0
- package/dist/modules/bitshares-native/serial/chain_constants.js.map +1 -0
- package/dist/modules/bitshares-native/serial/index.d.ts +10 -0
- package/dist/modules/bitshares-native/serial/index.d.ts.map +1 -0
- package/dist/modules/bitshares-native/serial/index.js +14 -0
- package/dist/modules/bitshares-native/serial/index.js.map +1 -0
- package/dist/modules/bitshares-native/serial/operations.d.ts +102 -0
- package/dist/modules/bitshares-native/serial/operations.d.ts.map +1 -0
- package/dist/modules/bitshares-native/serial/operations.js +615 -0
- package/dist/modules/bitshares-native/serial/operations.js.map +1 -0
- package/dist/modules/bitshares-native/serial/serializer.d.ts +64 -0
- package/dist/modules/bitshares-native/serial/serializer.d.ts.map +1 -0
- package/dist/modules/bitshares-native/serial/serializer.js +252 -0
- package/dist/modules/bitshares-native/serial/serializer.js.map +1 -0
- package/dist/modules/bitshares-native/serial/types.d.ts +120 -0
- package/dist/modules/bitshares-native/serial/types.d.ts.map +1 -0
- package/dist/modules/bitshares-native/serial/types.js +837 -0
- package/dist/modules/bitshares-native/serial/types.js.map +1 -0
- package/dist/modules/bitshares-native/signing_client.d.ts +6 -0
- package/dist/modules/bitshares-native/signing_client.d.ts.map +1 -0
- package/dist/modules/bitshares-native/signing_client.js +141 -0
- package/dist/modules/bitshares-native/signing_client.js.map +1 -0
- package/dist/modules/bitshares-native/subscriptions.d.ts +6 -0
- package/dist/modules/bitshares-native/subscriptions.d.ts.map +1 -0
- package/dist/modules/bitshares-native/subscriptions.js +865 -0
- package/dist/modules/bitshares-native/subscriptions.js.map +1 -0
- package/dist/modules/bitshares-native/transport.d.ts +51 -0
- package/dist/modules/bitshares-native/transport.d.ts.map +1 -0
- package/dist/modules/bitshares-native/transport.js +447 -0
- package/dist/modules/bitshares-native/transport.js.map +1 -0
- package/dist/modules/bitshares-native/tx/builder.d.ts +30 -0
- package/dist/modules/bitshares-native/tx/builder.d.ts.map +1 -0
- package/dist/modules/bitshares-native/tx/builder.js +262 -0
- package/dist/modules/bitshares-native/tx/builder.js.map +1 -0
- package/dist/modules/bitshares_client.d.ts +129 -0
- package/dist/modules/bitshares_client.d.ts.map +1 -0
- package/dist/modules/bitshares_client.js +627 -0
- package/dist/modules/bitshares_client.js.map +1 -0
- package/dist/modules/bot_settings.d.ts +33 -0
- package/dist/modules/bot_settings.d.ts.map +1 -0
- package/dist/modules/bot_settings.js +328 -0
- package/dist/modules/bot_settings.js.map +1 -0
- package/dist/modules/bots_file_lock.d.ts +88 -0
- package/dist/modules/bots_file_lock.d.ts.map +1 -0
- package/dist/modules/bots_file_lock.js +161 -0
- package/dist/modules/bots_file_lock.js.map +1 -0
- package/dist/modules/chain_keys.d.ts +302 -0
- package/dist/modules/chain_keys.d.ts.map +1 -0
- package/dist/modules/chain_keys.js +1095 -0
- package/dist/modules/chain_keys.js.map +1 -0
- package/dist/modules/chain_orders.d.ts +423 -0
- package/dist/modules/chain_orders.d.ts.map +1 -0
- package/dist/modules/chain_orders.js +1201 -0
- package/dist/modules/chain_orders.js.map +1 -0
- package/dist/modules/cli_whitelist_args.d.ts +6 -0
- package/dist/modules/cli_whitelist_args.d.ts.map +1 -0
- package/dist/modules/cli_whitelist_args.js +13 -0
- package/dist/modules/cli_whitelist_args.js.map +1 -0
- package/dist/modules/config.d.ts +57 -0
- package/dist/modules/config.d.ts.map +1 -0
- package/dist/modules/config.js +107 -0
- package/dist/modules/config.js.map +1 -0
- package/dist/modules/constants.d.ts +635 -0
- package/dist/modules/constants.d.ts.map +1 -0
- package/dist/modules/constants.js +1464 -0
- package/dist/modules/constants.js.map +1 -0
- package/dist/modules/cr_planner.d.ts +51 -0
- package/dist/modules/cr_planner.d.ts.map +1 -0
- package/dist/modules/cr_planner.js +299 -0
- package/dist/modules/cr_planner.js.map +1 -0
- package/dist/modules/credential_policy.d.ts +188 -0
- package/dist/modules/credential_policy.d.ts.map +1 -0
- package/dist/modules/credential_policy.js +1452 -0
- package/dist/modules/credential_policy.js.map +1 -0
- package/dist/modules/credential_runtime.d.ts +42 -0
- package/dist/modules/credential_runtime.d.ts.map +1 -0
- package/dist/modules/credential_runtime.js +148 -0
- package/dist/modules/credential_runtime.js.map +1 -0
- package/dist/modules/credential_session_cache.d.ts +36 -0
- package/dist/modules/credential_session_cache.d.ts.map +1 -0
- package/dist/modules/credential_session_cache.js +106 -0
- package/dist/modules/credential_session_cache.js.map +1 -0
- package/dist/modules/credit_runtime.d.ts +412 -0
- package/dist/modules/credit_runtime.d.ts.map +1 -0
- package/dist/modules/credit_runtime.js +2866 -0
- package/dist/modules/credit_runtime.js.map +1 -0
- package/dist/modules/crypto/browser_provider.d.ts +15 -0
- package/dist/modules/crypto/browser_provider.d.ts.map +1 -0
- package/dist/modules/crypto/browser_provider.js +113 -0
- package/dist/modules/crypto/browser_provider.js.map +1 -0
- package/dist/modules/crypto/index.d.ts +9 -0
- package/dist/modules/crypto/index.d.ts.map +1 -0
- package/dist/modules/crypto/index.js +44 -0
- package/dist/modules/crypto/index.js.map +1 -0
- package/dist/modules/crypto/node_provider.d.ts +15 -0
- package/dist/modules/crypto/node_provider.d.ts.map +1 -0
- package/dist/modules/crypto/node_provider.js +74 -0
- package/dist/modules/crypto/node_provider.js.map +1 -0
- package/dist/modules/crypto/provider.d.ts +34 -0
- package/dist/modules/crypto/provider.d.ts.map +1 -0
- package/dist/modules/crypto/provider.js +3 -0
- package/dist/modules/crypto/provider.js.map +1 -0
- package/dist/modules/crypto/pure_ripemd160.d.ts +8 -0
- package/dist/modules/crypto/pure_ripemd160.d.ts.map +1 -0
- package/dist/modules/crypto/pure_ripemd160.js +142 -0
- package/dist/modules/crypto/pure_ripemd160.js.map +1 -0
- package/dist/modules/crypto/pure_scrypt.d.ts +23 -0
- package/dist/modules/crypto/pure_scrypt.d.ts.map +1 -0
- package/dist/modules/crypto/pure_scrypt.js +161 -0
- package/dist/modules/crypto/pure_scrypt.js.map +1 -0
- package/dist/modules/crypto/pure_secp256k1.d.ts +29 -0
- package/dist/modules/crypto/pure_secp256k1.d.ts.map +1 -0
- package/dist/modules/crypto/pure_secp256k1.js +195 -0
- package/dist/modules/crypto/pure_secp256k1.js.map +1 -0
- package/dist/modules/crypto/sync.d.ts +13 -0
- package/dist/modules/crypto/sync.d.ts.map +1 -0
- package/dist/modules/crypto/sync.js +37 -0
- package/dist/modules/crypto/sync.js.map +1 -0
- package/dist/modules/dexbot_class.d.ts +1074 -0
- package/dist/modules/dexbot_class.d.ts.map +1 -0
- package/dist/modules/dexbot_class.js +4613 -0
- package/dist/modules/dexbot_class.js.map +1 -0
- package/dist/modules/dexbot_credential_client.d.ts +71 -0
- package/dist/modules/dexbot_credential_client.d.ts.map +1 -0
- package/dist/modules/dexbot_credential_client.js +224 -0
- package/dist/modules/dexbot_credential_client.js.map +1 -0
- package/dist/modules/dexbot_fill_runtime.d.ts +173 -0
- package/dist/modules/dexbot_fill_runtime.d.ts.map +1 -0
- package/dist/modules/dexbot_fill_runtime.js +217 -0
- package/dist/modules/dexbot_fill_runtime.js.map +1 -0
- package/dist/modules/dexbot_maintenance_runtime.d.ts +279 -0
- package/dist/modules/dexbot_maintenance_runtime.d.ts.map +1 -0
- package/dist/modules/dexbot_maintenance_runtime.js +1613 -0
- package/dist/modules/dexbot_maintenance_runtime.js.map +1 -0
- package/dist/modules/env.d.ts +12 -0
- package/dist/modules/env.d.ts.map +1 -0
- package/dist/modules/env.js +57 -0
- package/dist/modules/env.js.map +1 -0
- package/dist/modules/fund_registry.d.ts +96 -0
- package/dist/modules/fund_registry.d.ts.map +1 -0
- package/dist/modules/fund_registry.js +261 -0
- package/dist/modules/fund_registry.js.map +1 -0
- package/dist/modules/general_settings.d.ts +36 -0
- package/dist/modules/general_settings.d.ts.map +1 -0
- package/dist/modules/general_settings.js +63 -0
- package/dist/modules/general_settings.js.map +1 -0
- package/dist/modules/graceful_shutdown.d.ts +86 -0
- package/dist/modules/graceful_shutdown.d.ts.map +1 -0
- package/dist/modules/graceful_shutdown.js +164 -0
- package/dist/modules/graceful_shutdown.js.map +1 -0
- package/dist/modules/key_store.d.ts +60 -0
- package/dist/modules/key_store.d.ts.map +1 -0
- package/dist/modules/key_store.js +215 -0
- package/dist/modules/key_store.js.map +1 -0
- package/dist/modules/launcher/bot_supervisor.d.ts +84 -0
- package/dist/modules/launcher/bot_supervisor.d.ts.map +1 -0
- package/dist/modules/launcher/bot_supervisor.js +1067 -0
- package/dist/modules/launcher/bot_supervisor.js.map +1 -0
- package/dist/modules/launcher/child_env.d.ts +9 -0
- package/dist/modules/launcher/child_env.d.ts.map +1 -0
- package/dist/modules/launcher/child_env.js +78 -0
- package/dist/modules/launcher/child_env.js.map +1 -0
- package/dist/modules/launcher/credential_bootstrap.d.ts +22 -0
- package/dist/modules/launcher/credential_bootstrap.d.ts.map +1 -0
- package/dist/modules/launcher/credential_bootstrap.js +303 -0
- package/dist/modules/launcher/credential_bootstrap.js.map +1 -0
- package/dist/modules/launcher/credential_daemon.d.ts +32 -0
- package/dist/modules/launcher/credential_daemon.d.ts.map +1 -0
- package/dist/modules/launcher/credential_daemon.js +173 -0
- package/dist/modules/launcher/credential_daemon.js.map +1 -0
- package/dist/modules/launcher/credential_secret.d.ts +6 -0
- package/dist/modules/launcher/credential_secret.d.ts.map +1 -0
- package/dist/modules/launcher/credential_secret.js +15 -0
- package/dist/modules/launcher/credential_secret.js.map +1 -0
- package/dist/modules/launcher/foreign_cred_daemon.d.ts +2 -0
- package/dist/modules/launcher/foreign_cred_daemon.d.ts.map +1 -0
- package/dist/modules/launcher/foreign_cred_daemon.js +166 -0
- package/dist/modules/launcher/foreign_cred_daemon.js.map +1 -0
- package/dist/modules/launcher/headless_password.d.ts +8 -0
- package/dist/modules/launcher/headless_password.d.ts.map +1 -0
- package/dist/modules/launcher/headless_password.js +33 -0
- package/dist/modules/launcher/headless_password.js.map +1 -0
- package/dist/modules/launcher/launch_modes.d.ts +36 -0
- package/dist/modules/launcher/launch_modes.d.ts.map +1 -0
- package/dist/modules/launcher/launch_modes.js +129 -0
- package/dist/modules/launcher/launch_modes.js.map +1 -0
- package/dist/modules/launcher/market_adapter_runtime.d.ts +43 -0
- package/dist/modules/launcher/market_adapter_runtime.d.ts.map +1 -0
- package/dist/modules/launcher/market_adapter_runtime.js +217 -0
- package/dist/modules/launcher/market_adapter_runtime.js.map +1 -0
- package/dist/modules/launcher/market_adapter_watchdog.d.ts +26 -0
- package/dist/modules/launcher/market_adapter_watchdog.d.ts.map +1 -0
- package/dist/modules/launcher/market_adapter_watchdog.js +214 -0
- package/dist/modules/launcher/market_adapter_watchdog.js.map +1 -0
- package/dist/modules/launcher/monolithic_runtime.d.ts +89 -0
- package/dist/modules/launcher/monolithic_runtime.d.ts.map +1 -0
- package/dist/modules/launcher/monolithic_runtime.js +425 -0
- package/dist/modules/launcher/monolithic_runtime.js.map +1 -0
- package/dist/modules/launcher/runtime_entry.d.ts +26 -0
- package/dist/modules/launcher/runtime_entry.d.ts.map +1 -0
- package/dist/modules/launcher/runtime_entry.js +49 -0
- package/dist/modules/launcher/runtime_entry.js.map +1 -0
- package/dist/modules/launcher/status_reporting.d.ts +48 -0
- package/dist/modules/launcher/status_reporting.d.ts.map +1 -0
- package/dist/modules/launcher/status_reporting.js +113 -0
- package/dist/modules/launcher/status_reporting.js.map +1 -0
- package/dist/modules/launcher/supervisor_control.d.ts +6 -0
- package/dist/modules/launcher/supervisor_control.d.ts.map +1 -0
- package/dist/modules/launcher/supervisor_control.js +59 -0
- package/dist/modules/launcher/supervisor_control.js.map +1 -0
- package/dist/modules/logger.d.ts +2 -0
- package/dist/modules/logger.d.ts.map +1 -0
- package/dist/modules/logger.js +71 -0
- package/dist/modules/logger.js.map +1 -0
- package/dist/modules/market_adapter_whitelist.d.ts +22 -0
- package/dist/modules/market_adapter_whitelist.d.ts.map +1 -0
- package/dist/modules/market_adapter_whitelist.js +82 -0
- package/dist/modules/market_adapter_whitelist.js.map +1 -0
- package/dist/modules/node_health_cache.d.ts +55 -0
- package/dist/modules/node_health_cache.d.ts.map +1 -0
- package/dist/modules/node_health_cache.js +134 -0
- package/dist/modules/node_health_cache.js.map +1 -0
- package/dist/modules/node_manager.d.ts +215 -0
- package/dist/modules/node_manager.d.ts.map +1 -0
- package/dist/modules/node_manager.js +628 -0
- package/dist/modules/node_manager.js.map +1 -0
- package/dist/modules/order/accounting.d.ts +349 -0
- package/dist/modules/order/accounting.d.ts.map +1 -0
- package/dist/modules/order/accounting.js +1191 -0
- package/dist/modules/order/accounting.js.map +1 -0
- package/dist/modules/order/async_lock.d.ts +126 -0
- package/dist/modules/order/async_lock.d.ts.map +1 -0
- package/dist/modules/order/async_lock.js +195 -0
- package/dist/modules/order/async_lock.js.map +1 -0
- package/dist/modules/order/export.d.ts +129 -0
- package/dist/modules/order/export.d.ts.map +1 -0
- package/dist/modules/order/export.js +316 -0
- package/dist/modules/order/export.js.map +1 -0
- package/dist/modules/order/format.d.ts +158 -0
- package/dist/modules/order/format.d.ts.map +1 -0
- package/dist/modules/order/format.js +232 -0
- package/dist/modules/order/format.js.map +1 -0
- package/dist/modules/order/grid.d.ts +549 -0
- package/dist/modules/order/grid.d.ts.map +1 -0
- package/dist/modules/order/grid.js +1746 -0
- package/dist/modules/order/grid.js.map +1 -0
- package/dist/modules/order/grid_reconcile.d.ts +154 -0
- package/dist/modules/order/grid_reconcile.d.ts.map +1 -0
- package/dist/modules/order/grid_reconcile.js +1192 -0
- package/dist/modules/order/grid_reconcile.js.map +1 -0
- package/dist/modules/order/index.d.ts +55 -0
- package/dist/modules/order/index.d.ts.map +1 -0
- package/dist/modules/order/index.js +79 -0
- package/dist/modules/order/index.js.map +1 -0
- package/dist/modules/order/logger.d.ts +136 -0
- package/dist/modules/order/logger.d.ts.map +1 -0
- package/dist/modules/order/logger.js +614 -0
- package/dist/modules/order/logger.js.map +1 -0
- package/dist/modules/order/logger_state.d.ts +133 -0
- package/dist/modules/order/logger_state.d.ts.map +1 -0
- package/dist/modules/order/logger_state.js +170 -0
- package/dist/modules/order/logger_state.js.map +1 -0
- package/dist/modules/order/manager.d.ts +413 -0
- package/dist/modules/order/manager.d.ts.map +1 -0
- package/dist/modules/order/manager.js +1605 -0
- package/dist/modules/order/manager.js.map +1 -0
- package/dist/modules/order/processed_fill_store.d.ts +135 -0
- package/dist/modules/order/processed_fill_store.d.ts.map +1 -0
- package/dist/modules/order/processed_fill_store.js +288 -0
- package/dist/modules/order/processed_fill_store.js.map +1 -0
- package/dist/modules/order/runner.d.ts +70 -0
- package/dist/modules/order/runner.d.ts.map +1 -0
- package/dist/modules/order/runner.js +140 -0
- package/dist/modules/order/runner.js.map +1 -0
- package/dist/modules/order/strategy.d.ts +196 -0
- package/dist/modules/order/strategy.d.ts.map +1 -0
- package/dist/modules/order/strategy.js +398 -0
- package/dist/modules/order/strategy.js.map +1 -0
- package/dist/modules/order/sync_engine.d.ts +386 -0
- package/dist/modules/order/sync_engine.d.ts.map +1 -0
- package/dist/modules/order/sync_engine.js +1459 -0
- package/dist/modules/order/sync_engine.js.map +1 -0
- package/dist/modules/order/utils/math.d.ts +677 -0
- package/dist/modules/order/utils/math.d.ts.map +1 -0
- package/dist/modules/order/utils/math.js +1172 -0
- package/dist/modules/order/utils/math.js.map +1 -0
- package/dist/modules/order/utils/order.d.ts +572 -0
- package/dist/modules/order/utils/order.d.ts.map +1 -0
- package/dist/modules/order/utils/order.js +1145 -0
- package/dist/modules/order/utils/order.js.map +1 -0
- package/dist/modules/order/utils/system.d.ts +268 -0
- package/dist/modules/order/utils/system.d.ts.map +1 -0
- package/dist/modules/order/utils/system.js +1261 -0
- package/dist/modules/order/utils/system.js.map +1 -0
- package/dist/modules/order/utils/validate.d.ts +280 -0
- package/dist/modules/order/utils/validate.d.ts.map +1 -0
- package/dist/modules/order/utils/validate.js +918 -0
- package/dist/modules/order/utils/validate.js.map +1 -0
- package/dist/modules/order/working_grid.d.ts +212 -0
- package/dist/modules/order/working_grid.d.ts.map +1 -0
- package/dist/modules/order/working_grid.js +279 -0
- package/dist/modules/order/working_grid.js.map +1 -0
- package/dist/modules/path_api.d.ts +32 -0
- package/dist/modules/path_api.d.ts.map +1 -0
- package/dist/modules/path_api.js +148 -0
- package/dist/modules/path_api.js.map +1 -0
- package/dist/modules/paths.d.ts +58 -0
- package/dist/modules/paths.d.ts.map +1 -0
- package/dist/modules/paths.js +82 -0
- package/dist/modules/paths.js.map +1 -0
- package/dist/modules/process_discovery.d.ts +58 -0
- package/dist/modules/process_discovery.d.ts.map +1 -0
- package/dist/modules/process_discovery.js +265 -0
- package/dist/modules/process_discovery.js.map +1 -0
- package/dist/modules/runtime.d.ts +34 -0
- package/dist/modules/runtime.d.ts.map +1 -0
- package/dist/modules/runtime.js +98 -0
- package/dist/modules/runtime.js.map +1 -0
- package/dist/modules/runtime_settings.d.ts +12 -0
- package/dist/modules/runtime_settings.d.ts.map +1 -0
- package/dist/modules/runtime_settings.js +122 -0
- package/dist/modules/runtime_settings.js.map +1 -0
- package/dist/modules/settings_merge.d.ts +38 -0
- package/dist/modules/settings_merge.d.ts.map +1 -0
- package/dist/modules/settings_merge.js +246 -0
- package/dist/modules/settings_merge.js.map +1 -0
- package/dist/modules/storage/browser_adapter.d.ts +56 -0
- package/dist/modules/storage/browser_adapter.d.ts.map +1 -0
- package/dist/modules/storage/browser_adapter.js +231 -0
- package/dist/modules/storage/browser_adapter.js.map +1 -0
- package/dist/modules/storage/index.d.ts +28 -0
- package/dist/modules/storage/index.d.ts.map +1 -0
- package/dist/modules/storage/index.js +52 -0
- package/dist/modules/storage/index.js.map +1 -0
- package/dist/modules/storage/node_adapter.d.ts +49 -0
- package/dist/modules/storage/node_adapter.d.ts.map +1 -0
- package/dist/modules/storage/node_adapter.js +167 -0
- package/dist/modules/storage/node_adapter.js.map +1 -0
- package/dist/modules/storage/types.d.ts +92 -0
- package/dist/modules/storage/types.d.ts.map +1 -0
- package/dist/modules/storage/types.js +3 -0
- package/dist/modules/storage/types.js.map +1 -0
- package/dist/modules/types.d.ts +1382 -0
- package/dist/modules/types.d.ts.map +1 -0
- package/dist/modules/types.js +11 -0
- package/dist/modules/types.js.map +1 -0
- package/dist/modules/utils/base58check.d.ts +12 -0
- package/dist/modules/utils/base58check.d.ts.map +1 -0
- package/dist/modules/utils/base58check.js +112 -0
- package/dist/modules/utils/base58check.js.map +1 -0
- package/dist/modules/utils/build_dir.d.ts +7 -0
- package/dist/modules/utils/build_dir.d.ts.map +1 -0
- package/dist/modules/utils/build_dir.js +8 -0
- package/dist/modules/utils/build_dir.js.map +1 -0
- package/dist/modules/utils/fs_utils.d.ts +25 -0
- package/dist/modules/utils/fs_utils.d.ts.map +1 -0
- package/dist/modules/utils/fs_utils.js +27 -0
- package/dist/modules/utils/fs_utils.js.map +1 -0
- package/dist/modules/utils/math_utils.d.ts +10 -0
- package/dist/modules/utils/math_utils.d.ts.map +1 -0
- package/dist/modules/utils/math_utils.js +17 -0
- package/dist/modules/utils/math_utils.js.map +1 -0
- package/dist/modules/validate_profiles.d.ts +37 -0
- package/dist/modules/validate_profiles.d.ts.map +1 -0
- package/dist/modules/validate_profiles.js +369 -0
- package/dist/modules/validate_profiles.js.map +1 -0
- package/dist/pm2.d.ts +167 -0
- package/dist/pm2.d.ts.map +1 -0
- package/dist/pm2.js +998 -0
- package/dist/pm2.js.map +1 -0
- package/dist/scripts/analyze-git.d.ts +11 -0
- package/dist/scripts/analyze-git.d.ts.map +1 -0
- package/dist/scripts/analyze-git.js +851 -0
- package/dist/scripts/analyze-git.js.map +1 -0
- package/dist/scripts/analyze-orders.d.ts +17 -0
- package/dist/scripts/analyze-orders.d.ts.map +1 -0
- package/dist/scripts/analyze-orders.js +1568 -0
- package/dist/scripts/analyze-orders.js.map +1 -0
- package/dist/scripts/diagnose-kibana-candles.d.ts +3 -0
- package/dist/scripts/diagnose-kibana-candles.d.ts.map +1 -0
- package/dist/scripts/diagnose-kibana-candles.js +82 -0
- package/dist/scripts/diagnose-kibana-candles.js.map +1 -0
- package/dist/scripts/diagnose-pool-history.d.ts +3 -0
- package/dist/scripts/diagnose-pool-history.d.ts.map +1 -0
- package/dist/scripts/diagnose-pool-history.js +296 -0
- package/dist/scripts/diagnose-pool-history.js.map +1 -0
- package/dist/scripts/divergence-calc.d.ts +26 -0
- package/dist/scripts/divergence-calc.d.ts.map +1 -0
- package/dist/scripts/divergence-calc.js +119 -0
- package/dist/scripts/divergence-calc.js.map +1 -0
- package/dist/scripts/generate_lp_chart.d.ts +31 -0
- package/dist/scripts/generate_lp_chart.d.ts.map +1 -0
- package/dist/scripts/generate_lp_chart.js +92 -0
- package/dist/scripts/generate_lp_chart.js.map +1 -0
- package/dist/scripts/generate_mainnet_corpus_report.d.ts +24 -0
- package/dist/scripts/generate_mainnet_corpus_report.d.ts.map +1 -0
- package/dist/scripts/generate_mainnet_corpus_report.js +237 -0
- package/dist/scripts/generate_mainnet_corpus_report.js.map +1 -0
- package/dist/scripts/generate_market_adapter_whitelist.d.ts +2 -0
- package/dist/scripts/generate_market_adapter_whitelist.d.ts.map +1 -0
- package/dist/scripts/generate_market_adapter_whitelist.js +111 -0
- package/dist/scripts/generate_market_adapter_whitelist.js.map +1 -0
- package/dist/scripts/migrate_bot_keys.d.ts +6 -0
- package/dist/scripts/migrate_bot_keys.d.ts.map +1 -0
- package/dist/scripts/migrate_bot_keys.js +301 -0
- package/dist/scripts/migrate_bot_keys.js.map +1 -0
- package/dist/scripts/native_release_gates.d.ts +3 -0
- package/dist/scripts/native_release_gates.d.ts.map +1 -0
- package/dist/scripts/native_release_gates.js +52 -0
- package/dist/scripts/native_release_gates.js.map +1 -0
- package/dist/scripts/print_grid.d.ts +16 -0
- package/dist/scripts/print_grid.d.ts.map +1 -0
- package/dist/scripts/print_grid.js +80 -0
- package/dist/scripts/print_grid.js.map +1 -0
- package/dist/scripts/run-tests.d.ts +2 -0
- package/dist/scripts/run-tests.d.ts.map +1 -0
- package/dist/scripts/run-tests.js +49 -0
- package/dist/scripts/run-tests.js.map +1 -0
- package/dist/scripts/sync-version.d.ts +14 -0
- package/dist/scripts/sync-version.d.ts.map +1 -0
- package/dist/scripts/sync-version.js +158 -0
- package/dist/scripts/sync-version.js.map +1 -0
- package/dist/scripts/test-credit-renewal.d.ts +2 -0
- package/dist/scripts/test-credit-renewal.d.ts.map +1 -0
- package/dist/scripts/test-credit-renewal.js +329 -0
- package/dist/scripts/test-credit-renewal.js.map +1 -0
- package/dist/scripts/update.d.ts +24 -0
- package/dist/scripts/update.d.ts.map +1 -0
- package/dist/scripts/update.js +650 -0
- package/dist/scripts/update.js.map +1 -0
- package/dist/scripts/validate_bots.d.ts +16 -0
- package/dist/scripts/validate_bots.d.ts.map +1 -0
- package/dist/scripts/validate_bots.js +106 -0
- package/dist/scripts/validate_bots.js.map +1 -0
- package/dist/scripts/verify-browser-bundle.d.ts +22 -0
- package/dist/scripts/verify-browser-bundle.d.ts.map +1 -0
- package/dist/scripts/verify-browser-bundle.js +339 -0
- package/dist/scripts/verify-browser-bundle.js.map +1 -0
- package/dist/unlock.d.ts +48 -0
- package/dist/unlock.d.ts.map +1 -0
- package/dist/unlock.js +925 -0
- package/dist/unlock.js.map +1 -0
- package/package.json +112 -0
- package/scripts/README.md +356 -0
- package/scripts/clear-all.sh +195 -0
- package/scripts/clear-logs.sh +95 -0
- package/scripts/clear-market-adapter.sh +196 -0
- package/scripts/clear-orders.sh +113 -0
- package/scripts/create-bot-symlinks.sh +51 -0
- package/scripts/postinstall.js +9 -0
- package/scripts/reset-settings.sh +118 -0
|
@@ -0,0 +1,677 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* modules/order/utils/math.ts - Mathematical and Numeric Utilities
|
|
3
|
+
*
|
|
4
|
+
* Pure numeric calculations, blockchain conversions, fee math, and fund allocation.
|
|
5
|
+
*
|
|
6
|
+
* ===============================================================================
|
|
7
|
+
* TABLE OF CONTENTS (42 exported functions)
|
|
8
|
+
* ===============================================================================
|
|
9
|
+
*
|
|
10
|
+
* SECTION 1: PARSING & VALIDATION (4 functions)
|
|
11
|
+
* - isExplicitZeroAllocation(value) - Check if value is explicitly zero
|
|
12
|
+
* - isPercentageString(v) - Check if value is percentage string
|
|
13
|
+
* - parsePercentageString(v) - Parse percentage string to decimal
|
|
14
|
+
* - resolveRelativePrice(value, startPrice, mode) - Resolve relative price values
|
|
15
|
+
*
|
|
16
|
+
* SECTION 2: FUND CALCULATIONS (4 functions)
|
|
17
|
+
* - computeChainFundTotals(accountTotals, committedChain) - Compute total funds
|
|
18
|
+
* - calculateAvailableFundsValue(side, accountTotals, funds, ...) - Calculate available funds
|
|
19
|
+
* - calculateSpreadFromOrders(activeBuys, activeSells) - Calculate spread percentage
|
|
20
|
+
* - resolveConfigValue(value, total) - Resolve percentage or absolute config value
|
|
21
|
+
*
|
|
22
|
+
* SECTION 3: BLOCKCHAIN CONVERSIONS (5 functions)
|
|
23
|
+
* - blockchainToFloat(intValue, precision) - Convert blockchain int to float
|
|
24
|
+
* - floatToBlockchainInt(floatValue, precision) - Convert float to blockchain int
|
|
25
|
+
* - quantizeFloat(value, precision) - Round float to blockchain precision
|
|
26
|
+
* - normalizeInt(value, precision) - Normalize int within precision bounds
|
|
27
|
+
* - hasValidAccountTotals(accountTotals, checkFree) - Validate account totals structure
|
|
28
|
+
*
|
|
29
|
+
* SECTION 4: PRECISION UTILITIES (5 functions)
|
|
30
|
+
* - getPrecision(assets, orderType) - Get precision for order type
|
|
31
|
+
* - getPrecisionByOrderType(assets, orderType) - Alias for getPrecision
|
|
32
|
+
* - getPrecisionForSide(assets, side) - Get precision by side (buy/sell)
|
|
33
|
+
* - getPrecisionsForManager(manager) - Get both asset precisions
|
|
34
|
+
* - getPrecisionSlack(precision) - Calculate tolerance for precision
|
|
35
|
+
*
|
|
36
|
+
* SECTION 5: ORDER SIZE VALIDATION (7 functions)
|
|
37
|
+
* - calculatePriceTolerance(price, size, type, assets) - Calculate price match tolerance
|
|
38
|
+
* - validateOrderAmountsWithinLimits(amountToSell, minToReceive) - Validate order limits
|
|
39
|
+
* - getMinOrderSize(assets, type) - Get minimum order size for type
|
|
40
|
+
* - getDustThresholdFactor() - Get dust threshold multiplier
|
|
41
|
+
* - getSingleDustThreshold(idealSize, dustThresholdPercent) - Get single dust threshold
|
|
42
|
+
* - getDoubleDustThreshold(idealSize, dustThresholdPercent) - Get double dust threshold
|
|
43
|
+
* - getMinAbsoluteOrderSize(orderType, assets, minFactor) - Get minimum absolute order size
|
|
44
|
+
* - validateOrderSize(manager, size, type, context) - Validate order size against minimums
|
|
45
|
+
*
|
|
46
|
+
* SECTION 6: FEE CALCULATIONS (2 functions + 2 internal)
|
|
47
|
+
* - getAssetFees(assetSymbol, assetAmount, isMaker) - Get fee info for asset
|
|
48
|
+
* - _setFeeCache(cache) - Set internal fee cache (internal)
|
|
49
|
+
* - _getFeeCache() - Get internal fee cache (internal)
|
|
50
|
+
*
|
|
51
|
+
* SECTION 7: FUND ALLOCATION (6 functions)
|
|
52
|
+
* - allocateFundsByWeights(available, targetCount) - Allocate funds by weight
|
|
53
|
+
* - cloneWeightDistribution(weightDistribution, base) - Clone weight distribution safely
|
|
54
|
+
* - calculateOrderSizes(manager, orderType) - Calculate order sizes for placement
|
|
55
|
+
* - calculateRotationOrderSizes(manager, orderType, fillAmount) - Calculate rotation sizes
|
|
56
|
+
* - calculateGridSideDivergenceMetric(manager, orderType, threshold) - Calculate divergence
|
|
57
|
+
* - clamp(value, min, max) - Clamp a value between min and max bounds
|
|
58
|
+
*
|
|
59
|
+
* SECTION 8: FEE DEDUCTION (3 functions)
|
|
60
|
+
* - calculateOrderCreationFees(count, btsFeeData) - Calculate total creation fees
|
|
61
|
+
* - deductOrderFeesFromFunds(available, count, btsFeeData, btsSide) - Deduct fees from funds
|
|
62
|
+
* - calculateSwapInAmount(targetReceive, poolReserveOut, poolReserveIn) - AMM swap math
|
|
63
|
+
*
|
|
64
|
+
* SECTION 9: GRID UTILITIES (1 function)
|
|
65
|
+
* - calculateGapSlots(incrementPercent, targetSpreadPercent) - Calculate gap slots count
|
|
66
|
+
*
|
|
67
|
+
* ===============================================================================
|
|
68
|
+
*/
|
|
69
|
+
/**
|
|
70
|
+
* Check if a value is explicitly set to zero (number 0, string "0", or "0%").
|
|
71
|
+
* Used to distinguish between "not set" and "explicitly disabled".
|
|
72
|
+
*
|
|
73
|
+
* @param {*} value - Value to check
|
|
74
|
+
* @returns {boolean} True if value is explicitly zero
|
|
75
|
+
*/
|
|
76
|
+
declare function isExplicitZeroAllocation(value: any): boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Check if a value is a percentage string (ends with '%').
|
|
79
|
+
*
|
|
80
|
+
* @param {*} v - Value to test
|
|
81
|
+
* @returns {boolean} True if v is a string ending with '%'
|
|
82
|
+
*/
|
|
83
|
+
declare function isPercentageString(v: any): boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Check if a value is a positive number.
|
|
86
|
+
*
|
|
87
|
+
* @param {*} value - Value to test
|
|
88
|
+
* @returns {boolean} True if the value is a finite number greater than 0
|
|
89
|
+
*/
|
|
90
|
+
declare function isPositiveNumber(value: any): boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Check if a value is a positive number or a positive percentage string.
|
|
93
|
+
*
|
|
94
|
+
* @param {*} value - Value to test
|
|
95
|
+
* @returns {boolean} True if the value is a positive number or a percentage string like "25%"
|
|
96
|
+
*/
|
|
97
|
+
declare function isPositiveNumberOrPercent(value: any): boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Check if a value is a positive integer.
|
|
100
|
+
*
|
|
101
|
+
* @param {*} value - Value to test
|
|
102
|
+
* @returns {boolean} True if the value is an integer greater than 0
|
|
103
|
+
*/
|
|
104
|
+
declare function isPositiveInt(value: any): boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Parse a percentage string to decimal form.
|
|
107
|
+
* Extracts numeric value before '%' and divides by 100.
|
|
108
|
+
*
|
|
109
|
+
* @param {string} v - Percentage string (e.g., "50%")
|
|
110
|
+
* @returns {number|null} Decimal form (e.g., 0.5) or null if invalid
|
|
111
|
+
*/
|
|
112
|
+
declare function parsePercentageString(v: any): number;
|
|
113
|
+
/**
|
|
114
|
+
* Convert a value (number, percentage string, or numeric string) to its
|
|
115
|
+
* decimal form. Unlike parsePercentageString which only handles '%' strings,
|
|
116
|
+
* this also accepts bare numbers and numeric strings.
|
|
117
|
+
* @param {*} value - Number (100 = 100), "100%" (= 1.0), or "100" (= 100)
|
|
118
|
+
* @returns {number} Decimal value, 0 if unparseable
|
|
119
|
+
*/
|
|
120
|
+
declare function toDecimal(value: any): number;
|
|
121
|
+
/**
|
|
122
|
+
* Resolve a relative price expression (multiplier format) to absolute price.
|
|
123
|
+
* Supports expressions like "3x" to mean 3 times the reference price.
|
|
124
|
+
*
|
|
125
|
+
* @param {*} value - Value to resolve (e.g., "3x" or "0.5x")
|
|
126
|
+
* @param {number} startPrice - Reference price for multiplier calculation
|
|
127
|
+
* @param {string} [mode='min'] - "min" divides (price/multiplier), "max" multiplies (price*multiplier)
|
|
128
|
+
* @returns {number|null} Resolved price or null if value is not a relative expression
|
|
129
|
+
*/
|
|
130
|
+
declare function resolveRelativePrice(value: any, startPrice: any, mode?: string): number;
|
|
131
|
+
/**
|
|
132
|
+
* Calculate chain fund totals from account balances and committed orders.
|
|
133
|
+
* Reconciles free/locked balances with committed capital to produce fund summary.
|
|
134
|
+
*
|
|
135
|
+
* @param {Object} accountTotals - Account balance snapshot with buyFree, sellFree, buy, sell properties
|
|
136
|
+
* @param {Object} committedChain - Committed capital with buy and sell properties
|
|
137
|
+
* @returns {Object} Summary object with chainFreeBuy, chainFreeSell, committedChainBuy,
|
|
138
|
+
* committedChainSell, freePlusLockedBuy, freePlusLockedSell, chainTotalBuy, chainTotalSell
|
|
139
|
+
*/
|
|
140
|
+
declare function computeChainFundTotals(accountTotals: any, committedChain: any): {
|
|
141
|
+
chainFreeBuy: any;
|
|
142
|
+
chainFreeSell: any;
|
|
143
|
+
committedChainBuy: any;
|
|
144
|
+
committedChainSell: any;
|
|
145
|
+
freePlusLockedBuy: any;
|
|
146
|
+
freePlusLockedSell: any;
|
|
147
|
+
chainTotalBuy: any;
|
|
148
|
+
chainTotalSell: any;
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* Quantize a float value by round-tripping through blockchain integer representation.
|
|
152
|
+
* Converts float → blockchain int (satoshi-level precision) → float.
|
|
153
|
+
* Eliminates floating-point accumulation errors.
|
|
154
|
+
*
|
|
155
|
+
* @param {number} value - Float value to quantize
|
|
156
|
+
* @param {number} precision - Asset precision (satoshis)
|
|
157
|
+
* @returns {number} Quantized float value
|
|
158
|
+
*/
|
|
159
|
+
declare function quantizeFloat(value: any, precision: any): number;
|
|
160
|
+
/**
|
|
161
|
+
* Normalize an integer value by round-tripping through float representation.
|
|
162
|
+
* Converts int → float (readable format) → blockchain int.
|
|
163
|
+
* Ensures the integer aligns with precision boundaries.
|
|
164
|
+
* Used for precision-aware comparisons.
|
|
165
|
+
*
|
|
166
|
+
* @param {number} value - Integer value to normalize
|
|
167
|
+
* @param {number} precision - Asset precision (satoshis)
|
|
168
|
+
* @returns {number} Normalized integer value
|
|
169
|
+
*/
|
|
170
|
+
declare function normalizeInt(value: any, precision: any): number;
|
|
171
|
+
/**
|
|
172
|
+
* @private Set the fee cache (called by system.js::initializeFeeCache).
|
|
173
|
+
*
|
|
174
|
+
* @param {Object} cache - Fee cache object keyed by asset symbol
|
|
175
|
+
* @returns {void}
|
|
176
|
+
*/
|
|
177
|
+
declare function _setFeeCache(cache: any): void;
|
|
178
|
+
/**
|
|
179
|
+
* Get fee information for an asset.
|
|
180
|
+
|
|
181
|
+
* Returns fee structure or net proceeds calculation if asset amount provided.
|
|
182
|
+
*
|
|
183
|
+
* @param {string} assetSymbol - Asset symbol (e.g., "BTS", "USD")
|
|
184
|
+
* @param {number} [assetAmount=null] - Asset amount to calculate net proceeds
|
|
185
|
+
* @param {boolean} [isMaker=true] - Whether this is a maker or taker (affects BTS fees)
|
|
186
|
+
* @returns {Object} Fee structure with create/update/net fees or net proceeds if amount provided
|
|
187
|
+
* @throws {Error} If fees not cached (call initializeFeeCache first)
|
|
188
|
+
*/
|
|
189
|
+
declare function getAssetFees(assetSymbol: any, assetAmount?: any, isMaker?: boolean): {
|
|
190
|
+
netProceeds: number;
|
|
191
|
+
total: number;
|
|
192
|
+
refund: number;
|
|
193
|
+
isMaker: boolean;
|
|
194
|
+
createFee?: undefined;
|
|
195
|
+
updateFee?: undefined;
|
|
196
|
+
cancelFee?: undefined;
|
|
197
|
+
makerFeeDiscountPercent?: undefined;
|
|
198
|
+
makerNetFee?: undefined;
|
|
199
|
+
takerNetFee?: undefined;
|
|
200
|
+
netFee?: undefined;
|
|
201
|
+
feeAmount?: undefined;
|
|
202
|
+
feePercent?: undefined;
|
|
203
|
+
marketFee?: undefined;
|
|
204
|
+
takerFee?: undefined;
|
|
205
|
+
percent?: undefined;
|
|
206
|
+
} | {
|
|
207
|
+
total: any;
|
|
208
|
+
createFee: any;
|
|
209
|
+
updateFee: any;
|
|
210
|
+
cancelFee: any;
|
|
211
|
+
makerFeeDiscountPercent: any;
|
|
212
|
+
makerNetFee: number;
|
|
213
|
+
takerNetFee: number;
|
|
214
|
+
netFee: number;
|
|
215
|
+
isMaker: boolean;
|
|
216
|
+
netProceeds?: undefined;
|
|
217
|
+
refund?: undefined;
|
|
218
|
+
feeAmount?: undefined;
|
|
219
|
+
feePercent?: undefined;
|
|
220
|
+
marketFee?: undefined;
|
|
221
|
+
takerFee?: undefined;
|
|
222
|
+
percent?: undefined;
|
|
223
|
+
} | {
|
|
224
|
+
netProceeds: number;
|
|
225
|
+
total: number;
|
|
226
|
+
feeAmount: number;
|
|
227
|
+
feePercent: any;
|
|
228
|
+
isMaker: boolean;
|
|
229
|
+
refund?: undefined;
|
|
230
|
+
createFee?: undefined;
|
|
231
|
+
updateFee?: undefined;
|
|
232
|
+
cancelFee?: undefined;
|
|
233
|
+
makerFeeDiscountPercent?: undefined;
|
|
234
|
+
makerNetFee?: undefined;
|
|
235
|
+
takerNetFee?: undefined;
|
|
236
|
+
netFee?: undefined;
|
|
237
|
+
marketFee?: undefined;
|
|
238
|
+
takerFee?: undefined;
|
|
239
|
+
percent?: undefined;
|
|
240
|
+
} | {
|
|
241
|
+
marketFee: any;
|
|
242
|
+
takerFee: any;
|
|
243
|
+
percent: any;
|
|
244
|
+
netProceeds?: undefined;
|
|
245
|
+
total?: undefined;
|
|
246
|
+
refund?: undefined;
|
|
247
|
+
isMaker?: undefined;
|
|
248
|
+
createFee?: undefined;
|
|
249
|
+
updateFee?: undefined;
|
|
250
|
+
cancelFee?: undefined;
|
|
251
|
+
makerFeeDiscountPercent?: undefined;
|
|
252
|
+
makerNetFee?: undefined;
|
|
253
|
+
takerNetFee?: undefined;
|
|
254
|
+
netFee?: undefined;
|
|
255
|
+
feeAmount?: undefined;
|
|
256
|
+
feePercent?: undefined;
|
|
257
|
+
};
|
|
258
|
+
/**
|
|
259
|
+
* Calculate available funds for a specific side (buy or sell).
|
|
260
|
+
* Deducts virtual reservations, BTS fees owed, and BTS fee reservation from chain-free balance.
|
|
261
|
+
*
|
|
262
|
+
* @param {string} side - Trading side: "buy" or "sell"
|
|
263
|
+
* @param {Object} accountTotals - Account balance snapshot
|
|
264
|
+
* @param {Object} funds - Fund allocation object with virtual, btsFeesOwed properties
|
|
265
|
+
* @param {string} assetA - First asset symbol
|
|
266
|
+
* @param {string} assetB - Second asset symbol
|
|
267
|
+
* @param {Object} [activeOrders=null] - Active order counts {buy, sell} for BTS reservation calculation
|
|
268
|
+
* @returns {number} Available funds for the side (0 if side invalid or insufficient funds)
|
|
269
|
+
*/
|
|
270
|
+
declare function calculateAvailableFundsValue(side: any, accountTotals: any, funds: any, assetA: any, assetB: any, activeOrders?: any, configMinBtsValue?: any, feeParams?: any): number;
|
|
271
|
+
/**
|
|
272
|
+
* Find the best (highest) buy price and best (lowest) sell price from active orders.
|
|
273
|
+
*
|
|
274
|
+
* @param {Array<Object>} activeBuys - Active buy orders with price property
|
|
275
|
+
* @param {Array<Object>} activeSells - Active sell orders with price property
|
|
276
|
+
* @returns {{bestBuy: number|null, bestSell: number|null}} Best prices or null if no orders
|
|
277
|
+
*/
|
|
278
|
+
declare function getGridBestPrices(activeBuys: any, activeSells: any): {
|
|
279
|
+
bestBuy: number;
|
|
280
|
+
bestSell: number;
|
|
281
|
+
};
|
|
282
|
+
/**
|
|
283
|
+
* Calculate bid-ask spread percentage from active buy and sell orders.
|
|
284
|
+
* Spread = (bestSell / bestBuy - 1) * 100 (percentage).
|
|
285
|
+
*
|
|
286
|
+
* @param {Array<Object>} activeBuys - Active buy orders with price property
|
|
287
|
+
* @param {Array<Object>} activeSells - Active sell orders with price property
|
|
288
|
+
* @returns {number} Spread percentage or 0 if insufficient data
|
|
289
|
+
*/
|
|
290
|
+
declare function calculateSpreadFromOrders(activeBuys: any, activeSells: any): number;
|
|
291
|
+
/**
|
|
292
|
+
* Resolve a config value to a numeric amount.
|
|
293
|
+
* Interprets percentage strings, numeric strings, or direct numbers.
|
|
294
|
+
*
|
|
295
|
+
* @param {*} value - Value to resolve (string, number, or percentage)
|
|
296
|
+
* @param {number} total - Total amount for percentage calculations
|
|
297
|
+
* @returns {number} Resolved numeric value or 0 if uninterpretable
|
|
298
|
+
*/
|
|
299
|
+
declare function resolveConfigValue(value: any, total: any): number;
|
|
300
|
+
/**
|
|
301
|
+
* Resolve a config value to a numeric amount, accounting for shared-account
|
|
302
|
+
* fund registry. If the bot has a registry entry, returns the proportional
|
|
303
|
+
* share of chainTotal. Falls back to standard resolveConfigValue if the
|
|
304
|
+
* registry has no entry for this bot (single-bot accounts or unregistered).
|
|
305
|
+
*
|
|
306
|
+
* @param {*} value - Value to resolve (string, number, or percentage)
|
|
307
|
+
* @param {number} chainTotal - Total chain balance for this side
|
|
308
|
+
* @param {string} account - Blockchain account name
|
|
309
|
+
* @param {string} botName - Bot identifier
|
|
310
|
+
* @param {'buy'|'sell'} side - Trade side
|
|
311
|
+
* @returns {number} Resolved numeric value or 0 if uninterpretable
|
|
312
|
+
*/
|
|
313
|
+
declare function resolveConfigValueWithRegistry(value: any, chainTotal: any, account: any, botName: any, side: any): any;
|
|
314
|
+
/**
|
|
315
|
+
* Check if account totals contain valid buy/sell balance data.
|
|
316
|
+
*
|
|
317
|
+
* @param {Object} accountTotals - Account total balances object
|
|
318
|
+
* @param {boolean} [checkFree=true] - Check free balances if true, else check total balances
|
|
319
|
+
* @returns {boolean} True if both buy and sell values are valid finite numbers
|
|
320
|
+
*/
|
|
321
|
+
declare function hasValidAccountTotals(accountTotals: any, checkFree?: boolean): any;
|
|
322
|
+
/**
|
|
323
|
+
* Convert blockchain integer to float using asset precision.
|
|
324
|
+
* Divides by 10^precision to convert satoshi-level units to human-readable float.
|
|
325
|
+
* Formula: float = blockchain_int / (10^precision)
|
|
326
|
+
*
|
|
327
|
+
* @param {number} intValue - Integer value from blockchain (satoshi units)
|
|
328
|
+
* @param {number} precision - Asset precision level (exponent: 5, 8, 4, etc)
|
|
329
|
+
* @returns {number} Float representation in human-readable units
|
|
330
|
+
* @throws {Error} If precision is invalid
|
|
331
|
+
*/
|
|
332
|
+
declare function blockchainToFloat(intValue: any, precision: any): number;
|
|
333
|
+
/**
|
|
334
|
+
* Convert float to blockchain integer using asset precision.
|
|
335
|
+
* Multiplies by 10^precision and rounds to satoshi-level units.
|
|
336
|
+
* Clamps to MAX_INT64/MIN_INT64 to prevent overflow.
|
|
337
|
+
* Formula: blockchain_int = round(float * (10^precision))
|
|
338
|
+
*
|
|
339
|
+
* Round-trip (float → int → float) eliminates floating-point accumulation errors.
|
|
340
|
+
* Overflow protection: Blockchain integers must fit in signed 64-bit range.
|
|
341
|
+
*
|
|
342
|
+
* @param {number} floatValue - Float value to convert (human-readable units)
|
|
343
|
+
* @param {number} precision - Asset precision level (exponent: 5, 8, 4, etc)
|
|
344
|
+
* @returns {number} Blockchain integer representation (satoshi units)
|
|
345
|
+
* @throws {Error} If precision is invalid
|
|
346
|
+
*/
|
|
347
|
+
declare function floatToBlockchainInt(floatValue: any, precision: any): number;
|
|
348
|
+
/**
|
|
349
|
+
* Get asset precision for a specific order type (BUY or SELL).
|
|
350
|
+
* BUY orders size in assetB, SELL orders size in assetA.
|
|
351
|
+
*
|
|
352
|
+
* @param {Object} assets - Asset metadata with assetA and assetB
|
|
353
|
+
* @param {string} orderType - Order type (ORDER_TYPES.BUY or ORDER_TYPES.SELL)
|
|
354
|
+
* @returns {number} Asset precision
|
|
355
|
+
* @throws {Error} If precision missing for the required asset
|
|
356
|
+
*/
|
|
357
|
+
declare function getPrecisionByOrderType(assets: any, orderType: any): any;
|
|
358
|
+
/**
|
|
359
|
+
* Get asset precision for a specific trading side.
|
|
360
|
+
*
|
|
361
|
+
* @param {Object} assets - Asset metadata with assetA and assetB
|
|
362
|
+
* @param {string} side - Side ("buy" or "sell")
|
|
363
|
+
* @returns {number} Asset precision for the side
|
|
364
|
+
* @throws {Error} If precision missing
|
|
365
|
+
*/
|
|
366
|
+
declare function getPrecisionForSide(assets: any, side: any): any;
|
|
367
|
+
/**
|
|
368
|
+
* Get asset precisions for both assetA and assetB.
|
|
369
|
+
*
|
|
370
|
+
* @param {Object} assets - Asset metadata with assetA and assetB
|
|
371
|
+
* @returns {Object} Object with A and B precision properties
|
|
372
|
+
* @throws {Error} If precision missing for either asset
|
|
373
|
+
*/
|
|
374
|
+
declare function getPrecisionsForManager(assets: any): {
|
|
375
|
+
A: any;
|
|
376
|
+
B: any;
|
|
377
|
+
};
|
|
378
|
+
/**
|
|
379
|
+
* Calculate precision slack (rounding tolerance) for a given precision level.
|
|
380
|
+
* Used for safe comparison of blockchain values that may differ by rounding.
|
|
381
|
+
*
|
|
382
|
+
* @param {number} precision - Asset precision level
|
|
383
|
+
* @param {number} [factor=2] - Multiplier for slack (default 2)
|
|
384
|
+
* @returns {number} Tolerance value (e.g., 2 * 10^-8 for 8-decimal precision)
|
|
385
|
+
*/
|
|
386
|
+
declare function getPrecisionSlack(precision: any, factor?: number): number;
|
|
387
|
+
/**
|
|
388
|
+
* Unified precision lookup for assets.
|
|
389
|
+
*
|
|
390
|
+
* @param {Object} assets - Assets object with assetA and assetB
|
|
391
|
+
* @param {Object} [options={}] - Lookup options { type, side, proceeds }
|
|
392
|
+
* @returns {number} Asset precision
|
|
393
|
+
*/
|
|
394
|
+
declare function getPrecision(assets: any, { type, side, proceeds }?: {
|
|
395
|
+
type?: string;
|
|
396
|
+
side?: string;
|
|
397
|
+
proceeds?: boolean;
|
|
398
|
+
}): any;
|
|
399
|
+
/**
|
|
400
|
+
* Calculate price tolerance for order matching on-chain.
|
|
401
|
+
* Accounts for precision limits of both assets to determine acceptable price deviation.
|
|
402
|
+
* Used when matching grid orders to blockchain orders.
|
|
403
|
+
*
|
|
404
|
+
* NOTE on the orderSize parameter: larger sizes produce tighter (more precise)
|
|
405
|
+
* tolerance values. When using this function for duplicate-price-level
|
|
406
|
+
* detection, always pass Math.max(sizeA, sizeB) as orderSize — a tiny dust
|
|
407
|
+
* order would inflate the tolerance window and falsely match distant prices.
|
|
408
|
+
*
|
|
409
|
+
* @param {number} gridPrice - Grid order price
|
|
410
|
+
* @param {number} orderSize - Order size on primary side (larger = tighter tolerance)
|
|
411
|
+
* @param {string} orderType - Order type ("buy" or "sell")
|
|
412
|
+
* @param {Object} [assets=null] - Asset metadata with precision (required)
|
|
413
|
+
* @returns {number|null} Price tolerance value or null if invalid inputs
|
|
414
|
+
* @throws {Error} If assets missing or precisions invalid
|
|
415
|
+
*/
|
|
416
|
+
declare function calculatePriceTolerance(gridPrice: any, orderSize: any, orderType: any, assets?: any): number;
|
|
417
|
+
/**
|
|
418
|
+
* Validate order amounts are within blockchain limits (0 < INT64_MAX).
|
|
419
|
+
* Converts floats to blockchain integers and checks they fit in signed 64-bit integers.
|
|
420
|
+
*
|
|
421
|
+
* @param {number} amountToSell - Amount to sell (float)
|
|
422
|
+
* @param {number} minToReceive - Minimum amount to receive (float)
|
|
423
|
+
* @param {number} sellPrecision - Precision of sell asset
|
|
424
|
+
* @param {number} receivePrecision - Precision of receive asset
|
|
425
|
+
* @returns {boolean} True if both amounts are valid and within limits
|
|
426
|
+
*/
|
|
427
|
+
declare function validateOrderAmountsWithinLimits(amountToSell: any, minToReceive: any, sellPrecision: any, receivePrecision: any): boolean;
|
|
428
|
+
/**
|
|
429
|
+
* Calculate minimum absolute order size for an order type.
|
|
430
|
+
* Returns factor * 10^-precision (e.g., 50 * 10^-8 for 8-decimal asset).
|
|
431
|
+
*
|
|
432
|
+
* @param {string} orderType - Order type (BUY or SELL)
|
|
433
|
+
* @param {Object} assets - Asset metadata with assetA and assetB precisions
|
|
434
|
+
* @param {number} [factor=50] - Minimum size factor (default 50)
|
|
435
|
+
* @returns {number} Minimum order size in asset units
|
|
436
|
+
* @throws {Error} If precision cannot be determined
|
|
437
|
+
*/
|
|
438
|
+
declare function getMinOrderSize(orderType: any, assets: any, factor?: number): number;
|
|
439
|
+
/**
|
|
440
|
+
* Calculate dust threshold factor as decimal fraction.
|
|
441
|
+
*
|
|
442
|
+
* @param {number} [dustThresholdPercent=5] - Dust threshold percentage (default 5%)
|
|
443
|
+
* @returns {number} Dust factor (e.g., 0.05 for 5%)
|
|
444
|
+
*/
|
|
445
|
+
declare function getDustThresholdFactor(dustThresholdPercent?: number): number;
|
|
446
|
+
/**
|
|
447
|
+
* Calculate single dust threshold for an ideal order size.
|
|
448
|
+
* Returns idealSize * (dustThresholdPercent / 100).
|
|
449
|
+
*
|
|
450
|
+
* @param {number} idealSize - Ideal/reference order size
|
|
451
|
+
* @param {number} [dustThresholdPercent=5] - Threshold percentage (default 5%)
|
|
452
|
+
* @returns {number} Single dust threshold (0 if idealSize invalid)
|
|
453
|
+
*/
|
|
454
|
+
declare function getSingleDustThreshold(idealSize: any, dustThresholdPercent?: number): number;
|
|
455
|
+
/**
|
|
456
|
+
* Calculate double dust threshold for an ideal order size.
|
|
457
|
+
* Returns idealSize * (dustThresholdPercent / 100) * 2.
|
|
458
|
+
* Used to filter very small orders that would be uneconomical.
|
|
459
|
+
*
|
|
460
|
+
* @param {number} idealSize - Ideal/reference order size
|
|
461
|
+
* @param {number} [dustThresholdPercent=5] - Threshold percentage (default 5%)
|
|
462
|
+
* @returns {number} Double dust threshold (0 if idealSize invalid)
|
|
463
|
+
*/
|
|
464
|
+
declare function getDoubleDustThreshold(idealSize: any, dustThresholdPercent?: number): number;
|
|
465
|
+
/**
|
|
466
|
+
* Calculate minimum absolute order size (wrapper for getMinOrderSize with default factor).
|
|
467
|
+
*
|
|
468
|
+
* @param {string} orderType - Order type (BUY or SELL)
|
|
469
|
+
* @param {Object} assets - Asset metadata
|
|
470
|
+
* @param {number} [minFactor=50] - Minimum size factor (default 50)
|
|
471
|
+
* @returns {number} Minimum order size in asset units
|
|
472
|
+
*/
|
|
473
|
+
declare function getMinAbsoluteOrderSize(orderType: any, assets: any, minFactor?: number): number;
|
|
474
|
+
/**
|
|
475
|
+
* Validate an order size against minimum absolute and dust thresholds.
|
|
476
|
+
* Returns detailed validation result with reasons if invalid.
|
|
477
|
+
*
|
|
478
|
+
* @param {number} orderSize - Order size to validate
|
|
479
|
+
* @param {string} orderType - Order type (BUY or SELL)
|
|
480
|
+
* @param {Object} assets - Asset metadata with precisions
|
|
481
|
+
* @param {number} [minFactor=50] - Minimum size factor (default 50)
|
|
482
|
+
* @param {number} [idealSize=null] - Ideal size for dust calculations
|
|
483
|
+
* @param {number} [dustThresholdPercent=5] - Dust threshold percentage (default 5%)
|
|
484
|
+
* @returns {Object} Validation result {isValid, reason, minAbsoluteSize, minDustSize}
|
|
485
|
+
*/
|
|
486
|
+
declare function validateOrderSize(orderSize: any, orderType: any, assets: any, minFactor?: number, idealSize?: any, dustThresholdPercent?: number): {
|
|
487
|
+
isValid: boolean;
|
|
488
|
+
reason: string;
|
|
489
|
+
minAbsoluteSize: number;
|
|
490
|
+
minDustSize: number;
|
|
491
|
+
};
|
|
492
|
+
/**
|
|
493
|
+
* Allocate total funds across n orders using exponential weight distribution.
|
|
494
|
+
* Optionally enforces precision quantization to match blockchain constraints.
|
|
495
|
+
* If precision provided, adjusts the largest order to compensate for rounding errors.
|
|
496
|
+
*
|
|
497
|
+
* @param {number} totalFunds - Total funds to allocate
|
|
498
|
+
* @param {number} n - Number of orders to create allocations for
|
|
499
|
+
* @param {number} weight - Weight factor (0-1) controlling distribution steepness
|
|
500
|
+
* @param {number} incrementFactor - Increment factor (typically 0.01 for 1% grid spacing)
|
|
501
|
+
* @param {boolean} [reverse=false] - If true, allocate larger sizes to higher indices
|
|
502
|
+
* @param {number} [minSize=0] - Minimum size for each allocation (currently unused, for future validation)
|
|
503
|
+
* @param {number} [precision=null] - Asset precision; if provided, quantize to blockchain integers
|
|
504
|
+
* @returns {Array<number>} Array of n allocation sizes
|
|
505
|
+
*/
|
|
506
|
+
declare function allocateFundsByWeights(totalFunds: any, n: any, weight: any, incrementFactor: any, reverse?: boolean, minSize?: number, precision?: any): any[];
|
|
507
|
+
/**
|
|
508
|
+
* Calculate order sizes for a list of orders using weighted fund allocation.
|
|
509
|
+
* Allocates buy and sell funds separately using weight distribution from config.
|
|
510
|
+
* Preserves order sequence while adding size property to each order.
|
|
511
|
+
*
|
|
512
|
+
* @param {Array<Object>} orders - Array of order objects with type property
|
|
513
|
+
* @param {Object} config - Configuration with incrementPercent and weightDistribution
|
|
514
|
+
* @param {number} sellFunds - Total funds available for SELL orders
|
|
515
|
+
* @param {number} buyFunds - Total funds available for BUY orders
|
|
516
|
+
* @param {number} [minSellSize=0] - Minimum size for sell allocations
|
|
517
|
+
* @param {number} [minBuySize=0] - Minimum size for buy allocations
|
|
518
|
+
* @param {number} [precisionA=null] - Precision for assetA (SELL asset)
|
|
519
|
+
* @param {number} [precisionB=null] - Precision for assetB (BUY asset)
|
|
520
|
+
* @returns {Array<Object>} Orders array with size property added to each
|
|
521
|
+
*/
|
|
522
|
+
declare function calculateOrderSizes(orders: any, config: any, sellFunds: any, buyFunds: any, minSellSize?: number, minBuySize?: number, precisionA?: any, precisionB?: any): any;
|
|
523
|
+
/**
|
|
524
|
+
* Calculate order sizes for rotation operations.
|
|
525
|
+
* Combines available funds with existing grid allocation for sizing.
|
|
526
|
+
* Used during order refreshes when rotating orders to new positions.
|
|
527
|
+
*
|
|
528
|
+
* @param {number} availableFunds - Free funds not yet allocated
|
|
529
|
+
* @param {number} totalGridAllocation - Sum of all existing grid order sizes
|
|
530
|
+
* @param {number} orderCount - Number of orders to size
|
|
531
|
+
* @param {string} orderType - Order type (BUY or SELL)
|
|
532
|
+
* @param {Object} config - Configuration with incrementPercent and weightDistribution
|
|
533
|
+
* @param {number} [minSize=0] - Minimum size for each allocation
|
|
534
|
+
* @param {number} [precision=null] - Asset precision for quantization
|
|
535
|
+
* @returns {Array<number>} Array of order sizes
|
|
536
|
+
*/
|
|
537
|
+
declare function calculateRotationOrderSizes(availableFunds: any, totalGridAllocation: any, orderCount: any, orderType: any, config: any, minSize?: number, precision?: any): any[];
|
|
538
|
+
/**
|
|
539
|
+
* Calculate RMS (Root Mean Square) divergence between calculated and persisted grids.
|
|
540
|
+
* Measures how much the current grid differs from the calculated ideal.
|
|
541
|
+
* Used to determine if grid recalculation is needed.
|
|
542
|
+
*
|
|
543
|
+
* RMS quadratically penalizes large errors and unmatched orders (treated as 100% error).
|
|
544
|
+
* Default 14.3% RMS threshold allows ~3.2% average error concentrated in few orders.
|
|
545
|
+
* See README GRID RECALCULATION section for threshold interpretation table.
|
|
546
|
+
*
|
|
547
|
+
* @param {Array<Object>} calculatedOrders - Ideal/calculated order grid
|
|
548
|
+
* @param {Array<Object>} persistedOrders - Current/persisted order grid
|
|
549
|
+
* @param {string} [sideName='unknown'] - Side name for logging (buy/sell)
|
|
550
|
+
* @returns {number} RMS divergence metric (0 = perfect match, higher = more divergence)
|
|
551
|
+
*/
|
|
552
|
+
declare function calculateGridSideDivergenceMetric(calculatedOrders: any, persistedOrders: any, sideName?: string): number;
|
|
553
|
+
/**
|
|
554
|
+
* Calculate estimated BTS order creation fees for a number of orders.
|
|
555
|
+
* Works for all pairs — returns the BTS fee budget needed for order operations.
|
|
556
|
+
*
|
|
557
|
+
* @param {string} assetA - First asset symbol
|
|
558
|
+
* @param {string} assetB - Second asset symbol (unused in calculation, kept for signature compat)
|
|
559
|
+
* @param {number} totalOrders - Number of orders to create
|
|
560
|
+
* @param {number} [feeMultiplier=BTS_RESERVATION_MULTIPLIER] - Multiplier for reservation (typically 5x)
|
|
561
|
+
* @returns {number} Total fee amount (fallback BTS_FALLBACK_FEE if fee lookup fails; warning logged)
|
|
562
|
+
*/
|
|
563
|
+
declare function calculateOrderCreationFees(assetA: any, assetB: any, totalOrders: any, feeMultiplier?: any): any;
|
|
564
|
+
/**
|
|
565
|
+
* Deduct order fees from available buy/sell funds.
|
|
566
|
+
* If BTS is the buy asset, deducts from buyFunds; if sell asset, deducts from sellFunds.
|
|
567
|
+
*
|
|
568
|
+
* @param {number} buyFunds - Available buy-side funds
|
|
569
|
+
* @param {number} sellFunds - Available sell-side funds
|
|
570
|
+
* @param {number} fees - Fee amount to deduct
|
|
571
|
+
* @param {Object} config - Configuration with assetA and assetB
|
|
572
|
+
* @param {Object} [logger=null] - Optional logger for logging deductions
|
|
573
|
+
* @returns {Object} Updated funds object {buyFunds, sellFunds}
|
|
574
|
+
*/
|
|
575
|
+
declare function deductOrderFeesFromFunds(buyFunds: any, sellFunds: any, fees: any, config: any, logger?: any): {
|
|
576
|
+
buyFunds: any;
|
|
577
|
+
sellFunds: any;
|
|
578
|
+
};
|
|
579
|
+
/**
|
|
580
|
+
* Calculate how much input asset to swap into a constant-product AMM pool
|
|
581
|
+
* to receive a target amount of output asset.
|
|
582
|
+
*
|
|
583
|
+
* Formula: k = reserveIn * reserveOut
|
|
584
|
+
* newReserveOut = reserveOut - targetReceive
|
|
585
|
+
* newReserveIn = k / newReserveOut
|
|
586
|
+
* sellAmount = newReserveIn - reserveIn
|
|
587
|
+
*
|
|
588
|
+
* Caps swap at 50% of pool reserves to prevent extreme slippage.
|
|
589
|
+
*
|
|
590
|
+
* @param {number} targetReceive - Desired amount of output asset
|
|
591
|
+
* @param {number} poolReserveOut - Pool reserve of output asset
|
|
592
|
+
* @param {number} poolReserveIn - Pool reserve of input asset
|
|
593
|
+
* @returns {number} Amount of input asset to sell
|
|
594
|
+
*/
|
|
595
|
+
declare function calculateSwapInAmount(targetReceive: any, poolReserveOut: any, poolReserveIn: any): number;
|
|
596
|
+
/**
|
|
597
|
+
* Calculate the spread gap size (number of empty slots between BUY and SELL rails).
|
|
598
|
+
* Used by both grid creation and strategy rebalancing to keep spread math consistent.
|
|
599
|
+
*
|
|
600
|
+
* @param {number} incrementPercent - Grid increment percentage
|
|
601
|
+
* @param {number} targetSpreadPercent - Target spread percentage
|
|
602
|
+
* @param {Object} GRID_LIMITS - Grid limits constants (optional, uses defaults)
|
|
603
|
+
* @returns {number} Number of gap slots
|
|
604
|
+
*/
|
|
605
|
+
declare function calculateGapSlots(incrementPercent: any, targetSpreadPercent: any, gridLimits?: {
|
|
606
|
+
MIN_SPREAD_FACTOR?: number;
|
|
607
|
+
MIN_SPREAD_ORDERS?: number;
|
|
608
|
+
}): number;
|
|
609
|
+
declare const _default: {
|
|
610
|
+
calculateGapSlots: typeof calculateGapSlots;
|
|
611
|
+
isPercentageString: typeof isPercentageString;
|
|
612
|
+
isPositiveNumber: typeof isPositiveNumber;
|
|
613
|
+
isPositiveNumberOrPercent: typeof isPositiveNumberOrPercent;
|
|
614
|
+
isPositiveInt: typeof isPositiveInt;
|
|
615
|
+
parsePercentageString: typeof parsePercentageString;
|
|
616
|
+
toDecimal: typeof toDecimal;
|
|
617
|
+
resolveRelativePrice: typeof resolveRelativePrice;
|
|
618
|
+
isExplicitZeroAllocation: typeof isExplicitZeroAllocation;
|
|
619
|
+
getPrecision: typeof getPrecision;
|
|
620
|
+
computeChainFundTotals: typeof computeChainFundTotals;
|
|
621
|
+
calculateAvailableFundsValue: typeof calculateAvailableFundsValue;
|
|
622
|
+
getGridBestPrices: typeof getGridBestPrices;
|
|
623
|
+
calculateSpreadFromOrders: typeof calculateSpreadFromOrders;
|
|
624
|
+
resolveConfigValue: typeof resolveConfigValue;
|
|
625
|
+
resolveConfigValueWithRegistry: typeof resolveConfigValueWithRegistry;
|
|
626
|
+
hasValidAccountTotals: typeof hasValidAccountTotals;
|
|
627
|
+
blockchainToFloat: typeof blockchainToFloat;
|
|
628
|
+
floatToBlockchainInt: typeof floatToBlockchainInt;
|
|
629
|
+
quantizeFloat: typeof quantizeFloat;
|
|
630
|
+
normalizeInt: typeof normalizeInt;
|
|
631
|
+
getPrecisionByOrderType: typeof getPrecisionByOrderType;
|
|
632
|
+
getPrecisionForSide: typeof getPrecisionForSide;
|
|
633
|
+
getPrecisionsForManager: typeof getPrecisionsForManager;
|
|
634
|
+
getPrecisionSlack: typeof getPrecisionSlack;
|
|
635
|
+
calculatePriceTolerance: typeof calculatePriceTolerance;
|
|
636
|
+
validateOrderAmountsWithinLimits: typeof validateOrderAmountsWithinLimits;
|
|
637
|
+
getMinOrderSize: typeof getMinOrderSize;
|
|
638
|
+
getDustThresholdFactor: typeof getDustThresholdFactor;
|
|
639
|
+
getSingleDustThreshold: typeof getSingleDustThreshold;
|
|
640
|
+
getDoubleDustThreshold: typeof getDoubleDustThreshold;
|
|
641
|
+
getMinAbsoluteOrderSize: typeof getMinAbsoluteOrderSize;
|
|
642
|
+
validateOrderSize: typeof validateOrderSize;
|
|
643
|
+
getAssetFees: typeof getAssetFees;
|
|
644
|
+
allocateFundsByWeights: typeof allocateFundsByWeights;
|
|
645
|
+
calculateOrderSizes: typeof calculateOrderSizes;
|
|
646
|
+
calculateRotationOrderSizes: typeof calculateRotationOrderSizes;
|
|
647
|
+
calculateGridSideDivergenceMetric: typeof calculateGridSideDivergenceMetric;
|
|
648
|
+
calculateOrderCreationFees: typeof calculateOrderCreationFees;
|
|
649
|
+
deductOrderFeesFromFunds: typeof deductOrderFeesFromFunds;
|
|
650
|
+
calculateSwapInAmount: typeof calculateSwapInAmount;
|
|
651
|
+
_setFeeCache: typeof _setFeeCache;
|
|
652
|
+
cloneWeightDistribution: typeof cloneWeightDistribution;
|
|
653
|
+
clamp: typeof clamp;
|
|
654
|
+
};
|
|
655
|
+
export = _default;
|
|
656
|
+
/**
|
|
657
|
+
* Clamp a value between min and max bounds.
|
|
658
|
+
* @param {number} value - The value to clamp
|
|
659
|
+
* @param {number} min - Lower bound
|
|
660
|
+
* @param {number} max - Upper bound
|
|
661
|
+
* @returns {number}
|
|
662
|
+
*/
|
|
663
|
+
declare function clamp(value: any, min: any, max: any): number;
|
|
664
|
+
/**
|
|
665
|
+
* Safely clone a weight distribution object.
|
|
666
|
+
* Validates numeric sell/buy values and falls back to a base object if provided.
|
|
667
|
+
* Returns null if neither primary nor base yields valid numbers.
|
|
668
|
+
*
|
|
669
|
+
* @param {Object|null} weightDistribution - Primary weights (e.g. { sell, buy })
|
|
670
|
+
* @param {Object|null} base - Fallback weights if primary is missing/invalid
|
|
671
|
+
* @returns {{sell:number,buy:number}|null}
|
|
672
|
+
*/
|
|
673
|
+
declare function cloneWeightDistribution(weightDistribution: any, base?: any): {
|
|
674
|
+
sell: number;
|
|
675
|
+
buy: number;
|
|
676
|
+
};
|
|
677
|
+
//# sourceMappingURL=math.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../../../modules/order/utils/math.ts"],"names":[],"mappings":"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"}
|