dexbot 1.4.16 → 1.4.17
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/CHANGELOG.md +5013 -0
- package/README.md +4 -6
- package/analysis/README.md +468 -0
- package/analysis/ama_fitting/README.md +258 -0
- package/analysis/ama_fitting/analyze_ama_price_changes.ts +151 -0
- package/analysis/ama_fitting/analyze_lambda_vs_slow.ts +407 -0
- package/analysis/ama_fitting/calibrate_convergence_er.ts +199 -0
- package/analysis/ama_fitting/fetch_lp_candles.ts +187 -0
- package/analysis/ama_fitting/generate_unified_comparison_chart.ts +269 -0
- package/analysis/ama_fitting/optimizer_high_resolution.ts +792 -0
- package/analysis/ama_fitting/package.json +12 -0
- package/analysis/analyze_derivatives.ts +318 -0
- package/analysis/analyze_dynamic_weight.ts +219 -0
- package/analysis/analyze_kalman.ts +126 -0
- package/analysis/analyze_regime.ts +156 -0
- package/analysis/analyze_regime_windows.ts +460 -0
- package/analysis/analyze_risk_profile.ts +199 -0
- package/analysis/analyze_trade_heatmap.ts +362 -0
- package/analysis/analyze_volatility.ts +182 -0
- package/analysis/bot_fitting/README.md +124 -0
- package/analysis/bot_fitting/backtest_ama_sweep.ts +816 -0
- package/analysis/bot_fitting/backtest_bot_fitting.ts +421 -0
- package/analysis/bot_fitting/shared_utils.ts +46 -0
- package/analysis/bot_key_utils.ts +154 -0
- package/analysis/bot_usage/discover_bot_accounts.ts +579 -0
- package/analysis/bot_usage/kibana_bot_queries.ts +427 -0
- package/analysis/chart_css.ts +60 -0
- package/analysis/chart_ui.ts +106 -0
- package/{dist/analysis/chart_utils.js → analysis/chart_utils.ts} +21 -13
- package/analysis/derivative_chart_generator.ts +874 -0
- package/analysis/math_utils.ts +60 -0
- package/analysis/price_sources.ts +130 -0
- package/analysis/resolve_source.ts +89 -0
- package/analysis/trade_profitability.ts +1412 -0
- package/analysis/tradingview/README.md +161 -0
- package/analysis/tradingview/analyze_tradingview.ts +160 -0
- package/{dist/analysis/tradingview/tradingview_uplot_chart_generator.js → analysis/tradingview/tradingview_uplot_chart_generator.ts} +40 -36
- package/analysis/trend_detection/DYNAMIC_WEIGHT_RESEARCH.md +437 -0
- package/analysis/trend_detection/README.md +27 -0
- package/analysis/trend_detection/SIGNAL_DOCUMENTATION.md +403 -0
- package/analysis/trend_detection/derivative_analyzer.ts +1050 -0
- package/analysis/trend_detection/dynamic_weight_chart_generator.ts +1376 -0
- package/analysis/trend_detection/hurst_analyzer.ts +7 -0
- package/analysis/trend_detection/kalman_chart_generator.ts +371 -0
- package/analysis/trend_detection/kalman_trend_analyzer.ts +9 -0
- package/analysis/trend_detection/kalman_velocity_smoothing.ts +7 -0
- package/analysis/trend_detection/package.json +23 -0
- package/analysis/trend_detection/permutation_entropy_analyzer.ts +7 -0
- package/analysis/trend_detection/regime_chart_generator.ts +319 -0
- package/analysis/trend_detection/tests/test_kalman_trend.ts +153 -0
- package/analysis/trend_detection/tests/test_kalman_velocity_smoothing.ts +64 -0
- package/analysis/trend_detection/volatility_chart_generator.ts +655 -0
- package/analysis/tsconfig.json +29 -0
- package/analysis/uplot/index.d.ts +128 -0
- package/analysis/uplot/uPlot.iife.min.js +2 -0
- package/analysis/uplot/uPlot.min.css +1 -0
- package/claw/README.md +4 -0
- package/claw/examples/claw_profiles_example.ts +1 -1
- package/claw/examples/memu_integration_example.ts +1 -1
- package/claw/modules/bitshares_client.ts +47 -7
- package/claw/modules/chain_actions.ts +10 -1
- package/claw/modules/claw_infra.ts +13 -3
- package/claw/modules/claw_launcher.ts +41 -7
- package/claw/modules/claw_manifest.ts +9 -1
- package/claw/modules/claw_skill_md.ts +34 -13
- package/claw/modules/credit_runtime_adapter.ts +24 -5
- package/claw/modules/decision_loop.ts +10 -2
- package/claw/modules/dexbot_profiles.ts +1 -24
- package/claw/modules/feed_price_source.ts +1 -1
- package/claw/modules/honest_ecosystem.ts +32 -8
- package/claw/modules/kibana_price_source.ts +6 -2
- package/claw/modules/launcher_mode_detector.ts +10 -13
- package/claw/modules/liquidity_pools.ts +2 -2
- package/claw/modules/mcp_utils.ts +46 -5
- package/claw/modules/memu_bridge.ts +17 -1
- package/claw/modules/position_discovery.ts +1 -1
- package/claw/modules/position_health.ts +1 -1
- package/claw/modules/position_manager.ts +39 -13
- package/claw/modules/skill_utils.ts +4 -8
- package/claw/modules/types.ts +20 -1
- package/claw/package.json +1 -1
- package/claw/runtimes/openclaw-plugin/openclaw.plugin.json +1 -1
- package/claw/runtimes/openclaw-plugin/package.json +1 -1
- package/claw/scripts/claw_bridge.ts +22 -3
- package/claw/scripts/claw_mcp_server.ts +28 -13
- package/claw/scripts/honest_assets_report.ts +3 -1
- package/claw/scripts/memu_mcp_server.ts +15 -4
- package/claw/tests/test_claw_data_flow.ts +4 -2
- package/claw/tests/test_claw_mcp_transport.ts +2 -2
- package/claw/tests/test_claw_regressions.ts +5 -0
- package/claw/tests/test_claw_skill_generation.ts +3 -3
- package/claw/tests/test_nullclaw_tmp_integration.ts +1 -1
- package/claw/tsconfig.json +1 -2
- package/dist/bot.js +1 -1
- package/dist/bot.js.map +1 -1
- package/dist/credential-daemon.js +1 -1
- package/dist/credential-daemon.js.map +1 -1
- package/dist/market_adapter/core/market_adapter_service.js +2 -2
- package/dist/market_adapter/core/market_adapter_service.js.map +1 -1
- package/dist/market_adapter/core/signals/hurst_analyzer.js +1 -1
- package/dist/market_adapter/core/signals/kalman_trend_analyzer.js +1 -1
- package/dist/market_adapter/core/signals/permutation_entropy_analyzer.js +1 -1
- package/dist/market_adapter/core/strategies/ama_slope_model.js +1 -1
- package/dist/market_adapter/core/strategies/collateral_manager.js +1 -1
- package/dist/market_adapter/core/strategies/regime_gate.js +1 -1
- package/dist/market_adapter/lp_chart_core.js +1 -1
- package/dist/market_adapter/market_adapter.js +2 -2
- package/dist/market_adapter/market_adapter.js.map +1 -1
- package/dist/modules/account_bots.d.ts.map +1 -1
- package/dist/modules/account_bots.js +7 -17
- package/dist/modules/account_bots.js.map +1 -1
- package/dist/modules/account_orders.d.ts +8 -1
- package/dist/modules/account_orders.d.ts.map +1 -1
- package/dist/modules/account_orders.js +3 -11
- package/dist/modules/account_orders.js.map +1 -1
- package/dist/modules/authority_resolver.js +1 -1
- package/dist/modules/authority_resolver.js.map +1 -1
- package/dist/modules/bitshares-native/crypto/ecc.browser.d.ts +1 -2
- package/dist/modules/bitshares-native/crypto/ecc.browser.d.ts.map +1 -1
- package/dist/modules/bitshares-native/crypto/ecc.browser.js +19 -58
- package/dist/modules/bitshares-native/crypto/ecc.browser.js.map +1 -1
- package/dist/modules/bitshares-native/crypto/ecc.d.ts +2 -9
- package/dist/modules/bitshares-native/crypto/ecc.d.ts.map +1 -1
- package/dist/modules/bitshares-native/crypto/ecc.js +6 -145
- package/dist/modules/bitshares-native/crypto/ecc.js.map +1 -1
- package/dist/modules/bitshares-native/serial/chain_constants.d.ts +1 -17
- package/dist/modules/bitshares-native/serial/chain_constants.d.ts.map +1 -1
- package/dist/modules/bitshares-native/serial/chain_constants.js +1 -30
- package/dist/modules/bitshares-native/serial/chain_constants.js.map +1 -1
- package/dist/modules/bitshares-native/serial/types.d.ts +1 -30
- package/dist/modules/bitshares-native/serial/types.d.ts.map +1 -1
- package/dist/modules/bitshares-native/serial/types.js +1 -169
- package/dist/modules/bitshares-native/serial/types.js.map +1 -1
- package/dist/modules/bitshares-native/signing_client.js +1 -1
- package/dist/modules/bitshares-native/signing_client.js.map +1 -1
- package/dist/modules/bitshares-native/subscriptions.js +7 -7
- package/dist/modules/bitshares-native/subscriptions.js.map +1 -1
- package/dist/modules/bitshares-native/transport.js +1 -1
- package/dist/modules/bitshares-native/transport.js.map +1 -1
- package/dist/modules/bitshares-native/tx/builder.d.ts +1 -6
- package/dist/modules/bitshares-native/tx/builder.d.ts.map +1 -1
- package/dist/modules/bitshares-native/tx/builder.js +2 -11
- package/dist/modules/bitshares-native/tx/builder.js.map +1 -1
- package/dist/modules/bitshares-native/tx/tx_cache.js +1 -1
- package/dist/modules/bitshares-native/tx/tx_cache.js.map +1 -1
- package/dist/modules/bitshares_client.js +1 -1
- package/dist/modules/bitshares_client.js.map +1 -1
- package/dist/modules/bot_settings.js +1 -1
- package/dist/modules/bot_settings.js.map +1 -1
- package/dist/modules/chain_keys.d.ts +2 -2
- package/dist/modules/chain_keys.js +2 -2
- package/dist/modules/chain_orders.d.ts.map +1 -1
- package/dist/modules/chain_orders.js +7 -23
- package/dist/modules/chain_orders.js.map +1 -1
- package/dist/modules/constants.js +1 -1
- package/dist/modules/constants.js.map +1 -1
- package/dist/modules/cr_planner.js +3 -3
- package/dist/modules/cr_planner.js.map +1 -1
- package/dist/modules/credential_policy.d.ts.map +1 -1
- package/dist/modules/credential_policy.js +5 -11
- package/dist/modules/credential_policy.js.map +1 -1
- package/dist/modules/credit_runtime.d.ts.map +1 -1
- package/dist/modules/credit_runtime.js +18 -27
- package/dist/modules/credit_runtime.js.map +1 -1
- package/dist/modules/crypto/pure_secp256k1.d.ts +4 -1
- package/dist/modules/crypto/pure_secp256k1.d.ts.map +1 -1
- package/dist/modules/crypto/pure_secp256k1.js +1 -1
- package/dist/modules/crypto/pure_secp256k1.js.map +1 -1
- package/dist/modules/crypto/sync.d.ts +0 -3
- package/dist/modules/crypto/sync.d.ts.map +1 -1
- package/dist/modules/crypto/sync.js +0 -3
- package/dist/modules/crypto/sync.js.map +1 -1
- package/dist/modules/dexbot_class.d.ts +9 -9
- package/dist/modules/dexbot_class.js +9 -9
- package/dist/modules/dexbot_cow_runtime.d.ts +3 -3
- package/dist/modules/dexbot_cow_runtime.d.ts.map +1 -1
- package/dist/modules/dexbot_cow_runtime.js +4 -9
- package/dist/modules/dexbot_cow_runtime.js.map +1 -1
- package/dist/modules/dexbot_fill_runtime.d.ts +10 -10
- package/dist/modules/dexbot_fill_runtime.js +10 -10
- package/dist/modules/dexbot_maintenance_runtime.d.ts +7 -7
- package/dist/modules/dexbot_maintenance_runtime.d.ts.map +1 -1
- package/dist/modules/dexbot_maintenance_runtime.js +16 -15
- package/dist/modules/dexbot_maintenance_runtime.js.map +1 -1
- package/dist/modules/env.d.ts +0 -1
- package/dist/modules/env.d.ts.map +1 -1
- package/dist/modules/env.js +0 -34
- package/dist/modules/env.js.map +1 -1
- package/dist/modules/graceful_shutdown.js +1 -1
- package/dist/modules/graceful_shutdown.js.map +1 -1
- package/dist/modules/launcher/launch_modes.d.ts +1 -2
- package/dist/modules/launcher/launch_modes.d.ts.map +1 -1
- package/dist/modules/launcher/launch_modes.js +1 -2
- package/dist/modules/launcher/launch_modes.js.map +1 -1
- package/dist/modules/launcher/market_adapter_runtime.d.ts +1 -2
- package/dist/modules/launcher/market_adapter_runtime.d.ts.map +1 -1
- package/dist/modules/launcher/market_adapter_runtime.js +1 -4
- package/dist/modules/launcher/market_adapter_runtime.js.map +1 -1
- package/dist/modules/launcher/monolithic_runtime.d.ts +1 -2
- package/dist/modules/launcher/monolithic_runtime.d.ts.map +1 -1
- package/dist/modules/launcher/monolithic_runtime.js +1 -15
- package/dist/modules/launcher/monolithic_runtime.js.map +1 -1
- package/dist/modules/launcher/runtime_entry.d.ts +1 -2
- package/dist/modules/launcher/runtime_entry.d.ts.map +1 -1
- package/dist/modules/launcher/runtime_entry.js +1 -14
- package/dist/modules/launcher/runtime_entry.js.map +1 -1
- package/dist/modules/launcher/status_reporting.d.ts +1 -3
- package/dist/modules/launcher/status_reporting.d.ts.map +1 -1
- package/dist/modules/launcher/status_reporting.js +1 -10
- package/dist/modules/launcher/status_reporting.js.map +1 -1
- package/dist/modules/node_manager.d.ts.map +1 -1
- package/dist/modules/node_manager.js +4 -3
- package/dist/modules/node_manager.js.map +1 -1
- package/dist/modules/order/export.d.ts.map +1 -1
- package/dist/modules/order/export.js +4 -3
- package/dist/modules/order/export.js.map +1 -1
- package/dist/modules/order/format.d.ts +1 -10
- package/dist/modules/order/format.d.ts.map +1 -1
- package/dist/modules/order/format.js +1 -22
- package/dist/modules/order/format.js.map +1 -1
- package/dist/modules/order/grid.d.ts +19 -19
- package/dist/modules/order/grid.d.ts.map +1 -1
- package/dist/modules/order/grid.js +25 -25
- package/dist/modules/order/grid.js.map +1 -1
- package/dist/modules/order/grid_reconcile_internal.d.ts +1 -83
- package/dist/modules/order/grid_reconcile_internal.d.ts.map +1 -1
- package/dist/modules/order/grid_reconcile_internal.js +1 -1
- package/dist/modules/order/grid_reconcile_internal.js.map +1 -1
- package/dist/modules/order/manager.d.ts +15 -15
- package/dist/modules/order/manager.js +15 -15
- package/dist/modules/order/processed_fill_store.d.ts +1 -1
- package/dist/modules/order/processed_fill_store.js +1 -1
- package/dist/modules/order/sync_engine.d.ts +4 -4
- package/dist/modules/order/sync_engine.js +4 -4
- package/dist/modules/order/utils/math.d.ts +7 -2
- package/dist/modules/order/utils/math.d.ts.map +1 -1
- package/dist/modules/order/utils/math.js +10 -3
- package/dist/modules/order/utils/math.js.map +1 -1
- package/dist/modules/order/utils/order.js +3 -3
- package/dist/modules/order/utils/order.js.map +1 -1
- package/dist/modules/order/utils/system.d.ts +17 -1
- package/dist/modules/order/utils/system.d.ts.map +1 -1
- package/dist/modules/order/utils/system.js +45 -3
- package/dist/modules/order/utils/system.js.map +1 -1
- package/dist/modules/order/utils/validate.d.ts +3 -3
- package/dist/modules/order/utils/validate.d.ts.map +1 -1
- package/dist/modules/order/utils/validate.js +5 -5
- package/dist/modules/order/utils/validate.js.map +1 -1
- package/dist/modules/order/utils/withPoolRef.js +1 -1
- package/dist/modules/order/utils/withPoolRef.js.map +1 -1
- package/dist/modules/paths.d.ts +4 -2
- package/dist/modules/paths.d.ts.map +1 -1
- package/dist/modules/paths.js +5 -3
- package/dist/modules/paths.js.map +1 -1
- package/dist/modules/runtime.d.ts +1 -0
- package/dist/modules/runtime.d.ts.map +1 -1
- package/dist/modules/runtime_settings.d.ts.map +1 -1
- package/dist/modules/runtime_settings.js +26 -30
- package/dist/modules/runtime_settings.js.map +1 -1
- package/dist/modules/settings_merge.d.ts +7 -1
- package/dist/modules/settings_merge.d.ts.map +1 -1
- package/dist/modules/settings_merge.js +10 -6
- package/dist/modules/settings_merge.js.map +1 -1
- package/dist/modules/types.d.ts +0 -753
- package/dist/modules/types.d.ts.map +1 -1
- package/dist/modules/types.js +0 -15
- package/dist/modules/types.js.map +1 -1
- package/dist/modules/utils/base58check.js +4 -4
- package/dist/modules/utils/base58check.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 +1 -1
- package/dist/modules/validate_profiles.js.map +1 -1
- package/dist/scripts/update.d.ts +3 -0
- package/dist/scripts/update.d.ts.map +1 -1
- package/dist/scripts/update.js +91 -6
- package/dist/scripts/update.js.map +1 -1
- package/docs/BITSHARES_ONBOARDING.md +435 -0
- package/docs/COPY_ON_WRITE_MASTER_PLAN.md +514 -0
- package/docs/COW_INVARIANTS.md +309 -0
- package/docs/CREDENTIAL_SECURITY.md +450 -0
- package/docs/DEXBOT_COMPARISON.md +922 -0
- package/docs/EVOLUTION.md +210 -0
- package/docs/FUND_MOVEMENT_AND_ACCOUNTING.md +851 -0
- package/docs/GRID_RECALCULATION.md +624 -0
- package/docs/GRID_RECONCILE.md +259 -0
- package/docs/LOGGING.md +318 -0
- package/docs/MPA_CREDIT_USAGE.md +353 -0
- package/docs/README.md +199 -0
- package/docs/WORKFLOW.md +369 -0
- package/docs/architecture.md +1466 -0
- package/docs/developer_guide.md +1929 -0
- package/docs/docker.md +141 -0
- package/market_adapter/README.md +1003 -0
- package/modules/README.md +176 -0
- package/package.json +38 -3
- package/scripts/README.md +55 -32
- package/scripts/bots +18 -0
- package/scripts/clean-dist.js +9 -0
- package/scripts/create-bot-symlinks.sh +3 -3
- package/scripts/dexbot +17 -0
- package/scripts/git-viewer.sh +489 -0
- package/scripts/keys +18 -0
- package/scripts/pdev.sh +38 -0
- package/scripts/pm2 +17 -0
- package/scripts/pmain.sh +45 -0
- package/scripts/ptest.sh +26 -0
- package/scripts/repo-stats.html +480 -0
- package/scripts/unlock +17 -0
- package/scripts/update.js +13 -0
- package/tests/README.md +135 -0
- package/claw/data/positions.json +0 -150070
- package/claw/node_modules/.package-lock.json +0 -935
- package/claw/node_modules/@babel/runtime/LICENSE +0 -22
- package/claw/node_modules/@babel/runtime/README.md +0 -19
- package/claw/node_modules/@babel/runtime/helpers/AwaitValue.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/OverloadYield.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js +0 -9
- package/claw/node_modules/@babel/runtime/helpers/applyDecs.js +0 -236
- package/claw/node_modules/@babel/runtime/helpers/applyDecs2203.js +0 -184
- package/claw/node_modules/@babel/runtime/helpers/applyDecs2203R.js +0 -191
- package/claw/node_modules/@babel/runtime/helpers/applyDecs2301.js +0 -222
- package/claw/node_modules/@babel/runtime/helpers/applyDecs2305.js +0 -133
- package/claw/node_modules/@babel/runtime/helpers/applyDecs2311.js +0 -124
- package/claw/node_modules/@babel/runtime/helpers/arrayLikeToArray.js +0 -6
- package/claw/node_modules/@babel/runtime/helpers/arrayWithHoles.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/arrayWithoutHoles.js +0 -5
- package/claw/node_modules/@babel/runtime/helpers/assertClassBrand.js +0 -5
- package/claw/node_modules/@babel/runtime/helpers/assertThisInitialized.js +0 -5
- package/claw/node_modules/@babel/runtime/helpers/asyncGeneratorDelegate.js +0 -24
- package/claw/node_modules/@babel/runtime/helpers/asyncIterator.js +0 -45
- package/claw/node_modules/@babel/runtime/helpers/asyncToGenerator.js +0 -26
- package/claw/node_modules/@babel/runtime/helpers/awaitAsyncGenerator.js +0 -5
- package/claw/node_modules/@babel/runtime/helpers/callSuper.js +0 -7
- package/claw/node_modules/@babel/runtime/helpers/checkInRHS.js +0 -6
- package/claw/node_modules/@babel/runtime/helpers/checkPrivateRedeclaration.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/classApplyDescriptorDestructureSet.js +0 -10
- package/claw/node_modules/@babel/runtime/helpers/classApplyDescriptorGet.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/classApplyDescriptorSet.js +0 -7
- package/claw/node_modules/@babel/runtime/helpers/classCallCheck.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/classCheckPrivateStaticAccess.js +0 -5
- package/claw/node_modules/@babel/runtime/helpers/classCheckPrivateStaticFieldDescriptor.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/classExtractFieldDescriptor.js +0 -5
- package/claw/node_modules/@babel/runtime/helpers/classNameTDZError.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/classPrivateFieldDestructureSet.js +0 -7
- package/claw/node_modules/@babel/runtime/helpers/classPrivateFieldGet.js +0 -7
- package/claw/node_modules/@babel/runtime/helpers/classPrivateFieldGet2.js +0 -5
- package/claw/node_modules/@babel/runtime/helpers/classPrivateFieldInitSpec.js +0 -5
- package/claw/node_modules/@babel/runtime/helpers/classPrivateFieldLooseBase.js +0 -5
- package/claw/node_modules/@babel/runtime/helpers/classPrivateFieldLooseKey.js +0 -5
- package/claw/node_modules/@babel/runtime/helpers/classPrivateFieldSet.js +0 -7
- package/claw/node_modules/@babel/runtime/helpers/classPrivateFieldSet2.js +0 -5
- package/claw/node_modules/@babel/runtime/helpers/classPrivateGetter.js +0 -5
- package/claw/node_modules/@babel/runtime/helpers/classPrivateMethodGet.js +0 -5
- package/claw/node_modules/@babel/runtime/helpers/classPrivateMethodInitSpec.js +0 -5
- package/claw/node_modules/@babel/runtime/helpers/classPrivateMethodSet.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/classPrivateSetter.js +0 -5
- package/claw/node_modules/@babel/runtime/helpers/classStaticPrivateFieldDestructureSet.js +0 -7
- package/claw/node_modules/@babel/runtime/helpers/classStaticPrivateFieldSpecGet.js +0 -7
- package/claw/node_modules/@babel/runtime/helpers/classStaticPrivateFieldSpecSet.js +0 -7
- package/claw/node_modules/@babel/runtime/helpers/classStaticPrivateMethodGet.js +0 -5
- package/claw/node_modules/@babel/runtime/helpers/classStaticPrivateMethodSet.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/construct.js +0 -10
- package/claw/node_modules/@babel/runtime/helpers/createClass.js +0 -13
- package/claw/node_modules/@babel/runtime/helpers/createForOfIteratorHelper.js +0 -50
- package/claw/node_modules/@babel/runtime/helpers/createForOfIteratorHelperLoose.js +0 -19
- package/claw/node_modules/@babel/runtime/helpers/createSuper.js +0 -16
- package/claw/node_modules/@babel/runtime/helpers/decorate.js +0 -250
- package/claw/node_modules/@babel/runtime/helpers/defaults.js +0 -9
- package/claw/node_modules/@babel/runtime/helpers/defineAccessor.js +0 -8
- package/claw/node_modules/@babel/runtime/helpers/defineEnumerableProperties.js +0 -12
- package/claw/node_modules/@babel/runtime/helpers/defineProperty.js +0 -10
- package/claw/node_modules/@babel/runtime/helpers/dispose.js +0 -28
- package/claw/node_modules/@babel/runtime/helpers/esm/AwaitValue.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/esm/OverloadYield.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/esm/applyDecoratedDescriptor.js +0 -9
- package/claw/node_modules/@babel/runtime/helpers/esm/applyDecs.js +0 -236
- package/claw/node_modules/@babel/runtime/helpers/esm/applyDecs2203.js +0 -184
- package/claw/node_modules/@babel/runtime/helpers/esm/applyDecs2203R.js +0 -191
- package/claw/node_modules/@babel/runtime/helpers/esm/applyDecs2301.js +0 -222
- package/claw/node_modules/@babel/runtime/helpers/esm/applyDecs2305.js +0 -133
- package/claw/node_modules/@babel/runtime/helpers/esm/applyDecs2311.js +0 -124
- package/claw/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js +0 -6
- package/claw/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js +0 -5
- package/claw/node_modules/@babel/runtime/helpers/esm/assertClassBrand.js +0 -5
- package/claw/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js +0 -5
- package/claw/node_modules/@babel/runtime/helpers/esm/asyncGeneratorDelegate.js +0 -24
- package/claw/node_modules/@babel/runtime/helpers/esm/asyncIterator.js +0 -45
- package/claw/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js +0 -26
- package/claw/node_modules/@babel/runtime/helpers/esm/awaitAsyncGenerator.js +0 -5
- package/claw/node_modules/@babel/runtime/helpers/esm/callSuper.js +0 -7
- package/claw/node_modules/@babel/runtime/helpers/esm/checkInRHS.js +0 -6
- package/claw/node_modules/@babel/runtime/helpers/esm/checkPrivateRedeclaration.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/esm/classApplyDescriptorDestructureSet.js +0 -10
- package/claw/node_modules/@babel/runtime/helpers/esm/classApplyDescriptorGet.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/esm/classApplyDescriptorSet.js +0 -7
- package/claw/node_modules/@babel/runtime/helpers/esm/classCallCheck.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/esm/classCheckPrivateStaticAccess.js +0 -5
- package/claw/node_modules/@babel/runtime/helpers/esm/classCheckPrivateStaticFieldDescriptor.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/esm/classExtractFieldDescriptor.js +0 -5
- package/claw/node_modules/@babel/runtime/helpers/esm/classNameTDZError.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/esm/classPrivateFieldDestructureSet.js +0 -7
- package/claw/node_modules/@babel/runtime/helpers/esm/classPrivateFieldGet.js +0 -7
- package/claw/node_modules/@babel/runtime/helpers/esm/classPrivateFieldGet2.js +0 -5
- package/claw/node_modules/@babel/runtime/helpers/esm/classPrivateFieldInitSpec.js +0 -5
- package/claw/node_modules/@babel/runtime/helpers/esm/classPrivateFieldLooseBase.js +0 -5
- package/claw/node_modules/@babel/runtime/helpers/esm/classPrivateFieldLooseKey.js +0 -5
- package/claw/node_modules/@babel/runtime/helpers/esm/classPrivateFieldSet.js +0 -7
- package/claw/node_modules/@babel/runtime/helpers/esm/classPrivateFieldSet2.js +0 -5
- package/claw/node_modules/@babel/runtime/helpers/esm/classPrivateGetter.js +0 -5
- package/claw/node_modules/@babel/runtime/helpers/esm/classPrivateMethodGet.js +0 -5
- package/claw/node_modules/@babel/runtime/helpers/esm/classPrivateMethodInitSpec.js +0 -5
- package/claw/node_modules/@babel/runtime/helpers/esm/classPrivateMethodSet.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/esm/classPrivateSetter.js +0 -5
- package/claw/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldDestructureSet.js +0 -7
- package/claw/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldSpecGet.js +0 -7
- package/claw/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldSpecSet.js +0 -7
- package/claw/node_modules/@babel/runtime/helpers/esm/classStaticPrivateMethodGet.js +0 -5
- package/claw/node_modules/@babel/runtime/helpers/esm/classStaticPrivateMethodSet.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/esm/construct.js +0 -10
- package/claw/node_modules/@babel/runtime/helpers/esm/createClass.js +0 -13
- package/claw/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js +0 -50
- package/claw/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelperLoose.js +0 -19
- package/claw/node_modules/@babel/runtime/helpers/esm/createSuper.js +0 -16
- package/claw/node_modules/@babel/runtime/helpers/esm/decorate.js +0 -250
- package/claw/node_modules/@babel/runtime/helpers/esm/defaults.js +0 -9
- package/claw/node_modules/@babel/runtime/helpers/esm/defineAccessor.js +0 -8
- package/claw/node_modules/@babel/runtime/helpers/esm/defineEnumerableProperties.js +0 -12
- package/claw/node_modules/@babel/runtime/helpers/esm/defineProperty.js +0 -10
- package/claw/node_modules/@babel/runtime/helpers/esm/dispose.js +0 -28
- package/claw/node_modules/@babel/runtime/helpers/esm/extends.js +0 -10
- package/claw/node_modules/@babel/runtime/helpers/esm/get.js +0 -11
- package/claw/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js +0 -6
- package/claw/node_modules/@babel/runtime/helpers/esm/identity.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/esm/importDeferProxy.js +0 -27
- package/claw/node_modules/@babel/runtime/helpers/esm/inherits.js +0 -14
- package/claw/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js +0 -5
- package/claw/node_modules/@babel/runtime/helpers/esm/initializerDefineProperty.js +0 -9
- package/claw/node_modules/@babel/runtime/helpers/esm/initializerWarningHelper.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/esm/instanceof.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/esm/interopRequireDefault.js +0 -6
- package/claw/node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js +0 -22
- package/claw/node_modules/@babel/runtime/helpers/esm/isNativeFunction.js +0 -8
- package/claw/node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js +0 -9
- package/claw/node_modules/@babel/runtime/helpers/esm/iterableToArray.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js +0 -28
- package/claw/node_modules/@babel/runtime/helpers/esm/jsx.js +0 -22
- package/claw/node_modules/@babel/runtime/helpers/esm/maybeArrayLike.js +0 -9
- package/claw/node_modules/@babel/runtime/helpers/esm/newArrowCheck.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/esm/nullishReceiverError.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/esm/objectDestructuringEmpty.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/esm/objectSpread.js +0 -14
- package/claw/node_modules/@babel/runtime/helpers/esm/objectSpread2.js +0 -23
- package/claw/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js +0 -13
- package/claw/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +0 -10
- package/claw/node_modules/@babel/runtime/helpers/esm/package.json +0 -3
- package/claw/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js +0 -8
- package/claw/node_modules/@babel/runtime/helpers/esm/readOnlyError.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/esm/regenerator.js +0 -89
- package/claw/node_modules/@babel/runtime/helpers/esm/regeneratorAsync.js +0 -8
- package/claw/node_modules/@babel/runtime/helpers/esm/regeneratorAsyncGen.js +0 -6
- package/claw/node_modules/@babel/runtime/helpers/esm/regeneratorAsyncIterator.js +0 -33
- package/claw/node_modules/@babel/runtime/helpers/esm/regeneratorDefine.js +0 -22
- package/claw/node_modules/@babel/runtime/helpers/esm/regeneratorKeys.js +0 -10
- package/claw/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js +0 -77
- package/claw/node_modules/@babel/runtime/helpers/esm/regeneratorValues.js +0 -19
- package/claw/node_modules/@babel/runtime/helpers/esm/set.js +0 -22
- package/claw/node_modules/@babel/runtime/helpers/esm/setFunctionName.js +0 -12
- package/claw/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +0 -6
- package/claw/node_modules/@babel/runtime/helpers/esm/skipFirstGeneratorNext.js +0 -7
- package/claw/node_modules/@babel/runtime/helpers/esm/slicedToArray.js +0 -8
- package/claw/node_modules/@babel/runtime/helpers/esm/superPropBase.js +0 -6
- package/claw/node_modules/@babel/runtime/helpers/esm/superPropGet.js +0 -9
- package/claw/node_modules/@babel/runtime/helpers/esm/superPropSet.js +0 -6
- package/claw/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js +0 -8
- package/claw/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteralLoose.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/esm/tdz.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/esm/temporalRef.js +0 -6
- package/claw/node_modules/@babel/runtime/helpers/esm/temporalUndefined.js +0 -2
- package/claw/node_modules/@babel/runtime/helpers/esm/toArray.js +0 -8
- package/claw/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js +0 -8
- package/claw/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +0 -12
- package/claw/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js +0 -7
- package/claw/node_modules/@babel/runtime/helpers/esm/toSetter.js +0 -10
- package/claw/node_modules/@babel/runtime/helpers/esm/tsRewriteRelativeImportExtensions.js +0 -6
- package/claw/node_modules/@babel/runtime/helpers/esm/typeof.js +0 -10
- package/claw/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js +0 -9
- package/claw/node_modules/@babel/runtime/helpers/esm/using.js +0 -12
- package/claw/node_modules/@babel/runtime/helpers/esm/usingCtx.js +0 -59
- package/claw/node_modules/@babel/runtime/helpers/esm/wrapAsyncGenerator.js +0 -56
- package/claw/node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js +0 -27
- package/claw/node_modules/@babel/runtime/helpers/esm/wrapRegExp.js +0 -52
- package/claw/node_modules/@babel/runtime/helpers/esm/writeOnlyError.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/extends.js +0 -10
- package/claw/node_modules/@babel/runtime/helpers/get.js +0 -11
- package/claw/node_modules/@babel/runtime/helpers/getPrototypeOf.js +0 -6
- package/claw/node_modules/@babel/runtime/helpers/identity.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/importDeferProxy.js +0 -27
- package/claw/node_modules/@babel/runtime/helpers/inherits.js +0 -14
- package/claw/node_modules/@babel/runtime/helpers/inheritsLoose.js +0 -5
- package/claw/node_modules/@babel/runtime/helpers/initializerDefineProperty.js +0 -9
- package/claw/node_modules/@babel/runtime/helpers/initializerWarningHelper.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/instanceof.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/interopRequireDefault.js +0 -6
- package/claw/node_modules/@babel/runtime/helpers/interopRequireWildcard.js +0 -22
- package/claw/node_modules/@babel/runtime/helpers/isNativeFunction.js +0 -8
- package/claw/node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js +0 -9
- package/claw/node_modules/@babel/runtime/helpers/iterableToArray.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/iterableToArrayLimit.js +0 -28
- package/claw/node_modules/@babel/runtime/helpers/jsx.js +0 -22
- package/claw/node_modules/@babel/runtime/helpers/maybeArrayLike.js +0 -9
- package/claw/node_modules/@babel/runtime/helpers/newArrowCheck.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/nonIterableRest.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/nonIterableSpread.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/nullishReceiverError.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/objectDestructuringEmpty.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/objectSpread.js +0 -14
- package/claw/node_modules/@babel/runtime/helpers/objectSpread2.js +0 -23
- package/claw/node_modules/@babel/runtime/helpers/objectWithoutProperties.js +0 -13
- package/claw/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js +0 -10
- package/claw/node_modules/@babel/runtime/helpers/possibleConstructorReturn.js +0 -8
- package/claw/node_modules/@babel/runtime/helpers/readOnlyError.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/regenerator.js +0 -89
- package/claw/node_modules/@babel/runtime/helpers/regeneratorAsync.js +0 -8
- package/claw/node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js +0 -6
- package/claw/node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js +0 -33
- package/claw/node_modules/@babel/runtime/helpers/regeneratorDefine.js +0 -22
- package/claw/node_modules/@babel/runtime/helpers/regeneratorKeys.js +0 -10
- package/claw/node_modules/@babel/runtime/helpers/regeneratorRuntime.js +0 -77
- package/claw/node_modules/@babel/runtime/helpers/regeneratorValues.js +0 -19
- package/claw/node_modules/@babel/runtime/helpers/set.js +0 -22
- package/claw/node_modules/@babel/runtime/helpers/setFunctionName.js +0 -12
- package/claw/node_modules/@babel/runtime/helpers/setPrototypeOf.js +0 -6
- package/claw/node_modules/@babel/runtime/helpers/skipFirstGeneratorNext.js +0 -7
- package/claw/node_modules/@babel/runtime/helpers/slicedToArray.js +0 -8
- package/claw/node_modules/@babel/runtime/helpers/superPropBase.js +0 -6
- package/claw/node_modules/@babel/runtime/helpers/superPropGet.js +0 -9
- package/claw/node_modules/@babel/runtime/helpers/superPropSet.js +0 -6
- package/claw/node_modules/@babel/runtime/helpers/taggedTemplateLiteral.js +0 -8
- package/claw/node_modules/@babel/runtime/helpers/taggedTemplateLiteralLoose.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/tdz.js +0 -4
- package/claw/node_modules/@babel/runtime/helpers/temporalRef.js +0 -6
- package/claw/node_modules/@babel/runtime/helpers/temporalUndefined.js +0 -2
- package/claw/node_modules/@babel/runtime/helpers/toArray.js +0 -8
- package/claw/node_modules/@babel/runtime/helpers/toConsumableArray.js +0 -8
- package/claw/node_modules/@babel/runtime/helpers/toPrimitive.js +0 -12
- package/claw/node_modules/@babel/runtime/helpers/toPropertyKey.js +0 -7
- package/claw/node_modules/@babel/runtime/helpers/toSetter.js +0 -10
- package/claw/node_modules/@babel/runtime/helpers/tsRewriteRelativeImportExtensions.js +0 -6
- package/claw/node_modules/@babel/runtime/helpers/typeof.js +0 -10
- package/claw/node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js +0 -9
- package/claw/node_modules/@babel/runtime/helpers/using.js +0 -12
- package/claw/node_modules/@babel/runtime/helpers/usingCtx.js +0 -59
- package/claw/node_modules/@babel/runtime/helpers/wrapAsyncGenerator.js +0 -56
- package/claw/node_modules/@babel/runtime/helpers/wrapNativeSuper.js +0 -27
- package/claw/node_modules/@babel/runtime/helpers/wrapRegExp.js +0 -52
- package/claw/node_modules/@babel/runtime/helpers/writeOnlyError.js +0 -4
- package/claw/node_modules/@babel/runtime/package.json +0 -1107
- package/claw/node_modules/@babel/runtime/regenerator/index.js +0 -15
- package/claw/node_modules/assert/.github/FUNDING.yml +0 -12
- package/claw/node_modules/assert/.github/SECURITY.md +0 -10
- package/claw/node_modules/assert/.travis.yml +0 -30
- package/claw/node_modules/assert/.zuul.yml +0 -13
- package/claw/node_modules/assert/CHANGELOG.md +0 -11
- package/claw/node_modules/assert/LICENSE +0 -18
- package/claw/node_modules/assert/README.md +0 -105
- package/claw/node_modules/assert/assert.js +0 -506
- package/claw/node_modules/assert/package.json +0 -32
- package/claw/node_modules/assert/test.js +0 -360
- package/claw/node_modules/async-limiter/.eslintignore +0 -2
- package/claw/node_modules/async-limiter/.nycrc +0 -10
- package/claw/node_modules/async-limiter/.travis.yml +0 -9
- package/claw/node_modules/async-limiter/LICENSE +0 -8
- package/claw/node_modules/async-limiter/index.js +0 -67
- package/claw/node_modules/async-limiter/package.json +0 -35
- package/claw/node_modules/async-limiter/readme.md +0 -132
- package/claw/node_modules/available-typed-arrays/.eslintrc +0 -5
- package/claw/node_modules/available-typed-arrays/.github/FUNDING.yml +0 -12
- package/claw/node_modules/available-typed-arrays/.nycrc +0 -9
- package/claw/node_modules/available-typed-arrays/CHANGELOG.md +0 -100
- package/claw/node_modules/available-typed-arrays/LICENSE +0 -21
- package/claw/node_modules/available-typed-arrays/README.md +0 -55
- package/claw/node_modules/available-typed-arrays/index.d.ts +0 -8
- package/claw/node_modules/available-typed-arrays/index.js +0 -17
- package/claw/node_modules/available-typed-arrays/package.json +0 -93
- package/claw/node_modules/available-typed-arrays/test/index.js +0 -18
- package/claw/node_modules/available-typed-arrays/tsconfig.json +0 -49
- package/claw/node_modules/base-x/LICENSE.md +0 -22
- package/claw/node_modules/base-x/README.md +0 -67
- package/claw/node_modules/base-x/package.json +0 -49
- package/claw/node_modules/base-x/src/index.d.ts +0 -10
- package/claw/node_modules/base-x/src/index.js +0 -123
- package/claw/node_modules/bigi/CHANGELOG.md +0 -85
- package/claw/node_modules/bigi/LICENSE.md +0 -30
- package/claw/node_modules/bigi/README.md +0 -14
- package/claw/node_modules/bigi/lib/bigi.js +0 -1509
- package/claw/node_modules/bigi/lib/convert.js +0 -91
- package/claw/node_modules/bigi/lib/index.js +0 -6
- package/claw/node_modules/bigi/package.json +0 -55
- package/claw/node_modules/bignumber.js/CHANGELOG.md +0 -222
- package/claw/node_modules/bignumber.js/LICENCE +0 -23
- package/claw/node_modules/bignumber.js/README.md +0 -266
- package/claw/node_modules/bignumber.js/bignumber.d.ts +0 -1797
- package/claw/node_modules/bignumber.js/bignumber.js +0 -2814
- package/claw/node_modules/bignumber.js/bignumber.js.map +0 -1
- package/claw/node_modules/bignumber.js/bignumber.min.js +0 -3
- package/claw/node_modules/bignumber.js/bignumber.mjs +0 -2793
- package/claw/node_modules/bignumber.js/bower.json +0 -36
- package/claw/node_modules/bignumber.js/doc/API.html +0 -2118
- package/claw/node_modules/bignumber.js/package.json +0 -39
- package/claw/node_modules/bs58/CHANGELOG.md +0 -61
- package/claw/node_modules/bs58/README.md +0 -71
- package/claw/node_modules/bs58/index.js +0 -4
- package/claw/node_modules/bs58/package.json +0 -37
- package/claw/node_modules/btsdex/.babelrc +0 -17
- package/claw/node_modules/btsdex/.github/workflows/check-style.yml +0 -16
- package/claw/node_modules/btsdex/LICENSE +0 -21
- package/claw/node_modules/btsdex/README.md +0 -467
- package/claw/node_modules/btsdex/cli.js +0 -165
- package/claw/node_modules/btsdex/lib/account.js +0 -60
- package/claw/node_modules/btsdex/lib/asset.js +0 -78
- package/claw/node_modules/btsdex/lib/bitshares.js +0 -363
- package/claw/node_modules/btsdex/lib/event.js +0 -137
- package/claw/node_modules/btsdex/lib/fees.js +0 -34
- package/claw/node_modules/btsdex/lib/index.js +0 -3
- package/claw/node_modules/btsdex/lib/transaction/TransactionBuilder.js +0 -797
- package/claw/node_modules/btsdex/lib/transaction/index.js +0 -64
- package/claw/node_modules/btsdex/package.json +0 -54
- package/claw/node_modules/btsdex/yarn-error.log +0 -3483
- package/claw/node_modules/btsdex-api/.babelrc +0 -14
- package/claw/node_modules/btsdex-api/README.md +0 -3
- package/claw/node_modules/btsdex-api/lib/apis.js +0 -59
- package/claw/node_modules/btsdex-api/lib/config.js +0 -39
- package/claw/node_modules/btsdex-api/lib/connection.js +0 -188
- package/claw/node_modules/btsdex-api/lib/index.js +0 -86
- package/claw/node_modules/btsdex-api/lib/logger.js +0 -45
- package/claw/node_modules/btsdex-api/lib/servers.js +0 -30
- package/claw/node_modules/btsdex-api/package.json +0 -29
- package/claw/node_modules/btsdex-ecc/.babelrc +0 -13
- package/claw/node_modules/btsdex-ecc/lib/BrainKey.js +0 -15
- package/claw/node_modules/btsdex-ecc/lib/KeyUtils.js +0 -205
- package/claw/node_modules/btsdex-ecc/lib/PrivateKey.js +0 -198
- package/claw/node_modules/btsdex-ecc/lib/PublicKey.js +0 -197
- package/claw/node_modules/btsdex-ecc/lib/address.js +0 -84
- package/claw/node_modules/btsdex-ecc/lib/addressPrefix.js +0 -15
- package/claw/node_modules/btsdex-ecc/lib/aes.js +0 -294
- package/claw/node_modules/btsdex-ecc/lib/ecdsa.js +0 -194
- package/claw/node_modules/btsdex-ecc/lib/ecsignature.js +0 -131
- package/claw/node_modules/btsdex-ecc/lib/enforce_types.js +0 -54
- package/claw/node_modules/btsdex-ecc/lib/hash.js +0 -60
- package/claw/node_modules/btsdex-ecc/lib/index.js +0 -84
- package/claw/node_modules/btsdex-ecc/lib/signature.js +0 -185
- package/claw/node_modules/btsdex-ecc/package.json +0 -37
- package/claw/node_modules/btsdex-serializer/.babelrc +0 -13
- package/claw/node_modules/btsdex-serializer/lib/ChainTypes.js +0 -154
- package/claw/node_modules/btsdex-serializer/lib/FastParser.js +0 -75
- package/claw/node_modules/btsdex-serializer/lib/ObjectId.js +0 -65
- package/claw/node_modules/btsdex-serializer/lib/SerializerValidation.js +0 -377
- package/claw/node_modules/btsdex-serializer/lib/convert.js +0 -54
- package/claw/node_modules/btsdex-serializer/lib/error_with_cause.js +0 -43
- package/claw/node_modules/btsdex-serializer/lib/index.js +0 -72
- package/claw/node_modules/btsdex-serializer/lib/operations.js +0 -1359
- package/claw/node_modules/btsdex-serializer/lib/precision.js +0 -108
- package/claw/node_modules/btsdex-serializer/lib/serializer.js +0 -205
- package/claw/node_modules/btsdex-serializer/lib/template.js +0 -23
- package/claw/node_modules/btsdex-serializer/lib/types.js +0 -1209
- package/claw/node_modules/btsdex-serializer/package-lock.json +0 -238
- package/claw/node_modules/btsdex-serializer/package.json +0 -32
- package/claw/node_modules/bytebuffer/.travis.yml +0 -5
- package/claw/node_modules/bytebuffer/LICENSE +0 -202
- package/claw/node_modules/bytebuffer/README.md +0 -64
- package/claw/node_modules/bytebuffer/bower.json +0 -12
- package/claw/node_modules/bytebuffer/bytebuffer.png +0 -0
- package/claw/node_modules/bytebuffer/dist/README.md +0 -47
- package/claw/node_modules/bytebuffer/dist/bytebuffer-dataview.js +0 -3461
- package/claw/node_modules/bytebuffer/dist/bytebuffer-dataview.min.js +0 -88
- package/claw/node_modules/bytebuffer/dist/bytebuffer-dataview.min.js.gz +0 -0
- package/claw/node_modules/bytebuffer/dist/bytebuffer-dataview.min.map +0 -8
- package/claw/node_modules/bytebuffer/dist/bytebuffer-node.js +0 -3454
- package/claw/node_modules/bytebuffer/dist/bytebuffer.js +0 -3746
- package/claw/node_modules/bytebuffer/dist/bytebuffer.min.js +0 -93
- package/claw/node_modules/bytebuffer/dist/bytebuffer.min.js.gz +0 -0
- package/claw/node_modules/bytebuffer/dist/bytebuffer.min.map +0 -8
- package/claw/node_modules/bytebuffer/donate.png +0 -0
- package/claw/node_modules/bytebuffer/externs/bytebuffer.js +0 -862
- package/claw/node_modules/bytebuffer/externs/minimal-env.js +0 -52
- package/claw/node_modules/bytebuffer/index.js +0 -1
- package/claw/node_modules/bytebuffer/jsdoc.json +0 -13
- package/claw/node_modules/bytebuffer/package.json +0 -51
- package/claw/node_modules/bytebuffer/scripts/build.js +0 -113
- package/claw/node_modules/bytebuffer/src/bower.json +0 -12
- package/claw/node_modules/bytebuffer/src/bytebuffer.js +0 -220
- package/claw/node_modules/bytebuffer/src/encodings/base64.js +0 -88
- package/claw/node_modules/bytebuffer/src/encodings/binary.js +0 -74
- package/claw/node_modules/bytebuffer/src/encodings/debug.js +0 -211
- package/claw/node_modules/bytebuffer/src/encodings/hex.js +0 -75
- package/claw/node_modules/bytebuffer/src/encodings/impl/base64.js +0 -3
- package/claw/node_modules/bytebuffer/src/encodings/impl/binary.js +0 -65
- package/claw/node_modules/bytebuffer/src/encodings/impl/debug.js +0 -3
- package/claw/node_modules/bytebuffer/src/encodings/impl/hex.js +0 -101
- package/claw/node_modules/bytebuffer/src/encodings/impl/utf8.js +0 -126
- package/claw/node_modules/bytebuffer/src/encodings/utf8.js +0 -71
- package/claw/node_modules/bytebuffer/src/helpers.js +0 -143
- package/claw/node_modules/bytebuffer/src/macros.js +0 -222
- package/claw/node_modules/bytebuffer/src/methods/append.js +0 -58
- package/claw/node_modules/bytebuffer/src/methods/assert.js +0 -12
- package/claw/node_modules/bytebuffer/src/methods/capacity.js +0 -8
- package/claw/node_modules/bytebuffer/src/methods/clear.js +0 -13
- package/claw/node_modules/bytebuffer/src/methods/clone.js +0 -34
- package/claw/node_modules/bytebuffer/src/methods/compact.js +0 -49
- package/claw/node_modules/bytebuffer/src/methods/copy.js +0 -73
- package/claw/node_modules/bytebuffer/src/methods/ensureCapacity.js +0 -15
- package/claw/node_modules/bytebuffer/src/methods/fill.js +0 -35
- package/claw/node_modules/bytebuffer/src/methods/flip.js +0 -11
- package/claw/node_modules/bytebuffer/src/methods/mark.js +0 -17
- package/claw/node_modules/bytebuffer/src/methods/order.js +0 -36
- package/claw/node_modules/bytebuffer/src/methods/prepend.js +0 -87
- package/claw/node_modules/bytebuffer/src/methods/printDebug.js +0 -16
- package/claw/node_modules/bytebuffer/src/methods/remaining.js +0 -9
- package/claw/node_modules/bytebuffer/src/methods/reset.js +0 -17
- package/claw/node_modules/bytebuffer/src/methods/resize.js +0 -39
- package/claw/node_modules/bytebuffer/src/methods/reverse.js +0 -25
- package/claw/node_modules/bytebuffer/src/methods/skip.js +0 -19
- package/claw/node_modules/bytebuffer/src/methods/slice.js +0 -18
- package/claw/node_modules/bytebuffer/src/methods/static/accessor.js +0 -13
- package/claw/node_modules/bytebuffer/src/methods/static/allocate.js +0 -14
- package/claw/node_modules/bytebuffer/src/methods/static/concat.js +0 -55
- package/claw/node_modules/bytebuffer/src/methods/static/isByteBuffer.js +0 -9
- package/claw/node_modules/bytebuffer/src/methods/static/type.js +0 -11
- package/claw/node_modules/bytebuffer/src/methods/static/wrap.js +0 -125
- package/claw/node_modules/bytebuffer/src/methods/toBuffer.js +0 -77
- package/claw/node_modules/bytebuffer/src/methods/toString.js +0 -43
- package/claw/node_modules/bytebuffer/src/types/bytes/bitset.js +0 -89
- package/claw/node_modules/bytebuffer/src/types/bytes/bytes.js +0 -34
- package/claw/node_modules/bytebuffer/src/types/floats/float32.js +0 -81
- package/claw/node_modules/bytebuffer/src/types/floats/float64.js +0 -77
- package/claw/node_modules/bytebuffer/src/types/floats/ieee754.js +0 -130
- package/claw/node_modules/bytebuffer/src/types/ints/int16.js +0 -167
- package/claw/node_modules/bytebuffer/src/types/ints/int32.js +0 -125
- package/claw/node_modules/bytebuffer/src/types/ints/int64.js +0 -194
- package/claw/node_modules/bytebuffer/src/types/ints/int8.js +0 -137
- package/claw/node_modules/bytebuffer/src/types/strings/cstring.js +0 -110
- package/claw/node_modules/bytebuffer/src/types/strings/istring.js +0 -81
- package/claw/node_modules/bytebuffer/src/types/strings/utf8string.js +0 -214
- package/claw/node_modules/bytebuffer/src/types/strings/vstring.js +0 -78
- package/claw/node_modules/bytebuffer/src/types/varints/varint32.js +0 -164
- package/claw/node_modules/bytebuffer/src/types/varints/varint64.js +0 -208
- package/claw/node_modules/bytebuffer/src/wrap-node.js +0 -50
- package/claw/node_modules/bytebuffer/src/wrap.js +0 -43
- package/claw/node_modules/bytebuffer/tests/bench.js +0 -99
- package/claw/node_modules/bytebuffer/tests/suite.js +0 -1005
- package/claw/node_modules/call-bind/.eslintignore +0 -1
- package/claw/node_modules/call-bind/.eslintrc +0 -16
- package/claw/node_modules/call-bind/.github/FUNDING.yml +0 -12
- package/claw/node_modules/call-bind/.nycrc +0 -9
- package/claw/node_modules/call-bind/CHANGELOG.md +0 -106
- package/claw/node_modules/call-bind/LICENSE +0 -21
- package/claw/node_modules/call-bind/README.md +0 -64
- package/claw/node_modules/call-bind/callBound.js +0 -15
- package/claw/node_modules/call-bind/index.js +0 -24
- package/claw/node_modules/call-bind/package.json +0 -93
- package/claw/node_modules/call-bind/test/callBound.js +0 -54
- package/claw/node_modules/call-bind/test/index.js +0 -74
- package/claw/node_modules/call-bind-apply-helpers/.eslintrc +0 -17
- package/claw/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +0 -12
- package/claw/node_modules/call-bind-apply-helpers/.nycrc +0 -9
- package/claw/node_modules/call-bind-apply-helpers/CHANGELOG.md +0 -30
- package/claw/node_modules/call-bind-apply-helpers/LICENSE +0 -21
- package/claw/node_modules/call-bind-apply-helpers/README.md +0 -62
- package/claw/node_modules/call-bind-apply-helpers/actualApply.d.ts +0 -1
- package/claw/node_modules/call-bind-apply-helpers/actualApply.js +0 -10
- package/claw/node_modules/call-bind-apply-helpers/applyBind.d.ts +0 -19
- package/claw/node_modules/call-bind-apply-helpers/applyBind.js +0 -10
- package/claw/node_modules/call-bind-apply-helpers/functionApply.d.ts +0 -1
- package/claw/node_modules/call-bind-apply-helpers/functionApply.js +0 -4
- package/claw/node_modules/call-bind-apply-helpers/functionCall.d.ts +0 -1
- package/claw/node_modules/call-bind-apply-helpers/functionCall.js +0 -4
- package/claw/node_modules/call-bind-apply-helpers/index.d.ts +0 -64
- package/claw/node_modules/call-bind-apply-helpers/index.js +0 -15
- package/claw/node_modules/call-bind-apply-helpers/package.json +0 -85
- package/claw/node_modules/call-bind-apply-helpers/reflectApply.d.ts +0 -3
- package/claw/node_modules/call-bind-apply-helpers/reflectApply.js +0 -4
- package/claw/node_modules/call-bind-apply-helpers/test/index.js +0 -63
- package/claw/node_modules/call-bind-apply-helpers/tsconfig.json +0 -9
- package/claw/node_modules/call-bound/.eslintrc +0 -13
- package/claw/node_modules/call-bound/.github/FUNDING.yml +0 -12
- package/claw/node_modules/call-bound/.nycrc +0 -9
- package/claw/node_modules/call-bound/CHANGELOG.md +0 -42
- package/claw/node_modules/call-bound/LICENSE +0 -21
- package/claw/node_modules/call-bound/README.md +0 -53
- package/claw/node_modules/call-bound/index.d.ts +0 -94
- package/claw/node_modules/call-bound/index.js +0 -19
- package/claw/node_modules/call-bound/package.json +0 -99
- package/claw/node_modules/call-bound/test/index.js +0 -61
- package/claw/node_modules/call-bound/tsconfig.json +0 -10
- package/claw/node_modules/cipher-base/.eslintrc +0 -26
- package/claw/node_modules/cipher-base/.github/FUNDING.yml +0 -12
- package/claw/node_modules/cipher-base/CHANGELOG.md +0 -73
- package/claw/node_modules/cipher-base/LICENSE +0 -21
- package/claw/node_modules/cipher-base/README.md +0 -17
- package/claw/node_modules/cipher-base/index.js +0 -103
- package/claw/node_modules/cipher-base/package.json +0 -63
- package/claw/node_modules/cipher-base/test/index.js +0 -221
- package/claw/node_modules/core-util-is/LICENSE +0 -19
- package/claw/node_modules/core-util-is/README.md +0 -3
- package/claw/node_modules/core-util-is/lib/util.js +0 -107
- package/claw/node_modules/core-util-is/package.json +0 -38
- package/claw/node_modules/create-hash/.travis.yml +0 -17
- package/claw/node_modules/create-hash/LICENSE +0 -21
- package/claw/node_modules/create-hash/README.md +0 -19
- package/claw/node_modules/create-hash/browser.js +0 -30
- package/claw/node_modules/create-hash/index.js +0 -1
- package/claw/node_modules/create-hash/md5.js +0 -5
- package/claw/node_modules/create-hash/package.json +0 -39
- package/claw/node_modules/create-hash/test.js +0 -41
- package/claw/node_modules/create-hmac/LICENSE +0 -21
- package/claw/node_modules/create-hmac/README.md +0 -20
- package/claw/node_modules/create-hmac/browser.js +0 -62
- package/claw/node_modules/create-hmac/index.js +0 -1
- package/claw/node_modules/create-hmac/legacy.js +0 -46
- package/claw/node_modules/create-hmac/package.json +0 -45
- package/claw/node_modules/crypto-js/CONTRIBUTING.md +0 -28
- package/claw/node_modules/crypto-js/LICENSE +0 -24
- package/claw/node_modules/crypto-js/README.md +0 -241
- package/claw/node_modules/crypto-js/aes.js +0 -232
- package/claw/node_modules/crypto-js/bower.json +0 -35
- package/claw/node_modules/crypto-js/cipher-core.js +0 -880
- package/claw/node_modules/crypto-js/core.js +0 -760
- package/claw/node_modules/crypto-js/crypto-js.js +0 -5988
- package/claw/node_modules/crypto-js/docs/QuickStartGuide.wiki +0 -470
- package/claw/node_modules/crypto-js/enc-base64.js +0 -135
- package/claw/node_modules/crypto-js/enc-hex.js +0 -18
- package/claw/node_modules/crypto-js/enc-latin1.js +0 -18
- package/claw/node_modules/crypto-js/enc-utf16.js +0 -149
- package/claw/node_modules/crypto-js/enc-utf8.js +0 -18
- package/claw/node_modules/crypto-js/evpkdf.js +0 -132
- package/claw/node_modules/crypto-js/format-hex.js +0 -66
- package/claw/node_modules/crypto-js/format-openssl.js +0 -18
- package/claw/node_modules/crypto-js/hmac-md5.js +0 -18
- package/claw/node_modules/crypto-js/hmac-ripemd160.js +0 -18
- package/claw/node_modules/crypto-js/hmac-sha1.js +0 -18
- package/claw/node_modules/crypto-js/hmac-sha224.js +0 -18
- package/claw/node_modules/crypto-js/hmac-sha256.js +0 -18
- package/claw/node_modules/crypto-js/hmac-sha3.js +0 -18
- package/claw/node_modules/crypto-js/hmac-sha384.js +0 -18
- package/claw/node_modules/crypto-js/hmac-sha512.js +0 -18
- package/claw/node_modules/crypto-js/hmac.js +0 -143
- package/claw/node_modules/crypto-js/index.js +0 -18
- package/claw/node_modules/crypto-js/lib-typedarrays.js +0 -76
- package/claw/node_modules/crypto-js/md5.js +0 -268
- package/claw/node_modules/crypto-js/mode-cfb.js +0 -78
- package/claw/node_modules/crypto-js/mode-ctr-gladman.js +0 -116
- package/claw/node_modules/crypto-js/mode-ctr.js +0 -58
- package/claw/node_modules/crypto-js/mode-ecb.js +0 -40
- package/claw/node_modules/crypto-js/mode-ofb.js +0 -54
- package/claw/node_modules/crypto-js/package.json +0 -38
- package/claw/node_modules/crypto-js/pad-ansix923.js +0 -49
- package/claw/node_modules/crypto-js/pad-iso10126.js +0 -44
- package/claw/node_modules/crypto-js/pad-iso97971.js +0 -40
- package/claw/node_modules/crypto-js/pad-nopadding.js +0 -30
- package/claw/node_modules/crypto-js/pad-pkcs7.js +0 -18
- package/claw/node_modules/crypto-js/pad-zeropadding.js +0 -45
- package/claw/node_modules/crypto-js/pbkdf2.js +0 -145
- package/claw/node_modules/crypto-js/rabbit-legacy.js +0 -190
- package/claw/node_modules/crypto-js/rabbit.js +0 -192
- package/claw/node_modules/crypto-js/rc4.js +0 -139
- package/claw/node_modules/crypto-js/ripemd160.js +0 -267
- package/claw/node_modules/crypto-js/sha1.js +0 -150
- package/claw/node_modules/crypto-js/sha224.js +0 -80
- package/claw/node_modules/crypto-js/sha256.js +0 -199
- package/claw/node_modules/crypto-js/sha3.js +0 -323
- package/claw/node_modules/crypto-js/sha384.js +0 -83
- package/claw/node_modules/crypto-js/sha512.js +0 -323
- package/claw/node_modules/crypto-js/tripledes.js +0 -770
- package/claw/node_modules/crypto-js/x64-core.js +0 -304
- package/claw/node_modules/deep-equal/.editorconfig +0 -20
- package/claw/node_modules/deep-equal/.eslintrc +0 -28
- package/claw/node_modules/deep-equal/.nycrc +0 -17
- package/claw/node_modules/deep-equal/.travis.yml +0 -12
- package/claw/node_modules/deep-equal/CHANGELOG.md +0 -320
- package/claw/node_modules/deep-equal/LICENSE +0 -21
- package/claw/node_modules/deep-equal/assert.js +0 -3
- package/claw/node_modules/deep-equal/example/cmp.js +0 -11
- package/claw/node_modules/deep-equal/index.js +0 -112
- package/claw/node_modules/deep-equal/lib/is_arguments.js +0 -1
- package/claw/node_modules/deep-equal/lib/keys.js +0 -1
- package/claw/node_modules/deep-equal/package.json +0 -109
- package/claw/node_modules/deep-equal/readme.markdown +0 -73
- package/claw/node_modules/deep-equal/test/_tape.js +0 -42
- package/claw/node_modules/deep-equal/test/cmp.js +0 -1343
- package/claw/node_modules/define-data-property/.eslintrc +0 -24
- package/claw/node_modules/define-data-property/.github/FUNDING.yml +0 -12
- package/claw/node_modules/define-data-property/.nycrc +0 -13
- package/claw/node_modules/define-data-property/CHANGELOG.md +0 -70
- package/claw/node_modules/define-data-property/LICENSE +0 -21
- package/claw/node_modules/define-data-property/README.md +0 -67
- package/claw/node_modules/define-data-property/index.d.ts +0 -12
- package/claw/node_modules/define-data-property/index.js +0 -56
- package/claw/node_modules/define-data-property/package.json +0 -106
- package/claw/node_modules/define-data-property/test/index.js +0 -392
- package/claw/node_modules/define-data-property/tsconfig.json +0 -59
- package/claw/node_modules/define-properties/.editorconfig +0 -13
- package/claw/node_modules/define-properties/.eslintrc +0 -19
- package/claw/node_modules/define-properties/.github/FUNDING.yml +0 -12
- package/claw/node_modules/define-properties/.nycrc +0 -9
- package/claw/node_modules/define-properties/CHANGELOG.md +0 -91
- package/claw/node_modules/define-properties/LICENSE +0 -21
- package/claw/node_modules/define-properties/README.md +0 -84
- package/claw/node_modules/define-properties/index.js +0 -47
- package/claw/node_modules/define-properties/package.json +0 -88
- package/claw/node_modules/dunder-proto/.eslintrc +0 -5
- package/claw/node_modules/dunder-proto/.github/FUNDING.yml +0 -12
- package/claw/node_modules/dunder-proto/.nycrc +0 -13
- package/claw/node_modules/dunder-proto/CHANGELOG.md +0 -24
- package/claw/node_modules/dunder-proto/LICENSE +0 -21
- package/claw/node_modules/dunder-proto/README.md +0 -54
- package/claw/node_modules/dunder-proto/get.d.ts +0 -5
- package/claw/node_modules/dunder-proto/get.js +0 -30
- package/claw/node_modules/dunder-proto/package.json +0 -76
- package/claw/node_modules/dunder-proto/set.d.ts +0 -5
- package/claw/node_modules/dunder-proto/set.js +0 -35
- package/claw/node_modules/dunder-proto/test/get.js +0 -34
- package/claw/node_modules/dunder-proto/test/index.js +0 -4
- package/claw/node_modules/dunder-proto/test/set.js +0 -50
- package/claw/node_modules/dunder-proto/tsconfig.json +0 -9
- package/claw/node_modules/ecurve/.min-wd +0 -7
- package/claw/node_modules/ecurve/.travis.yml +0 -14
- package/claw/node_modules/ecurve/CHANGELOG.md +0 -154
- package/claw/node_modules/ecurve/README.md +0 -11
- package/claw/node_modules/ecurve/lib/curve.js +0 -77
- package/claw/node_modules/ecurve/lib/curves.json +0 -65
- package/claw/node_modules/ecurve/lib/index.js +0 -10
- package/claw/node_modules/ecurve/lib/names.js +0 -21
- package/claw/node_modules/ecurve/lib/point.js +0 -244
- package/claw/node_modules/ecurve/package.json +0 -32
- package/claw/node_modules/es-define-property/.eslintrc +0 -13
- package/claw/node_modules/es-define-property/.github/FUNDING.yml +0 -12
- package/claw/node_modules/es-define-property/.nycrc +0 -9
- package/claw/node_modules/es-define-property/CHANGELOG.md +0 -29
- package/claw/node_modules/es-define-property/LICENSE +0 -21
- package/claw/node_modules/es-define-property/README.md +0 -49
- package/claw/node_modules/es-define-property/index.d.ts +0 -3
- package/claw/node_modules/es-define-property/index.js +0 -14
- package/claw/node_modules/es-define-property/package.json +0 -81
- package/claw/node_modules/es-define-property/test/index.js +0 -56
- package/claw/node_modules/es-define-property/tsconfig.json +0 -10
- package/claw/node_modules/es-errors/.eslintrc +0 -5
- package/claw/node_modules/es-errors/.github/FUNDING.yml +0 -12
- package/claw/node_modules/es-errors/CHANGELOG.md +0 -40
- package/claw/node_modules/es-errors/LICENSE +0 -21
- package/claw/node_modules/es-errors/README.md +0 -55
- package/claw/node_modules/es-errors/eval.d.ts +0 -3
- package/claw/node_modules/es-errors/eval.js +0 -4
- package/claw/node_modules/es-errors/index.d.ts +0 -3
- package/claw/node_modules/es-errors/index.js +0 -4
- package/claw/node_modules/es-errors/package.json +0 -80
- package/claw/node_modules/es-errors/range.d.ts +0 -3
- package/claw/node_modules/es-errors/range.js +0 -4
- package/claw/node_modules/es-errors/ref.d.ts +0 -3
- package/claw/node_modules/es-errors/ref.js +0 -4
- package/claw/node_modules/es-errors/syntax.d.ts +0 -3
- package/claw/node_modules/es-errors/syntax.js +0 -4
- package/claw/node_modules/es-errors/test/index.js +0 -19
- package/claw/node_modules/es-errors/tsconfig.json +0 -49
- package/claw/node_modules/es-errors/type.d.ts +0 -3
- package/claw/node_modules/es-errors/type.js +0 -4
- package/claw/node_modules/es-errors/uri.d.ts +0 -3
- package/claw/node_modules/es-errors/uri.js +0 -4
- package/claw/node_modules/es-object-atoms/.eslintrc +0 -16
- package/claw/node_modules/es-object-atoms/.github/FUNDING.yml +0 -12
- package/claw/node_modules/es-object-atoms/CHANGELOG.md +0 -37
- package/claw/node_modules/es-object-atoms/LICENSE +0 -21
- package/claw/node_modules/es-object-atoms/README.md +0 -63
- package/claw/node_modules/es-object-atoms/RequireObjectCoercible.d.ts +0 -3
- package/claw/node_modules/es-object-atoms/RequireObjectCoercible.js +0 -11
- package/claw/node_modules/es-object-atoms/ToObject.d.ts +0 -7
- package/claw/node_modules/es-object-atoms/ToObject.js +0 -10
- package/claw/node_modules/es-object-atoms/index.d.ts +0 -3
- package/claw/node_modules/es-object-atoms/index.js +0 -4
- package/claw/node_modules/es-object-atoms/isObject.d.ts +0 -3
- package/claw/node_modules/es-object-atoms/isObject.js +0 -6
- package/claw/node_modules/es-object-atoms/package.json +0 -80
- package/claw/node_modules/es-object-atoms/test/index.js +0 -38
- package/claw/node_modules/es-object-atoms/tsconfig.json +0 -6
- package/claw/node_modules/for-each/.editorconfig +0 -20
- package/claw/node_modules/for-each/.eslintrc +0 -30
- package/claw/node_modules/for-each/.github/FUNDING.yml +0 -12
- package/claw/node_modules/for-each/.github/SECURITY.md +0 -3
- package/claw/node_modules/for-each/.nycrc +0 -8
- package/claw/node_modules/for-each/CHANGELOG.md +0 -107
- package/claw/node_modules/for-each/LICENSE +0 -22
- package/claw/node_modules/for-each/README.md +0 -39
- package/claw/node_modules/for-each/index.d.ts +0 -35
- package/claw/node_modules/for-each/index.js +0 -69
- package/claw/node_modules/for-each/package.json +0 -76
- package/claw/node_modules/for-each/test/test.js +0 -224
- package/claw/node_modules/for-each/tsconfig.json +0 -8
- package/claw/node_modules/function-bind/.eslintrc +0 -21
- package/claw/node_modules/function-bind/.github/FUNDING.yml +0 -12
- package/claw/node_modules/function-bind/.github/SECURITY.md +0 -3
- package/claw/node_modules/function-bind/.nycrc +0 -13
- package/claw/node_modules/function-bind/CHANGELOG.md +0 -136
- package/claw/node_modules/function-bind/LICENSE +0 -20
- package/claw/node_modules/function-bind/README.md +0 -46
- package/claw/node_modules/function-bind/implementation.js +0 -84
- package/claw/node_modules/function-bind/index.js +0 -5
- package/claw/node_modules/function-bind/package.json +0 -87
- package/claw/node_modules/function-bind/test/.eslintrc +0 -9
- package/claw/node_modules/function-bind/test/index.js +0 -252
- package/claw/node_modules/functions-have-names/.editorconfig +0 -20
- package/claw/node_modules/functions-have-names/.eslintrc +0 -19
- package/claw/node_modules/functions-have-names/.github/FUNDING.yml +0 -12
- package/claw/node_modules/functions-have-names/.nycrc +0 -9
- package/claw/node_modules/functions-have-names/CHANGELOG.md +0 -89
- package/claw/node_modules/functions-have-names/LICENSE +0 -21
- package/claw/node_modules/functions-have-names/README.md +0 -40
- package/claw/node_modules/functions-have-names/index.js +0 -31
- package/claw/node_modules/functions-have-names/package.json +0 -55
- package/claw/node_modules/functions-have-names/test/index.js +0 -65
- package/claw/node_modules/get-intrinsic/.eslintrc +0 -42
- package/claw/node_modules/get-intrinsic/.github/FUNDING.yml +0 -12
- package/claw/node_modules/get-intrinsic/.nycrc +0 -9
- package/claw/node_modules/get-intrinsic/CHANGELOG.md +0 -186
- package/claw/node_modules/get-intrinsic/LICENSE +0 -21
- package/claw/node_modules/get-intrinsic/README.md +0 -71
- package/claw/node_modules/get-intrinsic/index.js +0 -378
- package/claw/node_modules/get-intrinsic/package.json +0 -97
- package/claw/node_modules/get-intrinsic/test/GetIntrinsic.js +0 -274
- package/claw/node_modules/get-proto/.eslintrc +0 -10
- package/claw/node_modules/get-proto/.github/FUNDING.yml +0 -12
- package/claw/node_modules/get-proto/.nycrc +0 -9
- package/claw/node_modules/get-proto/CHANGELOG.md +0 -21
- package/claw/node_modules/get-proto/LICENSE +0 -21
- package/claw/node_modules/get-proto/Object.getPrototypeOf.d.ts +0 -5
- package/claw/node_modules/get-proto/Object.getPrototypeOf.js +0 -6
- package/claw/node_modules/get-proto/README.md +0 -50
- package/claw/node_modules/get-proto/Reflect.getPrototypeOf.d.ts +0 -3
- package/claw/node_modules/get-proto/Reflect.getPrototypeOf.js +0 -4
- package/claw/node_modules/get-proto/index.d.ts +0 -5
- package/claw/node_modules/get-proto/index.js +0 -27
- package/claw/node_modules/get-proto/package.json +0 -81
- package/claw/node_modules/get-proto/test/index.js +0 -68
- package/claw/node_modules/get-proto/tsconfig.json +0 -9
- package/claw/node_modules/gopd/.eslintrc +0 -16
- package/claw/node_modules/gopd/.github/FUNDING.yml +0 -12
- package/claw/node_modules/gopd/CHANGELOG.md +0 -45
- package/claw/node_modules/gopd/LICENSE +0 -21
- package/claw/node_modules/gopd/README.md +0 -40
- package/claw/node_modules/gopd/gOPD.d.ts +0 -1
- package/claw/node_modules/gopd/gOPD.js +0 -4
- package/claw/node_modules/gopd/index.d.ts +0 -5
- package/claw/node_modules/gopd/index.js +0 -15
- package/claw/node_modules/gopd/package.json +0 -77
- package/claw/node_modules/gopd/test/index.js +0 -36
- package/claw/node_modules/gopd/tsconfig.json +0 -9
- package/claw/node_modules/has-property-descriptors/.eslintrc +0 -13
- package/claw/node_modules/has-property-descriptors/.github/FUNDING.yml +0 -12
- package/claw/node_modules/has-property-descriptors/.nycrc +0 -9
- package/claw/node_modules/has-property-descriptors/CHANGELOG.md +0 -35
- package/claw/node_modules/has-property-descriptors/LICENSE +0 -21
- package/claw/node_modules/has-property-descriptors/README.md +0 -43
- package/claw/node_modules/has-property-descriptors/index.js +0 -22
- package/claw/node_modules/has-property-descriptors/package.json +0 -77
- package/claw/node_modules/has-property-descriptors/test/index.js +0 -57
- package/claw/node_modules/has-symbols/.eslintrc +0 -11
- package/claw/node_modules/has-symbols/.github/FUNDING.yml +0 -12
- package/claw/node_modules/has-symbols/.nycrc +0 -9
- package/claw/node_modules/has-symbols/CHANGELOG.md +0 -91
- package/claw/node_modules/has-symbols/LICENSE +0 -21
- package/claw/node_modules/has-symbols/README.md +0 -46
- package/claw/node_modules/has-symbols/index.d.ts +0 -3
- package/claw/node_modules/has-symbols/index.js +0 -14
- package/claw/node_modules/has-symbols/package.json +0 -111
- package/claw/node_modules/has-symbols/shams.d.ts +0 -3
- package/claw/node_modules/has-symbols/shams.js +0 -45
- package/claw/node_modules/has-symbols/test/index.js +0 -22
- package/claw/node_modules/has-symbols/test/shams/core-js.js +0 -29
- package/claw/node_modules/has-symbols/test/shams/get-own-property-symbols.js +0 -29
- package/claw/node_modules/has-symbols/test/tests.js +0 -58
- package/claw/node_modules/has-symbols/tsconfig.json +0 -10
- package/claw/node_modules/has-tostringtag/.eslintrc +0 -5
- package/claw/node_modules/has-tostringtag/.github/FUNDING.yml +0 -12
- package/claw/node_modules/has-tostringtag/.nycrc +0 -13
- package/claw/node_modules/has-tostringtag/CHANGELOG.md +0 -42
- package/claw/node_modules/has-tostringtag/LICENSE +0 -21
- package/claw/node_modules/has-tostringtag/README.md +0 -46
- package/claw/node_modules/has-tostringtag/index.d.ts +0 -3
- package/claw/node_modules/has-tostringtag/index.js +0 -8
- package/claw/node_modules/has-tostringtag/package.json +0 -108
- package/claw/node_modules/has-tostringtag/shams.d.ts +0 -3
- package/claw/node_modules/has-tostringtag/shams.js +0 -8
- package/claw/node_modules/has-tostringtag/test/index.js +0 -21
- package/claw/node_modules/has-tostringtag/test/shams/core-js.js +0 -31
- package/claw/node_modules/has-tostringtag/test/shams/get-own-property-symbols.js +0 -30
- package/claw/node_modules/has-tostringtag/test/tests.js +0 -15
- package/claw/node_modules/has-tostringtag/tsconfig.json +0 -49
- package/claw/node_modules/hash-base/.github/FUNDING.yml +0 -12
- package/claw/node_modules/hash-base/CHANGELOG.md +0 -166
- package/claw/node_modules/hash-base/LICENSE +0 -21
- package/claw/node_modules/hash-base/README.md +0 -48
- package/claw/node_modules/hash-base/index.js +0 -109
- package/claw/node_modules/hash-base/package.json +0 -64
- package/claw/node_modules/hash-base/to-buffer.js +0 -20
- package/claw/node_modules/hasown/.eslintrc +0 -5
- package/claw/node_modules/hasown/.github/FUNDING.yml +0 -12
- package/claw/node_modules/hasown/.nycrc +0 -13
- package/claw/node_modules/hasown/CHANGELOG.md +0 -40
- package/claw/node_modules/hasown/LICENSE +0 -21
- package/claw/node_modules/hasown/README.md +0 -40
- package/claw/node_modules/hasown/index.d.ts +0 -3
- package/claw/node_modules/hasown/index.js +0 -8
- package/claw/node_modules/hasown/package.json +0 -92
- package/claw/node_modules/hasown/tsconfig.json +0 -6
- package/claw/node_modules/inherits/LICENSE +0 -16
- package/claw/node_modules/inherits/README.md +0 -42
- package/claw/node_modules/inherits/inherits.js +0 -9
- package/claw/node_modules/inherits/inherits_browser.js +0 -27
- package/claw/node_modules/inherits/package.json +0 -29
- package/claw/node_modules/is-arguments/.editorconfig +0 -20
- package/claw/node_modules/is-arguments/.eslintrc +0 -9
- package/claw/node_modules/is-arguments/.github/FUNDING.yml +0 -12
- package/claw/node_modules/is-arguments/.nycrc +0 -9
- package/claw/node_modules/is-arguments/CHANGELOG.md +0 -201
- package/claw/node_modules/is-arguments/LICENSE +0 -20
- package/claw/node_modules/is-arguments/README.md +0 -47
- package/claw/node_modules/is-arguments/index.d.ts +0 -6
- package/claw/node_modules/is-arguments/index.js +0 -44
- package/claw/node_modules/is-arguments/package.json +0 -105
- package/claw/node_modules/is-arguments/test/index.js +0 -47
- package/claw/node_modules/is-arguments/tsconfig.json +0 -9
- package/claw/node_modules/is-callable/.editorconfig +0 -31
- package/claw/node_modules/is-callable/.eslintrc +0 -10
- package/claw/node_modules/is-callable/.github/FUNDING.yml +0 -12
- package/claw/node_modules/is-callable/.nycrc +0 -9
- package/claw/node_modules/is-callable/CHANGELOG.md +0 -158
- package/claw/node_modules/is-callable/LICENSE +0 -22
- package/claw/node_modules/is-callable/README.md +0 -83
- package/claw/node_modules/is-callable/index.js +0 -101
- package/claw/node_modules/is-callable/package.json +0 -106
- package/claw/node_modules/is-callable/test/index.js +0 -244
- package/claw/node_modules/is-date-object/.editorconfig +0 -20
- package/claw/node_modules/is-date-object/.eslintrc +0 -9
- package/claw/node_modules/is-date-object/.github/FUNDING.yml +0 -12
- package/claw/node_modules/is-date-object/.nycrc +0 -10
- package/claw/node_modules/is-date-object/CHANGELOG.md +0 -134
- package/claw/node_modules/is-date-object/LICENSE +0 -22
- package/claw/node_modules/is-date-object/README.md +0 -52
- package/claw/node_modules/is-date-object/index.d.ts +0 -3
- package/claw/node_modules/is-date-object/index.js +0 -27
- package/claw/node_modules/is-date-object/package.json +0 -99
- package/claw/node_modules/is-date-object/test/index.js +0 -38
- package/claw/node_modules/is-date-object/tsconfig.json +0 -6
- package/claw/node_modules/is-regex/.editorconfig +0 -23
- package/claw/node_modules/is-regex/.eslintrc +0 -10
- package/claw/node_modules/is-regex/.nycrc +0 -10
- package/claw/node_modules/is-regex/CHANGELOG.md +0 -233
- package/claw/node_modules/is-regex/LICENSE +0 -20
- package/claw/node_modules/is-regex/README.md +0 -52
- package/claw/node_modules/is-regex/index.d.ts +0 -3
- package/claw/node_modules/is-regex/index.js +0 -69
- package/claw/node_modules/is-regex/package.json +0 -104
- package/claw/node_modules/is-regex/test/index.js +0 -121
- package/claw/node_modules/is-regex/tsconfig.json +0 -9
- package/claw/node_modules/is-typed-array/.editorconfig +0 -20
- package/claw/node_modules/is-typed-array/.eslintrc +0 -13
- package/claw/node_modules/is-typed-array/.github/FUNDING.yml +0 -12
- package/claw/node_modules/is-typed-array/.nycrc +0 -9
- package/claw/node_modules/is-typed-array/CHANGELOG.md +0 -166
- package/claw/node_modules/is-typed-array/LICENSE +0 -22
- package/claw/node_modules/is-typed-array/README.md +0 -70
- package/claw/node_modules/is-typed-array/index.d.ts +0 -9
- package/claw/node_modules/is-typed-array/index.js +0 -8
- package/claw/node_modules/is-typed-array/package.json +0 -129
- package/claw/node_modules/is-typed-array/test/index.js +0 -111
- package/claw/node_modules/is-typed-array/tsconfig.json +0 -6
- package/claw/node_modules/isarray/.travis.yml +0 -4
- package/claw/node_modules/isarray/Makefile +0 -6
- package/claw/node_modules/isarray/README.md +0 -60
- package/claw/node_modules/isarray/component.json +0 -19
- package/claw/node_modules/isarray/index.js +0 -5
- package/claw/node_modules/isarray/package.json +0 -45
- package/claw/node_modules/isarray/test.js +0 -20
- package/claw/node_modules/isomorphic-ws/LICENSE +0 -21
- package/claw/node_modules/isomorphic-ws/README.md +0 -58
- package/claw/node_modules/isomorphic-ws/browser.js +0 -17
- package/claw/node_modules/isomorphic-ws/index.d.ts +0 -8
- package/claw/node_modules/isomorphic-ws/node.js +0 -3
- package/claw/node_modules/isomorphic-ws/package.json +0 -34
- package/claw/node_modules/long/.travis.yml +0 -5
- package/claw/node_modules/long/LICENSE +0 -202
- package/claw/node_modules/long/README.md +0 -513
- package/claw/node_modules/long/bower.json +0 -9
- package/claw/node_modules/long/dist/README.md +0 -16
- package/claw/node_modules/long/dist/long.js +0 -1209
- package/claw/node_modules/long/dist/long.min.js +0 -20
- package/claw/node_modules/long/dist/long.min.js.gz +0 -0
- package/claw/node_modules/long/dist/long.min.map +0 -8
- package/claw/node_modules/long/doco/INDEX.md +0 -6
- package/claw/node_modules/long/doco/Long.md +0 -473
- package/claw/node_modules/long/donate.png +0 -0
- package/claw/node_modules/long/externs/long.js +0 -416
- package/claw/node_modules/long/index.js +0 -1
- package/claw/node_modules/long/jsdoc.json +0 -13
- package/claw/node_modules/long/long.png +0 -0
- package/claw/node_modules/long/package.json +0 -33
- package/claw/node_modules/long/scripts/build.js +0 -28
- package/claw/node_modules/long/src/bower.json +0 -9
- package/claw/node_modules/long/src/long.js +0 -1172
- package/claw/node_modules/long/src/wrap.js +0 -38
- package/claw/node_modules/long/tests/goog.math.long.js +0 -807
- package/claw/node_modules/long/tests/suite.js +0 -195
- package/claw/node_modules/lzma/.travis.yml +0 -9
- package/claw/node_modules/lzma/LICENSE +0 -20
- package/claw/node_modules/lzma/THANKS +0 -7
- package/claw/node_modules/lzma/bin/lzma.js +0 -362
- package/claw/node_modules/lzma/index.js +0 -19
- package/claw/node_modules/lzma/package.json +0 -30
- package/claw/node_modules/lzma/readme.md +0 -149
- package/claw/node_modules/lzma/src/lzma-c-min.js +0 -1
- package/claw/node_modules/lzma/src/lzma-c.js +0 -2021
- package/claw/node_modules/lzma/src/lzma-d-min.js +0 -1
- package/claw/node_modules/lzma/src/lzma-d.js +0 -878
- package/claw/node_modules/lzma/src/lzma-min.js +0 -2
- package/claw/node_modules/lzma/src/lzma.js +0 -153
- package/claw/node_modules/lzma/src/lzma_worker-min.js +0 -2
- package/claw/node_modules/lzma/src/lzma_worker.js +0 -2668
- package/claw/node_modules/math-intrinsics/.eslintrc +0 -16
- package/claw/node_modules/math-intrinsics/.github/FUNDING.yml +0 -12
- package/claw/node_modules/math-intrinsics/CHANGELOG.md +0 -24
- package/claw/node_modules/math-intrinsics/LICENSE +0 -21
- package/claw/node_modules/math-intrinsics/README.md +0 -50
- package/claw/node_modules/math-intrinsics/abs.d.ts +0 -1
- package/claw/node_modules/math-intrinsics/abs.js +0 -4
- package/claw/node_modules/math-intrinsics/constants/maxArrayLength.d.ts +0 -3
- package/claw/node_modules/math-intrinsics/constants/maxArrayLength.js +0 -4
- package/claw/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts +0 -3
- package/claw/node_modules/math-intrinsics/constants/maxSafeInteger.js +0 -5
- package/claw/node_modules/math-intrinsics/constants/maxValue.d.ts +0 -3
- package/claw/node_modules/math-intrinsics/constants/maxValue.js +0 -5
- package/claw/node_modules/math-intrinsics/floor.d.ts +0 -1
- package/claw/node_modules/math-intrinsics/floor.js +0 -4
- package/claw/node_modules/math-intrinsics/isFinite.d.ts +0 -3
- package/claw/node_modules/math-intrinsics/isFinite.js +0 -12
- package/claw/node_modules/math-intrinsics/isInteger.d.ts +0 -3
- package/claw/node_modules/math-intrinsics/isInteger.js +0 -16
- package/claw/node_modules/math-intrinsics/isNaN.d.ts +0 -1
- package/claw/node_modules/math-intrinsics/isNaN.js +0 -6
- package/claw/node_modules/math-intrinsics/isNegativeZero.d.ts +0 -3
- package/claw/node_modules/math-intrinsics/isNegativeZero.js +0 -6
- package/claw/node_modules/math-intrinsics/max.d.ts +0 -1
- package/claw/node_modules/math-intrinsics/max.js +0 -4
- package/claw/node_modules/math-intrinsics/min.d.ts +0 -1
- package/claw/node_modules/math-intrinsics/min.js +0 -4
- package/claw/node_modules/math-intrinsics/mod.d.ts +0 -3
- package/claw/node_modules/math-intrinsics/mod.js +0 -9
- package/claw/node_modules/math-intrinsics/package.json +0 -86
- package/claw/node_modules/math-intrinsics/pow.d.ts +0 -1
- package/claw/node_modules/math-intrinsics/pow.js +0 -4
- package/claw/node_modules/math-intrinsics/round.d.ts +0 -1
- package/claw/node_modules/math-intrinsics/round.js +0 -4
- package/claw/node_modules/math-intrinsics/sign.d.ts +0 -3
- package/claw/node_modules/math-intrinsics/sign.js +0 -11
- package/claw/node_modules/math-intrinsics/test/index.js +0 -192
- package/claw/node_modules/math-intrinsics/tsconfig.json +0 -3
- package/claw/node_modules/md5.js/LICENSE +0 -21
- package/claw/node_modules/md5.js/README.md +0 -29
- package/claw/node_modules/md5.js/index.js +0 -146
- package/claw/node_modules/md5.js/package.json +0 -38
- package/claw/node_modules/object-is/.eslintrc +0 -5
- package/claw/node_modules/object-is/.nycrc +0 -9
- package/claw/node_modules/object-is/CHANGELOG.md +0 -175
- package/claw/node_modules/object-is/LICENSE +0 -20
- package/claw/node_modules/object-is/README.md +0 -60
- package/claw/node_modules/object-is/auto.js +0 -3
- package/claw/node_modules/object-is/implementation.js +0 -19
- package/claw/node_modules/object-is/index.js +0 -18
- package/claw/node_modules/object-is/package.json +0 -96
- package/claw/node_modules/object-is/polyfill.js +0 -7
- package/claw/node_modules/object-is/shim.js +0 -14
- package/claw/node_modules/object-is/test/implementation.js +0 -12
- package/claw/node_modules/object-is/test/index.js +0 -12
- package/claw/node_modules/object-is/test/shimmed.js +0 -28
- package/claw/node_modules/object-is/test/tests.js +0 -57
- package/claw/node_modules/object-keys/.editorconfig +0 -13
- package/claw/node_modules/object-keys/.eslintrc +0 -17
- package/claw/node_modules/object-keys/.travis.yml +0 -277
- package/claw/node_modules/object-keys/CHANGELOG.md +0 -232
- package/claw/node_modules/object-keys/LICENSE +0 -21
- package/claw/node_modules/object-keys/README.md +0 -76
- package/claw/node_modules/object-keys/implementation.js +0 -122
- package/claw/node_modules/object-keys/index.js +0 -32
- package/claw/node_modules/object-keys/isArguments.js +0 -17
- package/claw/node_modules/object-keys/package.json +0 -88
- package/claw/node_modules/object-keys/test/index.js +0 -5
- package/claw/node_modules/object.assign/.editorconfig +0 -20
- package/claw/node_modules/object.assign/.eslintrc +0 -28
- package/claw/node_modules/object.assign/.github/FUNDING.yml +0 -12
- package/claw/node_modules/object.assign/.nycrc +0 -9
- package/claw/node_modules/object.assign/CHANGELOG.md +0 -246
- package/claw/node_modules/object.assign/LICENSE +0 -21
- package/claw/node_modules/object.assign/README.md +0 -136
- package/claw/node_modules/object.assign/auto.js +0 -3
- package/claw/node_modules/object.assign/dist/browser.js +0 -1304
- package/claw/node_modules/object.assign/hasSymbols.js +0 -43
- package/claw/node_modules/object.assign/implementation.js +0 -46
- package/claw/node_modules/object.assign/index.js +0 -22
- package/claw/node_modules/object.assign/package.json +0 -96
- package/claw/node_modules/object.assign/polyfill.js +0 -55
- package/claw/node_modules/object.assign/shim.js +0 -14
- package/claw/node_modules/object.assign/test/implementation.js +0 -19
- package/claw/node_modules/object.assign/test/index.js +0 -17
- package/claw/node_modules/object.assign/test/native.js +0 -49
- package/claw/node_modules/object.assign/test/ses-compat.js +0 -12
- package/claw/node_modules/object.assign/test/shimmed.js +0 -52
- package/claw/node_modules/object.assign/test/tests.js +0 -232
- package/claw/node_modules/possible-typed-array-names/.eslintrc +0 -5
- package/claw/node_modules/possible-typed-array-names/.github/FUNDING.yml +0 -12
- package/claw/node_modules/possible-typed-array-names/CHANGELOG.md +0 -29
- package/claw/node_modules/possible-typed-array-names/LICENSE +0 -21
- package/claw/node_modules/possible-typed-array-names/README.md +0 -50
- package/claw/node_modules/possible-typed-array-names/index.d.ts +0 -16
- package/claw/node_modules/possible-typed-array-names/index.js +0 -17
- package/claw/node_modules/possible-typed-array-names/package.json +0 -84
- package/claw/node_modules/possible-typed-array-names/test/index.js +0 -19
- package/claw/node_modules/possible-typed-array-names/tsconfig.json +0 -9
- package/claw/node_modules/process-nextick-args/index.js +0 -45
- package/claw/node_modules/process-nextick-args/license.md +0 -19
- package/claw/node_modules/process-nextick-args/package.json +0 -25
- package/claw/node_modules/process-nextick-args/readme.md +0 -18
- package/claw/node_modules/readable-stream/.travis.yml +0 -34
- package/claw/node_modules/readable-stream/CONTRIBUTING.md +0 -38
- package/claw/node_modules/readable-stream/GOVERNANCE.md +0 -136
- package/claw/node_modules/readable-stream/LICENSE +0 -47
- package/claw/node_modules/readable-stream/README.md +0 -58
- package/claw/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +0 -60
- package/claw/node_modules/readable-stream/duplex-browser.js +0 -1
- package/claw/node_modules/readable-stream/duplex.js +0 -1
- package/claw/node_modules/readable-stream/lib/_stream_duplex.js +0 -131
- package/claw/node_modules/readable-stream/lib/_stream_passthrough.js +0 -47
- package/claw/node_modules/readable-stream/lib/_stream_readable.js +0 -1019
- package/claw/node_modules/readable-stream/lib/_stream_transform.js +0 -214
- package/claw/node_modules/readable-stream/lib/_stream_writable.js +0 -685
- package/claw/node_modules/readable-stream/lib/internal/streams/BufferList.js +0 -78
- package/claw/node_modules/readable-stream/lib/internal/streams/destroy.js +0 -84
- package/claw/node_modules/readable-stream/lib/internal/streams/stream-browser.js +0 -1
- package/claw/node_modules/readable-stream/lib/internal/streams/stream.js +0 -1
- package/claw/node_modules/readable-stream/node_modules/safe-buffer/LICENSE +0 -21
- package/claw/node_modules/readable-stream/node_modules/safe-buffer/README.md +0 -584
- package/claw/node_modules/readable-stream/node_modules/safe-buffer/index.d.ts +0 -187
- package/claw/node_modules/readable-stream/node_modules/safe-buffer/index.js +0 -62
- package/claw/node_modules/readable-stream/node_modules/safe-buffer/package.json +0 -37
- package/claw/node_modules/readable-stream/package.json +0 -52
- package/claw/node_modules/readable-stream/passthrough.js +0 -1
- package/claw/node_modules/readable-stream/readable-browser.js +0 -7
- package/claw/node_modules/readable-stream/readable.js +0 -19
- package/claw/node_modules/readable-stream/transform.js +0 -1
- package/claw/node_modules/readable-stream/writable-browser.js +0 -1
- package/claw/node_modules/readable-stream/writable.js +0 -8
- package/claw/node_modules/regexp.prototype.flags/.editorconfig +0 -13
- package/claw/node_modules/regexp.prototype.flags/.eslintrc +0 -20
- package/claw/node_modules/regexp.prototype.flags/.nycrc +0 -9
- package/claw/node_modules/regexp.prototype.flags/CHANGELOG.md +0 -249
- package/claw/node_modules/regexp.prototype.flags/LICENSE +0 -22
- package/claw/node_modules/regexp.prototype.flags/README.md +0 -55
- package/claw/node_modules/regexp.prototype.flags/auto.js +0 -3
- package/claw/node_modules/regexp.prototype.flags/implementation.js +0 -39
- package/claw/node_modules/regexp.prototype.flags/index.js +0 -18
- package/claw/node_modules/regexp.prototype.flags/package.json +0 -105
- package/claw/node_modules/regexp.prototype.flags/polyfill.js +0 -39
- package/claw/node_modules/regexp.prototype.flags/shim.js +0 -26
- package/claw/node_modules/regexp.prototype.flags/test/builtin.js +0 -46
- package/claw/node_modules/regexp.prototype.flags/test/implementation.js +0 -20
- package/claw/node_modules/regexp.prototype.flags/test/index.js +0 -17
- package/claw/node_modules/regexp.prototype.flags/test/shimmed.js +0 -48
- package/claw/node_modules/regexp.prototype.flags/test/tests.js +0 -143
- package/claw/node_modules/ripemd160/.github/FUNDING.yml +0 -12
- package/claw/node_modules/ripemd160/CHANGELOG.md +0 -109
- package/claw/node_modules/ripemd160/LICENSE +0 -21
- package/claw/node_modules/ripemd160/README.md +0 -27
- package/claw/node_modules/ripemd160/index.js +0 -167
- package/claw/node_modules/ripemd160/package.json +0 -64
- package/claw/node_modules/safe-buffer/LICENSE +0 -21
- package/claw/node_modules/safe-buffer/README.md +0 -584
- package/claw/node_modules/safe-buffer/index.d.ts +0 -187
- package/claw/node_modules/safe-buffer/index.js +0 -65
- package/claw/node_modules/safe-buffer/package.json +0 -51
- package/claw/node_modules/secure-random/CHANGELOG.md +0 -51
- package/claw/node_modules/secure-random/Makefile +0 -8
- package/claw/node_modules/secure-random/README.md +0 -133
- package/claw/node_modules/secure-random/lib/secure-random.js +0 -83
- package/claw/node_modules/secure-random/package.json +0 -45
- package/claw/node_modules/set-function-length/.eslintrc +0 -27
- package/claw/node_modules/set-function-length/.github/FUNDING.yml +0 -12
- package/claw/node_modules/set-function-length/.nycrc +0 -13
- package/claw/node_modules/set-function-length/CHANGELOG.md +0 -70
- package/claw/node_modules/set-function-length/LICENSE +0 -21
- package/claw/node_modules/set-function-length/README.md +0 -56
- package/claw/node_modules/set-function-length/env.d.ts +0 -9
- package/claw/node_modules/set-function-length/env.js +0 -25
- package/claw/node_modules/set-function-length/index.d.ts +0 -7
- package/claw/node_modules/set-function-length/index.js +0 -42
- package/claw/node_modules/set-function-length/package.json +0 -102
- package/claw/node_modules/set-function-length/tsconfig.json +0 -9
- package/claw/node_modules/set-function-name/.eslintrc +0 -21
- package/claw/node_modules/set-function-name/.github/FUNDING.yml +0 -12
- package/claw/node_modules/set-function-name/CHANGELOG.md +0 -48
- package/claw/node_modules/set-function-name/LICENSE +0 -21
- package/claw/node_modules/set-function-name/README.md +0 -61
- package/claw/node_modules/set-function-name/index.d.ts +0 -5
- package/claw/node_modules/set-function-name/index.js +0 -23
- package/claw/node_modules/set-function-name/package.json +0 -99
- package/claw/node_modules/set-function-name/tsconfig.json +0 -59
- package/claw/node_modules/sha.js/.eslintrc +0 -76
- package/claw/node_modules/sha.js/CHANGELOG.md +0 -423
- package/claw/node_modules/sha.js/LICENSE +0 -49
- package/claw/node_modules/sha.js/README.md +0 -44
- package/claw/node_modules/sha.js/bin.js +0 -44
- package/claw/node_modules/sha.js/hash.js +0 -84
- package/claw/node_modules/sha.js/index.js +0 -19
- package/claw/node_modules/sha.js/package.json +0 -58
- package/claw/node_modules/sha.js/sha.js +0 -104
- package/claw/node_modules/sha.js/sha1.js +0 -109
- package/claw/node_modules/sha.js/sha224.js +0 -55
- package/claw/node_modules/sha.js/sha256.js +0 -189
- package/claw/node_modules/sha.js/sha384.js +0 -59
- package/claw/node_modules/sha.js/sha512.js +0 -382
- package/claw/node_modules/sha.js/test/hash.js +0 -80
- package/claw/node_modules/sha.js/test/test.js +0 -138
- package/claw/node_modules/sha.js/test/vectors.js +0 -72
- package/claw/node_modules/string_decoder/.travis.yml +0 -50
- package/claw/node_modules/string_decoder/LICENSE +0 -48
- package/claw/node_modules/string_decoder/README.md +0 -47
- package/claw/node_modules/string_decoder/lib/string_decoder.js +0 -296
- package/claw/node_modules/string_decoder/node_modules/safe-buffer/LICENSE +0 -21
- package/claw/node_modules/string_decoder/node_modules/safe-buffer/README.md +0 -584
- package/claw/node_modules/string_decoder/node_modules/safe-buffer/index.d.ts +0 -187
- package/claw/node_modules/string_decoder/node_modules/safe-buffer/index.js +0 -62
- package/claw/node_modules/string_decoder/node_modules/safe-buffer/package.json +0 -37
- package/claw/node_modules/string_decoder/package.json +0 -31
- package/claw/node_modules/to-buffer/.github/FUNDING.yml +0 -12
- package/claw/node_modules/to-buffer/CHANGELOG.md +0 -81
- package/claw/node_modules/to-buffer/LICENSE +0 -21
- package/claw/node_modules/to-buffer/README.md +0 -44
- package/claw/node_modules/to-buffer/index.js +0 -109
- package/claw/node_modules/to-buffer/node_modules/isarray/LICENSE +0 -21
- package/claw/node_modules/to-buffer/node_modules/isarray/README.md +0 -38
- package/claw/node_modules/to-buffer/node_modules/isarray/index.js +0 -5
- package/claw/node_modules/to-buffer/node_modules/isarray/package.json +0 -48
- package/claw/node_modules/to-buffer/package.json +0 -62
- package/claw/node_modules/typed-array-buffer/.eslintrc +0 -13
- package/claw/node_modules/typed-array-buffer/.github/FUNDING.yml +0 -12
- package/claw/node_modules/typed-array-buffer/.nycrc +0 -13
- package/claw/node_modules/typed-array-buffer/CHANGELOG.md +0 -50
- package/claw/node_modules/typed-array-buffer/LICENSE +0 -21
- package/claw/node_modules/typed-array-buffer/README.md +0 -42
- package/claw/node_modules/typed-array-buffer/index.d.ts +0 -9
- package/claw/node_modules/typed-array-buffer/index.js +0 -19
- package/claw/node_modules/typed-array-buffer/package.json +0 -82
- package/claw/node_modules/typed-array-buffer/test/index.js +0 -23
- package/claw/node_modules/typed-array-buffer/tsconfig.json +0 -9
- package/claw/node_modules/util/LICENSE +0 -18
- package/claw/node_modules/util/README.md +0 -15
- package/claw/node_modules/util/node_modules/inherits/LICENSE +0 -16
- package/claw/node_modules/util/node_modules/inherits/README.md +0 -42
- package/claw/node_modules/util/node_modules/inherits/inherits.js +0 -7
- package/claw/node_modules/util/node_modules/inherits/inherits_browser.js +0 -23
- package/claw/node_modules/util/node_modules/inherits/package.json +0 -29
- package/claw/node_modules/util/package.json +0 -35
- package/claw/node_modules/util/support/isBuffer.js +0 -3
- package/claw/node_modules/util/support/isBufferBrowser.js +0 -6
- package/claw/node_modules/util/util.js +0 -586
- package/claw/node_modules/util-deprecate/History.md +0 -16
- package/claw/node_modules/util-deprecate/LICENSE +0 -24
- package/claw/node_modules/util-deprecate/README.md +0 -53
- package/claw/node_modules/util-deprecate/browser.js +0 -67
- package/claw/node_modules/util-deprecate/node.js +0 -6
- package/claw/node_modules/util-deprecate/package.json +0 -27
- package/claw/node_modules/which-typed-array/.editorconfig +0 -20
- package/claw/node_modules/which-typed-array/.eslintrc +0 -10
- package/claw/node_modules/which-typed-array/.github/FUNDING.yml +0 -12
- package/claw/node_modules/which-typed-array/.nycrc +0 -13
- package/claw/node_modules/which-typed-array/CHANGELOG.md +0 -269
- package/claw/node_modules/which-typed-array/LICENSE +0 -22
- package/claw/node_modules/which-typed-array/README.md +0 -70
- package/claw/node_modules/which-typed-array/index.d.ts +0 -66
- package/claw/node_modules/which-typed-array/index.js +0 -122
- package/claw/node_modules/which-typed-array/package.json +0 -130
- package/claw/node_modules/which-typed-array/test/index.js +0 -105
- package/claw/node_modules/which-typed-array/tsconfig.json +0 -9
- package/claw/node_modules/ws/LICENSE +0 -21
- package/claw/node_modules/ws/README.md +0 -449
- package/claw/node_modules/ws/browser.js +0 -8
- package/claw/node_modules/ws/index.js +0 -9
- package/claw/node_modules/ws/lib/buffer-util.js +0 -144
- package/claw/node_modules/ws/lib/constants.js +0 -10
- package/claw/node_modules/ws/lib/event-target.js +0 -170
- package/claw/node_modules/ws/lib/extension.js +0 -222
- package/claw/node_modules/ws/lib/permessage-deflate.js +0 -502
- package/claw/node_modules/ws/lib/receiver.js +0 -492
- package/claw/node_modules/ws/lib/sender.js +0 -358
- package/claw/node_modules/ws/lib/validation.js +0 -30
- package/claw/node_modules/ws/lib/websocket-server.js +0 -415
- package/claw/node_modules/ws/lib/websocket.js +0 -895
- package/claw/node_modules/ws/package.json +0 -45
- package/dist/analysis/chart_utils.d.ts +0 -27
- package/dist/analysis/chart_utils.d.ts.map +0 -1
- package/dist/analysis/chart_utils.js.map +0 -1
- package/dist/analysis/math_utils.d.ts +0 -22
- package/dist/analysis/math_utils.d.ts.map +0 -1
- package/dist/analysis/math_utils.js +0 -43
- package/dist/analysis/math_utils.js.map +0 -1
- package/dist/analysis/tradingview/tradingview_uplot_chart_generator.d.ts +0 -5
- package/dist/analysis/tradingview/tradingview_uplot_chart_generator.d.ts.map +0 -1
- package/dist/analysis/tradingview/tradingview_uplot_chart_generator.js.map +0 -1
- package/dist/modules/logger.d.ts +0 -4
- package/dist/modules/logger.d.ts.map +0 -1
- package/dist/modules/logger.js +0 -5
- package/dist/modules/logger.js.map +0 -1
- package/dist/modules/utils/math_utils.d.ts +0 -3
- package/dist/modules/utils/math_utils.d.ts.map +0 -1
- package/dist/modules/utils/math_utils.js +0 -3
- package/dist/modules/utils/math_utils.js.map +0 -1
|
@@ -0,0 +1,1466 @@
|
|
|
1
|
+
# DEXBot2 Architecture
|
|
2
|
+
|
|
3
|
+
This document provides a high-level overview of the DEXBot2 architecture, module relationships, and key data flows.
|
|
4
|
+
|
|
5
|
+
> **For practical development guidance**, see [developer_guide.md](developer_guide.md) for quick start, glossary, module deep dive, and common development tasks.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## System Overview
|
|
10
|
+
|
|
11
|
+
DEXBot2 is a grid trading bot for the BitShares blockchain. It maintains a geometric grid of limit orders that automatically rebalance as the market moves, capturing profit from price oscillations.
|
|
12
|
+
|
|
13
|
+
### Core Concepts
|
|
14
|
+
|
|
15
|
+
- **Grid**: A geometric array of price levels with orders placed at each level
|
|
16
|
+
- **Spread Zone**: A buffer of empty slots between buy and sell orders (constant width)
|
|
17
|
+
- **Order States**: VIRTUAL (planned) → ACTIVE (on-chain) → PARTIAL (partially filled)
|
|
18
|
+
- **Fund Tracking**: Atomic accounting system preventing race conditions and overdrafts
|
|
19
|
+
|
|
20
|
+
### Design Philosophy
|
|
21
|
+
|
|
22
|
+
DEXBot2 prioritizes **simplicity and operational efficiency** over complex partial-handling mechanics:
|
|
23
|
+
|
|
24
|
+
1. **Constant Spread**: The spread zone width remains fixed at `targetSpreadPercent`, eliminating dynamic inflation triggers.
|
|
25
|
+
2. **Direct Consolidation**: Dust partials are absorbed into the next grid rebuild cycle, not handled by complex merge/split logic.
|
|
26
|
+
3. **Minimal Blockchain Interaction**: Fund-driven rebalancing occurs once per fill batch, not per-partial. Grid generation uses only available funds—no forced allocations.
|
|
27
|
+
4. **Closed-Loop Market Dynamics**: The boundary-crawl mechanism naturally handles price movement and fill flows without special-case logic.
|
|
28
|
+
5. **Powerful Maintenance Tools**: Periodic grid regeneration, recovery retries, and fund invariant verification keep the system healthy over long operations.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Top-Level Data Flow
|
|
33
|
+
|
|
34
|
+
The diagram below shows DEXBot2 from a **data perspective**: what data enters the system, how it moves through each engine, and what leaves as blockchain operations or persisted state.
|
|
35
|
+
|
|
36
|
+
```mermaid
|
|
37
|
+
graph TB
|
|
38
|
+
subgraph "INPUTS"
|
|
39
|
+
CFG[bots.json<br/>grid params, funds, pair]
|
|
40
|
+
GS[general.settings.json<br/>timing, thresholds]
|
|
41
|
+
KEYS[keys.json AES encrypted<br/>+ interactive unlock / one-shot local bootstrap]
|
|
42
|
+
PERSIST[orders/botKey.json<br/>grid snapshot,<br/>feesOwed, boundaryIdx]
|
|
43
|
+
FILLEV[Fill Events real-time<br/>BitShares block op-4]
|
|
44
|
+
OPENORD[Open Orders polling<br/>chain open-order list]
|
|
45
|
+
BALANCES[Account Balances<br/>FREE + COMMITTED assets]
|
|
46
|
+
PRICE[Market Price<br/>pool or order-book]
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
subgraph "BOOTSTRAP - once at startup"
|
|
50
|
+
AUTH[Credential Daemon<br/>Decrypt private key]
|
|
51
|
+
ASSETMETA[Asset Metadata<br/>precision, fees, IDs]
|
|
52
|
+
INITGRID[Initial Grid<br/>geometric price levels<br/>order sizes per side]
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
subgraph "CORE ENGINE - OrderManager"
|
|
56
|
+
MASTERGRID[Master Grid - immutable/frozen<br/>slot-id, price, size, state<br/>orderId, blockchain, grid, proceeds]
|
|
57
|
+
TWOPASS[SyncEngine<br/>2-pass: grid-to-chain then chain-to-grid<br/>match orderId, detect partials, flag stale]
|
|
58
|
+
FUNDS["Accounting - SSOT for funds<br/>available, virtual, committed<br/>btsFeesOwed<br/>Avail = max 0 ChainFree minus Virtual minus Fees"]
|
|
59
|
+
TARGET[Strategy Engine<br/>calculateTargetGrid<br/>boundary-crawl pivot<br/>partial-fill consolidation, rotation]
|
|
60
|
+
WORKGRID[WorkingGrid - COW copy<br/>all mutations here only<br/>commit to Master on confirmation]
|
|
61
|
+
FILLQUEUE[Fill Queue<br/>AsyncLock + dedup 5-60 min]
|
|
62
|
+
BATCHER[Fixed-Cap Batcher<br/>queue within cap: unified batch<br/>queue above cap: chunk at cap size<br/>default cap: 4]
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
subgraph "OUTPUTS"
|
|
66
|
+
OPS[Blockchain Operations<br/>CREATE / UPDATE / CANCEL<br/>limit orders on BitShares]
|
|
67
|
+
SNAP[Grid Snapshot<br/>profiles/orders/botKey.json]
|
|
68
|
+
LOGS[Logs and Metrics<br/>profiles/logs/botName.log<br/>queue depth, latency, health]
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
KEYS --> AUTH --> ASSETMETA
|
|
72
|
+
CFG --> INITGRID
|
|
73
|
+
GS --> INITGRID
|
|
74
|
+
ASSETMETA --> INITGRID
|
|
75
|
+
PERSIST --> MASTERGRID
|
|
76
|
+
INITGRID --> MASTERGRID
|
|
77
|
+
|
|
78
|
+
PRICE --> FUNDS
|
|
79
|
+
BALANCES --> FUNDS
|
|
80
|
+
BALANCES --> TWOPASS
|
|
81
|
+
OPENORD --> TWOPASS
|
|
82
|
+
TWOPASS --> FUNDS
|
|
83
|
+
TWOPASS --> MASTERGRID
|
|
84
|
+
|
|
85
|
+
FILLEV --> FILLQUEUE
|
|
86
|
+
OPENORD --> FILLQUEUE
|
|
87
|
+
FILLQUEUE --> BATCHER
|
|
88
|
+
BATCHER --> WORKGRID
|
|
89
|
+
|
|
90
|
+
MASTERGRID --> WORKGRID
|
|
91
|
+
FUNDS --> TARGET
|
|
92
|
+
WORKGRID --> TARGET
|
|
93
|
+
TARGET --> WORKGRID
|
|
94
|
+
WORKGRID --> OPS
|
|
95
|
+
OPS --> MASTERGRID
|
|
96
|
+
|
|
97
|
+
MASTERGRID --> SNAP
|
|
98
|
+
FUNDS --> LOGS
|
|
99
|
+
BATCHER --> LOGS
|
|
100
|
+
OPS --> LOGS
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Key Design Principles
|
|
104
|
+
|
|
105
|
+
| Principle | Mechanism |
|
|
106
|
+
|---|---|
|
|
107
|
+
| **Immutability** | Master Grid is frozen; all changes go through a disposable WorkingGrid (Copy-on-Write) |
|
|
108
|
+
| **Single Source of Truth** | Accounting engine owns all fund data; everything reads from it |
|
|
109
|
+
| **Event-driven + Polling** | Fill Events (real-time) and Open-Order polling feed the same queue |
|
|
110
|
+
| **Fixed-Cap Batching** | Deterministic batching with hard cap per broadcast (default 4 fills) |
|
|
111
|
+
| **Persistence** | Grid snapshot written after every confirmed blockchain commit |
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Module Architecture
|
|
116
|
+
|
|
117
|
+
```mermaid
|
|
118
|
+
graph TB
|
|
119
|
+
subgraph "Entry Points"
|
|
120
|
+
CLI[dexbot.ts]
|
|
121
|
+
BOT[bot.ts]
|
|
122
|
+
PM2[pm2.ts]
|
|
123
|
+
UNLOCK[unlock.ts]
|
|
124
|
+
CRED_DAEMON[credential-daemon.ts]
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
subgraph "Core Bot"
|
|
128
|
+
DEXBOT[DexBotClass<br/>modules/dexbot_class.ts]
|
|
129
|
+
FILL_RUNTIME[FillRuntime<br/>modules/dexbot_fill_runtime.ts]
|
|
130
|
+
MAINT_RUNTIME[MaintenanceRuntime<br/>modules/dexbot_maintenance_runtime.ts]
|
|
131
|
+
CONSTANTS[Constants<br/>modules/constants.ts]
|
|
132
|
+
FUND_REGISTRY[FundRegistry<br/>modules/fund_registry.ts]
|
|
133
|
+
SETTINGS_MERGE[SettingsMerge<br/>modules/settings_merge.ts]
|
|
134
|
+
CRED_RUNTIME[CredentialRuntime<br/>modules/credential_runtime.ts]
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
subgraph "Order Management System"
|
|
138
|
+
MANAGER[OrderManager<br/>modules/order/manager.ts]
|
|
139
|
+
|
|
140
|
+
subgraph "Specialized Engines"
|
|
141
|
+
ACCOUNTANT[Accountant<br/>accounting.ts]
|
|
142
|
+
STRATEGY[StrategyEngine<br/>strategy.ts]
|
|
143
|
+
SYNC[SyncEngine<br/>sync_engine.ts]
|
|
144
|
+
GRID[Grid<br/>grid.ts]
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
WORKGRID[WorkingGrid<br/>working_grid.ts]
|
|
148
|
+
GRID_RECONCILE[GridReconcile<br/>grid_reconcile.ts]
|
|
149
|
+
UTILS[Utils<br/>utils/]
|
|
150
|
+
LOGGER[Logger<br/>logger.ts]
|
|
151
|
+
FILL_STORE[ProcessedFillStore<br/>processed_fill_store.ts]
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
subgraph "Blockchain Layer"
|
|
155
|
+
CHAIN_ORDERS[ChainOrders<br/>modules/chain_orders.ts]
|
|
156
|
+
ACCOUNT_ORDERS[AccountOrders<br/>modules/account_orders.ts]
|
|
157
|
+
ACCOUNT_BOTS[AccountBots<br/>modules/account_bots.ts]
|
|
158
|
+
NODE_MGR[NodeManager<br/>modules/node_manager.ts]
|
|
159
|
+
BTS_CLIENT[BitSharesClient<br/>modules/bitshares_client.ts]
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
subgraph "Market Adapter"
|
|
163
|
+
MA[MarketAdapter<br/>market_adapter/market_adapter.ts]
|
|
164
|
+
MA_SVC[AdapterService<br/>core/market_adapter_service.ts]
|
|
165
|
+
AMA_RUNNER[AMA Signal Runner<br/>ama_signal_runner.ts]
|
|
166
|
+
KIBANA[inputs/kibana_source.ts]
|
|
167
|
+
LP_FETCH[inputs/fetch_lp_data.ts]
|
|
168
|
+
STRATEGIES[core/strategies/]
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
CLI --> DEXBOT
|
|
172
|
+
BOT --> DEXBOT
|
|
173
|
+
PM2 --> DEXBOT
|
|
174
|
+
UNLOCK --> CRED_DAEMON
|
|
175
|
+
CRED_DAEMON --> DEXBOT
|
|
176
|
+
|
|
177
|
+
DEXBOT --> MANAGER
|
|
178
|
+
DEXBOT --> FILL_RUNTIME
|
|
179
|
+
DEXBOT --> MAINT_RUNTIME
|
|
180
|
+
DEXBOT --> CONSTANTS
|
|
181
|
+
DEXBOT --> FUND_REGISTRY
|
|
182
|
+
DEXBOT --> SETTINGS_MERGE
|
|
183
|
+
DEXBOT --> CRED_RUNTIME
|
|
184
|
+
|
|
185
|
+
MANAGER --> ACCOUNTANT
|
|
186
|
+
MANAGER --> STRATEGY
|
|
187
|
+
MANAGER --> SYNC
|
|
188
|
+
MANAGER --> GRID
|
|
189
|
+
MANAGER --> WORKGRID
|
|
190
|
+
MANAGER --> GRID_RECONCILE
|
|
191
|
+
MANAGER --> UTILS
|
|
192
|
+
MANAGER --> LOGGER
|
|
193
|
+
MANAGER --> RUNNER
|
|
194
|
+
MANAGER --> FILL_STORE
|
|
195
|
+
|
|
196
|
+
ACCOUNTANT --> FUND_REGISTRY
|
|
197
|
+
STRATEGY --> UTILS
|
|
198
|
+
SYNC --> UTILS
|
|
199
|
+
GRID --> UTILS
|
|
200
|
+
|
|
201
|
+
RUNNER --> CHAIN_ORDERS
|
|
202
|
+
SYNC --> ACCOUNT_ORDERS
|
|
203
|
+
MANAGER --> ACCOUNT_BOTS
|
|
204
|
+
|
|
205
|
+
CHAIN_ORDERS --> BTS_CLIENT
|
|
206
|
+
ACCOUNT_ORDERS --> BTS_CLIENT
|
|
207
|
+
BTS_CLIENT --> NODE_MGR
|
|
208
|
+
|
|
209
|
+
MA --> MA_SVC
|
|
210
|
+
MA --> AMA_RUNNER
|
|
211
|
+
MA_SVC --> KIBANA
|
|
212
|
+
MA_SVC --> LP_FETCH
|
|
213
|
+
MA_SVC --> STRATEGIES
|
|
214
|
+
|
|
215
|
+
MA -.->|trigger files| MAINT_RUNTIME
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
## Browser-Safe Surface
|
|
219
|
+
|
|
220
|
+
DEXBot2 ships both a **Node CLI runtime** and the building blocks for an in-browser operator UI. To keep `require('fs')`, `process.kill`, and Unix-socket calls out of the browser bundle, the codebase enforces a strict Node-vs-browser split.
|
|
221
|
+
|
|
222
|
+
**Convention**: *everything is browser-safe unless listed as Node-only*. The source of truth is the `"browser"` field in `package.json`, which maps every Node-only **compiled** entry (`dist/*.js`) to `false`. The list below is documentation; always check `package.json` before reclassifying a module.
|
|
223
|
+
|
|
224
|
+
**Node-only modules** (must not be reached from a browser bundle):
|
|
225
|
+
|
|
226
|
+
| Module | Reason |
|
|
227
|
+
|--------|--------|
|
|
228
|
+
| `modules/launcher/*` | Credential daemon, bot supervisor, market-adapter runtime, monolithic runtime |
|
|
229
|
+
| `modules/dexbot_maintenance_runtime.ts` | Direct `fs` / `child_process` / `os` use |
|
|
230
|
+
| `modules/dexbot_class.ts` | Imports `dexbot_maintenance_runtime` |
|
|
231
|
+
| `unlock.ts`, `bot.ts`, `dexbot.ts`, `pm2.ts`, `credential-daemon.ts` | CLI entry points |
|
|
232
|
+
| `market_adapter/lp_chart_runner.ts` | `import { exec } from 'node:child_process'` for chart rendering |
|
|
233
|
+
|
|
234
|
+
**Environment detection** must go through `modules/env.ts` rather than inline `typeof window` / `typeof process` checks:
|
|
235
|
+
|
|
236
|
+
```javascript
|
|
237
|
+
import { isBrowser, hasProcess } from './env';
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
The previous 6+ inline ternaries that existed in `bitshares-native/*` and `runtime.ts` were consolidated into those helpers; do not reintroduce them.
|
|
241
|
+
|
|
242
|
+
---
|
|
243
|
+
|
|
244
|
+
## Order Manager: Central Coordinator
|
|
245
|
+
|
|
246
|
+
The `OrderManager` is the central hub that coordinates all order operations. It delegates specialized tasks to four engine modules:
|
|
247
|
+
|
|
248
|
+
### Engine Responsibilities
|
|
249
|
+
|
|
250
|
+
| Engine | File | Responsibility |
|
|
251
|
+
|--------|------|----------------|
|
|
252
|
+
| **Accountant** | `accounting.ts` | **Single Source of Truth**. Centralized fund tracking via `recalculateFunds()`, fee management, invariant verification, recovery retry state management (`resetRecoveryState()`) |
|
|
253
|
+
| **StrategyEngine** | `strategy.ts` | Grid rebalancing, order rotation, partial order handling, fill boundary shifts, remainder tracking |
|
|
254
|
+
| **SyncEngine** | `sync_engine.ts` | Blockchain synchronization, fill detection, stale-order cleanup, type-mismatch handling |
|
|
255
|
+
| **Grid** | `grid.ts` | Grid creation, sizing, divergence detection, remainder accuracy during capped resize |
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## Copy-on-Write (COW) Grid Pattern
|
|
260
|
+
|
|
261
|
+
The OrderManager implements a **Copy-on-Write (COW) pattern** to protect the master grid from speculative modifications until blockchain finality is confirmed.
|
|
262
|
+
|
|
263
|
+
### Core Principle
|
|
264
|
+
|
|
265
|
+
The master grid (`this.orders`) is **immutable** - it can only be replaced atomically, never mutated in place. All speculative planning operations work on isolated copies, and the master is only updated when blockchain confirms the operation.
|
|
266
|
+
|
|
267
|
+
**Important**: Index Sets (`_ordersByState`, `_ordersByType`) are **mutable by design** but must **only be mutated through `_applyOrderUpdate()`**. Direct external mutations violate the COW invariant.
|
|
268
|
+
|
|
269
|
+
### Protection Mechanisms
|
|
270
|
+
|
|
271
|
+
| Mechanism | Location | Purpose |
|
|
272
|
+
|-----------|----------|---------|
|
|
273
|
+
| `Object.freeze()` | `manager.ts` | Master Map is frozen at initialization |
|
|
274
|
+
| `deepFreeze()` | `manager.ts` | Individual order objects are deep-frozen |
|
|
275
|
+
| `_gridVersion` | `manager.ts` | Version counter for staleness detection |
|
|
276
|
+
| `_gridLock` | `manager.ts` | AsyncLock serializes grid mutations |
|
|
277
|
+
| Encapsulation | `manager.ts` | Index Sets are private; mutations only via `_applyOrderUpdate()` |
|
|
278
|
+
|
|
279
|
+
### Master Grid Update Pattern
|
|
280
|
+
|
|
281
|
+
All master grid updates follow clone-and-replace semantics:
|
|
282
|
+
|
|
283
|
+
```javascript
|
|
284
|
+
// 1. Clone existing Map
|
|
285
|
+
const newMap = cloneMap(this.orders);
|
|
286
|
+
|
|
287
|
+
// 2. Apply mutation to clone
|
|
288
|
+
newMap.set(id, updatedOrder);
|
|
289
|
+
|
|
290
|
+
// 3. Atomically replace with frozen copy
|
|
291
|
+
this.orders = Object.freeze(newMap);
|
|
292
|
+
this._gridVersion++;
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
Index Sets follow the same pattern - cloned, mutated, frozen, then replaced.
|
|
296
|
+
|
|
297
|
+
### WorkingGrid Class
|
|
298
|
+
|
|
299
|
+
The `WorkingGrid` class (`modules/order/working_grid.ts`) provides isolation for speculative operations:
|
|
300
|
+
|
|
301
|
+
- **Deep clones** the master grid on construction
|
|
302
|
+
- Tracks **modified orders** in a Set
|
|
303
|
+
- Supports **staleness detection** via `baseVersion`
|
|
304
|
+
- **Never modifies** the master grid
|
|
305
|
+
|
|
306
|
+
### COW Rebalance Pipeline
|
|
307
|
+
|
|
308
|
+
```
|
|
309
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
310
|
+
│ 1. Create WorkingGrid from frozen master │
|
|
311
|
+
│ workingGrid = new WorkingGrid(masterGrid, {baseVersion})│
|
|
312
|
+
└─────────────────────────┬───────────────────────────────────┘
|
|
313
|
+
↓
|
|
314
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
315
|
+
│ 2. Calculate target state (PURE - no side effects) │
|
|
316
|
+
│ strategy.calculateTargetGrid() returns new Map │
|
|
317
|
+
└─────────────────────────┬───────────────────────────────────┘
|
|
318
|
+
↓
|
|
319
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
320
|
+
│ 3. Project target onto working grid │
|
|
321
|
+
│ Modifies working copy only │
|
|
322
|
+
└─────────────────────────┬───────────────────────────────────┘
|
|
323
|
+
↓
|
|
324
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
325
|
+
│ 4. Validate funds & check staleness │
|
|
326
|
+
│ If stale: abort without committing │
|
|
327
|
+
└─────────────────────────┬───────────────────────────────────┘
|
|
328
|
+
↓
|
|
329
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
330
|
+
│ 5. Submit to blockchain & wait for finality │
|
|
331
|
+
│ synchronizeWithChain() confirms on-chain │
|
|
332
|
+
└─────────────────────────┬───────────────────────────────────┘
|
|
333
|
+
↓
|
|
334
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
335
|
+
│ 6. Commit: Replace master with working grid │
|
|
336
|
+
│ this.orders = Object.freeze(workingGrid.toMap()) │
|
|
337
|
+
└─────────────────────────────────────────────────────────────┘
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
### Triggers for Master Grid Updates
|
|
341
|
+
|
|
342
|
+
Only blockchain-confirmed events trigger master updates:
|
|
343
|
+
|
|
344
|
+
| Event | Entry Point | Mechanism |
|
|
345
|
+
|-------|-------------|-----------|
|
|
346
|
+
| Order Created | `sync_engine.ts` `synchronizeWithChain()` | Called with `source: 'createOrder'` |
|
|
347
|
+
| Order Cancelled | `sync_engine.ts` `synchronizeWithChain()` | Called with `source: 'cancelOrder'` |
|
|
348
|
+
| Order Filled | `sync_engine.ts` `syncFromFillHistory()` | Processes a real-time fill event |
|
|
349
|
+
| Full Sync | `sync_engine.ts` `syncFromOpenOrders()` | Reconciles grid against current open orders |
|
|
350
|
+
| Grid Init/Load | `grid.ts` `createOrderGrid()` | Bootstrap operations |
|
|
351
|
+
|
|
352
|
+
### Defensive Measures
|
|
353
|
+
|
|
354
|
+
1. **Double-check commit pattern**: Staleness is checked both outside and inside the lock
|
|
355
|
+
2. **Working grid sync**: If master mutates during planning, working grid is marked stale
|
|
356
|
+
3. **Version mismatch detection**: Commits abort if `baseVersion` doesn't match `_gridVersion`
|
|
357
|
+
|
|
358
|
+
---
|
|
359
|
+
|
|
360
|
+
## Fill Processing Pipeline
|
|
361
|
+
|
|
362
|
+
The fill pipeline handles incoming filled orders efficiently through fixed-cap batching instead of one-at-a-time processing.
|
|
363
|
+
|
|
364
|
+
### Architecture Diagram
|
|
365
|
+
|
|
366
|
+
```
|
|
367
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
368
|
+
│ Fill Event (Blockchain) │
|
|
369
|
+
│ (Order filled at price X) │
|
|
370
|
+
└─────────────────────┬───────────────────────────────────────┘
|
|
371
|
+
↓
|
|
372
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
373
|
+
│ _incomingFillQueue (FIFO Queue) │
|
|
374
|
+
│ (Accumulates fills from blockchain) │
|
|
375
|
+
│ Queue: [fill1, fill2, fill3, fill4, fill5, ...] │
|
|
376
|
+
└─────────────────────┬───────────────────────────────────────┘
|
|
377
|
+
↓
|
|
378
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
379
|
+
│ processFilledOrders() - Entry Point │
|
|
380
|
+
│ Use MAX_FILL_BATCH_SIZE cap for deterministic batching │
|
|
381
|
+
│ Rules: <=cap unified, >cap chunked at cap size │
|
|
382
|
+
└─────────────────────┬───────────────────────────────────────┘
|
|
383
|
+
↓
|
|
384
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
385
|
+
│ Pop Batch (up to MAX_FILL_BATCH_SIZE) │
|
|
386
|
+
│ Takes N fills from queue head (N = 1-4) │
|
|
387
|
+
│ Example: pops [fill1, fill2, fill3] for batch processing │
|
|
388
|
+
└─────────────────────┬───────────────────────────────────────┘
|
|
389
|
+
↓
|
|
390
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
391
|
+
│ processFillAccounting() - Single Call │
|
|
392
|
+
│ All fills credited to chainFree in ONE operation │
|
|
393
|
+
│ chainFree += proceeds[fill1] + proceeds[fill2] + ... │
|
|
394
|
+
│ Proceeds immediately available (same rebalance cycle) │
|
|
395
|
+
└─────────────────────┬───────────────────────────────────────┘
|
|
396
|
+
↓
|
|
397
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
398
|
+
│ calculateTargetGrid() - Single Call │
|
|
399
|
+
│ Size replacement orders using combined proceeds │
|
|
400
|
+
│ Apply rotations and boundary shifts │
|
|
401
|
+
│ Use unallocated remainder for next allocation opportunities │
|
|
402
|
+
└─────────────────────┬───────────────────────────────────────┘
|
|
403
|
+
↓
|
|
404
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
405
|
+
│ updateOrdersOnChainBatch() - Single Broadcast │
|
|
406
|
+
│ All new orders + cancellations in single operation │
|
|
407
|
+
│ Result: Atomic state update on blockchain │
|
|
408
|
+
└─────────────────────┬───────────────────────────────────────┘
|
|
409
|
+
↓
|
|
410
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
411
|
+
│ persistGrid() │
|
|
412
|
+
│ Save grid state to disk/storage │
|
|
413
|
+
└─────────────────────┬───────────────────────────────────────┘
|
|
414
|
+
↓
|
|
415
|
+
Loop to next batch
|
|
416
|
+
(or idle if queue empty)
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
### Key Properties
|
|
420
|
+
|
|
421
|
+
- **Fixed-Cap Batch Sizing**: Batch size is deterministic with `MAX_FILL_BATCH_SIZE` (default 4)
|
|
422
|
+
- 1..4 awaiting: single unified batch (one rebalance/broadcast cycle)
|
|
423
|
+
- 5+ awaiting: repeated chunks of 4 (last chunk may be smaller)
|
|
424
|
+
|
|
425
|
+
- **Single Rebalance Cycle**: All fills in batch processed in ONE rebalance
|
|
426
|
+
- No "split across cycles" delays
|
|
427
|
+
- Combined proceeds immediately available
|
|
428
|
+
- Single cache fund update
|
|
429
|
+
|
|
430
|
+
- **Recovery Retries**: Periodic retry system replaces one-shot flag
|
|
431
|
+
- Max 5 attempts per episode
|
|
432
|
+
- 60s minimum interval between retries
|
|
433
|
+
- Reset on fill arrival or periodic sync (10 minutes)
|
|
434
|
+
- `resetRecoveryState()` called by Accountant
|
|
435
|
+
|
|
436
|
+
- **Stale-Cleaned Order Tracking**: Prevents orphan double-credit
|
|
437
|
+
- Batch failure → cleanup stale order IDs
|
|
438
|
+
- Delayed orphan event → check if ID in stale-cleaned map
|
|
439
|
+
- Skip credit if already cleaned
|
|
440
|
+
- TTL pruning (5 minute retention)
|
|
441
|
+
|
|
442
|
+
### Impact vs. Legacy Sequential Processing
|
|
443
|
+
|
|
444
|
+
Scenario source: 29-fill burst during the Feb 7 market crash, modeled at
|
|
445
|
+
roughly 3 seconds per broadcast; see
|
|
446
|
+
[`FUND_MOVEMENT_AND_ACCOUNTING.md`](FUND_MOVEMENT_AND_ACCOUNTING.md#14-fill-batch-processing--cache-fund-timeline).
|
|
447
|
+
|
|
448
|
+
| Metric | Legacy (1-at-a-time) | Fixed-Cap Batching | Improvement |
|
|
449
|
+
|--------|---------------------|-------------------|-------------|
|
|
450
|
+
| **29 Fills** | ~90 seconds | ~24 seconds | **73% faster** |
|
|
451
|
+
| **Market Divergence** | High (90s window) | Low (24s window) | **Safer** |
|
|
452
|
+
| **Stale Orders** | Frequent | Rare | **More reliable** |
|
|
453
|
+
| **Recovery** | One-shot (brick) | Periodic (self-heal) | **Production-ready** |
|
|
454
|
+
|
|
455
|
+
---
|
|
456
|
+
|
|
457
|
+
## Fund-Driven Boundary Sync
|
|
458
|
+
|
|
459
|
+
The grid boundary (which separates BUY, SPREAD, and SELL zones) automatically aligns with the bot's actual inventory distribution.
|
|
460
|
+
|
|
461
|
+
### Why This Matters
|
|
462
|
+
|
|
463
|
+
By default, the grid is centered around `startPrice`. However, if the bot has asymmetric capital (e.g., more assetB than assetA), the boundary should shift to favor the "heavier" side.
|
|
464
|
+
|
|
465
|
+
**Example**: If 70% of capital is in assetB (buying power), the BUY zone should be expanded.
|
|
466
|
+
|
|
467
|
+
### Boundary Calculation
|
|
468
|
+
|
|
469
|
+
**Location**: `modules/dexbot_class.ts::_performPeriodicGridChecks()` → Boundary Sync step
|
|
470
|
+
|
|
471
|
+
**Algorithm**:
|
|
472
|
+
```javascript
|
|
473
|
+
// 1. Scan all grid slots and their current assignments
|
|
474
|
+
const buyTotal = sum(orders with type === BUY);
|
|
475
|
+
const sellTotal = sum(orders with type === SELL);
|
|
476
|
+
const totalAllocated = buyTotal + sellTotal;
|
|
477
|
+
|
|
478
|
+
// 2. Calculate target allocation based on available funds
|
|
479
|
+
const buyAvailable = manager.funds.available.buy;
|
|
480
|
+
const sellAvailable = manager.funds.available.sell;
|
|
481
|
+
const totalAvailable = buyAvailable + sellAvailable;
|
|
482
|
+
|
|
483
|
+
// 3. Determine ideal boundary position
|
|
484
|
+
const buyTargetRatio = buyAvailable / totalAvailable; // e.g., 0.7
|
|
485
|
+
const slots = grid.length;
|
|
486
|
+
const targetBuySlots = Math.round(slots * buyTargetRatio * 0.5); // Apply centering factor
|
|
487
|
+
|
|
488
|
+
// 4. Adjust boundary to new position
|
|
489
|
+
newBoundaryIdx = calculateNewBoundary(targetBuySlots);
|
|
490
|
+
|
|
491
|
+
// 5. Re-assign slot roles (BUY/SPREAD/SELL) based on new boundary
|
|
492
|
+
reassignSlotRoles(newBoundaryIdx);
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
### Three Rotation Cases
|
|
496
|
+
|
|
497
|
+
Once the new boundary is determined, existing on-chain orders are matched to desired slots:
|
|
498
|
+
|
|
499
|
+
| Case | Condition | Action |
|
|
500
|
+
|------|-----------|--------|
|
|
501
|
+
| **MATCH** | Existing order price matches desired slot | Update size if needed |
|
|
502
|
+
| **ACTIVATE** | Desired slot is empty | Place new order at this price |
|
|
503
|
+
| **DEACTIVATE** | Existing order exceeds target count | Cancel excess orders |
|
|
504
|
+
|
|
505
|
+
**Target Count**: `activeOrders` from config, applied uniformly to both sides.
|
|
506
|
+
|
|
507
|
+
### Impact
|
|
508
|
+
|
|
509
|
+
- **Automatic Capital Repositioning**: Grid follows capital distribution without manual intervention
|
|
510
|
+
- **Fund Respect**: Never exceeds available funds when activating slots
|
|
511
|
+
- **Smooth Transitions**: Rotations happen gradually, not all at once
|
|
512
|
+
|
|
513
|
+
---
|
|
514
|
+
|
|
515
|
+
## Spread Correction (Fund-Aware Approach)
|
|
516
|
+
|
|
517
|
+
Simplified spread maintenance that keeps the gap consistent and fund-driven, avoiding complex split/merge mechanics.
|
|
518
|
+
|
|
519
|
+
### The Approach
|
|
520
|
+
|
|
521
|
+
Instead of complex partial handling, spread corrections are **conservative and fund-safe**:
|
|
522
|
+
- Target spread width stays **constant** at `targetSpreadPercent`
|
|
523
|
+
- Corrections scale with **actual available funds**, not arbitrary slot budgets
|
|
524
|
+
- No dynamic spread inflation based on partial consolidation flags
|
|
525
|
+
- Edge-first surplus selection ensures stable rotation candidates
|
|
526
|
+
|
|
527
|
+
### Algorithm
|
|
528
|
+
|
|
529
|
+
**Location**: `modules/order/strategy.ts::calculateTargetGrid()`
|
|
530
|
+
|
|
531
|
+
The simplified approach prioritizes fund availability over aggressive corrections:
|
|
532
|
+
|
|
533
|
+
```
|
|
534
|
+
1. Detect that spread is wider than targetSpreadPercent
|
|
535
|
+
2. Calculate how many edge slots are missing
|
|
536
|
+
3. Attempt to place new edge orders with available funds
|
|
537
|
+
4. If insufficient funds for all edges:
|
|
538
|
+
- Create what's affordable with available funds
|
|
539
|
+
- Log shortfall (smooth over next rebalance cycle)
|
|
540
|
+
5. If a dust partial exists in the correction window:
|
|
541
|
+
- Mark for consolidation in next grid rebuild
|
|
542
|
+
- Don't create complex merge/split side effects
|
|
543
|
+
6. Maintain constant target spread—no inflation based on partial flags
|
|
544
|
+
```
|
|
545
|
+
|
|
546
|
+
### Fund-Safe Constraints
|
|
547
|
+
|
|
548
|
+
Spread corrections respect these hard limits:
|
|
549
|
+
|
|
550
|
+
```javascript
|
|
551
|
+
// In modules/constants.ts
|
|
552
|
+
SPREAD_LIMITS: {
|
|
553
|
+
MIN_SPREAD_ORDERS: 2, // Always maintain minimum gap
|
|
554
|
+
TARGET_SPREAD_PERCENT: (user-configured), // Fixed width, no inflation
|
|
555
|
+
MAX_REPLACEMENT_SLOTS: 5, // Conservative correction cap
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
// Each correction order must be healthy
|
|
559
|
+
const minHealthySize = calculateMinOrderSize(side);
|
|
560
|
+
const affordableOrderCount = Math.floor(availableFunds / minHealthySize);
|
|
561
|
+
const correctionOrders = Math.min(missingSlots, affordableOrderCount);
|
|
562
|
+
```
|
|
563
|
+
|
|
564
|
+
**Benefits**:
|
|
565
|
+
- ✅ No "double-dust" fragmentation
|
|
566
|
+
- ✅ Constant, predictable spread width
|
|
567
|
+
- ✅ Funds always respected (no forced allocation)
|
|
568
|
+
- ✅ Natural smoothing over multiple rebalance cycles
|
|
569
|
+
|
|
570
|
+
---
|
|
571
|
+
|
|
572
|
+
## Periodic Market Price Refresh
|
|
573
|
+
|
|
574
|
+
Background market price updates every 4 hours to ensure grid anchoring remains accurate during long-running sessions without fills.
|
|
575
|
+
|
|
576
|
+
### Purpose
|
|
577
|
+
|
|
578
|
+
If the bot hasn't seen fills for 4 hours, the `startPrice` might become stale if:
|
|
579
|
+
- Market has drifted significantly
|
|
580
|
+
- Liquidity pool price has shifted
|
|
581
|
+
- User wants grid recalculation
|
|
582
|
+
|
|
583
|
+
### Configuration
|
|
584
|
+
|
|
585
|
+
**Location**: `modules/constants.ts`
|
|
586
|
+
|
|
587
|
+
```javascript
|
|
588
|
+
BLOCKCHAIN_FETCH_INTERVAL_MIN: 240, // 4 hours = 240 minutes
|
|
589
|
+
```
|
|
590
|
+
|
|
591
|
+
### Implementation Flow
|
|
592
|
+
|
|
593
|
+
```javascript
|
|
594
|
+
// 1. Timer started during bot initialization
|
|
595
|
+
this.periodicRefreshTimer = setInterval(
|
|
596
|
+
() => this._performPeriodicRefresh(),
|
|
597
|
+
BLOCKCHAIN_FETCH_INTERVAL_MIN * 60 * 1000
|
|
598
|
+
);
|
|
599
|
+
|
|
600
|
+
// 2. When timer fires:
|
|
601
|
+
async _performPeriodicRefresh() {
|
|
602
|
+
// Fetch latest market price
|
|
603
|
+
const latestPrice = await derivePrice('book'); // Or 'pool'
|
|
604
|
+
|
|
605
|
+
// Update internal anchor if using dynamic pricing
|
|
606
|
+
if (config.startPrice === 'book' || config.startPrice === 'pool') {
|
|
607
|
+
this.manager.startPrice = latestPrice;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
// Grid remains un-affected (fund-driven during normal ops)
|
|
611
|
+
// Only used for valuation calculations and divergence checks
|
|
612
|
+
}
|
|
613
|
+
```
|
|
614
|
+
|
|
615
|
+
### When `startPrice` is Numeric
|
|
616
|
+
|
|
617
|
+
If user set `startPrice: 105.5` in bots.json:
|
|
618
|
+
- **No auto-refresh**: Numeric value is treated as fixed anchor
|
|
619
|
+
- **Valuation uses fixed value**: All calculations use 105.5
|
|
620
|
+
- **Grid doesn't move**: Orders stay where they are (fund-driven rebalancing only)
|
|
621
|
+
|
|
622
|
+
### Non-Disruptive Updates
|
|
623
|
+
|
|
624
|
+
Price refresh is passive:
|
|
625
|
+
- ✅ Updates internal valuation
|
|
626
|
+
- ✅ Affects future grid resets if triggered
|
|
627
|
+
- ❌ Does NOT move orders on blockchain (no funds wasted on unnecessary rotations)
|
|
628
|
+
|
|
629
|
+
---
|
|
630
|
+
|
|
631
|
+
## Out-of-Spread Metric Refinement
|
|
632
|
+
|
|
633
|
+
Refactored `outOfSpread` from a simple boolean flag to a numeric distance metric for more precise structural updates.
|
|
634
|
+
|
|
635
|
+
### Before (Boolean)
|
|
636
|
+
|
|
637
|
+
```javascript
|
|
638
|
+
// Old approach
|
|
639
|
+
mgr.outOfSpread = true; // Binary: either in or out
|
|
640
|
+
if (mgr.outOfSpread) {
|
|
641
|
+
// Perform spread correction
|
|
642
|
+
}
|
|
643
|
+
```
|
|
644
|
+
|
|
645
|
+
**Problem**: Doesn't distinguish between "slightly out" vs "severely out"
|
|
646
|
+
|
|
647
|
+
### After (Numeric Distance)
|
|
648
|
+
|
|
649
|
+
```javascript
|
|
650
|
+
// New approach: distance in steps
|
|
651
|
+
mgr.outOfSpread = 3; // 3 steps beyond target spread
|
|
652
|
+
|
|
653
|
+
// Use distance in correction logic
|
|
654
|
+
const spreadDistance = mgr.outOfSpread;
|
|
655
|
+
const replacementSlots = Math.min(spreadDistance, MAX_CORRECTION_SLOTS);
|
|
656
|
+
```
|
|
657
|
+
|
|
658
|
+
**Benefit**: Enables scaled corrections based on actual severity.
|
|
659
|
+
|
|
660
|
+
### Calculation
|
|
661
|
+
|
|
662
|
+
```javascript
|
|
663
|
+
// Calculate how many steps beyond target
|
|
664
|
+
const currentSpreadSteps = calculateCurrentSpreadGap();
|
|
665
|
+
const targetSpreadSteps = calculateTargetSpread();
|
|
666
|
+
const outOfSpreadDistance = Math.max(0, currentSpreadSteps - targetSpreadSteps);
|
|
667
|
+
|
|
668
|
+
mgr.outOfSpread = outOfSpreadDistance; // 0 = in spread, 3+ = out
|
|
669
|
+
```
|
|
670
|
+
|
|
671
|
+
---
|
|
672
|
+
|
|
673
|
+
## Pipeline Safety & Diagnostics
|
|
674
|
+
|
|
675
|
+
The bot includes a comprehensive pipeline monitoring system to prevent indefinite blocking and enable operational visibility.
|
|
676
|
+
|
|
677
|
+
### Pipeline Timeout Safeguard
|
|
678
|
+
|
|
679
|
+
**Problem**: Pipeline checks could block indefinitely if operations hung due to network issues or stuck corrections.
|
|
680
|
+
|
|
681
|
+
**Solution**: 5-minute timeout with automatic, non-destructive recovery.
|
|
682
|
+
|
|
683
|
+
**Configuration** (modules/constants.ts):
|
|
684
|
+
```javascript
|
|
685
|
+
PIPELINE_TIMING: {
|
|
686
|
+
TIMEOUT_MS: 300000, // 5 minutes
|
|
687
|
+
}
|
|
688
|
+
```
|
|
689
|
+
|
|
690
|
+
**How It Works**:
|
|
691
|
+
- `isPipelineEmpty()` tracks when pipeline operations started blocking via `_pipelineBlockedSince` timestamp
|
|
692
|
+
- If blockage exceeds 5 minutes, `clearStalePipelineOperations()` is called
|
|
693
|
+
- Non-destructive recovery: clears operation flags only, does NOT delete orders or modify grid state
|
|
694
|
+
- Recovery called from `_executeMaintenanceLogic()` during periodic maintenance checks
|
|
695
|
+
|
|
696
|
+
**Location**: `modules/order/manager.ts` (`isPipelineEmpty()` and `clearStalePipelineOperations()`)
|
|
697
|
+
|
|
698
|
+
### Data Flow
|
|
699
|
+
|
|
700
|
+
```mermaid
|
|
701
|
+
sequenceDiagram
|
|
702
|
+
participant Bot as DexBotClass
|
|
703
|
+
participant Mgr as OrderManager
|
|
704
|
+
participant Sync as SyncEngine
|
|
705
|
+
participant Strat as StrategyEngine
|
|
706
|
+
participant Acct as Accountant
|
|
707
|
+
participant Chain as Blockchain
|
|
708
|
+
|
|
709
|
+
Bot->>Mgr: Initialize grid
|
|
710
|
+
Mgr->>Acct: Reset funds
|
|
711
|
+
Mgr->>Sync: Fetch account balances
|
|
712
|
+
Sync->>Chain: Get balances
|
|
713
|
+
Chain-->>Sync: Balance data
|
|
714
|
+
Sync->>Acct: Set account totals
|
|
715
|
+
Acct->>Acct: Recalculate funds
|
|
716
|
+
|
|
717
|
+
Note over Mgr: Grid initialized, ready for trading
|
|
718
|
+
|
|
719
|
+
Bot->>Sync: Detect fills (polling)
|
|
720
|
+
Sync->>Chain: Get open orders
|
|
721
|
+
Chain-->>Sync: Order data
|
|
722
|
+
Sync->>Mgr: syncFromOpenOrders()
|
|
723
|
+
Mgr->>Mgr: processFilledOrders()
|
|
724
|
+
Strat->>Acct: Update funds (cache proceeds)
|
|
725
|
+
Strat->>Strat: Identify shortages/surpluses
|
|
726
|
+
Strat->>Mgr: Rotate orders
|
|
727
|
+
Mgr->>Acct: Deduct funds (atomic)
|
|
728
|
+
Mgr->>Chain: Place new orders
|
|
729
|
+
```
|
|
730
|
+
|
|
731
|
+
---
|
|
732
|
+
|
|
733
|
+
## Order State Machine
|
|
734
|
+
|
|
735
|
+
Orders transition through three primary **states** during their lifecycle. **SPREAD** is an *order type* (like BUY or SELL), not a state — spread-zone slots always carry `state: VIRTUAL`.
|
|
736
|
+
|
|
737
|
+
```mermaid
|
|
738
|
+
stateDiagram-v2
|
|
739
|
+
[*] --> VIRTUAL: Grid created
|
|
740
|
+
|
|
741
|
+
VIRTUAL --> ACTIVE: Order placed on-chain
|
|
742
|
+
VIRTUAL --> VIRTUAL: Rotated or rebuilt
|
|
743
|
+
|
|
744
|
+
ACTIVE --> PARTIAL: Partial fill detected
|
|
745
|
+
ACTIVE --> VIRTUAL: Order cancelled/rotated
|
|
746
|
+
|
|
747
|
+
PARTIAL --> ACTIVE: Consolidated (size >= ideal)
|
|
748
|
+
PARTIAL --> VIRTUAL: Moved/consolidated
|
|
749
|
+
|
|
750
|
+
VIRTUAL --> [*]: Grid regenerated
|
|
751
|
+
|
|
752
|
+
note right of VIRTUAL
|
|
753
|
+
No on-chain presence
|
|
754
|
+
Funds reserved in virtual pool
|
|
755
|
+
Includes spread-zone placeholders
|
|
756
|
+
end note
|
|
757
|
+
|
|
758
|
+
note right of ACTIVE
|
|
759
|
+
On-chain with orderId
|
|
760
|
+
Funds locked/committed
|
|
761
|
+
end note
|
|
762
|
+
|
|
763
|
+
note right of PARTIAL
|
|
764
|
+
Partially filled on-chain
|
|
765
|
+
Waiting for consolidation
|
|
766
|
+
end note
|
|
767
|
+
```
|
|
768
|
+
|
|
769
|
+
### State Transition Rules
|
|
770
|
+
|
|
771
|
+
| From State | To State | Trigger | Fund Impact |
|
|
772
|
+
|------------|----------|---------|-------------|
|
|
773
|
+
| VIRTUAL | ACTIVE | Order placed | Deduct from `chainFree` |
|
|
774
|
+
| ACTIVE | PARTIAL | Partial fill | Reduce `committed` by filled amount |
|
|
775
|
+
| ACTIVE | VIRTUAL | Order cancelled | Add back to `chainFree` |
|
|
776
|
+
| PARTIAL | ACTIVE | Consolidation | Update to `idealSize` (consumes available funds) |
|
|
777
|
+
| PARTIAL | VIRTUAL | Order moved | Release funds, re-reserve |
|
|
778
|
+
|
|
779
|
+
### Critical: Phantom Order Prevention
|
|
780
|
+
|
|
781
|
+
A **phantom order** is an illegal state where an order exists as ACTIVE/PARTIAL without a corresponding blockchain `orderId`. This corrupts fund tracking and causes "doubled funds" warnings.
|
|
782
|
+
|
|
783
|
+
**Why Phantoms Occur**:
|
|
784
|
+
1. **Grid Resize Bug**: `Grid._updateOrdersForSide()` could force VIRTUAL → ACTIVE without blockchain confirmation
|
|
785
|
+
2. **Sync Gap**: Orders without orderId could remain ACTIVE indefinitely if sync logic skipped them
|
|
786
|
+
3. **No Validation**: No centralized check prevented invalid state assignments
|
|
787
|
+
|
|
788
|
+
**Prevention System** (Three-Layer Defense):
|
|
789
|
+
|
|
790
|
+
| Layer | Location | Mechanism |
|
|
791
|
+
|-------|----------|-----------|
|
|
792
|
+
| **Guard** | `manager.ts::_updateOrder()` | Centralized validation in `_updateOrder()` rejects ACTIVE/PARTIAL without orderId, auto-downgrades to VIRTUAL |
|
|
793
|
+
| **Grid Protection** | `grid.ts` | Preserve order state during resize: `state: order.state` instead of forcing ACTIVE |
|
|
794
|
+
| **Sync Cleanup** | `sync_engine.ts` | Detect orders without orderId and convert to SPREAD placeholders; prevent phantom fills from triggering rebalancing |
|
|
795
|
+
|
|
796
|
+
**Verification**:
|
|
797
|
+
- Direct state assignment in code review: All transitions go through `_updateOrder()` (cannot bypass)
|
|
798
|
+
- Automated tests: `tests/repro_phantom_orders.ts` confirms all prevention layers work
|
|
799
|
+
- Logging: Any phantom creation attempt is logged as ERROR with context
|
|
800
|
+
|
|
801
|
+
---
|
|
802
|
+
|
|
803
|
+
## Fund Flow Architecture
|
|
804
|
+
|
|
805
|
+
The fund tracking system uses atomic operations to prevent race conditions and overdrafts.
|
|
806
|
+
|
|
807
|
+
```mermaid
|
|
808
|
+
graph LR
|
|
809
|
+
subgraph "Blockchain Balances"
|
|
810
|
+
CHAIN_FREE[chainFree<br/>Unallocated funds]
|
|
811
|
+
CHAIN_COMMITTED[committed.chain<br/>On-chain orders]
|
|
812
|
+
end
|
|
813
|
+
|
|
814
|
+
subgraph "Internal Tracking"
|
|
815
|
+
VIRTUAL[virtual<br/>Reserved for VIRTUAL orders]
|
|
816
|
+
GRID_COMMITTED[committed.grid<br/>ACTIVE order sizes]
|
|
817
|
+
end
|
|
818
|
+
|
|
819
|
+
subgraph "Calculated Values"
|
|
820
|
+
AVAILABLE[available<br/>= chainFree - virtual<br/>- fees]
|
|
821
|
+
TOTAL_CHAIN[total.chain<br/>= chainFree + committed.chain]
|
|
822
|
+
TOTAL_GRID[total.grid<br/>= committed.grid + virtual]
|
|
823
|
+
end
|
|
824
|
+
|
|
825
|
+
CHAIN_FREE --> AVAILABLE
|
|
826
|
+
VIRTUAL --> AVAILABLE
|
|
827
|
+
|
|
828
|
+
CHAIN_FREE --> TOTAL_CHAIN
|
|
829
|
+
CHAIN_COMMITTED --> TOTAL_CHAIN
|
|
830
|
+
|
|
831
|
+
GRID_COMMITTED --> TOTAL_GRID
|
|
832
|
+
VIRTUAL --> TOTAL_GRID
|
|
833
|
+
|
|
834
|
+
style AVAILABLE fill:#90EE90
|
|
835
|
+
style VIRTUAL fill:#87CEEB
|
|
836
|
+
```
|
|
837
|
+
|
|
838
|
+
### Fund Components Explained
|
|
839
|
+
|
|
840
|
+
- **chainFree**: Unallocated funds on blockchain (from `accountTotals.buyFree/sellFree`)
|
|
841
|
+
- **committed.chain**: Funds locked in on-chain orders (ACTIVE orders with `orderId`)
|
|
842
|
+
- **committed.grid**: Internal tracking of ACTIVE order sizes
|
|
843
|
+
- **virtual**: Funds reserved for VIRTUAL orders (not yet on-chain)
|
|
844
|
+
- **available**: Free funds for new orders = `max(0, chainFree - virtual - fees)`
|
|
845
|
+
|
|
846
|
+
### Atomic Fund Operations
|
|
847
|
+
|
|
848
|
+
```mermaid
|
|
849
|
+
sequenceDiagram
|
|
850
|
+
participant Strat as StrategyEngine
|
|
851
|
+
participant Mgr as OrderManager
|
|
852
|
+
participant Acct as Accountant
|
|
853
|
+
|
|
854
|
+
Note over Mgr: Want to place order<br/>size = 100
|
|
855
|
+
|
|
856
|
+
Mgr->>Acct: tryDeductFromChainFree(type, 100)
|
|
857
|
+
|
|
858
|
+
alt Sufficient funds (available >= 100)
|
|
859
|
+
Acct->>Acct: chainFree -= 100
|
|
860
|
+
Acct->>Acct: virtual += 100
|
|
861
|
+
Acct-->>Mgr: true (success)
|
|
862
|
+
Mgr->>Mgr: Place order
|
|
863
|
+
else Insufficient funds
|
|
864
|
+
Acct-->>Mgr: false (failed)
|
|
865
|
+
Note over Mgr: Order not placed<br/>No fund leak
|
|
866
|
+
end
|
|
867
|
+
```
|
|
868
|
+
|
|
869
|
+
---
|
|
870
|
+
|
|
871
|
+
## Grid Topology
|
|
872
|
+
|
|
873
|
+
The grid uses a unified "Master Rail" with a dynamic boundary that shifts as fills occur.
|
|
874
|
+
|
|
875
|
+
```mermaid
|
|
876
|
+
graph LR
|
|
877
|
+
subgraph "Master Rail (Price Levels)"
|
|
878
|
+
direction LR
|
|
879
|
+
B0[buy-0<br/>VIRTUAL]
|
|
880
|
+
B1[buy-1<br/>ACTIVE]
|
|
881
|
+
B2[buy-2<br/>ACTIVE]
|
|
882
|
+
BOUNDARY{Boundary<br/>Index}
|
|
883
|
+
S0[spread-0<br/>SPREAD]
|
|
884
|
+
S1[spread-1<br/>SPREAD]
|
|
885
|
+
S2[spread-2<br/>SPREAD]
|
|
886
|
+
SELL0[sell-173<br/>ACTIVE]
|
|
887
|
+
SELL1[sell-174<br/>ACTIVE]
|
|
888
|
+
SELL2[sell-175<br/>VIRTUAL]
|
|
889
|
+
end
|
|
890
|
+
|
|
891
|
+
B0 --> B1 --> B2 --> BOUNDARY
|
|
892
|
+
BOUNDARY --> S0 --> S1 --> S2
|
|
893
|
+
S2 --> SELL0 --> SELL1 --> SELL2
|
|
894
|
+
|
|
895
|
+
style B1 fill:#90EE90
|
|
896
|
+
style B2 fill:#90EE90
|
|
897
|
+
style S0 fill:#FFD700
|
|
898
|
+
style S1 fill:#FFD700
|
|
899
|
+
style S2 fill:#FFD700
|
|
900
|
+
style SELL0 fill:#FF6B6B
|
|
901
|
+
style SELL1 fill:#FF6B6B
|
|
902
|
+
style BOUNDARY fill:#87CEEB
|
|
903
|
+
```
|
|
904
|
+
|
|
905
|
+
### Boundary Movement
|
|
906
|
+
|
|
907
|
+
- **Buy Fill**: `boundaryIdx -= 1` (shift left/down)
|
|
908
|
+
- **Sell Fill**: `boundaryIdx += 1` (shift right/up)
|
|
909
|
+
|
|
910
|
+
### Role Assignment
|
|
911
|
+
|
|
912
|
+
- **BUY**: Slots `[0, boundaryIdx]`
|
|
913
|
+
- **SPREAD**: Slots `[boundaryIdx + 1, boundaryIdx + G]` where G = spread gap size (empty slots). Actual gaps = G + 1.
|
|
914
|
+
- **SELL**: Slots `[boundaryIdx + G + 1, N]`
|
|
915
|
+
|
|
916
|
+
---
|
|
917
|
+
|
|
918
|
+
## Key Operations
|
|
919
|
+
|
|
920
|
+
### 1. Fill Processing Flow
|
|
921
|
+
|
|
922
|
+
```mermaid
|
|
923
|
+
sequenceDiagram
|
|
924
|
+
participant Chain as Blockchain
|
|
925
|
+
participant Sync as SyncEngine
|
|
926
|
+
participant Mgr as OrderManager
|
|
927
|
+
participant Acct as Accountant
|
|
928
|
+
participant Strat as StrategyEngine
|
|
929
|
+
|
|
930
|
+
Chain->>Mgr: Order filled
|
|
931
|
+
Mgr->>Mgr: Detect fill
|
|
932
|
+
Mgr->>Strat: processFillsOnly([fills])
|
|
933
|
+
|
|
934
|
+
Strat->>Acct: Add proceeds to chainFree
|
|
935
|
+
|
|
936
|
+
Mgr->>Strat: calculateTargetGrid(params)
|
|
937
|
+
Strat-->>Mgr: target grid
|
|
938
|
+
Mgr->>Mgr: Apply rotations via WorkingGrid
|
|
939
|
+
Mgr->>Acct: Deduct BTS fees during recalculateFunds
|
|
940
|
+
Mgr->>Mgr: Consolidate dust partials
|
|
941
|
+
```
|
|
942
|
+
|
|
943
|
+
### 2. Order Rotation (Crawl Mechanism)
|
|
944
|
+
|
|
945
|
+
```mermaid
|
|
946
|
+
graph TB
|
|
947
|
+
START[Fill Detected] --> SHIFT[Shift Boundary]
|
|
948
|
+
SHIFT --> IDENTIFY[Identify Shortages<br/>Empty slots in active window]
|
|
949
|
+
IDENTIFY --> CHECK{Surpluses<br/>Available?}
|
|
950
|
+
|
|
951
|
+
CHECK -->|Yes| CRAWL[Select Crawl Candidate<br/>Furthest active order]
|
|
952
|
+
CHECK -->|No| NEW[Place New Order<br/>if funds available]
|
|
953
|
+
|
|
954
|
+
CRAWL --> COMPARE{Shortage price<br/>better than<br/>surplus price?}
|
|
955
|
+
COMPARE -->|Yes| ROTATE[Rotate Order<br/>Cancel old, place new]
|
|
956
|
+
COMPARE -->|No| SKIP[Skip rotation]
|
|
957
|
+
|
|
958
|
+
ROTATE --> NEXT{More<br/>shortages?}
|
|
959
|
+
SKIP --> NEXT
|
|
960
|
+
NEW --> NEXT
|
|
961
|
+
|
|
962
|
+
NEXT -->|Yes| IDENTIFY
|
|
963
|
+
NEXT -->|No| DONE[Rebalance Complete]
|
|
964
|
+
```
|
|
965
|
+
|
|
966
|
+
### 3. Grid Divergence Detection
|
|
967
|
+
|
|
968
|
+
The grid divergence system monitors and corrects misalignment between ideal grid state and persistent blockchain state.
|
|
969
|
+
|
|
970
|
+
```mermaid
|
|
971
|
+
graph TB
|
|
972
|
+
START[Grid Update Triggered] --> CALC[Calculate Ideal Grid<br/>Based on current funds]
|
|
973
|
+
CALC --> RELOAD[Force Reload Persisted Grid<br/>Ensure fresh blockchain state]
|
|
974
|
+
RELOAD --> COMPARE[Compare to Persisted Grid]
|
|
975
|
+
COMPARE --> RMS[Calculate RMS Divergence<br/>For PARTIAL orders only]
|
|
976
|
+
|
|
977
|
+
RMS --> CHECK{RMS > Threshold?}
|
|
978
|
+
CHECK -->|Yes| UPDATE[Update Grid Sizes<br/>Trigger rebalance]
|
|
979
|
+
CHECK -->|No| SKIP[Skip update]
|
|
980
|
+
|
|
981
|
+
UPDATE --> PERSIST[Persist New Grid State]
|
|
982
|
+
PERSIST --> DONE[Complete]
|
|
983
|
+
SKIP --> DONE
|
|
984
|
+
```
|
|
985
|
+
|
|
986
|
+
**Key Improvement (v1.0.0)**: Force reload mechanism now ensures fresh persisted grid data before comparison, preventing stale cache from causing false divergence detections.
|
|
987
|
+
|
|
988
|
+
---
|
|
989
|
+
|
|
990
|
+
## Concurrency & Locking
|
|
991
|
+
|
|
992
|
+
The system uses order-level locks to prevent race conditions during async operations. For the reconciler-specific lock hierarchy and the historical `_syncLock`/`_gridLock` swap, see [GRID_RECONCILE.md](GRID_RECONCILE.md#lock-hierarchy).
|
|
993
|
+
|
|
994
|
+
### Lock Mechanism
|
|
995
|
+
|
|
996
|
+
```mermaid
|
|
997
|
+
sequenceDiagram
|
|
998
|
+
participant Sync as SyncEngine
|
|
999
|
+
participant Strat as StrategyEngine
|
|
1000
|
+
participant Mgr as OrderManager
|
|
1001
|
+
|
|
1002
|
+
Note over Sync: Detected fill on order P1
|
|
1003
|
+
Sync->>Mgr: lockOrders([P1])
|
|
1004
|
+
Sync->>Sync: Process fill
|
|
1005
|
+
|
|
1006
|
+
par Concurrent Strategy Check
|
|
1007
|
+
Strat->>Mgr: isOrderLocked(P1)?
|
|
1008
|
+
Mgr-->>Strat: true
|
|
1009
|
+
Note over Strat: Skip P1 (locked)
|
|
1010
|
+
end
|
|
1011
|
+
|
|
1012
|
+
Sync->>Sync: Complete fill processing
|
|
1013
|
+
Sync->>Mgr: unlockOrders([P1])
|
|
1014
|
+
|
|
1015
|
+
Note over Strat: Next cycle can now process P1
|
|
1016
|
+
```
|
|
1017
|
+
|
|
1018
|
+
### Lock Lifetime
|
|
1019
|
+
|
|
1020
|
+
- **Default timeout**: 5-10 seconds
|
|
1021
|
+
- **Auto-expiry**: Prevents deadlocks from crashes
|
|
1022
|
+
- **Best practice**: Always use try/finally to ensure unlock
|
|
1023
|
+
|
|
1024
|
+
---
|
|
1025
|
+
|
|
1026
|
+
## Module Responsibilities Summary
|
|
1027
|
+
|
|
1028
|
+
| Module | Primary Responsibility | Key Functions |
|
|
1029
|
+
|--------|----------------------|---------------|
|
|
1030
|
+
| **OrderManager** | Central coordinator, state management | `_updateOrder()`, `lockOrders()`, `getOrdersByTypeAndState()` |
|
|
1031
|
+
| **Accountant** | Fund tracking, fee management | `recalculateFunds()`, `tryDeductFromChainFree()`, `_verifyFundInvariants()` |
|
|
1032
|
+
| **StrategyEngine** | Grid rebalancing, rotation target calculation | `calculateTargetGrid()`, `processFillsOnly()`, `hasAnyDust()` |
|
|
1033
|
+
| **SyncEngine** | Blockchain sync, fill detection | `syncFromOpenOrders()`, `synchronizeWithChain()` |
|
|
1034
|
+
| **Grid** | Grid creation, sizing, divergence | `createOrderGrid()`, `compareGrids()`, `checkAndUpdateGridIfNeeded()` |
|
|
1035
|
+
| **Utils** | Shared utilities, conversions | `quantizeFloat()`, `normalizeInt()` (`math.ts`); order predicates (`order.ts`); COW action building (`validate.ts`); price derivation (`system.ts`) |
|
|
1036
|
+
| **Logger** | Formatted logging, diagnostics | `logOrderGrid()`, `logFundsStatus()` |
|
|
1037
|
+
|
|
1038
|
+
---
|
|
1039
|
+
|
|
1040
|
+
## Dynamic Configuration Refresh
|
|
1041
|
+
|
|
1042
|
+
The bot implementation supports runtime updates to specific configuration parameters without requiring a process restart. This is handled via a **Periodic Configuration Refresh** mechanism.
|
|
1043
|
+
|
|
1044
|
+
### The Refresh Cycle
|
|
1045
|
+
|
|
1046
|
+
Every 4 hours (default `BLOCKCHAIN_FETCH_INTERVAL_MIN`), the bot performs the following safe refresh cycle:
|
|
1047
|
+
|
|
1048
|
+
1. **Thread-Safe Load**: The bot re-reads `profiles/bots.json` using `readBotsFileWithLock` to ensure it doesn't collide with manual edits or the CLI manager.
|
|
1049
|
+
2. **Memory Update**: It identifies its own configuration entry and updates its internal memory state (`this.config` and `manager.config`).
|
|
1050
|
+
3. **Non-Disruptive Application**: The refresh is designed to be **passive**. It updates valuation anchors but does **not** trigger on-chain order movement automatically.
|
|
1051
|
+
|
|
1052
|
+
### Configuration Authority: `startPrice` / `poolRef`
|
|
1053
|
+
|
|
1054
|
+
The `startPrice` parameter follows a strict hierarchy of authority:
|
|
1055
|
+
|
|
1056
|
+
| Setting Type | Source | Behavior |
|
|
1057
|
+
|--------------|--------|----------|
|
|
1058
|
+
| **Numeric** | `bots.json` | **Single Source of Truth**. Blocks all auto-derivation. Used as a fixed anchor for valuation and grid resets. |
|
|
1059
|
+
| **"pool"** | Blockchain | Derived from current Liquidity Pool price during resets or 4h refresh cycles. |
|
|
1060
|
+
| **"pool" + poolRef** | Blockchain | Same as `"pool"`, but pool is fetched directly by ID (`get_objects`) bypassing discovery. Set `poolRef` in `bots.json` (e.g. `"1.19.48"`) to pin a proxy pool. |
|
|
1061
|
+
| **"book"** | Blockchain | Derived from current order book price during resets or 4h refresh cycles. |
|
|
1062
|
+
|
|
1063
|
+
---
|
|
1064
|
+
|
|
1065
|
+
## Data Persistence
|
|
1066
|
+
|
|
1067
|
+
```mermaid
|
|
1068
|
+
graph LR
|
|
1069
|
+
subgraph "In-Memory State"
|
|
1070
|
+
ORDERS[orders Map<br/>Grid state]
|
|
1071
|
+
FUNDS[funds Object<br/>Fund tracking]
|
|
1072
|
+
INDICES[Indices<br/>_ordersByState<br/>_ordersByType]
|
|
1073
|
+
end
|
|
1074
|
+
|
|
1075
|
+
subgraph "Persisted State"
|
|
1076
|
+
ORDERS_JSON[<botKey>.json<br/>Grid snapshot<br/>feesOwed, boundaryIdx, btsBalance]
|
|
1077
|
+
BOTS_JSON[bots.json<br/>Bot config]
|
|
1078
|
+
end
|
|
1079
|
+
|
|
1080
|
+
ORDERS --> ORDERS_JSON
|
|
1081
|
+
FUNDS --> ORDERS_JSON
|
|
1082
|
+
|
|
1083
|
+
ORDERS_JSON -.->|Load on startup| ORDERS
|
|
1084
|
+
ORDERS_JSON -.->|Load on startup| FUNDS
|
|
1085
|
+
|
|
1086
|
+
BOTS_JSON -.->|Load on startup| CONFIG[Bot Config]
|
|
1087
|
+
```
|
|
1088
|
+
|
|
1089
|
+
### Persistence Strategy
|
|
1090
|
+
|
|
1091
|
+
- **Grid state**: Persisted after every rebalance to `<botKey>.json` in `profiles/orders/`
|
|
1092
|
+
- **Fund state**: Available funds derived from blockchain balances at runtime (no separate persistence needed)
|
|
1093
|
+
- **Retry logic**: 3 attempts with exponential backoff
|
|
1094
|
+
- **Graceful degradation**: Bot continues if persistence fails (in-memory only)
|
|
1095
|
+
|
|
1096
|
+
---
|
|
1097
|
+
|
|
1098
|
+
## Memory-Only Integer Tracking
|
|
1099
|
+
|
|
1100
|
+
The system has been optimized to use a "memory-driven" model for order updates, eliminating redundant blockchain API calls during normal operation.
|
|
1101
|
+
|
|
1102
|
+
### Key Changes
|
|
1103
|
+
|
|
1104
|
+
**1. Raw Order Cache (`rawOnChain`)**
|
|
1105
|
+
- Grid slots now store exact blockchain order representations (integers/satoshis) in a `rawOnChain` cache
|
|
1106
|
+
- **Birth**: Cache populated immediately after successful order placement using broadcasted arguments
|
|
1107
|
+
- **Partial Fills**: Cache updated in-place via integer subtraction (subtracting filled satoshis from `for_sale`)
|
|
1108
|
+
- **Updates/Rotations**: Cache refreshed with adjusted integers returned by build process
|
|
1109
|
+
|
|
1110
|
+
**2. Eliminated Redundant API Calls**
|
|
1111
|
+
- Removed all `readOpenOrders()` calls from `_buildSizeUpdateOps()` and `_buildRotationOps()`
|
|
1112
|
+
- Removed `computeVirtualOpenOrders()` logic that was redundantly fetching entire account state
|
|
1113
|
+
- The bot now trusts its internal state, backed by real-time fill listener, to build transactions
|
|
1114
|
+
|
|
1115
|
+
**3. Refactored `buildUpdateOrderOp()`**
|
|
1116
|
+
- Updated to support optional `cachedOrder` parameter
|
|
1117
|
+
- Allows callers to bypass blockchain queries if they have raw state in memory
|
|
1118
|
+
- Returns `finalInts` along with operation data for local tracking
|
|
1119
|
+
|
|
1120
|
+
**4. Self-Healing Resilience**
|
|
1121
|
+
- Maintains "State Recovery Sync" fallback
|
|
1122
|
+
- If a memory-driven transaction fails, bot catches error and performs a full refresh
|
|
1123
|
+
- Ensures internal ledger stays synchronized with BitShares blockchain
|
|
1124
|
+
|
|
1125
|
+
### Benefits
|
|
1126
|
+
- **Faster reaction time**: No waiting for blockchain queries during order updates
|
|
1127
|
+
- **Reduced API load**: Fewer fetches, less network congestion
|
|
1128
|
+
- **Mathematical precision**: Integer-based tracking prevents float precision errors
|
|
1129
|
+
- *See [FUND_MOVEMENT_AND_ACCOUNTING.md § 5.5](FUND_MOVEMENT_AND_ACCOUNTING.md#55-precision--quantization-patch-14) for quantization utilities and best practices*
|
|
1130
|
+
- **Fallback safety**: Automatic recovery if memory state becomes inconsistent
|
|
1131
|
+
|
|
1132
|
+
### Performance Impact
|
|
1133
|
+
- Batch operations (size updates, rotations) now run without any blockchain fetches
|
|
1134
|
+
- Only placement operations and recovery syncs query the blockchain
|
|
1135
|
+
- Estimated **10-20x speedup** for high-frequency operations
|
|
1136
|
+
|
|
1137
|
+
---
|
|
1138
|
+
|
|
1139
|
+
## Error Handling & Safety
|
|
1140
|
+
|
|
1141
|
+
### Fund Invariants
|
|
1142
|
+
|
|
1143
|
+
The system continuously monitors three mathematical invariants:
|
|
1144
|
+
|
|
1145
|
+
1. **Account Equality**: `chainTotal = chainFree + committed.chain`
|
|
1146
|
+
2. **Committed Ceiling**: `committed.grid <= chainTotal`
|
|
1147
|
+
3. **Available Leak Check**: `available <= chainFree`
|
|
1148
|
+
|
|
1149
|
+
**Tolerance**: 0.1% (to account for fees and rounding)
|
|
1150
|
+
|
|
1151
|
+
### Index Consistency
|
|
1152
|
+
|
|
1153
|
+
- **Validation**: `validateIndices()` checks Map ↔ Set consistency
|
|
1154
|
+
- **Repair**: `_repairIndices()` rebuilds indices if corruption detected
|
|
1155
|
+
- **Defensive**: Called after critical operations
|
|
1156
|
+
|
|
1157
|
+
---
|
|
1158
|
+
|
|
1159
|
+
## Performance Considerations
|
|
1160
|
+
|
|
1161
|
+
### Optimization Strategies
|
|
1162
|
+
|
|
1163
|
+
1. **Batch fund recalculation**: `pauseFundRecalc()` / `resumeFundRecalc()`
|
|
1164
|
+
2. **Index-based lookups**: O(1) access via `_ordersByState` and `_ordersByType`
|
|
1165
|
+
3. **Lock expiry**: Prevents permanent blocking from crashes
|
|
1166
|
+
4. **Fee caching**: Reduces blockchain API calls
|
|
1167
|
+
|
|
1168
|
+
### Metrics Tracking
|
|
1169
|
+
|
|
1170
|
+
```javascript
|
|
1171
|
+
manager.getMetrics()
|
|
1172
|
+
// Returns:
|
|
1173
|
+
// - fundRecalcCount
|
|
1174
|
+
// - invariantViolations
|
|
1175
|
+
// - lockAcquisitions
|
|
1176
|
+
// - stateTransitions
|
|
1177
|
+
// - lastSyncDurationMs
|
|
1178
|
+
```
|
|
1179
|
+
|
|
1180
|
+
---
|
|
1181
|
+
|
|
1182
|
+
### Zero-Dependency Policy
|
|
1183
|
+
|
|
1184
|
+
DEXBot2 operates under a **zero mandatory production dependency** policy. The dependency tree is empty — every production capability (blockchain client, WebSocket transport via Node's native `globalThis.WebSocket`, crypto/signing, serialization, testing, price feeds, credential vault) is implemented natively within the codebase. Requires **Node.js >= 22.12** for the built-in WebSocket.
|
|
1185
|
+
|
|
1186
|
+
**Why:** Trading bots handle real money. Every external dependency is a supply-chain risk surface. Keeping the dependency tree empty means no `npm audit` surprises, no supply-chain attacks on upstream packages, and no version-migration overhead for the core runtime.
|
|
1187
|
+
|
|
1188
|
+
**Special case — trading bots:** This level of dependency discipline is rare in open-source trading software. Established projects (Gekko, Freqtrade, Hummingbot) carry 15–20+ production dependencies. DEXBot2's empty dependency tree is a deliberate architectural choice, not an accidental outcome — it reflects the project's priority of operational safety over developer convenience.
|
|
1189
|
+
|
|
1190
|
+
**What this means in practice:**
|
|
1191
|
+
- Blockchain connectivity (`bitshares-native/`) — hand-rolled from protocol primitives
|
|
1192
|
+
- Elliptic curve crypto (secp256k1) — native JS, zero native addons
|
|
1193
|
+
- Testing — `node:assert`, no Jest/Mocha/Vitest
|
|
1194
|
+
- Persistence — JSON flat files, no SQLite/ORM
|
|
1195
|
+
- Price sources — native candle fetching, no CCXT/CoinGecko
|
|
1196
|
+
- Process management — PM2 ecosystem or direct Node.js, no Docker requirement
|
|
1197
|
+
|
|
1198
|
+
### Testing Strategy & Quality Assurance
|
|
1199
|
+
|
|
1200
|
+
DEXBot2 uses a native Node.js `assert` testing strategy to ensure reliability without heavy dependencies.
|
|
1201
|
+
|
|
1202
|
+
### Test Coverage by Module
|
|
1203
|
+
|
|
1204
|
+
```mermaid
|
|
1205
|
+
graph LR
|
|
1206
|
+
A["Logic Tests<br/>(tests/test_*_logic.ts)"]
|
|
1207
|
+
B["Integration Tests<br/>(tests/test_*.ts)"]
|
|
1208
|
+
C["Signal Tests<br/>(tests/test_*_signal*.ts)"]
|
|
1209
|
+
D["Credit/Debt Tests<br/>(tests/test_*_credit*.ts)"]
|
|
1210
|
+
|
|
1211
|
+
A -->|Manager, State Machine| A1["manager_logic"]
|
|
1212
|
+
A -->|Fund Tracking| A2["accounting_logic"]
|
|
1213
|
+
A -->|Grid Creation| A3["grid_logic"]
|
|
1214
|
+
A -->|Rebalancing| A4["strategy_logic"]
|
|
1215
|
+
A -->|Sync Logic| A5["sync_logic"]
|
|
1216
|
+
|
|
1217
|
+
B -->|Multi-step Scenarios| B1["Market Scenarios"]
|
|
1218
|
+
B -->|Edge Cases| B2["Partial Order Tests"]
|
|
1219
|
+
B -->|Real-world Scenarios| B3["Fills/FEE Tests"]
|
|
1220
|
+
|
|
1221
|
+
C -->|Dynamic Weight| C1["dynamic_weight"]
|
|
1222
|
+
C -->|Derivative Trap| C2["derivative_signal"]
|
|
1223
|
+
C -->|Momentum Gate| C3["momentum_gate"]
|
|
1224
|
+
|
|
1225
|
+
D -->|CR Planner| D1["cr_planner"]
|
|
1226
|
+
D -->|Credit Runtime| D2["credit_runtime"]
|
|
1227
|
+
D -->|MPA Wiring| D3["dexbot_credit_wiring"]
|
|
1228
|
+
```
|
|
1229
|
+
|
|
1230
|
+
### Running Tests
|
|
1231
|
+
|
|
1232
|
+
```bash
|
|
1233
|
+
# Run all tests (native assert)
|
|
1234
|
+
npm test
|
|
1235
|
+
|
|
1236
|
+
# Specific logic area
|
|
1237
|
+
tsx tests/test_accounting_logic.ts
|
|
1238
|
+
|
|
1239
|
+
# Signal tests
|
|
1240
|
+
tsx tests/test_market_adapter_signal_gates.ts
|
|
1241
|
+
tsx tests/test_dynamic_weight_override_wiring.ts
|
|
1242
|
+
|
|
1243
|
+
# Credit/debt tests
|
|
1244
|
+
tsx tests/test_cr_planner.ts
|
|
1245
|
+
tsx tests/test_dexbot_credit_wiring.ts
|
|
1246
|
+
```
|
|
1247
|
+
|
|
1248
|
+
### Test Quality Metrics
|
|
1249
|
+
|
|
1250
|
+
**Coverage Goals:**
|
|
1251
|
+
- ✅ All public methods have tests
|
|
1252
|
+
- ✅ All invariants verified automatically
|
|
1253
|
+
- ✅ Edge cases covered (zero funds, max orders, etc.)
|
|
1254
|
+
- ✅ Concurrent operations tested with locks
|
|
1255
|
+
- ✅ State transitions validated end-to-end
|
|
1256
|
+
- ✅ Signal pipelines tested (dynamic weight, derivative traps)
|
|
1257
|
+
- ✅ Credit/debt runtime tested (CR planner, MPA wiring)
|
|
1258
|
+
|
|
1259
|
+
**Test Suite Evolution:**
|
|
1260
|
+
- 50+ test cases for signal intelligence and credit runtime
|
|
1261
|
+
- Dynamic weight override and market adapter signal gate tests
|
|
1262
|
+
- Derivative momentum gate and signal trap regression tests
|
|
1263
|
+
- Credit/debt tests with CR planner and MPA wiring validation
|
|
1264
|
+
|
|
1265
|
+
### Testing Best Practices
|
|
1266
|
+
|
|
1267
|
+
**For Developers:**
|
|
1268
|
+
|
|
1269
|
+
1. **Run tests before commits**
|
|
1270
|
+
```bash
|
|
1271
|
+
npm test
|
|
1272
|
+
```
|
|
1273
|
+
|
|
1274
|
+
2. **Add tests for new features**
|
|
1275
|
+
- Follow patterns in existing tests
|
|
1276
|
+
- Test fund impact of new logic
|
|
1277
|
+
- Include edge cases
|
|
1278
|
+
|
|
1279
|
+
3. **Verify invariants**
|
|
1280
|
+
```javascript
|
|
1281
|
+
expect(manager.validateIndices()).toBe(true);
|
|
1282
|
+
expect(chainTotal === chainFree + chainCommitted).toBe(true);
|
|
1283
|
+
```
|
|
1284
|
+
|
|
1285
|
+
4. **Use debug mode for problematic scenarios**
|
|
1286
|
+
```javascript
|
|
1287
|
+
manager.logger.level = 'debug'; // Enable detailed logging
|
|
1288
|
+
// ... run scenario ...
|
|
1289
|
+
// Check console output for detailed fund tracking
|
|
1290
|
+
```
|
|
1291
|
+
|
|
1292
|
+
### Test Documentation References
|
|
1293
|
+
|
|
1294
|
+
- **[tests/README.md](../tests/README.md)** - Test suite organization, categories, and running instructions
|
|
1295
|
+
|
|
1296
|
+
- **[developer_guide.md#testing-fund-calculations](developer_guide.md#testing-fund-calculations)** - Testing guide for developers
|
|
1297
|
+
- How to write fund tests
|
|
1298
|
+
- Common test patterns
|
|
1299
|
+
- Debugging failing tests
|
|
1300
|
+
- Adding tests for new features
|
|
1301
|
+
|
|
1302
|
+
---
|
|
1303
|
+
|
|
1304
|
+
## Market Adapter Signal Pipeline
|
|
1305
|
+
|
|
1306
|
+
The market adapter runs as a standalone process that computes AMA-derived grid prices, trend signals, dynamic weights, and collateral-ratio advisories.
|
|
1307
|
+
|
|
1308
|
+
### Signal Flow
|
|
1309
|
+
|
|
1310
|
+
```
|
|
1311
|
+
price_candles -> AMA -> gridCenterPrice
|
|
1312
|
+
|
|
|
1313
|
+
+-> slope_analysis -> trend_offset (asymmetric weight shift)
|
|
1314
|
+
|
|
|
1315
|
+
price_candles -> ATR -> weight_variance (symmetric shift)
|
|
1316
|
+
|
|
|
1317
|
+
+-> regime_detection (Hurst/PE) -> regime_filter
|
|
1318
|
+
|
|
|
1319
|
+
+-> Kalman_confirmation -> blended_dynamic_weight
|
|
1320
|
+
```
|
|
1321
|
+
|
|
1322
|
+
### Outputs (per cycle, per bot)
|
|
1323
|
+
- `gridCenterPrice` — AMA center price, clamped to min/max bounds
|
|
1324
|
+
- `weights` — `{ buy, sell }` dynamic grid weighting
|
|
1325
|
+
- `collateralRecommendation` — advisory collateral ratio hint
|
|
1326
|
+
- `trend` / `atr` — raw regime and volatility signals
|
|
1327
|
+
- Trigger files when the adapter accepts the first AMA center, the grid price delta exceeds threshold, or whitelisted range-scaling slope delta exceeds threshold
|
|
1328
|
+
|
|
1329
|
+
### Integration with Bot Runtime
|
|
1330
|
+
|
|
1331
|
+
1. Adapter persists `profiles/orders/<botKey>.dynamicgrid.json` before any reset trigger.
|
|
1332
|
+
2. Adapter writes `profiles/recalculate.<botKey>.trigger` for bootstrap, AMA-center delta, or whitelisted AMA-slope range reset.
|
|
1333
|
+
3. `dexbot_maintenance_runtime.ts` consumes the trigger under `_fillProcessingLock`, with idle/dust deferral when needed.
|
|
1334
|
+
4. Bot runtime reads accepted center, range-scaling fields, and dynamic weights from the dynamic-grid snapshot during reset and selected maintenance paths.
|
|
1335
|
+
|
|
1336
|
+
---
|
|
1337
|
+
|
|
1338
|
+
## Credential Security Architecture
|
|
1339
|
+
|
|
1340
|
+
DEXBot2 uses a hardened credential daemon (`credential-daemon.ts`) for key management and signing.
|
|
1341
|
+
|
|
1342
|
+
### Security Layers
|
|
1343
|
+
- **Vault v2**: scrypt (N=2^17) key derivation, per-record HKDF isolation, AES-256-GCM encryption
|
|
1344
|
+
- **Daemon-backed signing**: Primary bot flow uses signing tokens; all signing happens inside the daemon, raw keys never exported
|
|
1345
|
+
- **Session cache**: Encrypted HKDF re-encryption with a random salt never persisted
|
|
1346
|
+
- **Runtime hardening**: lstat + owner/mode/type checks on all sockets and ready files; bootstrap socket destroyed after first use
|
|
1347
|
+
- **Strict daemon policy**: Memory safety and zeroing, session hardening, signing cache with time-based expiry
|
|
1348
|
+
|
|
1349
|
+
### PM2 Integration
|
|
1350
|
+
|
|
1351
|
+
`dexbot pm2` unlocks `dexbot-cred` through a one-shot local bootstrap channel instead of exporting the master password to every PM2 app. Use `dexbot pm2 restart ...` for DEXBot-managed PM2 actions.
|
|
1352
|
+
|
|
1353
|
+
---
|
|
1354
|
+
|
|
1355
|
+
## Credit/Debt Runtime
|
|
1356
|
+
|
|
1357
|
+
Native DEXBot2 support for MPA borrowing and credit offer workflows. The logic is split between a pure-math planner and a lifecycle runtime:
|
|
1358
|
+
|
|
1359
|
+
| Module | Role |
|
|
1360
|
+
|--------|------|
|
|
1361
|
+
| **`modules/cr_planner.ts`** | **Pure math / credit planning** — debt-first CR adjustments, derived order sizing. No I/O, no side effects; safe to unit-test in isolation. |
|
|
1362
|
+
| **`modules/credit_runtime.ts`** | **Lifecycle management** — applies the planner's output to the chain, enforces policy, drives watchdog cadence and grid-reset coupling. |
|
|
1363
|
+
|
|
1364
|
+
### Scope
|
|
1365
|
+
- **MPA borrowing**: Call-order updates with debt-first CR planning
|
|
1366
|
+
- **Credit offers**: Accept/repay with auto-reborrow, LP-backed collateral valuation
|
|
1367
|
+
- **Policy enforcement**: Per-bot `debtPolicy` with hard CR floors/ceilings and max fee rates
|
|
1368
|
+
- **Grid reset coupling**: Every successful CR adjustment requests a grid rebuild
|
|
1369
|
+
|
|
1370
|
+
### Runtime Rules
|
|
1371
|
+
- Evaluates on the dedicated credit watchdog interval
|
|
1372
|
+
- No separate enable switch — active when `debtPolicy.lending` is present, non-empty, and every item declares `collateralAsset`
|
|
1373
|
+
- Claw can read the same bot policy without redefining rules (via `claw/modules/credit_runtime_adapter.ts`)
|
|
1374
|
+
|
|
1375
|
+
---
|
|
1376
|
+
|
|
1377
|
+
## Grid Rebalancing Robustness
|
|
1378
|
+
|
|
1379
|
+
The strategy engine has been significantly strengthened with improvements to fund validation, dust handling, and order constraints:
|
|
1380
|
+
|
|
1381
|
+
**1. Pre-Flight Fund Validation**
|
|
1382
|
+
- Before executing batch order placements, available funds are validated
|
|
1383
|
+
- Prevents insufficient fund errors during large rotation cycles
|
|
1384
|
+
- Uses atomic check-and-deduct pattern for safety
|
|
1385
|
+
- Located in: `modules/order/strategy.ts` - `rebalanceSideRobust()`
|
|
1386
|
+
|
|
1387
|
+
**2. Dust Partial Handling**
|
|
1388
|
+
- Improved dust detection algorithm prevents false positives
|
|
1389
|
+
- Detects dust as `< 5% of ideal order size`
|
|
1390
|
+
- Dust partials are absorbed into the next grid rebuild cycle (no merge/split mechanics)
|
|
1391
|
+
- **Auto-Cancellation**: `_cancelDustOrders()` cancels dust partials on-chain immediately on detection — no delay, no timer maps, no retry budgets. Cancel is attempted post-fill (inside fill lock) and every 5-min health check (safety net).
|
|
1392
|
+
|
|
1393
|
+
**3. Strict Order Size Constraints**
|
|
1394
|
+
- Orders validated to not exceed available funds
|
|
1395
|
+
- Maximum order size enforced during both placement and rotation
|
|
1396
|
+
- Prevents oversized orders that fail on-chain
|
|
1397
|
+
- Atomic validation with placement ensures consistency
|
|
1398
|
+
|
|
1399
|
+
**4. Boundary Index Persistence**
|
|
1400
|
+
- BoundaryIdx (spread zone pivot) now correctly persisted across bot restarts
|
|
1401
|
+
- Ensures grid rotation continues seamlessly after divergence correction
|
|
1402
|
+
- Fixes grid instability from incorrect boundary tracking
|
|
1403
|
+
|
|
1404
|
+
**5. Taker Fee Accounting**
|
|
1405
|
+
- Both market and blockchain taker fees now accounted for correctly
|
|
1406
|
+
- Fee deduction uses proper `isMaker` parameter
|
|
1407
|
+
- Prevents fund leaks from missing fee calculations
|
|
1408
|
+
- Located in: `modules/order/manager.ts` - `processFilledOrders()`
|
|
1409
|
+
|
|
1410
|
+
**6. Precision Spread Management (Logarithmic Logic)**
|
|
1411
|
+
- **Discrete Step Tracking**: Replaced the legacy linear multiplier (`SPREAD_WIDENING_MULTIPLIER`) with a discrete 1-slot logarithmic buffer. This ensures correction triggers exactly when the market moves by one full increment.
|
|
1412
|
+
- **Center-Gap Awareness**: Refined the grid initialization math to account for the "Center Gap" naturally created during symmetric centering. This reduces the initial spread by ~0.5% (one full increment) compared to the previous version.
|
|
1413
|
+
- **Collision-Free Safety**: Increased `MIN_SPREAD_FACTOR` to 2.1 to ensure that the security minimum (2 spread orders) never conflicts with the spread correction threshold, even at micro-spread configurations.
|
|
1414
|
+
|
|
1415
|
+
### Related Documentation
|
|
1416
|
+
|
|
1417
|
+
For detailed fund calculations and test coverage, see:
|
|
1418
|
+
- [developer_guide.md#testing-fund-calculations](developer_guide.md#testing-fund-calculations) - How fund calculations are tested
|
|
1419
|
+
- [tests/README.md](../tests/README.md) - Test suite organization and running instructions
|
|
1420
|
+
|
|
1421
|
+
---
|
|
1422
|
+
|
|
1423
|
+
- [Fund Movement Logic](FUND_MOVEMENT_AND_ACCOUNTING.md) - Detailed mathematical formulas and algorithms
|
|
1424
|
+
- [Developer Guide](developer_guide.md) - Code navigation and onboarding
|
|
1425
|
+
- [README](../README.md) - User documentation and setup
|
|
1426
|
+
- [WORKFLOW.md](WORKFLOW.md) - Git branch workflow
|
|
1427
|
+
|
|
1428
|
+
---
|
|
1429
|
+
|
|
1430
|
+
## Quick Reference
|
|
1431
|
+
|
|
1432
|
+
### Common Code Patterns
|
|
1433
|
+
|
|
1434
|
+
**Get orders by state and type:**
|
|
1435
|
+
```javascript
|
|
1436
|
+
const activeBuys = manager.getOrdersByTypeAndState(ORDER_TYPES.BUY, ORDER_STATES.ACTIVE);
|
|
1437
|
+
```
|
|
1438
|
+
|
|
1439
|
+
**Atomic fund deduction:**
|
|
1440
|
+
```javascript
|
|
1441
|
+
if (manager.accountant.tryDeductFromChainFree(orderType, size)) {
|
|
1442
|
+
// Funds deducted, safe to place order
|
|
1443
|
+
} else {
|
|
1444
|
+
// Insufficient funds, skip
|
|
1445
|
+
}
|
|
1446
|
+
```
|
|
1447
|
+
|
|
1448
|
+
**Batch order updates:**
|
|
1449
|
+
```javascript
|
|
1450
|
+
manager.pauseFundRecalc();
|
|
1451
|
+
for (const order of orders) {
|
|
1452
|
+
// context parameter helps with logging/debugging the source of the update
|
|
1453
|
+
manager._updateOrder(order, 'batch-update', { skipAccounting: false, fee: 0 });
|
|
1454
|
+
}
|
|
1455
|
+
manager.resumeFundRecalc(); // Recalculates once
|
|
1456
|
+
```
|
|
1457
|
+
|
|
1458
|
+
**Lock orders during async operations:**
|
|
1459
|
+
```javascript
|
|
1460
|
+
manager.lockOrders([orderId]);
|
|
1461
|
+
try {
|
|
1462
|
+
await asyncOperation();
|
|
1463
|
+
} finally {
|
|
1464
|
+
manager.unlockOrders([orderId]);
|
|
1465
|
+
}
|
|
1466
|
+
```
|