@reefclaw/connect 0.1.12 → 0.1.13
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/assets/plugin/audit/mode-transition-audit.d.ts +11 -0
- package/assets/plugin/audit/mode-transition-audit.js +29 -0
- package/assets/plugin/balance-utils.d.ts +36 -0
- package/assets/plugin/balance-utils.js +98 -0
- package/assets/plugin/ccxt/binance-ban-gate.d.ts +47 -0
- package/assets/plugin/ccxt/binance-ban-gate.js +420 -0
- package/assets/plugin/ccxt/binance-private.d.ts +346 -0
- package/assets/plugin/ccxt/binance-private.js +1525 -0
- package/assets/plugin/ccxt/binance-public.d.ts +34 -0
- package/assets/plugin/ccxt/binance-public.js +180 -0
- package/assets/plugin/ccxt/intel-public.d.ts +25 -0
- package/assets/plugin/ccxt/intel-public.js +80 -0
- package/assets/plugin/ccxt/public-market-data-api.d.ts +26 -0
- package/assets/plugin/ccxt/public-market-data-api.js +23 -0
- package/assets/plugin/config/agent-config-client.d.ts +77 -0
- package/assets/plugin/config/agent-config-client.js +188 -0
- package/assets/plugin/config/agent-config-poller.d.ts +32 -0
- package/assets/plugin/config/agent-config-poller.js +101 -0
- package/assets/plugin/config/brackets-config.d.ts +22 -0
- package/assets/plugin/config/brackets-config.js +58 -0
- package/assets/plugin/config/entitlement-gate.d.ts +51 -0
- package/assets/plugin/config/entitlement-gate.js +137 -0
- package/assets/plugin/config/gate-store.d.ts +18 -0
- package/assets/plugin/config/gate-store.js +61 -0
- package/assets/plugin/config/plugin-config-io.d.ts +222 -0
- package/assets/plugin/config/plugin-config-io.js +126 -0
- package/assets/plugin/config/position-review-config.d.ts +35 -0
- package/assets/plugin/config/position-review-config.js +105 -0
- package/assets/plugin/config/tool-gate.d.ts +53 -0
- package/assets/plugin/config/tool-gate.js +128 -0
- package/assets/plugin/config/user-data-stream-config.d.ts +89 -0
- package/assets/plugin/config/user-data-stream-config.js +239 -0
- package/assets/plugin/connector-supervisor.d.ts +36 -0
- package/assets/plugin/connector-supervisor.js +149 -0
- package/assets/plugin/exchange-adapter.d.ts +65 -0
- package/assets/plugin/exchange-adapter.js +4 -0
- package/assets/plugin/index.d.ts +30 -0
- package/assets/plugin/index.js +2763 -0
- package/assets/plugin/ingest/pending-entry-metadata.d.ts +74 -0
- package/assets/plugin/ingest/pending-entry-metadata.js +236 -0
- package/assets/plugin/ingest/position-auto-capture.d.ts +171 -0
- package/assets/plugin/ingest/position-auto-capture.js +709 -0
- package/assets/plugin/ingest/position-decisions-client.d.ts +327 -0
- package/assets/plugin/ingest/position-decisions-client.js +306 -0
- package/assets/plugin/ingest/readiness-reporter.d.ts +42 -0
- package/assets/plugin/ingest/readiness-reporter.js +163 -0
- package/assets/plugin/ingest/reconcile-db-vs-exchange.d.ts +51 -0
- package/assets/plugin/ingest/reconcile-db-vs-exchange.js +170 -0
- package/assets/plugin/ingest/reconciler-cleanup.d.ts +37 -0
- package/assets/plugin/ingest/reconciler-cleanup.js +147 -0
- package/assets/plugin/ingest/rest-gap-filler.d.ts +191 -0
- package/assets/plugin/ingest/rest-gap-filler.js +565 -0
- package/assets/plugin/ingest/touched-symbols-store.d.ts +25 -0
- package/assets/plugin/ingest/touched-symbols-store.js +96 -0
- package/assets/plugin/ingest/trade-store-client.d.ts +40 -0
- package/assets/plugin/ingest/trade-store-client.js +125 -0
- package/assets/plugin/ingest/ws-ingest.d.ts +43 -0
- package/assets/plugin/ingest/ws-ingest.js +126 -0
- package/assets/plugin/learning/setup-family.d.ts +21 -0
- package/assets/plugin/learning/setup-family.js +103 -0
- package/assets/plugin/lifecycle/install-signal-handlers.d.ts +33 -0
- package/assets/plugin/lifecycle/install-signal-handlers.js +112 -0
- package/assets/plugin/lifecycle/shutdown-coordinator.d.ts +43 -0
- package/assets/plugin/lifecycle/shutdown-coordinator.js +131 -0
- package/assets/plugin/lifecycle/trading-operation-lock.d.ts +17 -0
- package/assets/plugin/lifecycle/trading-operation-lock.js +14 -0
- package/assets/plugin/live/bracket-id.d.ts +26 -0
- package/assets/plugin/live/bracket-id.js +112 -0
- package/assets/plugin/live/bracket-ledger.d.ts +54 -0
- package/assets/plugin/live/bracket-ledger.js +267 -0
- package/assets/plugin/live/bracket-manager.d.ts +82 -0
- package/assets/plugin/live/bracket-manager.js +478 -0
- package/assets/plugin/live/bracket-params.d.ts +22 -0
- package/assets/plugin/live/bracket-params.js +124 -0
- package/assets/plugin/live/bracket-reconciler.d.ts +95 -0
- package/assets/plugin/live/bracket-reconciler.js +573 -0
- package/assets/plugin/live/bracket-types.d.ts +102 -0
- package/assets/plugin/live/bracket-types.js +8 -0
- package/assets/plugin/live/deposit-tracker.d.ts +62 -0
- package/assets/plugin/live/deposit-tracker.js +97 -0
- package/assets/plugin/live/emergency-controls.d.ts +32 -0
- package/assets/plugin/live/emergency-controls.js +226 -0
- package/assets/plugin/live/exchange-errors.d.ts +12 -0
- package/assets/plugin/live/exchange-errors.js +130 -0
- package/assets/plugin/live/exchange-info-cache.d.ts +37 -0
- package/assets/plugin/live/exchange-info-cache.js +134 -0
- package/assets/plugin/live/fact-subscriber.d.ts +78 -0
- package/assets/plugin/live/fact-subscriber.js +182 -0
- package/assets/plugin/live/fill-price.d.ts +13 -0
- package/assets/plugin/live/fill-price.js +37 -0
- package/assets/plugin/live/intent-journal.d.ts +42 -0
- package/assets/plugin/live/intent-journal.js +122 -0
- package/assets/plugin/live/listen-key-manager.d.ts +70 -0
- package/assets/plugin/live/listen-key-manager.js +169 -0
- package/assets/plugin/live/live-adapter.d.ts +319 -0
- package/assets/plugin/live/live-adapter.js +1906 -0
- package/assets/plugin/live/live-balance-enricher.d.ts +32 -0
- package/assets/plugin/live/live-balance-enricher.js +104 -0
- package/assets/plugin/live/live-bracket-api.d.ts +13 -0
- package/assets/plugin/live/live-bracket-api.js +20 -0
- package/assets/plugin/live/live-state-store.d.ts +194 -0
- package/assets/plugin/live/live-state-store.js +450 -0
- package/assets/plugin/live/local-signal-service.d.ts +57 -0
- package/assets/plugin/live/local-signal-service.js +151 -0
- package/assets/plugin/live/local-strategy-evaluator.d.ts +62 -0
- package/assets/plugin/live/local-strategy-evaluator.js +131 -0
- package/assets/plugin/live/microstructure-assembler.d.ts +54 -0
- package/assets/plugin/live/microstructure-assembler.js +148 -0
- package/assets/plugin/live/order-poller.d.ts +29 -0
- package/assets/plugin/live/order-poller.js +125 -0
- package/assets/plugin/live/position-state-store.d.ts +87 -0
- package/assets/plugin/live/position-state-store.js +237 -0
- package/assets/plugin/live/proposal-decision-listener.d.ts +70 -0
- package/assets/plugin/live/proposal-decision-listener.js +292 -0
- package/assets/plugin/live/proposal-manager.d.ts +76 -0
- package/assets/plugin/live/proposal-manager.js +140 -0
- package/assets/plugin/live/rate-limiter.d.ts +47 -0
- package/assets/plugin/live/rate-limiter.js +159 -0
- package/assets/plugin/live/reconciler.d.ts +39 -0
- package/assets/plugin/live/reconciler.js +175 -0
- package/assets/plugin/live/setup-buckets.d.ts +7 -0
- package/assets/plugin/live/setup-buckets.js +33 -0
- package/assets/plugin/live/slippage-tracker.d.ts +45 -0
- package/assets/plugin/live/slippage-tracker.js +78 -0
- package/assets/plugin/live/stop-watcher.d.ts +67 -0
- package/assets/plugin/live/stop-watcher.js +218 -0
- package/assets/plugin/live/user-data-active-probe.d.ts +54 -0
- package/assets/plugin/live/user-data-active-probe.js +180 -0
- package/assets/plugin/live/user-data-stream-controller.d.ts +200 -0
- package/assets/plugin/live/user-data-stream-controller.js +579 -0
- package/assets/plugin/live/user-data-stream-ws.d.ts +22 -0
- package/assets/plugin/live/user-data-stream-ws.js +63 -0
- package/assets/plugin/live/user-data-stream.d.ts +243 -0
- package/assets/plugin/live/user-data-stream.js +704 -0
- package/assets/plugin/logger.d.ts +2 -0
- package/assets/plugin/logger.js +2 -0
- package/assets/plugin/mfe.d.ts +21 -0
- package/assets/plugin/mfe.js +68 -0
- package/assets/plugin/onboarding/mode-ladder.d.ts +1 -0
- package/assets/plugin/onboarding/mode-ladder.js +3 -0
- package/assets/plugin/onboarding/runtime.d.ts +102 -0
- package/assets/plugin/onboarding/runtime.js +215 -0
- package/assets/plugin/openclaw.plugin.json +92 -0
- package/assets/plugin/paper-adapter.d.ts +24 -0
- package/assets/plugin/paper-adapter.js +91 -0
- package/assets/plugin/persistence/state-manager.d.ts +66 -0
- package/assets/plugin/persistence/state-manager.js +222 -0
- package/assets/plugin/pinned-plan.d.ts +9 -0
- package/assets/plugin/pinned-plan.js +23 -0
- package/assets/plugin/portfolio/reentry-tracker.d.ts +36 -0
- package/assets/plugin/portfolio/reentry-tracker.js +127 -0
- package/assets/plugin/portfolio/wave9-admission.d.ts +67 -0
- package/assets/plugin/portfolio/wave9-admission.js +262 -0
- package/assets/plugin/portfolio/wave9-policy.d.ts +36 -0
- package/assets/plugin/portfolio/wave9-policy.js +183 -0
- package/assets/plugin/risk/pre-trade-check.d.ts +38 -0
- package/assets/plugin/risk/pre-trade-check.js +345 -0
- package/assets/plugin/risk/pre-trade-types.d.ts +60 -0
- package/assets/plugin/risk/pre-trade-types.js +3 -0
- package/assets/plugin/shadow/shadow-tracker.d.ts +36 -0
- package/assets/plugin/shadow/shadow-tracker.js +151 -0
- package/assets/plugin/shadow/types.d.ts +42 -0
- package/assets/plugin/shadow/types.js +20 -0
- package/assets/plugin/shared/indicators-extended.d.ts +52 -0
- package/assets/plugin/shared/indicators-extended.js +291 -0
- package/assets/plugin/shared/indicators.d.ts +15 -0
- package/assets/plugin/shared/indicators.js +114 -0
- package/assets/plugin/signals/conditions/registry.d.ts +16 -0
- package/assets/plugin/signals/conditions/registry.js +1333 -0
- package/assets/plugin/signals/conditions/types.d.ts +1 -0
- package/assets/plugin/signals/conditions/types.js +4 -0
- package/assets/plugin/signals/direction-rules.d.ts +3 -0
- package/assets/plugin/signals/direction-rules.js +24 -0
- package/assets/plugin/signals/entry-rules.d.ts +6 -0
- package/assets/plugin/signals/entry-rules.js +33 -0
- package/assets/plugin/signals/serialize-context.d.ts +4 -0
- package/assets/plugin/signals/serialize-context.js +39 -0
- package/assets/plugin/signals/stop-rules.d.ts +3 -0
- package/assets/plugin/signals/stop-rules.js +48 -0
- package/assets/plugin/signals/strategy-adapter.d.ts +47 -0
- package/assets/plugin/signals/strategy-adapter.js +209 -0
- package/assets/plugin/signals/types.d.ts +1 -0
- package/assets/plugin/signals/types.js +8 -0
- package/assets/plugin/simulator/exchange-simulator.d.ts +105 -0
- package/assets/plugin/simulator/exchange-simulator.js +759 -0
- package/assets/plugin/simulator/fill-engine.d.ts +53 -0
- package/assets/plugin/simulator/fill-engine.js +280 -0
- package/assets/plugin/simulator/paper-market-feed.d.ts +26 -0
- package/assets/plugin/simulator/paper-market-feed.js +104 -0
- package/assets/plugin/simulator/realistic-fills.d.ts +59 -0
- package/assets/plugin/simulator/realistic-fills.js +175 -0
- package/assets/plugin/simulator/types.d.ts +228 -0
- package/assets/plugin/simulator/types.js +43 -0
- package/assets/plugin/strategy/builtin-strategies.d.ts +2 -0
- package/assets/plugin/strategy/builtin-strategies.js +113 -0
- package/assets/plugin/strategy/condition-registry.d.ts +3 -0
- package/assets/plugin/strategy/condition-registry.js +153 -0
- package/assets/plugin/strategy/evaluator.d.ts +70 -0
- package/assets/plugin/strategy/evaluator.js +98 -0
- package/assets/plugin/tools/assessment-validation.d.ts +141 -0
- package/assets/plugin/tools/assessment-validation.js +473 -0
- package/assets/plugin/tools/attach-brackets.d.ts +39 -0
- package/assets/plugin/tools/attach-brackets.js +564 -0
- package/assets/plugin/tools/audit-bracket-protection.d.ts +49 -0
- package/assets/plugin/tools/audit-bracket-protection.js +683 -0
- package/assets/plugin/tools/bracket-control.d.ts +12 -0
- package/assets/plugin/tools/bracket-control.js +35 -0
- package/assets/plugin/tools/cancel-all-orders.d.ts +9 -0
- package/assets/plugin/tools/cancel-all-orders.js +8 -0
- package/assets/plugin/tools/cancel-order.d.ts +14 -0
- package/assets/plugin/tools/cancel-order.js +60 -0
- package/assets/plugin/tools/check-position-health.d.ts +46 -0
- package/assets/plugin/tools/check-position-health.js +194 -0
- package/assets/plugin/tools/clear-exchange-credentials.d.ts +24 -0
- package/assets/plugin/tools/clear-exchange-credentials.js +70 -0
- package/assets/plugin/tools/close-position.d.ts +45 -0
- package/assets/plugin/tools/close-position.js +722 -0
- package/assets/plugin/tools/create-order.d.ts +89 -0
- package/assets/plugin/tools/create-order.js +1555 -0
- package/assets/plugin/tools/exit-gate.d.ts +58 -0
- package/assets/plugin/tools/exit-gate.js +162 -0
- package/assets/plugin/tools/fetch-balance.d.ts +5 -0
- package/assets/plugin/tools/fetch-balance.js +4 -0
- package/assets/plugin/tools/fetch-ohlcv.d.ts +11 -0
- package/assets/plugin/tools/fetch-ohlcv.js +8 -0
- package/assets/plugin/tools/fetch-open-orders.d.ts +7 -0
- package/assets/plugin/tools/fetch-open-orders.js +4 -0
- package/assets/plugin/tools/fetch-positions.d.ts +7 -0
- package/assets/plugin/tools/fetch-positions.js +4 -0
- package/assets/plugin/tools/fetch-ticker.d.ts +11 -0
- package/assets/plugin/tools/fetch-ticker.js +5 -0
- package/assets/plugin/tools/get-agent-profile.d.ts +4 -0
- package/assets/plugin/tools/get-agent-profile.js +6 -0
- package/assets/plugin/tools/get-analytics.d.ts +6 -0
- package/assets/plugin/tools/get-analytics.js +7 -0
- package/assets/plugin/tools/get-backtest.d.ts +12 -0
- package/assets/plugin/tools/get-backtest.js +91 -0
- package/assets/plugin/tools/get-basis.d.ts +7 -0
- package/assets/plugin/tools/get-basis.js +7 -0
- package/assets/plugin/tools/get-bracket-config.d.ts +11 -0
- package/assets/plugin/tools/get-bracket-config.js +24 -0
- package/assets/plugin/tools/get-cascade-risk.d.ts +7 -0
- package/assets/plugin/tools/get-cascade-risk.js +8 -0
- package/assets/plugin/tools/get-crypto-metrics.d.ts +18 -0
- package/assets/plugin/tools/get-crypto-metrics.js +62 -0
- package/assets/plugin/tools/get-cvd.d.ts +6 -0
- package/assets/plugin/tools/get-cvd.js +6 -0
- package/assets/plugin/tools/get-divergences.d.ts +6 -0
- package/assets/plugin/tools/get-divergences.js +6 -0
- package/assets/plugin/tools/get-funding-context.d.ts +6 -0
- package/assets/plugin/tools/get-funding-context.js +16 -0
- package/assets/plugin/tools/get-liquidation-levels.d.ts +7 -0
- package/assets/plugin/tools/get-liquidation-levels.js +7 -0
- package/assets/plugin/tools/get-liquidation-pulse.d.ts +9 -0
- package/assets/plugin/tools/get-liquidation-pulse.js +22 -0
- package/assets/plugin/tools/get-market-breadth.d.ts +6 -0
- package/assets/plugin/tools/get-market-breadth.js +8 -0
- package/assets/plugin/tools/get-market-intel.d.ts +19 -0
- package/assets/plugin/tools/get-market-intel.js +116 -0
- package/assets/plugin/tools/get-market-structure.d.ts +47 -0
- package/assets/plugin/tools/get-market-structure.js +198 -0
- package/assets/plugin/tools/get-my-mined-patterns.d.ts +20 -0
- package/assets/plugin/tools/get-my-mined-patterns.js +61 -0
- package/assets/plugin/tools/get-my-proposed-learnings.d.ts +20 -0
- package/assets/plugin/tools/get-my-proposed-learnings.js +55 -0
- package/assets/plugin/tools/get-my-recent-reviews.d.ts +22 -0
- package/assets/plugin/tools/get-my-recent-reviews.js +66 -0
- package/assets/plugin/tools/get-orderbook.d.ts +21 -0
- package/assets/plugin/tools/get-orderbook.js +32 -0
- package/assets/plugin/tools/get-pattern-scan.d.ts +7 -0
- package/assets/plugin/tools/get-pattern-scan.js +8 -0
- package/assets/plugin/tools/get-regime.d.ts +6 -0
- package/assets/plugin/tools/get-regime.js +7 -0
- package/assets/plugin/tools/get-relevant-learnings.d.ts +21 -0
- package/assets/plugin/tools/get-relevant-learnings.js +65 -0
- package/assets/plugin/tools/get-resting-liquidity.d.ts +6 -0
- package/assets/plugin/tools/get-resting-liquidity.js +11 -0
- package/assets/plugin/tools/get-risk-scenario.d.ts +29 -0
- package/assets/plugin/tools/get-risk-scenario.js +47 -0
- package/assets/plugin/tools/get-risk-summary.d.ts +51 -0
- package/assets/plugin/tools/get-risk-summary.js +118 -0
- package/assets/plugin/tools/get-sentiment.d.ts +4 -0
- package/assets/plugin/tools/get-sentiment.js +6 -0
- package/assets/plugin/tools/get-session-review.d.ts +7 -0
- package/assets/plugin/tools/get-session-review.js +8 -0
- package/assets/plugin/tools/get-setup-detail.d.ts +7 -0
- package/assets/plugin/tools/get-setup-detail.js +322 -0
- package/assets/plugin/tools/get-signals.d.ts +15 -0
- package/assets/plugin/tools/get-signals.js +54 -0
- package/assets/plugin/tools/get-sizing.d.ts +6 -0
- package/assets/plugin/tools/get-sizing.js +6 -0
- package/assets/plugin/tools/get-trade-feedback.d.ts +7 -0
- package/assets/plugin/tools/get-trade-feedback.js +8 -0
- package/assets/plugin/tools/get-trade-flow.d.ts +7 -0
- package/assets/plugin/tools/get-trade-flow.js +7 -0
- package/assets/plugin/tools/get-volume-analysis.d.ts +21 -0
- package/assets/plugin/tools/get-volume-analysis.js +74 -0
- package/assets/plugin/tools/get-volume-profile.d.ts +7 -0
- package/assets/plugin/tools/get-volume-profile.js +7 -0
- package/assets/plugin/tools/get-wave9-status.d.ts +127 -0
- package/assets/plugin/tools/get-wave9-status.js +796 -0
- package/assets/plugin/tools/helpers.d.ts +26 -0
- package/assets/plugin/tools/helpers.js +39 -0
- package/assets/plugin/tools/intel-api.d.ts +34 -0
- package/assets/plugin/tools/intel-api.js +119 -0
- package/assets/plugin/tools/intel-cache.d.ts +25 -0
- package/assets/plugin/tools/intel-cache.js +148 -0
- package/assets/plugin/tools/list-strategies.d.ts +17 -0
- package/assets/plugin/tools/list-strategies.js +23 -0
- package/assets/plugin/tools/modify-stop.d.ts +21 -0
- package/assets/plugin/tools/modify-stop.js +120 -0
- package/assets/plugin/tools/modify-target.d.ts +21 -0
- package/assets/plugin/tools/modify-target.js +110 -0
- package/assets/plugin/tools/propose-learning.d.ts +22 -0
- package/assets/plugin/tools/propose-learning.js +65 -0
- package/assets/plugin/tools/query-review-outcomes.d.ts +30 -0
- package/assets/plugin/tools/query-review-outcomes.js +64 -0
- package/assets/plugin/tools/query-trades.d.ts +21 -0
- package/assets/plugin/tools/query-trades.js +37 -0
- package/assets/plugin/tools/record-position-reviews.d.ts +38 -0
- package/assets/plugin/tools/record-position-reviews.js +147 -0
- package/assets/plugin/tools/save-strategy.d.ts +16 -0
- package/assets/plugin/tools/save-strategy.js +46 -0
- package/assets/plugin/tools/scan-pairs.d.ts +22 -0
- package/assets/plugin/tools/scan-pairs.js +234 -0
- package/assets/plugin/tools/score-setup.d.ts +31 -0
- package/assets/plugin/tools/score-setup.js +268 -0
- package/assets/plugin/tools/set-bracket-requirement.d.ts +18 -0
- package/assets/plugin/tools/set-bracket-requirement.js +81 -0
- package/assets/plugin/tools/set-exchange-credentials.d.ts +25 -0
- package/assets/plugin/tools/set-exchange-credentials.js +80 -0
- package/assets/plugin/tools/set-trading-mode.d.ts +26 -0
- package/assets/plugin/tools/set-trading-mode.js +152 -0
- package/assets/plugin/tools/test-exchange-credentials.d.ts +16 -0
- package/assets/plugin/tools/test-exchange-credentials.js +100 -0
- package/assets/plugin/tools/toggle-strategy.d.ts +8 -0
- package/assets/plugin/tools/toggle-strategy.js +15 -0
- package/assets/plugin/trading-params-cache.d.ts +26 -0
- package/assets/plugin/trading-params-cache.js +52 -0
- package/assets/plugin/types.d.ts +134 -0
- package/assets/plugin/types.js +7 -0
- package/assets/plugin/util/plugin-paths.d.ts +3 -0
- package/assets/plugin/util/plugin-paths.js +15 -0
- package/assets/plugin/venues/hyperliquid/hl-balance.d.ts +116 -0
- package/assets/plugin/venues/hyperliquid/hl-balance.js +145 -0
- package/assets/plugin/venues/hyperliquid/hl-bracket-coordinator.d.ts +123 -0
- package/assets/plugin/venues/hyperliquid/hl-bracket-coordinator.js +533 -0
- package/assets/plugin/venues/hyperliquid/hl-brackets.d.ts +102 -0
- package/assets/plugin/venues/hyperliquid/hl-brackets.js +172 -0
- package/assets/plugin/venues/hyperliquid/hl-cloid.d.ts +22 -0
- package/assets/plugin/venues/hyperliquid/hl-cloid.js +82 -0
- package/assets/plugin/venues/hyperliquid/hl-info-cache.d.ts +46 -0
- package/assets/plugin/venues/hyperliquid/hl-info-cache.js +125 -0
- package/assets/plugin/venues/hyperliquid/hl-live-adapter.d.ts +146 -0
- package/assets/plugin/venues/hyperliquid/hl-live-adapter.js +728 -0
- package/assets/plugin/venues/hyperliquid/hl-precision.d.ts +61 -0
- package/assets/plugin/venues/hyperliquid/hl-precision.js +176 -0
- package/assets/plugin/venues/hyperliquid/hl-private.d.ts +88 -0
- package/assets/plugin/venues/hyperliquid/hl-private.js +357 -0
- package/assets/plugin/venues/hyperliquid/hl-public.d.ts +79 -0
- package/assets/plugin/venues/hyperliquid/hl-public.js +436 -0
- package/assets/plugin/venues/hyperliquid/hl-rate-gate.d.ts +57 -0
- package/assets/plugin/venues/hyperliquid/hl-rate-gate.js +220 -0
- package/assets/plugin/venues/hyperliquid/hl-user-stream.d.ts +90 -0
- package/assets/plugin/venues/hyperliquid/hl-user-stream.js +220 -0
- package/assets/plugin/venues/registry.d.ts +38 -0
- package/assets/plugin/venues/registry.js +46 -0
- package/assets/plugin/venues/symbols.d.ts +43 -0
- package/assets/plugin/venues/symbols.js +107 -0
- package/assets/plugin/wave9/live-account-capture.d.ts +67 -0
- package/assets/plugin/wave9/live-account-capture.js +435 -0
- package/assets/plugin/wave9/live-autonomous-protection.d.ts +39 -0
- package/assets/plugin/wave9/live-autonomous-protection.js +112 -0
- package/assets/plugin/wave9/live-durable-reconciliation-scheduler.d.ts +33 -0
- package/assets/plugin/wave9/live-durable-reconciliation-scheduler.js +115 -0
- package/assets/plugin/wave9/live-execution-ledger.d.ts +107 -0
- package/assets/plugin/wave9/live-execution-ledger.js +498 -0
- package/assets/plugin/wave9/live-position-confirmation.d.ts +18 -0
- package/assets/plugin/wave9/live-position-confirmation.js +111 -0
- package/assets/plugin/wave9/live-residual-protection.d.ts +18 -0
- package/assets/plugin/wave9/live-residual-protection.js +250 -0
- package/assets/plugin/wave9/live-startup-reconciliation.d.ts +38 -0
- package/assets/plugin/wave9/live-startup-reconciliation.js +454 -0
- package/assets/plugin/wave9/live-symbol-ownership.d.ts +20 -0
- package/assets/plugin/wave9/live-symbol-ownership.js +132 -0
- package/assets/plugin/wave9/paper-admission-guard.d.ts +199 -0
- package/assets/plugin/wave9/paper-admission-guard.js +650 -0
- package/assets/plugin/wave9/usdm-evidence-provider.d.ts +42 -0
- package/assets/plugin/wave9/usdm-evidence-provider.js +133 -0
- package/package.json +1 -1
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import type { BinancePrivateApi } from '../ccxt/binance-private.js';
|
|
2
|
+
import type { UserDataStream } from '../live/user-data-stream.js';
|
|
3
|
+
import type { LiveStateStore } from '../live/live-state-store.js';
|
|
4
|
+
import type { TradeStoreClient } from './trade-store-client.js';
|
|
5
|
+
import { TouchedSymbolsStore } from './touched-symbols-store.js';
|
|
6
|
+
export interface RestGapFillerOptions {
|
|
7
|
+
api: BinancePrivateApi;
|
|
8
|
+
stream: UserDataStream;
|
|
9
|
+
store: LiveStateStore;
|
|
10
|
+
client: TradeStoreClient;
|
|
11
|
+
userId: string;
|
|
12
|
+
/** Defaults to 'binance_futures'. */
|
|
13
|
+
exchange?: string;
|
|
14
|
+
/** How far BEFORE the disconnect to start the backfill window. A 10s
|
|
15
|
+
* buffer compensates for clock skew between the client and exchange
|
|
16
|
+
* and for any in-flight frames we may have already processed.
|
|
17
|
+
* Dedupe at the webapp prevents duplicate rows. */
|
|
18
|
+
safetyBufferMs?: number;
|
|
19
|
+
/** Hard floor on the backfill window. A long outage shouldn't trigger
|
|
20
|
+
* a fetchMyTrades that walks back days. Binance returns up to 1000
|
|
21
|
+
* trades per symbol per call; past that you need multiple paginated
|
|
22
|
+
* calls. Default 1h. If a real outage exceeds this, operator runs the
|
|
23
|
+
* Phase 2 continuous reconciler separately. */
|
|
24
|
+
maxWindowMs?: number;
|
|
25
|
+
/** Limit on trades per symbol per call. Binance cap is 1000. */
|
|
26
|
+
perSymbolLimit?: number;
|
|
27
|
+
/** Run a one-shot deep backfill on start() that recovers fills which landed
|
|
28
|
+
* while the plugin was DOWN — the reconnect path (handleResyncRequired) only
|
|
29
|
+
* covers gaps while the plugin is RUNNING, so a position's closing trade that
|
|
30
|
+
* fills during downtime is never re-pushed by the WS and accumulates silently
|
|
31
|
+
* across restarts. Defaults to OFF; activate via env `RC_GAPFILL_STARTUP=on`. */
|
|
32
|
+
startupDeepFill?: boolean;
|
|
33
|
+
/** How far back the startup deep-fill looks. Default 7 days (env
|
|
34
|
+
* `RC_GAPFILL_STARTUP_LOOKBACK_MS`). Sized to cover realistic inter-restart
|
|
35
|
+
* downtime; a longer outage is a one-off the operator backfills manually. */
|
|
36
|
+
startupLookbackMs?: number;
|
|
37
|
+
/** Delay between paced Binance calls in the deep-fill (per page + per symbol),
|
|
38
|
+
* to stay clear of the per-IP weight ceiling. Default 250ms
|
|
39
|
+
* (env `RC_GAPFILL_PACE_MS`). */
|
|
40
|
+
deepFillPaceMs?: number;
|
|
41
|
+
/** Safety cap on paginated pages per 7-day window in the deep-fill — bounds
|
|
42
|
+
* the worst case if a symbol churned a huge number of fills. Default 25. */
|
|
43
|
+
maxPagesPerWindow?: number;
|
|
44
|
+
/** Persistent symbol store. Defaults to a file-backed implementation
|
|
45
|
+
* under ~/.reefclaw/touched-symbols-<userId>.json. Tests inject a
|
|
46
|
+
* store pointed at a tmpdir path or a stub. Pass `null` to disable
|
|
47
|
+
* persistence entirely (in-memory only). */
|
|
48
|
+
touchedSymbolsStore?: TouchedSymbolsStore | null;
|
|
49
|
+
/** For unit tests — injected clock. */
|
|
50
|
+
now?: () => number;
|
|
51
|
+
}
|
|
52
|
+
export interface RestGapFillerHealth {
|
|
53
|
+
reconnectEvents: number;
|
|
54
|
+
gapFillRuns: number;
|
|
55
|
+
symbolsQueried: number;
|
|
56
|
+
tradesBackfilled: number;
|
|
57
|
+
errorCount: number;
|
|
58
|
+
}
|
|
59
|
+
export declare class RestGapFiller {
|
|
60
|
+
private readonly api;
|
|
61
|
+
private readonly stream;
|
|
62
|
+
private readonly store;
|
|
63
|
+
private readonly client;
|
|
64
|
+
private readonly userId;
|
|
65
|
+
private readonly exchange;
|
|
66
|
+
private readonly safetyBufferMs;
|
|
67
|
+
private readonly maxWindowMs;
|
|
68
|
+
private readonly perSymbolLimit;
|
|
69
|
+
private readonly startupDeepFill;
|
|
70
|
+
private readonly startupLookbackMs;
|
|
71
|
+
private readonly deepFillPaceMs;
|
|
72
|
+
private readonly maxPagesPerWindow;
|
|
73
|
+
private readonly now;
|
|
74
|
+
/** Every symbol we've seen via WS orderUpdate, a position snapshot, or
|
|
75
|
+
* the persistent disk store. Never shrinks — a symbol's closing trade
|
|
76
|
+
* may still be pending delivery when its position hits zero, and a
|
|
77
|
+
* symbol traded in a previous session is still a candidate for fills
|
|
78
|
+
* the WS missed during a plugin restart. */
|
|
79
|
+
private readonly knownSymbols;
|
|
80
|
+
/** Optional file-backed persistence so the symbol universe survives
|
|
81
|
+
* plugin restarts. Null in tests that want pure in-memory behaviour. */
|
|
82
|
+
private readonly touchedStore;
|
|
83
|
+
/** Timestamp of the last observed disconnect. Bootstrapped to null so
|
|
84
|
+
* the initial window (before the first disconnect) contributes no
|
|
85
|
+
* backfill — no blind window existed before the stream was ever up. */
|
|
86
|
+
private lastDisconnectAt;
|
|
87
|
+
private started;
|
|
88
|
+
private readonly onResyncRequired;
|
|
89
|
+
private readonly onDisconnected;
|
|
90
|
+
private readonly onOrderUpdate;
|
|
91
|
+
private reconnectEvents;
|
|
92
|
+
private gapFillRuns;
|
|
93
|
+
private symbolsQueried;
|
|
94
|
+
private tradesBackfilled;
|
|
95
|
+
private errorCount;
|
|
96
|
+
constructor(opts: RestGapFillerOptions);
|
|
97
|
+
start(): void;
|
|
98
|
+
stop(): void;
|
|
99
|
+
getHealth(): RestGapFillerHealth;
|
|
100
|
+
/** Testing hook — lets unit tests trigger a gap-fill pass with a known
|
|
101
|
+
* time window instead of replaying stream events. */
|
|
102
|
+
runGapFill(since: number): Promise<void>;
|
|
103
|
+
/** One-shot startup deep-fill — the recurrence fix.
|
|
104
|
+
*
|
|
105
|
+
* The reconnect gap-fill (handleResyncRequired) only covers blind windows
|
|
106
|
+
* while the plugin is RUNNING and caps its lookback at maxWindowMs (1h). A
|
|
107
|
+
* fill that lands while the plugin is DOWN — most damagingly a position's
|
|
108
|
+
* closing trade — is never re-pushed by the event-driven WS and was never
|
|
109
|
+
* gap-filled, so it silently never reaches the `trades` ledger. Over many
|
|
110
|
+
* restarts these missing closes accumulate and make the journal's net-PnL
|
|
111
|
+
* (derived from the ledger) wrong. This pass queries userTrades for every
|
|
112
|
+
* known symbol over a configurable lookback so downtime closes land on the
|
|
113
|
+
* next start. Paginated + 7-day-window-chunked (Binance caps userTrades at
|
|
114
|
+
* 1000 rows / 7-day span per call) and paced to stay clear of the per-IP
|
|
115
|
+
* weight ceiling. Idempotent at the webapp (ON CONFLICT DO NOTHING), so
|
|
116
|
+
* re-querying already-recorded fills is a harmless no-op. */
|
|
117
|
+
runStartupDeepFill(sinceFloor: number): Promise<void>;
|
|
118
|
+
/** Deep-fill a single symbol over [sinceFloor, now], chunked into ≤7-day
|
|
119
|
+
* windows (Binance's per-call span cap). Within a window the FIRST page is
|
|
120
|
+
* time-bounded (startTime/endTime); FULL pages continue via Binance's
|
|
121
|
+
* `fromId = lastTradeId + 1` (doc-verified: fromId pages ascending by
|
|
122
|
+
* trade id and CANNOT be combined with startTime/endTime), stopping when
|
|
123
|
+
* a page runs past the window end, comes back short, or hits the page
|
|
124
|
+
* cap. Paging by id — not by `lastTime + 1` — is what keeps
|
|
125
|
+
* same-millisecond trades on a full-page boundary from being skipped.
|
|
126
|
+
*
|
|
127
|
+
* Every fetch goes through the ban-gated `api.fetchMyTradesOrNull`
|
|
128
|
+
* wrapper — we deliberately do NOT use CCXT's built-in `{ paginate: true }`,
|
|
129
|
+
* which re-enters CCXT directly and would bypass the process-wide IP-ban
|
|
130
|
+
* gate. A `null` read (paced / banned / garbled) is a FAILED read, not an
|
|
131
|
+
* empty window: we abort THIS symbol by throwing (caller logs + counts the
|
|
132
|
+
* error and continues other symbols) instead of advancing the cursor —
|
|
133
|
+
* error-as-empty silently truncated the backfill exactly when Binance was
|
|
134
|
+
* shedding us. Returns the number of fills posted. */
|
|
135
|
+
private deepFillSymbol;
|
|
136
|
+
/** Epoch-ms timestamp of a CCXT trade — unified `timestamp` first, raw
|
|
137
|
+
* Binance `info.time` as fallback. 0 when neither is present. */
|
|
138
|
+
private tradeTime;
|
|
139
|
+
/** Numeric Binance trade id of a CCXT trade — unified `id` first, raw
|
|
140
|
+
* `info.id` fallback. Null when not a finite number (`fromId` is a LONG
|
|
141
|
+
* on the Binance side, so a non-numeric id cannot seed pagination). */
|
|
142
|
+
private tradeId;
|
|
143
|
+
/** Cooperative delay used to pace deep-fill Binance calls. Resolves
|
|
144
|
+
* immediately for a non-positive duration (e.g. tests pass 0). */
|
|
145
|
+
private sleep;
|
|
146
|
+
private handleResyncRequired;
|
|
147
|
+
private handleDisconnected;
|
|
148
|
+
private seedKnownSymbolsFromStore;
|
|
149
|
+
/** Merge the on-disk symbol history into the in-memory set. Best-effort —
|
|
150
|
+
* load() returns an empty Set on any error so a corrupt cache file is a
|
|
151
|
+
* silent regression to "session-only" behaviour, never a startup blocker. */
|
|
152
|
+
private hydrateKnownSymbolsFromDisk;
|
|
153
|
+
/** Discovery via /fapi/v1/income. Catches symbols traded during a blind
|
|
154
|
+
* window (plugin downtime, mid-session WS outage) that aren't represented
|
|
155
|
+
* in the persisted touched cache or the current open-position seed —
|
|
156
|
+
* i.e. brand-new symbols that opened AND closed entirely during the gap.
|
|
157
|
+
*
|
|
158
|
+
* `since` defaults to the maxWindow lookback (used by start()'s one-shot
|
|
159
|
+
* pass). On every resync, handleResyncRequired passes the reconnect's
|
|
160
|
+
* computed `since` so the discovery window precisely matches the
|
|
161
|
+
* fetchMyTrades window — a single REST call recovers every symbol that
|
|
162
|
+
* could have had activity in the gap.
|
|
163
|
+
*
|
|
164
|
+
* Best-effort: any error logs and returns; gap-fill still runs against
|
|
165
|
+
* whatever knownSymbols already contains. */
|
|
166
|
+
private discoverSymbolsFromIncome;
|
|
167
|
+
/** Convert raw CCXT trade objects to FillEvents and post each to the
|
|
168
|
+
* webapp ingest endpoint. Returns the count successfully posted
|
|
169
|
+
* (posted means handed to the HTTP client; upsert dedup happens in
|
|
170
|
+
* the webapp). Silent on empty input. */
|
|
171
|
+
private postTrades;
|
|
172
|
+
/** Map a CCXT trade (Binance /fapi/v1/userTrades) to our FillEvent shape.
|
|
173
|
+
* Returns null on malformed input — tradeId + orderId + price + qty are
|
|
174
|
+
* all required columns on the trades table.
|
|
175
|
+
*
|
|
176
|
+
* Binance raw field names (NOT CCXT-unified) per the docs — we read these
|
|
177
|
+
* via `t.info.*` as the second-choice source after CCXT's unified fields:
|
|
178
|
+
* id, orderId, symbol, side, positionSide, price, qty, quoteQty,
|
|
179
|
+
* commission, commissionAsset, time, buyer, maker, realizedPnl.
|
|
180
|
+
* Spec: https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List
|
|
181
|
+
*
|
|
182
|
+
* Fields NOT returned by userTrades (document-verified):
|
|
183
|
+
* - `reduceOnly` — lives on order endpoints, not trades. Gap-filled rows
|
|
184
|
+
* get reduceOnly=undefined; the primary WS path (source='ws') always
|
|
185
|
+
* has it. Since dedup preserves the first-writer row, trades delivered
|
|
186
|
+
* by WS retain reduceOnly; only genuinely-missed-by-WS trades that the
|
|
187
|
+
* gap-filler rescues will have this field blank. Acceptable gap.
|
|
188
|
+
* - `clientOrderId` — same: lives on the order, not the trade. We infer
|
|
189
|
+
* from the ledger by crosswalking `orderId` if consumers need it. */
|
|
190
|
+
private tradeToFillEvent;
|
|
191
|
+
}
|