clodds 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +468 -0
- package/dist/acp/agreement.d.ts +110 -0
- package/dist/acp/agreement.js +514 -0
- package/dist/acp/agreement.js.map +1 -0
- package/dist/acp/discovery.d.ts +84 -0
- package/dist/acp/discovery.js +332 -0
- package/dist/acp/discovery.js.map +1 -0
- package/dist/acp/escrow.d.ts +139 -0
- package/dist/acp/escrow.js +880 -0
- package/dist/acp/escrow.js.map +1 -0
- package/dist/acp/identity.d.ts +135 -0
- package/dist/acp/identity.js +716 -0
- package/dist/acp/identity.js.map +1 -0
- package/dist/acp/index.d.ts +205 -0
- package/dist/acp/index.js +583 -0
- package/dist/acp/index.js.map +1 -0
- package/dist/acp/persistence.d.ts +59 -0
- package/dist/acp/persistence.js +590 -0
- package/dist/acp/persistence.js.map +1 -0
- package/dist/acp/predictions.d.ts +89 -0
- package/dist/acp/predictions.js +417 -0
- package/dist/acp/predictions.js.map +1 -0
- package/dist/acp/registry.d.ts +143 -0
- package/dist/acp/registry.js +584 -0
- package/dist/acp/registry.js.map +1 -0
- package/dist/agents/handlers/acp.d.ts +12 -0
- package/dist/agents/handlers/acp.js +987 -0
- package/dist/agents/handlers/acp.js.map +1 -0
- package/dist/agents/handlers/agentbets.d.ts +8 -0
- package/dist/agents/handlers/agentbets.js +63 -0
- package/dist/agents/handlers/agentbets.js.map +1 -0
- package/dist/agents/handlers/arbitrage.d.ts +16 -0
- package/dist/agents/handlers/arbitrage.js +187 -0
- package/dist/agents/handlers/arbitrage.js.map +1 -0
- package/dist/agents/handlers/betfair.d.ts +11 -0
- package/dist/agents/handlers/betfair.js +214 -0
- package/dist/agents/handlers/betfair.js.map +1 -0
- package/dist/agents/handlers/binance.d.ts +9 -0
- package/dist/agents/handlers/binance.js +227 -0
- package/dist/agents/handlers/binance.js.map +1 -0
- package/dist/agents/handlers/bittensor.d.ts +10 -0
- package/dist/agents/handlers/bittensor.js +90 -0
- package/dist/agents/handlers/bittensor.js.map +1 -0
- package/dist/agents/handlers/bybit.d.ts +9 -0
- package/dist/agents/handlers/bybit.js +226 -0
- package/dist/agents/handlers/bybit.js.map +1 -0
- package/dist/agents/handlers/credentials.d.ts +8 -0
- package/dist/agents/handlers/credentials.js +103 -0
- package/dist/agents/handlers/credentials.js.map +1 -0
- package/dist/agents/handlers/hyperliquid.d.ts +9 -0
- package/dist/agents/handlers/hyperliquid.js +326 -0
- package/dist/agents/handlers/hyperliquid.js.map +1 -0
- package/dist/agents/handlers/index.d.ts +82 -0
- package/dist/agents/handlers/index.js +143 -0
- package/dist/agents/handlers/index.js.map +1 -0
- package/dist/agents/handlers/kalshi.d.ts +10 -0
- package/dist/agents/handlers/kalshi.js +1377 -0
- package/dist/agents/handlers/kalshi.js.map +1 -0
- package/dist/agents/handlers/manifold.d.ts +9 -0
- package/dist/agents/handlers/manifold.js +1001 -0
- package/dist/agents/handlers/manifold.js.map +1 -0
- package/dist/agents/handlers/markets.d.ts +8 -0
- package/dist/agents/handlers/markets.js +321 -0
- package/dist/agents/handlers/markets.js.map +1 -0
- package/dist/agents/handlers/opinion.d.ts +11 -0
- package/dist/agents/handlers/opinion.js +374 -0
- package/dist/agents/handlers/opinion.js.map +1 -0
- package/dist/agents/handlers/paper-trading.d.ts +8 -0
- package/dist/agents/handlers/paper-trading.js +124 -0
- package/dist/agents/handlers/paper-trading.js.map +1 -0
- package/dist/agents/handlers/polymarket.d.ts +17 -0
- package/dist/agents/handlers/polymarket.js +455 -0
- package/dist/agents/handlers/polymarket.js.map +1 -0
- package/dist/agents/handlers/predictfun.d.ts +9 -0
- package/dist/agents/handlers/predictfun.js +488 -0
- package/dist/agents/handlers/predictfun.js.map +1 -0
- package/dist/agents/handlers/smarkets.d.ts +11 -0
- package/dist/agents/handlers/smarkets.js +205 -0
- package/dist/agents/handlers/smarkets.js.map +1 -0
- package/dist/agents/handlers/solana.d.ts +14 -0
- package/dist/agents/handlers/solana.js +1530 -0
- package/dist/agents/handlers/solana.js.map +1 -0
- package/dist/agents/handlers/types.d.ts +58 -0
- package/dist/agents/handlers/types.js +34 -0
- package/dist/agents/handlers/types.js.map +1 -0
- package/dist/agents/handlers/virtuals.d.ts +11 -0
- package/dist/agents/handlers/virtuals.js +135 -0
- package/dist/agents/handlers/virtuals.js.map +1 -0
- package/dist/agents/handlers/wallets.d.ts +9 -0
- package/dist/agents/handlers/wallets.js +222 -0
- package/dist/agents/handlers/wallets.js.map +1 -0
- package/dist/agents/index.d.ts +79 -0
- package/dist/agents/index.js +16690 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/subagents.d.ts +219 -0
- package/dist/agents/subagents.js +736 -0
- package/dist/agents/subagents.js.map +1 -0
- package/dist/alerts/index.d.ts +110 -0
- package/dist/alerts/index.js +421 -0
- package/dist/alerts/index.js.map +1 -0
- package/dist/alerts/realtime.d.ts +114 -0
- package/dist/alerts/realtime.js +262 -0
- package/dist/alerts/realtime.js.map +1 -0
- package/dist/api/apikeys.d.ts +74 -0
- package/dist/api/apikeys.js +319 -0
- package/dist/api/apikeys.js.map +1 -0
- package/dist/api/compute/code.d.ts +28 -0
- package/dist/api/compute/code.js +257 -0
- package/dist/api/compute/code.js.map +1 -0
- package/dist/api/compute/data.d.ts +72 -0
- package/dist/api/compute/data.js +264 -0
- package/dist/api/compute/data.js.map +1 -0
- package/dist/api/compute/gateway.d.ts +185 -0
- package/dist/api/compute/gateway.js +958 -0
- package/dist/api/compute/gateway.js.map +1 -0
- package/dist/api/compute/index.d.ts +21 -0
- package/dist/api/compute/index.js +46 -0
- package/dist/api/compute/index.js.map +1 -0
- package/dist/api/compute/llm.d.ts +64 -0
- package/dist/api/compute/llm.js +602 -0
- package/dist/api/compute/llm.js.map +1 -0
- package/dist/api/compute/persistence.d.ts +77 -0
- package/dist/api/compute/persistence.js +251 -0
- package/dist/api/compute/persistence.js.map +1 -0
- package/dist/api/compute/storage.d.ts +48 -0
- package/dist/api/compute/storage.js +283 -0
- package/dist/api/compute/storage.js.map +1 -0
- package/dist/api/compute/trade.d.ts +69 -0
- package/dist/api/compute/trade.js +460 -0
- package/dist/api/compute/trade.js.map +1 -0
- package/dist/api/compute/types.d.ts +271 -0
- package/dist/api/compute/types.js +87 -0
- package/dist/api/compute/types.js.map +1 -0
- package/dist/api/compute/web.d.ts +29 -0
- package/dist/api/compute/web.js +255 -0
- package/dist/api/compute/web.js.map +1 -0
- package/dist/api/custody.d.ts +48 -0
- package/dist/api/custody.js +272 -0
- package/dist/api/custody.js.map +1 -0
- package/dist/api/fees.d.ts +91 -0
- package/dist/api/fees.js +155 -0
- package/dist/api/fees.js.map +1 -0
- package/dist/api/gateway.d.ts +40 -0
- package/dist/api/gateway.js +569 -0
- package/dist/api/gateway.js.map +1 -0
- package/dist/api/index.d.ts +29 -0
- package/dist/api/index.js +55 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/jobs.d.ts +59 -0
- package/dist/api/jobs.js +362 -0
- package/dist/api/jobs.js.map +1 -0
- package/dist/api/middleware.d.ts +60 -0
- package/dist/api/middleware.js +315 -0
- package/dist/api/middleware.js.map +1 -0
- package/dist/api/prompt.d.ts +44 -0
- package/dist/api/prompt.js +345 -0
- package/dist/api/prompt.js.map +1 -0
- package/dist/api/sdk.d.ts +258 -0
- package/dist/api/sdk.js +341 -0
- package/dist/api/sdk.js.map +1 -0
- package/dist/api/server.d.ts +17 -0
- package/dist/api/server.js +852 -0
- package/dist/api/server.js.map +1 -0
- package/dist/api/types.d.ts +307 -0
- package/dist/api/types.js +64 -0
- package/dist/api/types.js.map +1 -0
- package/dist/arbitrage/index.d.ts +124 -0
- package/dist/arbitrage/index.js +482 -0
- package/dist/arbitrage/index.js.map +1 -0
- package/dist/auth/copilot.d.ts +87 -0
- package/dist/auth/copilot.js +328 -0
- package/dist/auth/copilot.js.map +1 -0
- package/dist/auth/google.d.ts +121 -0
- package/dist/auth/google.js +479 -0
- package/dist/auth/google.js.map +1 -0
- package/dist/auth/index.d.ts +8 -0
- package/dist/auth/index.js +25 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/oauth.d.ts +94 -0
- package/dist/auth/oauth.js +502 -0
- package/dist/auth/oauth.js.map +1 -0
- package/dist/auth/qwen.d.ts +110 -0
- package/dist/auth/qwen.js +351 -0
- package/dist/auth/qwen.js.map +1 -0
- package/dist/auto-reply/index.d.ts +143 -0
- package/dist/auto-reply/index.js +391 -0
- package/dist/auto-reply/index.js.map +1 -0
- package/dist/automation/cron.d.ts +66 -0
- package/dist/automation/cron.js +226 -0
- package/dist/automation/cron.js.map +1 -0
- package/dist/automation/heartbeats.d.ts +63 -0
- package/dist/automation/heartbeats.js +144 -0
- package/dist/automation/heartbeats.js.map +1 -0
- package/dist/automation/index.d.ts +9 -0
- package/dist/automation/index.js +15 -0
- package/dist/automation/index.js.map +1 -0
- package/dist/automation/webhooks.d.ts +60 -0
- package/dist/automation/webhooks.js +225 -0
- package/dist/automation/webhooks.js.map +1 -0
- package/dist/bankr/client.d.ts +86 -0
- package/dist/bankr/client.js +177 -0
- package/dist/bankr/client.js.map +1 -0
- package/dist/bankr/index.d.ts +6 -0
- package/dist/bankr/index.js +23 -0
- package/dist/bankr/index.js.map +1 -0
- package/dist/base/index.d.ts +6 -0
- package/dist/base/index.js +23 -0
- package/dist/base/index.js.map +1 -0
- package/dist/base/provider.d.ts +27 -0
- package/dist/base/provider.js +128 -0
- package/dist/base/provider.js.map +1 -0
- package/dist/bin/worker.d.ts +31 -0
- package/dist/bin/worker.js +127 -0
- package/dist/bin/worker.js.map +1 -0
- package/dist/bittensor/chutes.d.ts +14 -0
- package/dist/bittensor/chutes.js +141 -0
- package/dist/bittensor/chutes.js.map +1 -0
- package/dist/bittensor/index.d.ts +7 -0
- package/dist/bittensor/index.js +13 -0
- package/dist/bittensor/index.js.map +1 -0
- package/dist/bittensor/persistence.d.ts +8 -0
- package/dist/bittensor/persistence.js +188 -0
- package/dist/bittensor/persistence.js.map +1 -0
- package/dist/bittensor/plugin.d.ts +30 -0
- package/dist/bittensor/plugin.js +134 -0
- package/dist/bittensor/plugin.js.map +1 -0
- package/dist/bittensor/python-runner.d.ts +7 -0
- package/dist/bittensor/python-runner.js +83 -0
- package/dist/bittensor/python-runner.js.map +1 -0
- package/dist/bittensor/server.d.ts +7 -0
- package/dist/bittensor/server.js +110 -0
- package/dist/bittensor/server.js.map +1 -0
- package/dist/bittensor/service.d.ts +7 -0
- package/dist/bittensor/service.js +291 -0
- package/dist/bittensor/service.js.map +1 -0
- package/dist/bittensor/tool.d.ts +45 -0
- package/dist/bittensor/tool.js +147 -0
- package/dist/bittensor/tool.js.map +1 -0
- package/dist/bittensor/types.d.ts +188 -0
- package/dist/bittensor/types.js +6 -0
- package/dist/bittensor/types.js.map +1 -0
- package/dist/bittensor/wallet.d.ts +18 -0
- package/dist/bittensor/wallet.js +192 -0
- package/dist/bittensor/wallet.js.map +1 -0
- package/dist/bridge/wormhole.d.ts +239 -0
- package/dist/bridge/wormhole.js +404 -0
- package/dist/bridge/wormhole.js.map +1 -0
- package/dist/browser/index.d.ts +67 -0
- package/dist/browser/index.js +458 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/cache/index.d.ts +105 -0
- package/dist/cache/index.js +306 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/canvas/index.d.ts +66 -0
- package/dist/canvas/index.js +391 -0
- package/dist/canvas/index.js.map +1 -0
- package/dist/channels/base-adapter.d.ts +126 -0
- package/dist/channels/base-adapter.js +416 -0
- package/dist/channels/base-adapter.js.map +1 -0
- package/dist/channels/bluebubbles/index.d.ts +23 -0
- package/dist/channels/bluebubbles/index.js +182 -0
- package/dist/channels/bluebubbles/index.js.map +1 -0
- package/dist/channels/discord/index.d.ts +25 -0
- package/dist/channels/discord/index.js +419 -0
- package/dist/channels/discord/index.js.map +1 -0
- package/dist/channels/googlechat/index.d.ts +35 -0
- package/dist/channels/googlechat/index.js +223 -0
- package/dist/channels/googlechat/index.js.map +1 -0
- package/dist/channels/imessage/index.d.ts +28 -0
- package/dist/channels/imessage/index.js +340 -0
- package/dist/channels/imessage/index.js.map +1 -0
- package/dist/channels/index.d.ts +58 -0
- package/dist/channels/index.js +382 -0
- package/dist/channels/index.js.map +1 -0
- package/dist/channels/line/index.d.ts +307 -0
- package/dist/channels/line/index.js +760 -0
- package/dist/channels/line/index.js.map +1 -0
- package/dist/channels/matrix/index.d.ts +35 -0
- package/dist/channels/matrix/index.js +328 -0
- package/dist/channels/matrix/index.js.map +1 -0
- package/dist/channels/mattermost/index.d.ts +25 -0
- package/dist/channels/mattermost/index.js +239 -0
- package/dist/channels/mattermost/index.js.map +1 -0
- package/dist/channels/nextcloud-talk/index.d.ts +25 -0
- package/dist/channels/nextcloud-talk/index.js +175 -0
- package/dist/channels/nextcloud-talk/index.js.map +1 -0
- package/dist/channels/nostr/index.d.ts +21 -0
- package/dist/channels/nostr/index.js +278 -0
- package/dist/channels/nostr/index.js.map +1 -0
- package/dist/channels/signal/index.d.ts +33 -0
- package/dist/channels/signal/index.js +333 -0
- package/dist/channels/signal/index.js.map +1 -0
- package/dist/channels/slack/index.d.ts +26 -0
- package/dist/channels/slack/index.js +266 -0
- package/dist/channels/slack/index.js.map +1 -0
- package/dist/channels/teams/index.d.ts +42 -0
- package/dist/channels/teams/index.js +312 -0
- package/dist/channels/teams/index.js.map +1 -0
- package/dist/channels/telegram/index.d.ts +9 -0
- package/dist/channels/telegram/index.js +761 -0
- package/dist/channels/telegram/index.js.map +1 -0
- package/dist/channels/tlon/index.d.ts +25 -0
- package/dist/channels/tlon/index.js +236 -0
- package/dist/channels/tlon/index.js.map +1 -0
- package/dist/channels/twitch/index.d.ts +25 -0
- package/dist/channels/twitch/index.js +182 -0
- package/dist/channels/twitch/index.js.map +1 -0
- package/dist/channels/voice/index.d.ts +31 -0
- package/dist/channels/voice/index.js +208 -0
- package/dist/channels/voice/index.js.map +1 -0
- package/dist/channels/webchat/index.d.ts +29 -0
- package/dist/channels/webchat/index.js +366 -0
- package/dist/channels/webchat/index.js.map +1 -0
- package/dist/channels/whatsapp/index.d.ts +72 -0
- package/dist/channels/whatsapp/index.js +767 -0
- package/dist/channels/whatsapp/index.js.map +1 -0
- package/dist/channels/zalo/index.d.ts +45 -0
- package/dist/channels/zalo/index.js +285 -0
- package/dist/channels/zalo/index.js.map +1 -0
- package/dist/cli/commands/doctor.d.ts +23 -0
- package/dist/cli/commands/doctor.js +649 -0
- package/dist/cli/commands/doctor.js.map +1 -0
- package/dist/cli/commands/gateway.d.ts +6 -0
- package/dist/cli/commands/gateway.js +32 -0
- package/dist/cli/commands/gateway.js.map +1 -0
- package/dist/cli/commands/index.d.ts +31 -0
- package/dist/cli/commands/index.js +3743 -0
- package/dist/cli/commands/index.js.map +1 -0
- package/dist/cli/commands/onboard.d.ts +4 -0
- package/dist/cli/commands/onboard.js +334 -0
- package/dist/cli/commands/onboard.js.map +1 -0
- package/dist/cli/commands/repl.d.ts +11 -0
- package/dist/cli/commands/repl.js +185 -0
- package/dist/cli/commands/repl.js.map +1 -0
- package/dist/cli/commands/skills.d.ts +29 -0
- package/dist/cli/commands/skills.js +297 -0
- package/dist/cli/commands/skills.js.map +1 -0
- package/dist/cli/index.d.ts +12 -0
- package/dist/cli/index.js +449 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/secure.d.ts +14 -0
- package/dist/cli/secure.js +626 -0
- package/dist/cli/secure.js.map +1 -0
- package/dist/commands/index.d.ts +61 -0
- package/dist/commands/index.js +290 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/registry.d.ts +69 -0
- package/dist/commands/registry.js +3142 -0
- package/dist/commands/registry.js.map +1 -0
- package/dist/config/index.d.ts +465 -0
- package/dist/config/index.js +1451 -0
- package/dist/config/index.js.map +1 -0
- package/dist/credentials/index.d.ts +51 -0
- package/dist/credentials/index.js +270 -0
- package/dist/credentials/index.js.map +1 -0
- package/dist/cron/index.d.ts +151 -0
- package/dist/cron/index.js +1283 -0
- package/dist/cron/index.js.map +1 -0
- package/dist/cron/types.d.ts +102 -0
- package/dist/cron/types.js +6 -0
- package/dist/cron/types.js.map +1 -0
- package/dist/daemon/index.d.ts +23 -0
- package/dist/daemon/index.js +159 -0
- package/dist/daemon/index.js.map +1 -0
- package/dist/db/index.d.ts +825 -0
- package/dist/db/index.js +3382 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/migrations.d.ts +70 -0
- package/dist/db/migrations.js +1373 -0
- package/dist/db/migrations.js.map +1 -0
- package/dist/docker/index.d.ts +188 -0
- package/dist/docker/index.js +571 -0
- package/dist/docker/index.js.map +1 -0
- package/dist/doctor/index.d.ts +47 -0
- package/dist/doctor/index.js +379 -0
- package/dist/doctor/index.js.map +1 -0
- package/dist/embeddings/index.d.ts +65 -0
- package/dist/embeddings/index.js +399 -0
- package/dist/embeddings/index.js.map +1 -0
- package/dist/evm/contracts.d.ts +112 -0
- package/dist/evm/contracts.js +332 -0
- package/dist/evm/contracts.js.map +1 -0
- package/dist/evm/index.d.ts +21 -0
- package/dist/evm/index.js +45 -0
- package/dist/evm/index.js.map +1 -0
- package/dist/evm/multichain.d.ts +87 -0
- package/dist/evm/multichain.js +308 -0
- package/dist/evm/multichain.js.map +1 -0
- package/dist/evm/odos.d.ts +62 -0
- package/dist/evm/odos.js +261 -0
- package/dist/evm/odos.js.map +1 -0
- package/dist/evm/oneinch.d.ts +55 -0
- package/dist/evm/oneinch.js +324 -0
- package/dist/evm/oneinch.js.map +1 -0
- package/dist/evm/transfers.d.ts +83 -0
- package/dist/evm/transfers.js +393 -0
- package/dist/evm/transfers.js.map +1 -0
- package/dist/evm/uniswap.d.ts +56 -0
- package/dist/evm/uniswap.js +307 -0
- package/dist/evm/uniswap.js.map +1 -0
- package/dist/evm/virtuals.d.ts +220 -0
- package/dist/evm/virtuals.js +735 -0
- package/dist/evm/virtuals.js.map +1 -0
- package/dist/evm/wallet.d.ts +96 -0
- package/dist/evm/wallet.js +258 -0
- package/dist/evm/wallet.js.map +1 -0
- package/dist/exchanges/binance-futures/index.d.ts +83 -0
- package/dist/exchanges/binance-futures/index.js +394 -0
- package/dist/exchanges/binance-futures/index.js.map +1 -0
- package/dist/exchanges/bybit/index.d.ts +78 -0
- package/dist/exchanges/bybit/index.js +379 -0
- package/dist/exchanges/bybit/index.js.map +1 -0
- package/dist/exchanges/hyperliquid/index.d.ts +594 -0
- package/dist/exchanges/hyperliquid/index.js +1101 -0
- package/dist/exchanges/hyperliquid/index.js.map +1 -0
- package/dist/exchanges/mexc/index.d.ts +80 -0
- package/dist/exchanges/mexc/index.js +389 -0
- package/dist/exchanges/mexc/index.js.map +1 -0
- package/dist/exchanges/opinion/index.d.ts +128 -0
- package/dist/exchanges/opinion/index.js +443 -0
- package/dist/exchanges/opinion/index.js.map +1 -0
- package/dist/exchanges/predictfun/index.d.ts +107 -0
- package/dist/exchanges/predictfun/index.js +398 -0
- package/dist/exchanges/predictfun/index.js.map +1 -0
- package/dist/execution/auto-redeem.d.ts +55 -0
- package/dist/execution/auto-redeem.js +324 -0
- package/dist/execution/auto-redeem.js.map +1 -0
- package/dist/execution/bracket-orders.d.ts +84 -0
- package/dist/execution/bracket-orders.js +387 -0
- package/dist/execution/bracket-orders.js.map +1 -0
- package/dist/execution/circuit-breaker.d.ts +87 -0
- package/dist/execution/circuit-breaker.js +274 -0
- package/dist/execution/circuit-breaker.js.map +1 -0
- package/dist/execution/dca-persistence.d.ts +47 -0
- package/dist/execution/dca-persistence.js +159 -0
- package/dist/execution/dca-persistence.js.map +1 -0
- package/dist/execution/dca.d.ts +60 -0
- package/dist/execution/dca.js +273 -0
- package/dist/execution/dca.js.map +1 -0
- package/dist/execution/futures.d.ts +162 -0
- package/dist/execution/futures.js +1336 -0
- package/dist/execution/futures.js.map +1 -0
- package/dist/execution/index.d.ts +346 -0
- package/dist/execution/index.js +2532 -0
- package/dist/execution/index.js.map +1 -0
- package/dist/execution/mev-protection.d.ts +150 -0
- package/dist/execution/mev-protection.js +377 -0
- package/dist/execution/mev-protection.js.map +1 -0
- package/dist/execution/order-persistence.d.ts +81 -0
- package/dist/execution/order-persistence.js +350 -0
- package/dist/execution/order-persistence.js.map +1 -0
- package/dist/execution/position-manager.d.ts +142 -0
- package/dist/execution/position-manager.js +404 -0
- package/dist/execution/position-manager.js.map +1 -0
- package/dist/execution/smart-router.d.ts +90 -0
- package/dist/execution/smart-router.js +323 -0
- package/dist/execution/smart-router.js.map +1 -0
- package/dist/execution/trigger-orders.d.ts +81 -0
- package/dist/execution/trigger-orders.js +266 -0
- package/dist/execution/trigger-orders.js.map +1 -0
- package/dist/execution/twap.d.ts +87 -0
- package/dist/execution/twap.js +405 -0
- package/dist/execution/twap.js.map +1 -0
- package/dist/extensions/copilot-proxy/index.d.ts +49 -0
- package/dist/extensions/copilot-proxy/index.js +204 -0
- package/dist/extensions/copilot-proxy/index.js.map +1 -0
- package/dist/extensions/diagnostics-otel/index.d.ts +54 -0
- package/dist/extensions/diagnostics-otel/index.js +290 -0
- package/dist/extensions/diagnostics-otel/index.js.map +1 -0
- package/dist/extensions/google-auth/index.d.ts +71 -0
- package/dist/extensions/google-auth/index.js +350 -0
- package/dist/extensions/google-auth/index.js.map +1 -0
- package/dist/extensions/index.d.ts +11 -0
- package/dist/extensions/index.js +29 -0
- package/dist/extensions/index.js.map +1 -0
- package/dist/extensions/llm-task/index.d.ts +80 -0
- package/dist/extensions/llm-task/index.js +248 -0
- package/dist/extensions/llm-task/index.js.map +1 -0
- package/dist/extensions/lobster/index.d.ts +69 -0
- package/dist/extensions/lobster/index.js +178 -0
- package/dist/extensions/lobster/index.js.map +1 -0
- package/dist/extensions/memory-lancedb/index.d.ts +62 -0
- package/dist/extensions/memory-lancedb/index.js +343 -0
- package/dist/extensions/memory-lancedb/index.js.map +1 -0
- package/dist/extensions/open-prose/index.d.ts +82 -0
- package/dist/extensions/open-prose/index.js +565 -0
- package/dist/extensions/open-prose/index.js.map +1 -0
- package/dist/extensions/qwen-portal/index.d.ts +48 -0
- package/dist/extensions/qwen-portal/index.js +161 -0
- package/dist/extensions/qwen-portal/index.js.map +1 -0
- package/dist/extensions/task-runner/index.d.ts +121 -0
- package/dist/extensions/task-runner/index.js +640 -0
- package/dist/extensions/task-runner/index.js.map +1 -0
- package/dist/farcaster/client.d.ts +101 -0
- package/dist/farcaster/client.js +282 -0
- package/dist/farcaster/client.js.map +1 -0
- package/dist/farcaster/index.d.ts +4 -0
- package/dist/farcaster/index.js +21 -0
- package/dist/farcaster/index.js.map +1 -0
- package/dist/feeds/acled/index.d.ts +86 -0
- package/dist/feeds/acled/index.js +215 -0
- package/dist/feeds/acled/index.js.map +1 -0
- package/dist/feeds/agentbets/index.d.ts +17 -0
- package/dist/feeds/agentbets/index.js +137 -0
- package/dist/feeds/agentbets/index.js.map +1 -0
- package/dist/feeds/betfair/index.d.ts +132 -0
- package/dist/feeds/betfair/index.js +640 -0
- package/dist/feeds/betfair/index.js.map +1 -0
- package/dist/feeds/crypto/index.d.ts +101 -0
- package/dist/feeds/crypto/index.js +506 -0
- package/dist/feeds/crypto/index.js.map +1 -0
- package/dist/feeds/crypto/whale-tracker.d.ts +138 -0
- package/dist/feeds/crypto/whale-tracker.js +685 -0
- package/dist/feeds/crypto/whale-tracker.js.map +1 -0
- package/dist/feeds/descriptors.d.ts +14 -0
- package/dist/feeds/descriptors.js +582 -0
- package/dist/feeds/descriptors.js.map +1 -0
- package/dist/feeds/drift/index.d.ts +23 -0
- package/dist/feeds/drift/index.js +182 -0
- package/dist/feeds/drift/index.js.map +1 -0
- package/dist/feeds/drift/trading.d.ts +75 -0
- package/dist/feeds/drift/trading.js +457 -0
- package/dist/feeds/drift/trading.js.map +1 -0
- package/dist/feeds/external/index.d.ts +48 -0
- package/dist/feeds/external/index.js +575 -0
- package/dist/feeds/external/index.js.map +1 -0
- package/dist/feeds/fred/index.d.ts +134 -0
- package/dist/feeds/fred/index.js +263 -0
- package/dist/feeds/fred/index.js.map +1 -0
- package/dist/feeds/freshness.d.ts +79 -0
- package/dist/feeds/freshness.js +259 -0
- package/dist/feeds/freshness.js.map +1 -0
- package/dist/feeds/hedgehog/index.d.ts +24 -0
- package/dist/feeds/hedgehog/index.js +589 -0
- package/dist/feeds/hedgehog/index.js.map +1 -0
- package/dist/feeds/hedgehog/types.d.ts +215 -0
- package/dist/feeds/hedgehog/types.js +7 -0
- package/dist/feeds/hedgehog/types.js.map +1 -0
- package/dist/feeds/index.d.ts +38 -0
- package/dist/feeds/index.js +469 -0
- package/dist/feeds/index.js.map +1 -0
- package/dist/feeds/kalshi/index.d.ts +116 -0
- package/dist/feeds/kalshi/index.js +970 -0
- package/dist/feeds/kalshi/index.js.map +1 -0
- package/dist/feeds/manifold/index.d.ts +15 -0
- package/dist/feeds/manifold/index.js +269 -0
- package/dist/feeds/manifold/index.js.map +1 -0
- package/dist/feeds/metaculus/index.d.ts +22 -0
- package/dist/feeds/metaculus/index.js +149 -0
- package/dist/feeds/metaculus/index.js.map +1 -0
- package/dist/feeds/news/index.d.ts +20 -0
- package/dist/feeds/news/index.js +308 -0
- package/dist/feeds/news/index.js.map +1 -0
- package/dist/feeds/opinion/index.d.ts +31 -0
- package/dist/feeds/opinion/index.js +389 -0
- package/dist/feeds/opinion/index.js.map +1 -0
- package/dist/feeds/polymarket/index.d.ts +21 -0
- package/dist/feeds/polymarket/index.js +501 -0
- package/dist/feeds/polymarket/index.js.map +1 -0
- package/dist/feeds/polymarket/rtds.d.ts +40 -0
- package/dist/feeds/polymarket/rtds.js +159 -0
- package/dist/feeds/polymarket/rtds.js.map +1 -0
- package/dist/feeds/polymarket/user-ws.d.ts +64 -0
- package/dist/feeds/polymarket/user-ws.js +230 -0
- package/dist/feeds/polymarket/user-ws.js.map +1 -0
- package/dist/feeds/polymarket/whale-tracker.d.ts +152 -0
- package/dist/feeds/polymarket/whale-tracker.js +709 -0
- package/dist/feeds/polymarket/whale-tracker.js.map +1 -0
- package/dist/feeds/predictfun/index.d.ts +24 -0
- package/dist/feeds/predictfun/index.js +234 -0
- package/dist/feeds/predictfun/index.js.map +1 -0
- package/dist/feeds/predictit/index.d.ts +14 -0
- package/dist/feeds/predictit/index.js +88 -0
- package/dist/feeds/predictit/index.js.map +1 -0
- package/dist/feeds/registry.d.ts +148 -0
- package/dist/feeds/registry.js +197 -0
- package/dist/feeds/registry.js.map +1 -0
- package/dist/feeds/smarkets/index.d.ts +76 -0
- package/dist/feeds/smarkets/index.js +415 -0
- package/dist/feeds/smarkets/index.js.map +1 -0
- package/dist/feeds/virtuals/index.d.ts +92 -0
- package/dist/feeds/virtuals/index.js +341 -0
- package/dist/feeds/virtuals/index.js.map +1 -0
- package/dist/feeds/weather-nws/index.d.ts +73 -0
- package/dist/feeds/weather-nws/index.js +162 -0
- package/dist/feeds/weather-nws/index.js.map +1 -0
- package/dist/feeds/weather-openmeteo/index.d.ts +80 -0
- package/dist/feeds/weather-openmeteo/index.js +197 -0
- package/dist/feeds/weather-openmeteo/index.js.map +1 -0
- package/dist/gateway/alerts-routes.d.ts +15 -0
- package/dist/gateway/alerts-routes.js +188 -0
- package/dist/gateway/alerts-routes.js.map +1 -0
- package/dist/gateway/alt-data-routes.d.ts +15 -0
- package/dist/gateway/alt-data-routes.js +67 -0
- package/dist/gateway/alt-data-routes.js.map +1 -0
- package/dist/gateway/api-routes.d.ts +39 -0
- package/dist/gateway/api-routes.js +1028 -0
- package/dist/gateway/api-routes.js.map +1 -0
- package/dist/gateway/audit-routes.d.ts +8 -0
- package/dist/gateway/audit-routes.js +61 -0
- package/dist/gateway/audit-routes.js.map +1 -0
- package/dist/gateway/bracket-routes.d.ts +12 -0
- package/dist/gateway/bracket-routes.js +122 -0
- package/dist/gateway/bracket-routes.js.map +1 -0
- package/dist/gateway/control-ui.d.ts +45 -0
- package/dist/gateway/control-ui.js +301 -0
- package/dist/gateway/control-ui.js.map +1 -0
- package/dist/gateway/copy-trading-routes.d.ts +12 -0
- package/dist/gateway/copy-trading-routes.js +159 -0
- package/dist/gateway/copy-trading-routes.js.map +1 -0
- package/dist/gateway/cron-routes.d.ts +14 -0
- package/dist/gateway/cron-routes.js +132 -0
- package/dist/gateway/cron-routes.js.map +1 -0
- package/dist/gateway/dca-routes.d.ts +8 -0
- package/dist/gateway/dca-routes.js +179 -0
- package/dist/gateway/dca-routes.js.map +1 -0
- package/dist/gateway/embeddings-routes.d.ts +12 -0
- package/dist/gateway/embeddings-routes.js +102 -0
- package/dist/gateway/embeddings-routes.js.map +1 -0
- package/dist/gateway/feeds-routes.d.ts +34 -0
- package/dist/gateway/feeds-routes.js +167 -0
- package/dist/gateway/feeds-routes.js.map +1 -0
- package/dist/gateway/index.d.ts +100 -0
- package/dist/gateway/index.js +2321 -0
- package/dist/gateway/index.js.map +1 -0
- package/dist/gateway/monitoring-routes.d.ts +12 -0
- package/dist/gateway/monitoring-routes.js +73 -0
- package/dist/gateway/monitoring-routes.js.map +1 -0
- package/dist/gateway/opportunity-routes.d.ts +12 -0
- package/dist/gateway/opportunity-routes.js +238 -0
- package/dist/gateway/opportunity-routes.js.map +1 -0
- package/dist/gateway/payments-routes.d.ts +14 -0
- package/dist/gateway/payments-routes.js +82 -0
- package/dist/gateway/payments-routes.js.map +1 -0
- package/dist/gateway/percolator-routes.d.ts +16 -0
- package/dist/gateway/percolator-routes.js +139 -0
- package/dist/gateway/percolator-routes.js.map +1 -0
- package/dist/gateway/queue-routes.d.ts +12 -0
- package/dist/gateway/queue-routes.js +47 -0
- package/dist/gateway/queue-routes.js.map +1 -0
- package/dist/gateway/risk-routes.d.ts +12 -0
- package/dist/gateway/risk-routes.js +119 -0
- package/dist/gateway/risk-routes.js.map +1 -0
- package/dist/gateway/routing-routes.d.ts +12 -0
- package/dist/gateway/routing-routes.js +86 -0
- package/dist/gateway/routing-routes.js.map +1 -0
- package/dist/gateway/server.d.ts +215 -0
- package/dist/gateway/server.js +2287 -0
- package/dist/gateway/server.js.map +1 -0
- package/dist/gateway/shield-routes.d.ts +8 -0
- package/dist/gateway/shield-routes.js +88 -0
- package/dist/gateway/shield-routes.js.map +1 -0
- package/dist/gateway/signal-bus.d.ts +51 -0
- package/dist/gateway/signal-bus.js +64 -0
- package/dist/gateway/signal-bus.js.map +1 -0
- package/dist/gateway/trigger-routes.d.ts +12 -0
- package/dist/gateway/trigger-routes.js +127 -0
- package/dist/gateway/trigger-routes.js.map +1 -0
- package/dist/gateway/twap-routes.d.ts +12 -0
- package/dist/gateway/twap-routes.js +142 -0
- package/dist/gateway/twap-routes.js.map +1 -0
- package/dist/gateway/webhooks-routes.d.ts +31 -0
- package/dist/gateway/webhooks-routes.js +107 -0
- package/dist/gateway/webhooks-routes.js.map +1 -0
- package/dist/gateway/whale-routes.d.ts +12 -0
- package/dist/gateway/whale-routes.js +204 -0
- package/dist/gateway/whale-routes.js.map +1 -0
- package/dist/history/index.d.ts +81 -0
- package/dist/history/index.js +362 -0
- package/dist/history/index.js.map +1 -0
- package/dist/hooks/index.d.ts +279 -0
- package/dist/hooks/index.js +739 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/i18n/index.d.ts +65 -0
- package/dist/i18n/index.js +183 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/identity/erc8004.d.ts +104 -0
- package/dist/identity/erc8004.js +493 -0
- package/dist/identity/erc8004.js.map +1 -0
- package/dist/identity/index.d.ts +1 -0
- package/dist/identity/index.js +18 -0
- package/dist/identity/index.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +240 -0
- package/dist/index.js.map +1 -0
- package/dist/infra/index.d.ts +133 -0
- package/dist/infra/index.js +481 -0
- package/dist/infra/index.js.map +1 -0
- package/dist/infra/retry.d.ts +132 -0
- package/dist/infra/retry.js +450 -0
- package/dist/infra/retry.js.map +1 -0
- package/dist/ledger/anchor.d.ts +45 -0
- package/dist/ledger/anchor.js +271 -0
- package/dist/ledger/anchor.js.map +1 -0
- package/dist/ledger/hash.d.ts +26 -0
- package/dist/ledger/hash.js +69 -0
- package/dist/ledger/hash.js.map +1 -0
- package/dist/ledger/hooks.d.ts +107 -0
- package/dist/ledger/hooks.js +314 -0
- package/dist/ledger/hooks.js.map +1 -0
- package/dist/ledger/index.d.ts +67 -0
- package/dist/ledger/index.js +221 -0
- package/dist/ledger/index.js.map +1 -0
- package/dist/ledger/storage.d.ts +57 -0
- package/dist/ledger/storage.js +368 -0
- package/dist/ledger/storage.js.map +1 -0
- package/dist/ledger/types.d.ts +138 -0
- package/dist/ledger/types.js +16 -0
- package/dist/ledger/types.js.map +1 -0
- package/dist/link-understanding/index.d.ts +61 -0
- package/dist/link-understanding/index.js +320 -0
- package/dist/link-understanding/index.js.map +1 -0
- package/dist/logging/index.d.ts +50 -0
- package/dist/logging/index.js +255 -0
- package/dist/logging/index.js.map +1 -0
- package/dist/macos/index.d.ts +143 -0
- package/dist/macos/index.js +587 -0
- package/dist/macos/index.js.map +1 -0
- package/dist/markdown/index.d.ts +43 -0
- package/dist/markdown/index.js +305 -0
- package/dist/markdown/index.js.map +1 -0
- package/dist/market-index/index.d.ts +51 -0
- package/dist/market-index/index.js +553 -0
- package/dist/market-index/index.js.map +1 -0
- package/dist/mcp/index.d.ts +263 -0
- package/dist/mcp/index.js +940 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/installer.d.ts +11 -0
- package/dist/mcp/installer.js +128 -0
- package/dist/mcp/installer.js.map +1 -0
- package/dist/mcp/server.d.ts +7 -0
- package/dist/mcp/server.js +172 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/media/index.d.ts +119 -0
- package/dist/media/index.js +740 -0
- package/dist/media/index.js.map +1 -0
- package/dist/memory/context.d.ts +189 -0
- package/dist/memory/context.js +541 -0
- package/dist/memory/context.js.map +1 -0
- package/dist/memory/index.d.ts +74 -0
- package/dist/memory/index.js +352 -0
- package/dist/memory/index.js.map +1 -0
- package/dist/memory/summarizer.d.ts +10 -0
- package/dist/memory/summarizer.js +51 -0
- package/dist/memory/summarizer.js.map +1 -0
- package/dist/memory/tokenizer.d.ts +4 -0
- package/dist/memory/tokenizer.js +61 -0
- package/dist/memory/tokenizer.js.map +1 -0
- package/dist/messages/unified.d.ts +7 -0
- package/dist/messages/unified.js +77 -0
- package/dist/messages/unified.js.map +1 -0
- package/dist/ml-pipeline/collector.d.ts +23 -0
- package/dist/ml-pipeline/collector.js +176 -0
- package/dist/ml-pipeline/collector.js.map +1 -0
- package/dist/ml-pipeline/index.d.ts +21 -0
- package/dist/ml-pipeline/index.js +72 -0
- package/dist/ml-pipeline/index.js.map +1 -0
- package/dist/ml-pipeline/trainer.d.ts +32 -0
- package/dist/ml-pipeline/trainer.js +228 -0
- package/dist/ml-pipeline/trainer.js.map +1 -0
- package/dist/ml-pipeline/types.d.ts +51 -0
- package/dist/ml-pipeline/types.js +23 -0
- package/dist/ml-pipeline/types.js.map +1 -0
- package/dist/models/adaptive.d.ts +11 -0
- package/dist/models/adaptive.js +64 -0
- package/dist/models/adaptive.js.map +1 -0
- package/dist/models/failover.d.ts +51 -0
- package/dist/models/failover.js +151 -0
- package/dist/models/failover.js.map +1 -0
- package/dist/models/index.d.ts +7 -0
- package/dist/models/index.js +13 -0
- package/dist/models/index.js.map +1 -0
- package/dist/monitoring/alerts.d.ts +185 -0
- package/dist/monitoring/alerts.js +565 -0
- package/dist/monitoring/alerts.js.map +1 -0
- package/dist/monitoring/health.d.ts +151 -0
- package/dist/monitoring/health.js +423 -0
- package/dist/monitoring/health.js.map +1 -0
- package/dist/monitoring/index.d.ts +25 -0
- package/dist/monitoring/index.js +258 -0
- package/dist/monitoring/index.js.map +1 -0
- package/dist/monitoring/metrics.d.ts +147 -0
- package/dist/monitoring/metrics.js +519 -0
- package/dist/monitoring/metrics.js.map +1 -0
- package/dist/nodes/index.d.ts +81 -0
- package/dist/nodes/index.js +475 -0
- package/dist/nodes/index.js.map +1 -0
- package/dist/opportunity/analytics.d.ts +221 -0
- package/dist/opportunity/analytics.js +678 -0
- package/dist/opportunity/analytics.js.map +1 -0
- package/dist/opportunity/combinatorial.d.ts +147 -0
- package/dist/opportunity/combinatorial.js +765 -0
- package/dist/opportunity/combinatorial.js.map +1 -0
- package/dist/opportunity/correlation.d.ts +107 -0
- package/dist/opportunity/correlation.js +410 -0
- package/dist/opportunity/correlation.js.map +1 -0
- package/dist/opportunity/executor.d.ts +108 -0
- package/dist/opportunity/executor.js +356 -0
- package/dist/opportunity/executor.js.map +1 -0
- package/dist/opportunity/index.d.ts +285 -0
- package/dist/opportunity/index.js +839 -0
- package/dist/opportunity/index.js.map +1 -0
- package/dist/opportunity/links.d.ts +87 -0
- package/dist/opportunity/links.js +344 -0
- package/dist/opportunity/links.js.map +1 -0
- package/dist/opportunity/matching.d.ts +101 -0
- package/dist/opportunity/matching.js +551 -0
- package/dist/opportunity/matching.js.map +1 -0
- package/dist/opportunity/outcomes.d.ts +74 -0
- package/dist/opportunity/outcomes.js +321 -0
- package/dist/opportunity/outcomes.js.map +1 -0
- package/dist/opportunity/risk.d.ts +128 -0
- package/dist/opportunity/risk.js +381 -0
- package/dist/opportunity/risk.js.map +1 -0
- package/dist/opportunity/scoring.d.ts +151 -0
- package/dist/opportunity/scoring.js +421 -0
- package/dist/opportunity/scoring.js.map +1 -0
- package/dist/pairing/index.d.ts +108 -0
- package/dist/pairing/index.js +431 -0
- package/dist/pairing/index.js.map +1 -0
- package/dist/payments/index.d.ts +12 -0
- package/dist/payments/index.js +34 -0
- package/dist/payments/index.js.map +1 -0
- package/dist/payments/x402/evm.d.ts +53 -0
- package/dist/payments/x402/evm.js +282 -0
- package/dist/payments/x402/evm.js.map +1 -0
- package/dist/payments/x402/index.d.ts +158 -0
- package/dist/payments/x402/index.js +531 -0
- package/dist/payments/x402/index.js.map +1 -0
- package/dist/payments/x402/solana.d.ts +51 -0
- package/dist/payments/x402/solana.js +397 -0
- package/dist/payments/x402/solana.js.map +1 -0
- package/dist/percolator/accounts.d.ts +21 -0
- package/dist/percolator/accounts.js +76 -0
- package/dist/percolator/accounts.js.map +1 -0
- package/dist/percolator/encode.d.ts +14 -0
- package/dist/percolator/encode.js +90 -0
- package/dist/percolator/encode.js.map +1 -0
- package/dist/percolator/execution.d.ts +29 -0
- package/dist/percolator/execution.js +239 -0
- package/dist/percolator/execution.js.map +1 -0
- package/dist/percolator/feed.d.ts +15 -0
- package/dist/percolator/feed.js +160 -0
- package/dist/percolator/feed.js.map +1 -0
- package/dist/percolator/index.d.ts +20 -0
- package/dist/percolator/index.js +24 -0
- package/dist/percolator/index.js.map +1 -0
- package/dist/percolator/instructions.d.ts +29 -0
- package/dist/percolator/instructions.js +52 -0
- package/dist/percolator/instructions.js.map +1 -0
- package/dist/percolator/keeper.d.ts +11 -0
- package/dist/percolator/keeper.js +83 -0
- package/dist/percolator/keeper.js.map +1 -0
- package/dist/percolator/pda.d.ts +15 -0
- package/dist/percolator/pda.js +26 -0
- package/dist/percolator/pda.js.map +1 -0
- package/dist/percolator/slab.d.ts +122 -0
- package/dist/percolator/slab.js +325 -0
- package/dist/percolator/slab.js.map +1 -0
- package/dist/percolator/tx.d.ts +27 -0
- package/dist/percolator/tx.js +77 -0
- package/dist/percolator/tx.js.map +1 -0
- package/dist/percolator/types.d.ts +51 -0
- package/dist/percolator/types.js +9 -0
- package/dist/percolator/types.js.map +1 -0
- package/dist/permissions/index.d.ts +262 -0
- package/dist/permissions/index.js +929 -0
- package/dist/permissions/index.js.map +1 -0
- package/dist/plugins/index.d.ts +158 -0
- package/dist/plugins/index.js +444 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/portfolio/index.d.ts +170 -0
- package/dist/portfolio/index.js +970 -0
- package/dist/portfolio/index.js.map +1 -0
- package/dist/presence/index.d.ts +34 -0
- package/dist/presence/index.js +124 -0
- package/dist/presence/index.js.map +1 -0
- package/dist/process/index.d.ts +82 -0
- package/dist/process/index.js +402 -0
- package/dist/process/index.js.map +1 -0
- package/dist/providers/discovery.d.ts +209 -0
- package/dist/providers/discovery.js +751 -0
- package/dist/providers/discovery.js.map +1 -0
- package/dist/providers/health.d.ts +27 -0
- package/dist/providers/health.js +80 -0
- package/dist/providers/health.js.map +1 -0
- package/dist/providers/index.d.ts +154 -0
- package/dist/providers/index.js +897 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/queue/index.d.ts +36 -0
- package/dist/queue/index.js +146 -0
- package/dist/queue/index.js.map +1 -0
- package/dist/queue/jobs/index.d.ts +11 -0
- package/dist/queue/jobs/index.js +32 -0
- package/dist/queue/jobs/index.js.map +1 -0
- package/dist/queue/jobs/producer.d.ts +43 -0
- package/dist/queue/jobs/producer.js +233 -0
- package/dist/queue/jobs/producer.js.map +1 -0
- package/dist/queue/jobs/types.d.ts +128 -0
- package/dist/queue/jobs/types.js +14 -0
- package/dist/queue/jobs/types.js.map +1 -0
- package/dist/queue/jobs/worker.d.ts +22 -0
- package/dist/queue/jobs/worker.js +220 -0
- package/dist/queue/jobs/worker.js.map +1 -0
- package/dist/remote/index.d.ts +136 -0
- package/dist/remote/index.js +456 -0
- package/dist/remote/index.js.map +1 -0
- package/dist/risk/circuit-breaker.d.ts +99 -0
- package/dist/risk/circuit-breaker.js +300 -0
- package/dist/risk/circuit-breaker.js.map +1 -0
- package/dist/risk/dashboard.d.ts +69 -0
- package/dist/risk/dashboard.js +127 -0
- package/dist/risk/dashboard.js.map +1 -0
- package/dist/risk/engine.d.ts +128 -0
- package/dist/risk/engine.js +311 -0
- package/dist/risk/engine.js.map +1 -0
- package/dist/risk/index.d.ts +10 -0
- package/dist/risk/index.js +38 -0
- package/dist/risk/index.js.map +1 -0
- package/dist/risk/stress.d.ts +70 -0
- package/dist/risk/stress.js +215 -0
- package/dist/risk/stress.js.map +1 -0
- package/dist/risk/var.d.ts +72 -0
- package/dist/risk/var.js +173 -0
- package/dist/risk/var.js.map +1 -0
- package/dist/risk/volatility.d.ts +61 -0
- package/dist/risk/volatility.js +132 -0
- package/dist/risk/volatility.js.map +1 -0
- package/dist/routing/index.d.ts +116 -0
- package/dist/routing/index.js +371 -0
- package/dist/routing/index.js.map +1 -0
- package/dist/search/index.d.ts +30 -0
- package/dist/search/index.js +129 -0
- package/dist/search/index.js.map +1 -0
- package/dist/security/address-checker.d.ts +6 -0
- package/dist/security/address-checker.js +213 -0
- package/dist/security/address-checker.js.map +1 -0
- package/dist/security/code-scanner.d.ts +3 -0
- package/dist/security/code-scanner.js +190 -0
- package/dist/security/code-scanner.js.map +1 -0
- package/dist/security/index.d.ts +176 -0
- package/dist/security/index.js +498 -0
- package/dist/security/index.js.map +1 -0
- package/dist/security/sanitizer.d.ts +2 -0
- package/dist/security/sanitizer.js +135 -0
- package/dist/security/sanitizer.js.map +1 -0
- package/dist/security/scam-db.d.ts +5 -0
- package/dist/security/scam-db.js +116 -0
- package/dist/security/scam-db.js.map +1 -0
- package/dist/security/shield.d.ts +12 -0
- package/dist/security/shield.js +80 -0
- package/dist/security/shield.js.map +1 -0
- package/dist/security/tx-validator.d.ts +5 -0
- package/dist/security/tx-validator.js +115 -0
- package/dist/security/tx-validator.js.map +1 -0
- package/dist/security/types.d.ts +84 -0
- package/dist/security/types.js +6 -0
- package/dist/security/types.js.map +1 -0
- package/dist/services/alt-data/feeds/fear-greed.d.ts +14 -0
- package/dist/services/alt-data/feeds/fear-greed.js +81 -0
- package/dist/services/alt-data/feeds/fear-greed.js.map +1 -0
- package/dist/services/alt-data/feeds/funding-rates.d.ts +13 -0
- package/dist/services/alt-data/feeds/funding-rates.js +90 -0
- package/dist/services/alt-data/feeds/funding-rates.js.map +1 -0
- package/dist/services/alt-data/feeds/reddit.d.ts +13 -0
- package/dist/services/alt-data/feeds/reddit.js +112 -0
- package/dist/services/alt-data/feeds/reddit.js.map +1 -0
- package/dist/services/alt-data/index.d.ts +31 -0
- package/dist/services/alt-data/index.js +278 -0
- package/dist/services/alt-data/index.js.map +1 -0
- package/dist/services/alt-data/market-matcher.d.ts +29 -0
- package/dist/services/alt-data/market-matcher.js +157 -0
- package/dist/services/alt-data/market-matcher.js.map +1 -0
- package/dist/services/alt-data/sentiment.d.ts +11 -0
- package/dist/services/alt-data/sentiment.js +277 -0
- package/dist/services/alt-data/sentiment.js.map +1 -0
- package/dist/services/alt-data/types.d.ts +86 -0
- package/dist/services/alt-data/types.js +9 -0
- package/dist/services/alt-data/types.js.map +1 -0
- package/dist/services/feature-engineering/accessor.d.ts +19 -0
- package/dist/services/feature-engineering/accessor.js +31 -0
- package/dist/services/feature-engineering/accessor.js.map +1 -0
- package/dist/services/feature-engineering/index.d.ts +15 -0
- package/dist/services/feature-engineering/index.js +345 -0
- package/dist/services/feature-engineering/index.js.map +1 -0
- package/dist/services/feature-engineering/indicators.d.ts +90 -0
- package/dist/services/feature-engineering/indicators.js +254 -0
- package/dist/services/feature-engineering/indicators.js.map +1 -0
- package/dist/services/feature-engineering/rolling-window.d.ts +89 -0
- package/dist/services/feature-engineering/rolling-window.js +173 -0
- package/dist/services/feature-engineering/rolling-window.js.map +1 -0
- package/dist/services/feature-engineering/thresholds.d.ts +137 -0
- package/dist/services/feature-engineering/thresholds.js +280 -0
- package/dist/services/feature-engineering/thresholds.js.map +1 -0
- package/dist/services/feature-engineering/types.d.ts +138 -0
- package/dist/services/feature-engineering/types.js +6 -0
- package/dist/services/feature-engineering/types.js.map +1 -0
- package/dist/services/tick-recorder/index.d.ts +12 -0
- package/dist/services/tick-recorder/index.js +200 -0
- package/dist/services/tick-recorder/index.js.map +1 -0
- package/dist/services/tick-recorder/queries.d.ts +46 -0
- package/dist/services/tick-recorder/queries.js +291 -0
- package/dist/services/tick-recorder/queries.js.map +1 -0
- package/dist/services/tick-recorder/schema.d.ts +27 -0
- package/dist/services/tick-recorder/schema.js +185 -0
- package/dist/services/tick-recorder/schema.js.map +1 -0
- package/dist/services/tick-recorder/timescale.d.ts +27 -0
- package/dist/services/tick-recorder/timescale.js +105 -0
- package/dist/services/tick-recorder/timescale.js.map +1 -0
- package/dist/services/tick-recorder/types.d.ts +113 -0
- package/dist/services/tick-recorder/types.js +7 -0
- package/dist/services/tick-recorder/types.js.map +1 -0
- package/dist/services/tick-streamer/index.d.ts +12 -0
- package/dist/services/tick-streamer/index.js +317 -0
- package/dist/services/tick-streamer/index.js.map +1 -0
- package/dist/services/tick-streamer/types.d.ts +134 -0
- package/dist/services/tick-streamer/types.js +6 -0
- package/dist/services/tick-streamer/types.js.map +1 -0
- package/dist/session/index.d.ts +147 -0
- package/dist/session/index.js +429 -0
- package/dist/session/index.js.map +1 -0
- package/dist/sessions/index.d.ts +69 -0
- package/dist/sessions/index.js +447 -0
- package/dist/sessions/index.js.map +1 -0
- package/dist/signal-router/index.d.ts +2 -0
- package/dist/signal-router/index.js +6 -0
- package/dist/signal-router/index.js.map +1 -0
- package/dist/signal-router/router.d.ts +25 -0
- package/dist/signal-router/router.js +391 -0
- package/dist/signal-router/router.js.map +1 -0
- package/dist/signal-router/types.d.ts +64 -0
- package/dist/signal-router/types.js +9 -0
- package/dist/signal-router/types.js.map +1 -0
- package/dist/skills/bundled/acp/index.d.ts +25 -0
- package/dist/skills/bundled/acp/index.js +472 -0
- package/dist/skills/bundled/acp/index.js.map +1 -0
- package/dist/skills/bundled/agentbets/index.d.ts +15 -0
- package/dist/skills/bundled/agentbets/index.js +168 -0
- package/dist/skills/bundled/agentbets/index.js.map +1 -0
- package/dist/skills/bundled/ai-strategy/index.d.ts +21 -0
- package/dist/skills/bundled/ai-strategy/index.js +647 -0
- package/dist/skills/bundled/ai-strategy/index.js.map +1 -0
- package/dist/skills/bundled/alerts/index.d.ts +20 -0
- package/dist/skills/bundled/alerts/index.js +249 -0
- package/dist/skills/bundled/alerts/index.js.map +1 -0
- package/dist/skills/bundled/analytics/index.d.ts +17 -0
- package/dist/skills/bundled/analytics/index.js +112 -0
- package/dist/skills/bundled/analytics/index.js.map +1 -0
- package/dist/skills/bundled/arbitrage/index.d.ts +24 -0
- package/dist/skills/bundled/arbitrage/index.js +253 -0
- package/dist/skills/bundled/arbitrage/index.js.map +1 -0
- package/dist/skills/bundled/auto-reply/index.d.ts +18 -0
- package/dist/skills/bundled/auto-reply/index.js +215 -0
- package/dist/skills/bundled/auto-reply/index.js.map +1 -0
- package/dist/skills/bundled/automation/index.d.ts +19 -0
- package/dist/skills/bundled/automation/index.js +160 -0
- package/dist/skills/bundled/automation/index.js.map +1 -0
- package/dist/skills/bundled/backtest/index.d.ts +18 -0
- package/dist/skills/bundled/backtest/index.js +250 -0
- package/dist/skills/bundled/backtest/index.js.map +1 -0
- package/dist/skills/bundled/bags/index.d.ts +49 -0
- package/dist/skills/bundled/bags/index.js +1069 -0
- package/dist/skills/bundled/bags/index.js.map +1 -0
- package/dist/skills/bundled/bankr/index.d.ts +161 -0
- package/dist/skills/bundled/bankr/index.js +271 -0
- package/dist/skills/bundled/bankr/index.js.map +1 -0
- package/dist/skills/bundled/betfair/index.d.ts +24 -0
- package/dist/skills/bundled/betfair/index.js +511 -0
- package/dist/skills/bundled/betfair/index.js.map +1 -0
- package/dist/skills/bundled/binance-futures/index.d.ts +15 -0
- package/dist/skills/bundled/binance-futures/index.js +485 -0
- package/dist/skills/bundled/binance-futures/index.js.map +1 -0
- package/dist/skills/bundled/botchan/index.d.ts +130 -0
- package/dist/skills/bundled/botchan/index.js +427 -0
- package/dist/skills/bundled/botchan/index.js.map +1 -0
- package/dist/skills/bundled/bridge/index.d.ts +17 -0
- package/dist/skills/bundled/bridge/index.js +297 -0
- package/dist/skills/bundled/bridge/index.js.map +1 -0
- package/dist/skills/bundled/bybit-futures/index.d.ts +15 -0
- package/dist/skills/bundled/bybit-futures/index.js +380 -0
- package/dist/skills/bundled/bybit-futures/index.js.map +1 -0
- package/dist/skills/bundled/clanker/index.d.ts +236 -0
- package/dist/skills/bundled/clanker/index.js +759 -0
- package/dist/skills/bundled/clanker/index.js.map +1 -0
- package/dist/skills/bundled/copy-trading/index.d.ts +20 -0
- package/dist/skills/bundled/copy-trading/index.js +213 -0
- package/dist/skills/bundled/copy-trading/index.js.map +1 -0
- package/dist/skills/bundled/copy-trading-solana/index.d.ts +21 -0
- package/dist/skills/bundled/copy-trading-solana/index.js +421 -0
- package/dist/skills/bundled/copy-trading-solana/index.js.map +1 -0
- package/dist/skills/bundled/credentials/index.d.ts +17 -0
- package/dist/skills/bundled/credentials/index.js +137 -0
- package/dist/skills/bundled/credentials/index.js.map +1 -0
- package/dist/skills/bundled/crypto-hft/index.d.ts +26 -0
- package/dist/skills/bundled/crypto-hft/index.js +361 -0
- package/dist/skills/bundled/crypto-hft/index.js.map +1 -0
- package/dist/skills/bundled/dca/index.d.ts +26 -0
- package/dist/skills/bundled/dca/index.js +1342 -0
- package/dist/skills/bundled/dca/index.js.map +1 -0
- package/dist/skills/bundled/divergence/index.d.ts +19 -0
- package/dist/skills/bundled/divergence/index.js +272 -0
- package/dist/skills/bundled/divergence/index.js.map +1 -0
- package/dist/skills/bundled/doctor/index.d.ts +18 -0
- package/dist/skills/bundled/doctor/index.js +78 -0
- package/dist/skills/bundled/doctor/index.js.map +1 -0
- package/dist/skills/bundled/drift/index.d.ts +13 -0
- package/dist/skills/bundled/drift/index.js +378 -0
- package/dist/skills/bundled/drift/index.js.map +1 -0
- package/dist/skills/bundled/drift-sdk/index.d.ts +17 -0
- package/dist/skills/bundled/drift-sdk/index.js +501 -0
- package/dist/skills/bundled/drift-sdk/index.js.map +1 -0
- package/dist/skills/bundled/edge/index.d.ts +16 -0
- package/dist/skills/bundled/edge/index.js +91 -0
- package/dist/skills/bundled/edge/index.js.map +1 -0
- package/dist/skills/bundled/embeddings/index.d.ts +19 -0
- package/dist/skills/bundled/embeddings/index.js +215 -0
- package/dist/skills/bundled/embeddings/index.js.map +1 -0
- package/dist/skills/bundled/endaoment/index.d.ts +105 -0
- package/dist/skills/bundled/endaoment/index.js +285 -0
- package/dist/skills/bundled/endaoment/index.js.map +1 -0
- package/dist/skills/bundled/ens/index.d.ts +151 -0
- package/dist/skills/bundled/ens/index.js +278 -0
- package/dist/skills/bundled/ens/index.js.map +1 -0
- package/dist/skills/bundled/erc8004/index.d.ts +123 -0
- package/dist/skills/bundled/erc8004/index.js +301 -0
- package/dist/skills/bundled/erc8004/index.js.map +1 -0
- package/dist/skills/bundled/execution/index.d.ts +18 -0
- package/dist/skills/bundled/execution/index.js +358 -0
- package/dist/skills/bundled/execution/index.js.map +1 -0
- package/dist/skills/bundled/farcaster/index.d.ts +121 -0
- package/dist/skills/bundled/farcaster/index.js +314 -0
- package/dist/skills/bundled/farcaster/index.js.map +1 -0
- package/dist/skills/bundled/features/index.d.ts +17 -0
- package/dist/skills/bundled/features/index.js +305 -0
- package/dist/skills/bundled/features/index.js.map +1 -0
- package/dist/skills/bundled/feeds/index.d.ts +26 -0
- package/dist/skills/bundled/feeds/index.js +462 -0
- package/dist/skills/bundled/feeds/index.js.map +1 -0
- package/dist/skills/bundled/harden/index.d.ts +55 -0
- package/dist/skills/bundled/harden/index.js +510 -0
- package/dist/skills/bundled/harden/index.js.map +1 -0
- package/dist/skills/bundled/history/index.d.ts +21 -0
- package/dist/skills/bundled/history/index.js +195 -0
- package/dist/skills/bundled/history/index.js.map +1 -0
- package/dist/skills/bundled/hyperliquid/index.d.ts +19 -0
- package/dist/skills/bundled/hyperliquid/index.js +1280 -0
- package/dist/skills/bundled/hyperliquid/index.js.map +1 -0
- package/dist/skills/bundled/identity/index.d.ts +17 -0
- package/dist/skills/bundled/identity/index.js +223 -0
- package/dist/skills/bundled/identity/index.js.map +1 -0
- package/dist/skills/bundled/integrations/index.d.ts +17 -0
- package/dist/skills/bundled/integrations/index.js +138 -0
- package/dist/skills/bundled/integrations/index.js.map +1 -0
- package/dist/skills/bundled/jupiter/index.d.ts +41 -0
- package/dist/skills/bundled/jupiter/index.js +872 -0
- package/dist/skills/bundled/jupiter/index.js.map +1 -0
- package/dist/skills/bundled/kamino/index.d.ts +33 -0
- package/dist/skills/bundled/kamino/index.js +578 -0
- package/dist/skills/bundled/kamino/index.js.map +1 -0
- package/dist/skills/bundled/ledger/index.d.ts +14 -0
- package/dist/skills/bundled/ledger/index.js +186 -0
- package/dist/skills/bundled/ledger/index.js.map +1 -0
- package/dist/skills/bundled/market-index/index.d.ts +18 -0
- package/dist/skills/bundled/market-index/index.js +182 -0
- package/dist/skills/bundled/market-index/index.js.map +1 -0
- package/dist/skills/bundled/markets/index.d.ts +16 -0
- package/dist/skills/bundled/markets/index.js +95 -0
- package/dist/skills/bundled/markets/index.js.map +1 -0
- package/dist/skills/bundled/mcp/index.d.ts +19 -0
- package/dist/skills/bundled/mcp/index.js +212 -0
- package/dist/skills/bundled/mcp/index.js.map +1 -0
- package/dist/skills/bundled/memory/index.d.ts +20 -0
- package/dist/skills/bundled/memory/index.js +210 -0
- package/dist/skills/bundled/memory/index.js.map +1 -0
- package/dist/skills/bundled/metaculus/index.d.ts +17 -0
- package/dist/skills/bundled/metaculus/index.js +168 -0
- package/dist/skills/bundled/metaculus/index.js.map +1 -0
- package/dist/skills/bundled/meteora/index.d.ts +39 -0
- package/dist/skills/bundled/meteora/index.js +837 -0
- package/dist/skills/bundled/meteora/index.js.map +1 -0
- package/dist/skills/bundled/meteora-dbc/index.d.ts +33 -0
- package/dist/skills/bundled/meteora-dbc/index.js +993 -0
- package/dist/skills/bundled/meteora-dbc/index.js.map +1 -0
- package/dist/skills/bundled/metrics/index.d.ts +18 -0
- package/dist/skills/bundled/metrics/index.js +91 -0
- package/dist/skills/bundled/metrics/index.js.map +1 -0
- package/dist/skills/bundled/mev/index.d.ts +17 -0
- package/dist/skills/bundled/mev/index.js +108 -0
- package/dist/skills/bundled/mev/index.js.map +1 -0
- package/dist/skills/bundled/mexc-futures/index.d.ts +16 -0
- package/dist/skills/bundled/mexc-futures/index.js +389 -0
- package/dist/skills/bundled/mexc-futures/index.js.map +1 -0
- package/dist/skills/bundled/mm/index.d.ts +18 -0
- package/dist/skills/bundled/mm/index.js +315 -0
- package/dist/skills/bundled/mm/index.js.map +1 -0
- package/dist/skills/bundled/monitoring/index.d.ts +18 -0
- package/dist/skills/bundled/monitoring/index.js +146 -0
- package/dist/skills/bundled/monitoring/index.js.map +1 -0
- package/dist/skills/bundled/news/index.d.ts +17 -0
- package/dist/skills/bundled/news/index.js +161 -0
- package/dist/skills/bundled/news/index.js.map +1 -0
- package/dist/skills/bundled/onchainkit/index.d.ts +92 -0
- package/dist/skills/bundled/onchainkit/index.js +429 -0
- package/dist/skills/bundled/onchainkit/index.js.map +1 -0
- package/dist/skills/bundled/opinion/index.d.ts +12 -0
- package/dist/skills/bundled/opinion/index.js +429 -0
- package/dist/skills/bundled/opinion/index.js.map +1 -0
- package/dist/skills/bundled/opportunity/index.d.ts +25 -0
- package/dist/skills/bundled/opportunity/index.js +289 -0
- package/dist/skills/bundled/opportunity/index.js.map +1 -0
- package/dist/skills/bundled/orca/index.d.ts +12 -0
- package/dist/skills/bundled/orca/index.js +663 -0
- package/dist/skills/bundled/orca/index.js.map +1 -0
- package/dist/skills/bundled/pairing/index.d.ts +24 -0
- package/dist/skills/bundled/pairing/index.js +228 -0
- package/dist/skills/bundled/pairing/index.js.map +1 -0
- package/dist/skills/bundled/percolator/index.d.ts +20 -0
- package/dist/skills/bundled/percolator/index.js +229 -0
- package/dist/skills/bundled/percolator/index.js.map +1 -0
- package/dist/skills/bundled/permissions/index.d.ts +21 -0
- package/dist/skills/bundled/permissions/index.js +204 -0
- package/dist/skills/bundled/permissions/index.js.map +1 -0
- package/dist/skills/bundled/plugins/index.d.ts +20 -0
- package/dist/skills/bundled/plugins/index.js +209 -0
- package/dist/skills/bundled/plugins/index.js.map +1 -0
- package/dist/skills/bundled/portfolio/index.d.ts +20 -0
- package/dist/skills/bundled/portfolio/index.js +367 -0
- package/dist/skills/bundled/portfolio/index.js.map +1 -0
- package/dist/skills/bundled/portfolio-sync/index.d.ts +17 -0
- package/dist/skills/bundled/portfolio-sync/index.js +116 -0
- package/dist/skills/bundled/portfolio-sync/index.js.map +1 -0
- package/dist/skills/bundled/positions/index.d.ts +18 -0
- package/dist/skills/bundled/positions/index.js +161 -0
- package/dist/skills/bundled/positions/index.js.map +1 -0
- package/dist/skills/bundled/predictfun/index.d.ts +13 -0
- package/dist/skills/bundled/predictfun/index.js +612 -0
- package/dist/skills/bundled/predictfun/index.js.map +1 -0
- package/dist/skills/bundled/predictit/index.d.ts +16 -0
- package/dist/skills/bundled/predictit/index.js +138 -0
- package/dist/skills/bundled/predictit/index.js.map +1 -0
- package/dist/skills/bundled/presence/index.d.ts +18 -0
- package/dist/skills/bundled/presence/index.js +151 -0
- package/dist/skills/bundled/presence/index.js.map +1 -0
- package/dist/skills/bundled/processes/index.d.ts +17 -0
- package/dist/skills/bundled/processes/index.js +121 -0
- package/dist/skills/bundled/processes/index.js.map +1 -0
- package/dist/skills/bundled/pump-swarm/index.d.ts +16 -0
- package/dist/skills/bundled/pump-swarm/index.js +2235 -0
- package/dist/skills/bundled/pump-swarm/index.js.map +1 -0
- package/dist/skills/bundled/pumpfun/index.d.ts +47 -0
- package/dist/skills/bundled/pumpfun/index.js +1400 -0
- package/dist/skills/bundled/pumpfun/index.js.map +1 -0
- package/dist/skills/bundled/qmd/index.d.ts +18 -0
- package/dist/skills/bundled/qmd/index.js +116 -0
- package/dist/skills/bundled/qmd/index.js.map +1 -0
- package/dist/skills/bundled/qrcoin/index.d.ts +92 -0
- package/dist/skills/bundled/qrcoin/index.js +328 -0
- package/dist/skills/bundled/qrcoin/index.js.map +1 -0
- package/dist/skills/bundled/raydium/index.d.ts +35 -0
- package/dist/skills/bundled/raydium/index.js +695 -0
- package/dist/skills/bundled/raydium/index.js.map +1 -0
- package/dist/skills/bundled/remote/index.d.ts +19 -0
- package/dist/skills/bundled/remote/index.js +186 -0
- package/dist/skills/bundled/remote/index.js.map +1 -0
- package/dist/skills/bundled/research/index.d.ts +17 -0
- package/dist/skills/bundled/research/index.js +185 -0
- package/dist/skills/bundled/research/index.js.map +1 -0
- package/dist/skills/bundled/risk/index.d.ts +31 -0
- package/dist/skills/bundled/risk/index.js +379 -0
- package/dist/skills/bundled/risk/index.js.map +1 -0
- package/dist/skills/bundled/router/index.d.ts +17 -0
- package/dist/skills/bundled/router/index.js +160 -0
- package/dist/skills/bundled/router/index.js.map +1 -0
- package/dist/skills/bundled/routing/index.d.ts +23 -0
- package/dist/skills/bundled/routing/index.js +257 -0
- package/dist/skills/bundled/routing/index.js.map +1 -0
- package/dist/skills/bundled/sandbox/index.d.ts +18 -0
- package/dist/skills/bundled/sandbox/index.js +119 -0
- package/dist/skills/bundled/sandbox/index.js.map +1 -0
- package/dist/skills/bundled/search-config/index.d.ts +18 -0
- package/dist/skills/bundled/search-config/index.js +170 -0
- package/dist/skills/bundled/search-config/index.js.map +1 -0
- package/dist/skills/bundled/sessions/index.d.ts +29 -0
- package/dist/skills/bundled/sessions/index.js +193 -0
- package/dist/skills/bundled/sessions/index.js.map +1 -0
- package/dist/skills/bundled/shield/index.d.ts +22 -0
- package/dist/skills/bundled/shield/index.js +245 -0
- package/dist/skills/bundled/shield/index.js.map +1 -0
- package/dist/skills/bundled/signals/index.d.ts +24 -0
- package/dist/skills/bundled/signals/index.js +776 -0
- package/dist/skills/bundled/signals/index.js.map +1 -0
- package/dist/skills/bundled/sizing/index.d.ts +16 -0
- package/dist/skills/bundled/sizing/index.js +168 -0
- package/dist/skills/bundled/sizing/index.js.map +1 -0
- package/dist/skills/bundled/slippage/index.d.ts +16 -0
- package/dist/skills/bundled/slippage/index.js +111 -0
- package/dist/skills/bundled/slippage/index.js.map +1 -0
- package/dist/skills/bundled/smarkets/index.d.ts +23 -0
- package/dist/skills/bundled/smarkets/index.js +473 -0
- package/dist/skills/bundled/smarkets/index.js.map +1 -0
- package/dist/skills/bundled/strategy/index.d.ts +18 -0
- package/dist/skills/bundled/strategy/index.js +168 -0
- package/dist/skills/bundled/strategy/index.js.map +1 -0
- package/dist/skills/bundled/streaming/index.d.ts +19 -0
- package/dist/skills/bundled/streaming/index.js +147 -0
- package/dist/skills/bundled/streaming/index.js.map +1 -0
- package/dist/skills/bundled/tailscale/index.d.ts +18 -0
- package/dist/skills/bundled/tailscale/index.js +173 -0
- package/dist/skills/bundled/tailscale/index.js.map +1 -0
- package/dist/skills/bundled/ticks/index.d.ts +17 -0
- package/dist/skills/bundled/ticks/index.js +287 -0
- package/dist/skills/bundled/ticks/index.js.map +1 -0
- package/dist/skills/bundled/token-security/index.d.ts +19 -0
- package/dist/skills/bundled/token-security/index.js +138 -0
- package/dist/skills/bundled/token-security/index.js.map +1 -0
- package/dist/skills/bundled/trading-evm/index.d.ts +19 -0
- package/dist/skills/bundled/trading-evm/index.js +302 -0
- package/dist/skills/bundled/trading-evm/index.js.map +1 -0
- package/dist/skills/bundled/trading-futures/index.d.ts +14 -0
- package/dist/skills/bundled/trading-futures/index.js +874 -0
- package/dist/skills/bundled/trading-futures/index.js.map +1 -0
- package/dist/skills/bundled/trading-kalshi/index.d.ts +36 -0
- package/dist/skills/bundled/trading-kalshi/index.js +1199 -0
- package/dist/skills/bundled/trading-kalshi/index.js.map +1 -0
- package/dist/skills/bundled/trading-manifold/index.d.ts +23 -0
- package/dist/skills/bundled/trading-manifold/index.js +391 -0
- package/dist/skills/bundled/trading-manifold/index.js.map +1 -0
- package/dist/skills/bundled/trading-polymarket/index.d.ts +27 -0
- package/dist/skills/bundled/trading-polymarket/index.js +1321 -0
- package/dist/skills/bundled/trading-polymarket/index.js.map +1 -0
- package/dist/skills/bundled/trading-solana/index.d.ts +19 -0
- package/dist/skills/bundled/trading-solana/index.js +383 -0
- package/dist/skills/bundled/trading-solana/index.js.map +1 -0
- package/dist/skills/bundled/trading-system/index.d.ts +22 -0
- package/dist/skills/bundled/trading-system/index.js +355 -0
- package/dist/skills/bundled/trading-system/index.js.map +1 -0
- package/dist/skills/bundled/triggers/index.d.ts +18 -0
- package/dist/skills/bundled/triggers/index.js +172 -0
- package/dist/skills/bundled/triggers/index.js.map +1 -0
- package/dist/skills/bundled/tts/index.d.ts +16 -0
- package/dist/skills/bundled/tts/index.js +150 -0
- package/dist/skills/bundled/tts/index.js.map +1 -0
- package/dist/skills/bundled/tweet-ideas/index.d.ts +20 -0
- package/dist/skills/bundled/tweet-ideas/index.js +470 -0
- package/dist/skills/bundled/tweet-ideas/index.js.map +1 -0
- package/dist/skills/bundled/usage/index.d.ts +17 -0
- package/dist/skills/bundled/usage/index.js +145 -0
- package/dist/skills/bundled/usage/index.js.map +1 -0
- package/dist/skills/bundled/veil/index.d.ts +79 -0
- package/dist/skills/bundled/veil/index.js +322 -0
- package/dist/skills/bundled/veil/index.js.map +1 -0
- package/dist/skills/bundled/verify/index.d.ts +20 -0
- package/dist/skills/bundled/verify/index.js +157 -0
- package/dist/skills/bundled/verify/index.js.map +1 -0
- package/dist/skills/bundled/virtuals/index.d.ts +20 -0
- package/dist/skills/bundled/virtuals/index.js +255 -0
- package/dist/skills/bundled/virtuals/index.js.map +1 -0
- package/dist/skills/bundled/voice/index.d.ts +18 -0
- package/dist/skills/bundled/voice/index.js +190 -0
- package/dist/skills/bundled/voice/index.js.map +1 -0
- package/dist/skills/bundled/weather/index.d.ts +20 -0
- package/dist/skills/bundled/weather/index.js +475 -0
- package/dist/skills/bundled/weather/index.js.map +1 -0
- package/dist/skills/bundled/webhooks/index.d.ts +18 -0
- package/dist/skills/bundled/webhooks/index.js +136 -0
- package/dist/skills/bundled/webhooks/index.js.map +1 -0
- package/dist/skills/bundled/whale-tracking/index.d.ts +18 -0
- package/dist/skills/bundled/whale-tracking/index.js +441 -0
- package/dist/skills/bundled/whale-tracking/index.js.map +1 -0
- package/dist/skills/bundled/yoink/index.d.ts +78 -0
- package/dist/skills/bundled/yoink/index.js +236 -0
- package/dist/skills/bundled/yoink/index.js.map +1 -0
- package/dist/skills/executor.d.ts +117 -0
- package/dist/skills/executor.js +469 -0
- package/dist/skills/executor.js.map +1 -0
- package/dist/skills/frontmatter.d.ts +69 -0
- package/dist/skills/frontmatter.js +187 -0
- package/dist/skills/frontmatter.js.map +1 -0
- package/dist/skills/index.d.ts +150 -0
- package/dist/skills/index.js +531 -0
- package/dist/skills/index.js.map +1 -0
- package/dist/skills/loader.d.ts +48 -0
- package/dist/skills/loader.js +594 -0
- package/dist/skills/loader.js.map +1 -0
- package/dist/skills/registry.d.ts +94 -0
- package/dist/skills/registry.js +308 -0
- package/dist/skills/registry.js.map +1 -0
- package/dist/solana/copytrade.d.ts +116 -0
- package/dist/solana/copytrade.js +493 -0
- package/dist/solana/copytrade.js.map +1 -0
- package/dist/solana/drift.d.ts +154 -0
- package/dist/solana/drift.js +599 -0
- package/dist/solana/drift.js.map +1 -0
- package/dist/solana/jupiter.d.ts +283 -0
- package/dist/solana/jupiter.js +553 -0
- package/dist/solana/jupiter.js.map +1 -0
- package/dist/solana/kamino.d.ts +206 -0
- package/dist/solana/kamino.js +546 -0
- package/dist/solana/kamino.js.map +1 -0
- package/dist/solana/meteora-dbc.d.ts +430 -0
- package/dist/solana/meteora-dbc.js +1105 -0
- package/dist/solana/meteora-dbc.js.map +1 -0
- package/dist/solana/meteora.d.ts +232 -0
- package/dist/solana/meteora.js +682 -0
- package/dist/solana/meteora.js.map +1 -0
- package/dist/solana/orca.d.ts +163 -0
- package/dist/solana/orca.js +378 -0
- package/dist/solana/orca.js.map +1 -0
- package/dist/solana/pools.d.ts +26 -0
- package/dist/solana/pools.js +96 -0
- package/dist/solana/pools.js.map +1 -0
- package/dist/solana/pump-swarm.d.ts +349 -0
- package/dist/solana/pump-swarm.js +1663 -0
- package/dist/solana/pump-swarm.js.map +1 -0
- package/dist/solana/pumpapi.d.ts +196 -0
- package/dist/solana/pumpapi.js +462 -0
- package/dist/solana/pumpapi.js.map +1 -0
- package/dist/solana/raydium.d.ts +170 -0
- package/dist/solana/raydium.js +673 -0
- package/dist/solana/raydium.js.map +1 -0
- package/dist/solana/swarm-ai-builder.d.ts +97 -0
- package/dist/solana/swarm-ai-builder.js +571 -0
- package/dist/solana/swarm-ai-builder.js.map +1 -0
- package/dist/solana/swarm-arbitrage.d.ts +111 -0
- package/dist/solana/swarm-arbitrage.js +437 -0
- package/dist/solana/swarm-arbitrage.js.map +1 -0
- package/dist/solana/swarm-builders.d.ts +71 -0
- package/dist/solana/swarm-builders.js +402 -0
- package/dist/solana/swarm-builders.js.map +1 -0
- package/dist/solana/swarm-copytrade.d.ts +103 -0
- package/dist/solana/swarm-copytrade.js +420 -0
- package/dist/solana/swarm-copytrade.js.map +1 -0
- package/dist/solana/swarm-presets.d.ts +49 -0
- package/dist/solana/swarm-presets.js +282 -0
- package/dist/solana/swarm-presets.js.map +1 -0
- package/dist/solana/swarm-signals.d.ts +128 -0
- package/dist/solana/swarm-signals.js +529 -0
- package/dist/solana/swarm-signals.js.map +1 -0
- package/dist/solana/swarm-strategies.d.ts +230 -0
- package/dist/solana/swarm-strategies.js +611 -0
- package/dist/solana/swarm-strategies.js.map +1 -0
- package/dist/solana/tokenlist.d.ts +10 -0
- package/dist/solana/tokenlist.js +54 -0
- package/dist/solana/tokenlist.js.map +1 -0
- package/dist/solana/wallet.d.ts +12 -0
- package/dist/solana/wallet.js +90 -0
- package/dist/solana/wallet.js.map +1 -0
- package/dist/strategies/crypto-hft/index.d.ts +46 -0
- package/dist/strategies/crypto-hft/index.js +469 -0
- package/dist/strategies/crypto-hft/index.js.map +1 -0
- package/dist/strategies/crypto-hft/market-scanner.d.ts +26 -0
- package/dist/strategies/crypto-hft/market-scanner.js +177 -0
- package/dist/strategies/crypto-hft/market-scanner.js.map +1 -0
- package/dist/strategies/crypto-hft/orderbook.d.ts +37 -0
- package/dist/strategies/crypto-hft/orderbook.js +184 -0
- package/dist/strategies/crypto-hft/orderbook.js.map +1 -0
- package/dist/strategies/crypto-hft/positions.d.ts +49 -0
- package/dist/strategies/crypto-hft/positions.js +376 -0
- package/dist/strategies/crypto-hft/positions.js.map +1 -0
- package/dist/strategies/crypto-hft/presets.d.ts +11 -0
- package/dist/strategies/crypto-hft/presets.js +164 -0
- package/dist/strategies/crypto-hft/presets.js.map +1 -0
- package/dist/strategies/crypto-hft/strategies.d.ts +96 -0
- package/dist/strategies/crypto-hft/strategies.js +330 -0
- package/dist/strategies/crypto-hft/strategies.js.map +1 -0
- package/dist/strategies/crypto-hft/types.d.ts +196 -0
- package/dist/strategies/crypto-hft/types.js +32 -0
- package/dist/strategies/crypto-hft/types.js.map +1 -0
- package/dist/strategies/hft-divergence/detector.d.ts +29 -0
- package/dist/strategies/hft-divergence/detector.js +182 -0
- package/dist/strategies/hft-divergence/detector.js.map +1 -0
- package/dist/strategies/hft-divergence/index.d.ts +12 -0
- package/dist/strategies/hft-divergence/index.js +19 -0
- package/dist/strategies/hft-divergence/index.js.map +1 -0
- package/dist/strategies/hft-divergence/market-rotator.d.ts +17 -0
- package/dist/strategies/hft-divergence/market-rotator.js +128 -0
- package/dist/strategies/hft-divergence/market-rotator.js.map +1 -0
- package/dist/strategies/hft-divergence/position-manager.d.ts +35 -0
- package/dist/strategies/hft-divergence/position-manager.js +188 -0
- package/dist/strategies/hft-divergence/position-manager.js.map +1 -0
- package/dist/strategies/hft-divergence/strategy.d.ts +31 -0
- package/dist/strategies/hft-divergence/strategy.js +295 -0
- package/dist/strategies/hft-divergence/strategy.js.map +1 -0
- package/dist/strategies/hft-divergence/types.d.ts +114 -0
- package/dist/strategies/hft-divergence/types.js +10 -0
- package/dist/strategies/hft-divergence/types.js.map +1 -0
- package/dist/streaming/index.d.ts +70 -0
- package/dist/streaming/index.js +296 -0
- package/dist/streaming/index.js.map +1 -0
- package/dist/tailscale/index.d.ts +139 -0
- package/dist/tailscale/index.js +345 -0
- package/dist/tailscale/index.js.map +1 -0
- package/dist/telemetry/index.d.ts +143 -0
- package/dist/telemetry/index.js +535 -0
- package/dist/telemetry/index.js.map +1 -0
- package/dist/terminal/index.d.ts +121 -0
- package/dist/terminal/index.js +548 -0
- package/dist/terminal/index.js.map +1 -0
- package/dist/token-security/index.d.ts +36 -0
- package/dist/token-security/index.js +253 -0
- package/dist/token-security/index.js.map +1 -0
- package/dist/tools/browser.d.ts +128 -0
- package/dist/tools/browser.js +459 -0
- package/dist/tools/browser.js.map +1 -0
- package/dist/tools/canvas.d.ts +93 -0
- package/dist/tools/canvas.js +349 -0
- package/dist/tools/canvas.js.map +1 -0
- package/dist/tools/docker.d.ts +59 -0
- package/dist/tools/docker.js +191 -0
- package/dist/tools/docker.js.map +1 -0
- package/dist/tools/email.d.ts +25 -0
- package/dist/tools/email.js +131 -0
- package/dist/tools/email.js.map +1 -0
- package/dist/tools/exec.d.ts +81 -0
- package/dist/tools/exec.js +373 -0
- package/dist/tools/exec.js.map +1 -0
- package/dist/tools/files.d.ts +46 -0
- package/dist/tools/files.js +185 -0
- package/dist/tools/files.js.map +1 -0
- package/dist/tools/git.d.ts +29 -0
- package/dist/tools/git.js +105 -0
- package/dist/tools/git.js.map +1 -0
- package/dist/tools/image.d.ts +57 -0
- package/dist/tools/image.js +308 -0
- package/dist/tools/image.js.map +1 -0
- package/dist/tools/index.d.ts +39 -0
- package/dist/tools/index.js +46 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/message.d.ts +99 -0
- package/dist/tools/message.js +200 -0
- package/dist/tools/message.js.map +1 -0
- package/dist/tools/nodes.d.ts +134 -0
- package/dist/tools/nodes.js +357 -0
- package/dist/tools/nodes.js.map +1 -0
- package/dist/tools/sessions.d.ts +60 -0
- package/dist/tools/sessions.js +119 -0
- package/dist/tools/sessions.js.map +1 -0
- package/dist/tools/shell-history.d.ts +17 -0
- package/dist/tools/shell-history.js +118 -0
- package/dist/tools/shell-history.js.map +1 -0
- package/dist/tools/sms.d.ts +18 -0
- package/dist/tools/sms.js +66 -0
- package/dist/tools/sms.js.map +1 -0
- package/dist/tools/sql.d.ts +19 -0
- package/dist/tools/sql.js +91 -0
- package/dist/tools/sql.js.map +1 -0
- package/dist/tools/transcription.d.ts +13 -0
- package/dist/tools/transcription.js +99 -0
- package/dist/tools/transcription.js.map +1 -0
- package/dist/tools/web-fetch.d.ts +69 -0
- package/dist/tools/web-fetch.js +251 -0
- package/dist/tools/web-fetch.js.map +1 -0
- package/dist/tools/web-search.d.ts +58 -0
- package/dist/tools/web-search.js +204 -0
- package/dist/tools/web-search.js.map +1 -0
- package/dist/tools/webhooks.d.ts +74 -0
- package/dist/tools/webhooks.js +165 -0
- package/dist/tools/webhooks.js.map +1 -0
- package/dist/trading/accounts.d.ts +167 -0
- package/dist/trading/accounts.js +394 -0
- package/dist/trading/accounts.js.map +1 -0
- package/dist/trading/adapters/index.d.ts +27 -0
- package/dist/trading/adapters/index.js +165 -0
- package/dist/trading/adapters/index.js.map +1 -0
- package/dist/trading/backtest.d.ts +161 -0
- package/dist/trading/backtest.js +665 -0
- package/dist/trading/backtest.js.map +1 -0
- package/dist/trading/bots/index.d.ts +196 -0
- package/dist/trading/bots/index.js +688 -0
- package/dist/trading/bots/index.js.map +1 -0
- package/dist/trading/bridge.d.ts +33 -0
- package/dist/trading/bridge.js +121 -0
- package/dist/trading/bridge.js.map +1 -0
- package/dist/trading/builder.d.ts +102 -0
- package/dist/trading/builder.js +430 -0
- package/dist/trading/builder.js.map +1 -0
- package/dist/trading/copy-trading.d.ts +125 -0
- package/dist/trading/copy-trading.js +611 -0
- package/dist/trading/copy-trading.js.map +1 -0
- package/dist/trading/devtools.d.ts +172 -0
- package/dist/trading/devtools.js +425 -0
- package/dist/trading/devtools.js.map +1 -0
- package/dist/trading/futures/index.d.ts +981 -0
- package/dist/trading/futures/index.js +4011 -0
- package/dist/trading/futures/index.js.map +1 -0
- package/dist/trading/index.d.ts +102 -0
- package/dist/trading/index.js +310 -0
- package/dist/trading/index.js.map +1 -0
- package/dist/trading/kelly.d.ts +137 -0
- package/dist/trading/kelly.js +328 -0
- package/dist/trading/kelly.js.map +1 -0
- package/dist/trading/logger.d.ts +163 -0
- package/dist/trading/logger.js +424 -0
- package/dist/trading/logger.js.map +1 -0
- package/dist/trading/market-making/engine.d.ts +44 -0
- package/dist/trading/market-making/engine.js +165 -0
- package/dist/trading/market-making/engine.js.map +1 -0
- package/dist/trading/market-making/index.d.ts +10 -0
- package/dist/trading/market-making/index.js +29 -0
- package/dist/trading/market-making/index.js.map +1 -0
- package/dist/trading/market-making/strategy.d.ts +25 -0
- package/dist/trading/market-making/strategy.js +250 -0
- package/dist/trading/market-making/strategy.js.map +1 -0
- package/dist/trading/market-making/types.d.ts +92 -0
- package/dist/trading/market-making/types.js +6 -0
- package/dist/trading/market-making/types.js.map +1 -0
- package/dist/trading/ml-signals.d.ts +175 -0
- package/dist/trading/ml-signals.js +548 -0
- package/dist/trading/ml-signals.js.map +1 -0
- package/dist/trading/orchestrator.d.ts +59 -0
- package/dist/trading/orchestrator.js +199 -0
- package/dist/trading/orchestrator.js.map +1 -0
- package/dist/trading/position-bridge.d.ts +41 -0
- package/dist/trading/position-bridge.js +178 -0
- package/dist/trading/position-bridge.js.map +1 -0
- package/dist/trading/resilience.d.ts +81 -0
- package/dist/trading/resilience.js +257 -0
- package/dist/trading/resilience.js.map +1 -0
- package/dist/trading/risk.d.ts +18 -0
- package/dist/trading/risk.js +91 -0
- package/dist/trading/risk.js.map +1 -0
- package/dist/trading/safety.d.ts +114 -0
- package/dist/trading/safety.js +372 -0
- package/dist/trading/safety.js.map +1 -0
- package/dist/trading/secrets.d.ts +48 -0
- package/dist/trading/secrets.js +243 -0
- package/dist/trading/secrets.js.map +1 -0
- package/dist/trading/state.d.ts +88 -0
- package/dist/trading/state.js +221 -0
- package/dist/trading/state.js.map +1 -0
- package/dist/trading/stream.d.ts +121 -0
- package/dist/trading/stream.js +396 -0
- package/dist/trading/stream.js.map +1 -0
- package/dist/trading/tracking.d.ts +136 -0
- package/dist/trading/tracking.js +512 -0
- package/dist/trading/tracking.js.map +1 -0
- package/dist/tts/index.d.ts +28 -0
- package/dist/tts/index.js +64 -0
- package/dist/tts/index.js.map +1 -0
- package/dist/tui/index.d.ts +159 -0
- package/dist/tui/index.js +580 -0
- package/dist/tui/index.js.map +1 -0
- package/dist/types.d.ts +1373 -0
- package/dist/types.js +7 -0
- package/dist/types.js.map +1 -0
- package/dist/usage/index.d.ts +57 -0
- package/dist/usage/index.js +191 -0
- package/dist/usage/index.js.map +1 -0
- package/dist/utils/attachments.d.ts +12 -0
- package/dist/utils/attachments.js +104 -0
- package/dist/utils/attachments.js.map +1 -0
- package/dist/utils/config.d.ts +14 -0
- package/dist/utils/config.js +474 -0
- package/dist/utils/config.js.map +1 -0
- package/dist/utils/http.d.ts +22 -0
- package/dist/utils/http.js +191 -0
- package/dist/utils/http.js.map +1 -0
- package/dist/utils/id.d.ts +21 -0
- package/dist/utils/id.js +41 -0
- package/dist/utils/id.js.map +1 -0
- package/dist/utils/json-utils.d.ts +201 -0
- package/dist/utils/json-utils.js +151 -0
- package/dist/utils/json-utils.js.map +1 -0
- package/dist/utils/kalshi-auth.d.ts +10 -0
- package/dist/utils/kalshi-auth.js +48 -0
- package/dist/utils/kalshi-auth.js.map +1 -0
- package/dist/utils/kelly.d.ts +153 -0
- package/dist/utils/kelly.js +322 -0
- package/dist/utils/kelly.js.map +1 -0
- package/dist/utils/logger.d.ts +7 -0
- package/dist/utils/logger.js +26 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/opinion-auth.d.ts +17 -0
- package/dist/utils/opinion-auth.js +25 -0
- package/dist/utils/opinion-auth.js.map +1 -0
- package/dist/utils/polymarket-auth.d.ts +11 -0
- package/dist/utils/polymarket-auth.js +32 -0
- package/dist/utils/polymarket-auth.js.map +1 -0
- package/dist/utils/polymarket-order-signer.d.ts +118 -0
- package/dist/utils/polymarket-order-signer.js +329 -0
- package/dist/utils/polymarket-order-signer.js.map +1 -0
- package/dist/utils/polymarket-setup.d.ts +70 -0
- package/dist/utils/polymarket-setup.js +288 -0
- package/dist/utils/polymarket-setup.js.map +1 -0
- package/dist/utils/production.d.ts +112 -0
- package/dist/utils/production.js +294 -0
- package/dist/utils/production.js.map +1 -0
- package/dist/utils/rate-limiter.d.ts +77 -0
- package/dist/utils/rate-limiter.js +271 -0
- package/dist/utils/rate-limiter.js.map +1 -0
- package/dist/utils/webhook-security.d.ts +63 -0
- package/dist/utils/webhook-security.js +183 -0
- package/dist/utils/webhook-security.js.map +1 -0
- package/dist/voice/index.d.ts +125 -0
- package/dist/voice/index.js +557 -0
- package/dist/voice/index.js.map +1 -0
- package/dist/weather/edge.d.ts +70 -0
- package/dist/weather/edge.js +281 -0
- package/dist/weather/edge.js.map +1 -0
- package/dist/weather/index.d.ts +6 -0
- package/dist/weather/index.js +23 -0
- package/dist/weather/index.js.map +1 -0
- package/dist/weather/markets.d.ts +84 -0
- package/dist/weather/markets.js +320 -0
- package/dist/weather/markets.js.map +1 -0
- package/dist/weather/noaa.d.ts +113 -0
- package/dist/weather/noaa.js +287 -0
- package/dist/weather/noaa.js.map +1 -0
- package/dist/web/index.d.ts +112 -0
- package/dist/web/index.js +639 -0
- package/dist/web/index.js.map +1 -0
- package/dist/wizard/index.d.ts +27 -0
- package/dist/wizard/index.js +186 -0
- package/dist/wizard/index.js.map +1 -0
- package/dist/workspace/index.d.ts +73 -0
- package/dist/workspace/index.js +403 -0
- package/dist/workspace/index.js.map +1 -0
- package/package.json +168 -0
|
@@ -0,0 +1,1028 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Trading API Routes — REST endpoints for positions, portfolio, orders,
|
|
4
|
+
* signals, strategies, and orchestrator status.
|
|
5
|
+
*
|
|
6
|
+
* Mounted as a single Express Router via httpGateway.setTradingApiRouter().
|
|
7
|
+
* All endpoints are prefixed with /api by the caller.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.createTradingApiRouter = createTradingApiRouter;
|
|
11
|
+
const express_1 = require("express");
|
|
12
|
+
const logger_js_1 = require("../utils/logger.js");
|
|
13
|
+
const index_js_1 = require("../trading/bots/index.js");
|
|
14
|
+
const strategy_js_1 = require("../trading/market-making/strategy.js");
|
|
15
|
+
// ── Factory ─────────────────────────────────────────────────────────────────
|
|
16
|
+
function createTradingApiRouter(deps) {
|
|
17
|
+
const router = (0, express_1.Router)();
|
|
18
|
+
const { db, execution, orchestrator, safety, signalRouter, botManager, tradeLogger, tickRecorder, backtestEngine, strategyBuilder, signalBus, featureEngine, positionManager, mlPipeline, } = deps;
|
|
19
|
+
// ── GET /api/positions ──────────────────────────────────────────────────
|
|
20
|
+
router.get('/positions', (_req, res) => {
|
|
21
|
+
try {
|
|
22
|
+
const userId = 'default';
|
|
23
|
+
const positions = db.getPositions(userId);
|
|
24
|
+
res.json({ positions, count: positions.length });
|
|
25
|
+
}
|
|
26
|
+
catch (err) {
|
|
27
|
+
logger_js_1.logger.warn({ err }, 'API: Failed to get positions');
|
|
28
|
+
res.status(500).json({ error: 'Failed to fetch positions' });
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
// ── GET /api/portfolio ──────────────────────────────────────────────────
|
|
32
|
+
router.get('/portfolio', (_req, res) => {
|
|
33
|
+
try {
|
|
34
|
+
const userId = 'default';
|
|
35
|
+
const positions = db.getPositions(userId);
|
|
36
|
+
let totalValue = 0;
|
|
37
|
+
let totalCost = 0;
|
|
38
|
+
let unrealizedPnL = 0;
|
|
39
|
+
const positionSummaries = positions.map((p) => {
|
|
40
|
+
const value = p.shares * (p.currentPrice || p.avgPrice);
|
|
41
|
+
const cost = p.shares * p.avgPrice;
|
|
42
|
+
const pnl = value - cost;
|
|
43
|
+
const pnlPct = cost > 0 ? (pnl / cost) * 100 : 0;
|
|
44
|
+
totalValue += value;
|
|
45
|
+
totalCost += cost;
|
|
46
|
+
unrealizedPnL += pnl;
|
|
47
|
+
return {
|
|
48
|
+
id: p.id, platform: p.platform, marketId: p.marketId,
|
|
49
|
+
marketQuestion: p.marketQuestion, outcome: p.outcome,
|
|
50
|
+
shares: p.shares, avgPrice: p.avgPrice,
|
|
51
|
+
currentPrice: p.currentPrice || p.avgPrice,
|
|
52
|
+
value: Math.round(value * 100) / 100,
|
|
53
|
+
pnl: Math.round(pnl * 100) / 100,
|
|
54
|
+
pnlPct: Math.round(pnlPct * 10) / 10,
|
|
55
|
+
};
|
|
56
|
+
});
|
|
57
|
+
res.json({
|
|
58
|
+
totalValue: Math.round(totalValue * 100) / 100,
|
|
59
|
+
totalCost: Math.round(totalCost * 100) / 100,
|
|
60
|
+
unrealizedPnL: Math.round(unrealizedPnL * 100) / 100,
|
|
61
|
+
positionCount: positions.length,
|
|
62
|
+
positions: positionSummaries,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
catch (err) {
|
|
66
|
+
logger_js_1.logger.warn({ err }, 'API: Failed to get portfolio');
|
|
67
|
+
res.status(500).json({ error: 'Failed to fetch portfolio' });
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
// ── GET /api/orders ─────────────────────────────────────────────────────
|
|
71
|
+
router.get('/orders', async (req, res) => {
|
|
72
|
+
if (!execution) {
|
|
73
|
+
res.status(404).json({ error: 'Execution service not available' });
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
try {
|
|
77
|
+
const platform = req.query.platform || 'polymarket';
|
|
78
|
+
const openOrders = await execution.getOpenOrders(platform);
|
|
79
|
+
const recentFills = execution.getTrackedFills ? execution.getTrackedFills() : [];
|
|
80
|
+
res.json({ openOrders: openOrders || [], recentFills: recentFills || [], openCount: openOrders?.length || 0, fillCount: recentFills?.length || 0 });
|
|
81
|
+
}
|
|
82
|
+
catch (err) {
|
|
83
|
+
logger_js_1.logger.warn({ err }, 'API: Failed to get orders');
|
|
84
|
+
res.status(500).json({ error: 'Failed to fetch orders' });
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
// ── GET /api/signals/recent ─────────────────────────────────────────────
|
|
88
|
+
router.get('/signals/recent', (req, res) => {
|
|
89
|
+
if (!signalRouter) {
|
|
90
|
+
res.status(404).json({ error: 'Signal router not enabled' });
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
try {
|
|
94
|
+
const limit = parseInt(req.query.limit) || 50;
|
|
95
|
+
const executions = signalRouter.getRecentExecutions(limit);
|
|
96
|
+
const stats = signalRouter.getStats();
|
|
97
|
+
res.json({ executions, stats, count: executions.length });
|
|
98
|
+
}
|
|
99
|
+
catch (err) {
|
|
100
|
+
logger_js_1.logger.warn({ err }, 'API: Failed to get signals');
|
|
101
|
+
res.status(500).json({ error: 'Failed to fetch signals' });
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
// ── GET /api/orchestrator ───────────────────────────────────────────────
|
|
105
|
+
router.get('/orchestrator', (_req, res) => {
|
|
106
|
+
try {
|
|
107
|
+
const orchestratorStats = orchestrator?.getStats() ?? null;
|
|
108
|
+
const safetyState = safety?.getState() ?? null;
|
|
109
|
+
const circuitBreakerState = execution?.getCircuitBreakerState?.() ?? null;
|
|
110
|
+
res.json({
|
|
111
|
+
orchestrator: orchestratorStats ? { paused: orchestrator?.paused ?? false, ...orchestratorStats } : null,
|
|
112
|
+
safety: safetyState,
|
|
113
|
+
circuitBreaker: circuitBreakerState,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
catch (err) {
|
|
117
|
+
logger_js_1.logger.warn({ err }, 'API: Failed to get orchestrator status');
|
|
118
|
+
res.status(500).json({ error: 'Failed to fetch orchestrator status' });
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
// ══════════════════════════════════════════════════════════════════════════
|
|
122
|
+
// BOT MANAGER — Strategy lifecycle (start/stop/pause/resume/evaluate)
|
|
123
|
+
// ══════════════════════════════════════════════════════════════════════════
|
|
124
|
+
router.get('/strategies', (_req, res) => {
|
|
125
|
+
if (!botManager) {
|
|
126
|
+
res.status(404).json({ error: 'Bot manager not available' });
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
try {
|
|
130
|
+
const strategies = botManager.getStrategies();
|
|
131
|
+
const statuses = botManager.getAllBotStatuses();
|
|
132
|
+
const combined = strategies.map((cfg) => {
|
|
133
|
+
const status = statuses.find((s) => s.id === cfg.id);
|
|
134
|
+
return {
|
|
135
|
+
id: cfg.id, name: cfg.name, description: cfg.description,
|
|
136
|
+
platforms: cfg.platforms, intervalMs: cfg.intervalMs, dryRun: cfg.dryRun,
|
|
137
|
+
status: status?.status || 'stopped', tradesCount: status?.tradesCount || 0,
|
|
138
|
+
totalPnL: status?.totalPnL || 0, winRate: status?.winRate || 0,
|
|
139
|
+
lastCheck: status?.lastCheck || null, lastError: status?.lastError || null,
|
|
140
|
+
};
|
|
141
|
+
});
|
|
142
|
+
res.json({ strategies: combined, count: combined.length, running: combined.filter((s) => s.status === 'running').length });
|
|
143
|
+
}
|
|
144
|
+
catch (err) {
|
|
145
|
+
logger_js_1.logger.warn({ err }, 'API: Failed to get strategies');
|
|
146
|
+
res.status(500).json({ error: 'Failed to fetch strategies' });
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
router.post('/strategies/:id/start', async (req, res) => {
|
|
150
|
+
if (!botManager) {
|
|
151
|
+
res.status(404).json({ error: 'Bot manager not available' });
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
try {
|
|
155
|
+
const ok = await botManager.startBot(req.params.id);
|
|
156
|
+
if (!ok) {
|
|
157
|
+
res.status(400).json({ error: 'Strategy not found or already running' });
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
res.json({ success: true, status: botManager.getBotStatus(req.params.id) });
|
|
161
|
+
}
|
|
162
|
+
catch (err) {
|
|
163
|
+
res.status(500).json({ error: err?.message || 'Failed to start bot' });
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
router.post('/strategies/:id/stop', async (req, res) => {
|
|
167
|
+
if (!botManager) {
|
|
168
|
+
res.status(404).json({ error: 'Bot manager not available' });
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
try {
|
|
172
|
+
await botManager.stopBot(req.params.id);
|
|
173
|
+
res.json({ success: true, status: botManager.getBotStatus(req.params.id) });
|
|
174
|
+
}
|
|
175
|
+
catch (err) {
|
|
176
|
+
res.status(500).json({ error: err?.message || 'Failed to stop bot' });
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
router.post('/strategies/:id/pause', (req, res) => {
|
|
180
|
+
if (!botManager) {
|
|
181
|
+
res.status(404).json({ error: 'Bot manager not available' });
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
botManager.pauseBot(req.params.id);
|
|
185
|
+
res.json({ success: true, status: botManager.getBotStatus(req.params.id) });
|
|
186
|
+
});
|
|
187
|
+
router.post('/strategies/:id/resume', (req, res) => {
|
|
188
|
+
if (!botManager) {
|
|
189
|
+
res.status(404).json({ error: 'Bot manager not available' });
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
botManager.resumeBot(req.params.id);
|
|
193
|
+
res.json({ success: true, status: botManager.getBotStatus(req.params.id) });
|
|
194
|
+
});
|
|
195
|
+
router.post('/strategies/:id/evaluate', async (req, res) => {
|
|
196
|
+
if (!botManager) {
|
|
197
|
+
res.status(404).json({ error: 'Bot manager not available' });
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
try {
|
|
201
|
+
const signals = await botManager.evaluateNow(req.params.id);
|
|
202
|
+
res.json({ signals, count: signals.length });
|
|
203
|
+
}
|
|
204
|
+
catch (err) {
|
|
205
|
+
res.status(500).json({ error: err?.message || 'Evaluation failed' });
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
// ── GET /api/strategies/:id/mm-state ──────────────────────────────────
|
|
209
|
+
// Market making specific state (inventory, P&L, quotes)
|
|
210
|
+
router.get('/strategies/:id/mm-state', (req, res) => {
|
|
211
|
+
if (!botManager) {
|
|
212
|
+
res.status(404).json({ error: 'Bot manager not available' });
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
const strategy = botManager.getStrategy(req.params.id);
|
|
216
|
+
if (!strategy) {
|
|
217
|
+
res.status(404).json({ error: 'Strategy not found' });
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
const mmState = (0, strategy_js_1.getMMState)(strategy);
|
|
221
|
+
if (!mmState) {
|
|
222
|
+
res.status(404).json({ error: 'Not a market making strategy' });
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
res.json({
|
|
226
|
+
fairValue: mmState.fairValue,
|
|
227
|
+
emaFairValue: mmState.emaFairValue,
|
|
228
|
+
inventory: mmState.inventory,
|
|
229
|
+
realizedPnL: mmState.realizedPnL,
|
|
230
|
+
fillCount: mmState.fillCount,
|
|
231
|
+
activeBids: mmState.activeBids.length,
|
|
232
|
+
activeAsks: mmState.activeAsks.length,
|
|
233
|
+
isQuoting: mmState.isQuoting,
|
|
234
|
+
haltReason: mmState.haltReason ?? null,
|
|
235
|
+
});
|
|
236
|
+
});
|
|
237
|
+
// ══════════════════════════════════════════════════════════════════════════
|
|
238
|
+
// STRATEGY BUILDER — Create strategies from templates or NL
|
|
239
|
+
// ══════════════════════════════════════════════════════════════════════════
|
|
240
|
+
router.get('/strategy-builder/templates', (_req, res) => {
|
|
241
|
+
if (!strategyBuilder) {
|
|
242
|
+
res.status(404).json({ error: 'Strategy builder not available' });
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
res.json({ templates: strategyBuilder.listTemplates() });
|
|
246
|
+
});
|
|
247
|
+
router.get('/strategy-builder/templates/:name', (req, res) => {
|
|
248
|
+
if (!strategyBuilder) {
|
|
249
|
+
res.status(404).json({ error: 'Strategy builder not available' });
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
const params = strategyBuilder.getTemplateParams(req.params.name);
|
|
253
|
+
res.json({ template: req.params.name, params });
|
|
254
|
+
});
|
|
255
|
+
router.post('/strategy-builder/create', (req, res) => {
|
|
256
|
+
if (!strategyBuilder) {
|
|
257
|
+
res.status(404).json({ error: 'Strategy builder not available' });
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
if (!botManager) {
|
|
261
|
+
res.status(404).json({ error: 'Bot manager not available' });
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
try {
|
|
265
|
+
const definition = req.body;
|
|
266
|
+
const validation = strategyBuilder.validate(definition);
|
|
267
|
+
if (!validation.valid) {
|
|
268
|
+
res.status(400).json({ error: 'Invalid strategy', errors: validation.errors });
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
const strategy = strategyBuilder.createStrategy(definition);
|
|
272
|
+
botManager.registerStrategy(strategy);
|
|
273
|
+
const userId = req.userId || 'default';
|
|
274
|
+
const id = strategyBuilder.saveDefinition(userId, definition);
|
|
275
|
+
res.json({ success: true, strategyId: strategy.config.id, definitionId: id, config: strategy.config });
|
|
276
|
+
}
|
|
277
|
+
catch (err) {
|
|
278
|
+
res.status(500).json({ error: err?.message || 'Failed to create strategy' });
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
router.post('/strategy-builder/parse', (req, res) => {
|
|
282
|
+
if (!strategyBuilder) {
|
|
283
|
+
res.status(404).json({ error: 'Strategy builder not available' });
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
const { text } = req.body;
|
|
287
|
+
if (!text) {
|
|
288
|
+
res.status(400).json({ error: 'Missing text field' });
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
const result = strategyBuilder.parseNaturalLanguage(text);
|
|
292
|
+
if ('error' in result) {
|
|
293
|
+
res.status(400).json(result);
|
|
294
|
+
}
|
|
295
|
+
else {
|
|
296
|
+
res.json({ definition: result, validation: strategyBuilder.validate(result) });
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
router.get('/strategy-builder/saved', (req, res) => {
|
|
300
|
+
if (!strategyBuilder) {
|
|
301
|
+
res.status(404).json({ error: 'Strategy builder not available' });
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
const userId = req.query.userId || 'default';
|
|
305
|
+
const definitions = strategyBuilder.loadDefinitions(userId);
|
|
306
|
+
res.json({ definitions, count: definitions.length });
|
|
307
|
+
});
|
|
308
|
+
router.delete('/strategy-builder/saved/:id', (req, res) => {
|
|
309
|
+
if (!strategyBuilder) {
|
|
310
|
+
res.status(404).json({ error: 'Strategy builder not available' });
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
const userId = req.query.userId || 'default';
|
|
314
|
+
const deleted = strategyBuilder.deleteDefinition(userId, req.params.id);
|
|
315
|
+
res.json({ success: deleted });
|
|
316
|
+
});
|
|
317
|
+
// ══════════════════════════════════════════════════════════════════════════
|
|
318
|
+
// TRADES & PNL
|
|
319
|
+
// ══════════════════════════════════════════════════════════════════════════
|
|
320
|
+
router.get('/trades', (req, res) => {
|
|
321
|
+
if (!tradeLogger) {
|
|
322
|
+
res.status(404).json({ error: 'Trade logger not available' });
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
try {
|
|
326
|
+
const limit = parseInt(req.query.limit) || 50;
|
|
327
|
+
const platform = req.query.platform;
|
|
328
|
+
const strategyId = req.query.strategyId;
|
|
329
|
+
const status = req.query.status;
|
|
330
|
+
const trades = tradeLogger.getTrades({ limit, platform: platform, strategyId, status: status });
|
|
331
|
+
const stats = tradeLogger.getStats({ platform: platform, strategyId });
|
|
332
|
+
res.json({ trades, stats, count: trades.length });
|
|
333
|
+
}
|
|
334
|
+
catch (err) {
|
|
335
|
+
logger_js_1.logger.warn({ err }, 'API: Failed to get trades');
|
|
336
|
+
res.status(500).json({ error: 'Failed to fetch trades' });
|
|
337
|
+
}
|
|
338
|
+
});
|
|
339
|
+
router.get('/pnl', (req, res) => {
|
|
340
|
+
if (!tradeLogger) {
|
|
341
|
+
res.status(404).json({ error: 'Trade logger not available' });
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
try {
|
|
345
|
+
const days = parseInt(req.query.days) || 30;
|
|
346
|
+
const dailyPnl = tradeLogger.getDailyPnL(days);
|
|
347
|
+
const totalPnl = dailyPnl.reduce((sum, d) => sum + d.pnl, 0);
|
|
348
|
+
const totalTrades = dailyPnl.reduce((sum, d) => sum + d.trades, 0);
|
|
349
|
+
const profitDays = dailyPnl.filter((d) => d.pnl > 0).length;
|
|
350
|
+
res.json({ dailyPnl, totalPnl: Math.round(totalPnl * 100) / 100, totalTrades, profitDays, totalDays: dailyPnl.length, days });
|
|
351
|
+
}
|
|
352
|
+
catch (err) {
|
|
353
|
+
logger_js_1.logger.warn({ err }, 'API: Failed to get PnL');
|
|
354
|
+
res.status(500).json({ error: 'Failed to fetch PnL data' });
|
|
355
|
+
}
|
|
356
|
+
});
|
|
357
|
+
// ══════════════════════════════════════════════════════════════════════════
|
|
358
|
+
// ORDERS
|
|
359
|
+
// ══════════════════════════════════════════════════════════════════════════
|
|
360
|
+
router.post('/orders', async (req, res) => {
|
|
361
|
+
if (!execution) {
|
|
362
|
+
res.status(404).json({ error: 'Execution service not available' });
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
try {
|
|
366
|
+
const { platform, marketId, tokenId, outcome, side, price, size, orderType, negRisk } = req.body;
|
|
367
|
+
if (!platform || !marketId || !side || !price || !size) {
|
|
368
|
+
res.status(400).json({ error: 'Missing required fields: platform, marketId, side, price, size' });
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
371
|
+
const orderRequest = {
|
|
372
|
+
platform: platform,
|
|
373
|
+
marketId, tokenId, outcome, price: Number(price), size: Number(size),
|
|
374
|
+
orderType: orderType || 'GTC', negRisk: negRisk ?? undefined,
|
|
375
|
+
};
|
|
376
|
+
const result = side === 'buy' ? await execution.buyLimit(orderRequest) : await execution.sellLimit(orderRequest);
|
|
377
|
+
res.json({ success: result.success, orderId: result.orderId, status: result.status, filledSize: result.filledSize, avgFillPrice: result.avgFillPrice, error: result.error });
|
|
378
|
+
}
|
|
379
|
+
catch (err) {
|
|
380
|
+
logger_js_1.logger.warn({ err }, 'API: Failed to submit order');
|
|
381
|
+
res.status(500).json({ error: err?.message || 'Failed to submit order' });
|
|
382
|
+
}
|
|
383
|
+
});
|
|
384
|
+
// ══════════════════════════════════════════════════════════════════════════
|
|
385
|
+
// ORCHESTRATOR & SAFETY
|
|
386
|
+
// ══════════════════════════════════════════════════════════════════════════
|
|
387
|
+
router.post('/orchestrator/pause', (req, res) => {
|
|
388
|
+
if (!orchestrator) {
|
|
389
|
+
res.status(404).json({ error: 'Orchestrator not available' });
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
392
|
+
const reason = req.body?.reason || 'Paused via API';
|
|
393
|
+
orchestrator.pause(reason);
|
|
394
|
+
res.json({ success: true, paused: true, reason });
|
|
395
|
+
});
|
|
396
|
+
router.post('/orchestrator/resume', (_req, res) => {
|
|
397
|
+
if (!orchestrator) {
|
|
398
|
+
res.status(404).json({ error: 'Orchestrator not available' });
|
|
399
|
+
return;
|
|
400
|
+
}
|
|
401
|
+
orchestrator.resume();
|
|
402
|
+
res.json({ success: true, paused: false });
|
|
403
|
+
});
|
|
404
|
+
router.post('/safety/kill', (req, res) => {
|
|
405
|
+
if (!safety) {
|
|
406
|
+
res.status(404).json({ error: 'Safety manager not available' });
|
|
407
|
+
return;
|
|
408
|
+
}
|
|
409
|
+
const reason = req.body?.reason || 'Kill switch via API';
|
|
410
|
+
safety.killSwitch(reason);
|
|
411
|
+
res.json({ success: true, tradingEnabled: false, reason });
|
|
412
|
+
});
|
|
413
|
+
router.post('/safety/resume', (_req, res) => {
|
|
414
|
+
if (!safety) {
|
|
415
|
+
res.status(404).json({ error: 'Safety manager not available' });
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
418
|
+
const resumed = safety.resumeTrading();
|
|
419
|
+
res.json({ success: resumed, tradingEnabled: resumed });
|
|
420
|
+
});
|
|
421
|
+
// ══════════════════════════════════════════════════════════════════════════
|
|
422
|
+
// BACKTEST — Tick-replay, compare, Monte Carlo
|
|
423
|
+
// ══════════════════════════════════════════════════════════════════════════
|
|
424
|
+
function resolveStrategy(strategyType, platform, marketId, outcomeId, params) {
|
|
425
|
+
const plat = platform;
|
|
426
|
+
const baseConfig = { platforms: [plat], dryRun: true, params };
|
|
427
|
+
switch (strategyType) {
|
|
428
|
+
case 'mean-reversion': return (0, index_js_1.createMeanReversionStrategy)(baseConfig);
|
|
429
|
+
case 'momentum': return (0, index_js_1.createMomentumStrategy)(baseConfig);
|
|
430
|
+
case 'buy-and-hold':
|
|
431
|
+
default:
|
|
432
|
+
return {
|
|
433
|
+
config: { id: 'buy-and-hold', name: 'Buy and Hold', platforms: [plat], intervalMs: 60_000 },
|
|
434
|
+
async evaluate(ctx) {
|
|
435
|
+
if (ctx.positions.size === 0 && ctx.availableBalance > 10) {
|
|
436
|
+
const ph = ctx.priceHistory.values().next().value;
|
|
437
|
+
const price = ph?.[ph.length - 1] ?? 0.5;
|
|
438
|
+
return [{ type: 'buy', platform: plat, marketId, outcome: outcomeId, price, size: Math.floor(ctx.availableBalance * 0.9 / price), confidence: 1, reason: 'Buy and hold entry' }];
|
|
439
|
+
}
|
|
440
|
+
return [];
|
|
441
|
+
},
|
|
442
|
+
};
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
function formatBacktestResult(result) {
|
|
446
|
+
return {
|
|
447
|
+
strategyId: result.strategyId,
|
|
448
|
+
metrics: result.metrics,
|
|
449
|
+
tradeCount: result.trades.length,
|
|
450
|
+
trades: result.trades.slice(0, 100).map((t) => ({
|
|
451
|
+
timestamp: t.timestamp.toISOString(), side: t.side, price: t.price,
|
|
452
|
+
size: t.size, pnl: t.pnl, commission: t.commission, slippage: t.slippage,
|
|
453
|
+
})),
|
|
454
|
+
equityCurve: result.equityCurve.slice(0, 500).map((p) => ({
|
|
455
|
+
timestamp: p.timestamp.toISOString(), equity: Math.round(p.equity * 100) / 100,
|
|
456
|
+
})),
|
|
457
|
+
dailyReturns: result.dailyReturns,
|
|
458
|
+
};
|
|
459
|
+
}
|
|
460
|
+
router.post('/backtest/tick-replay', async (req, res) => {
|
|
461
|
+
if (!backtestEngine) {
|
|
462
|
+
res.status(404).json({ error: 'Backtest engine not available' });
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
465
|
+
if (!tickRecorder) {
|
|
466
|
+
res.status(404).json({ error: 'Tick recorder not available' });
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
469
|
+
try {
|
|
470
|
+
const { platform, marketId, outcomeId, startDate, endDate, initialCapital, commissionPct, slippagePct, evalIntervalMs, priceHistorySize, strategyId, strategyParams } = req.body;
|
|
471
|
+
if (!platform || !marketId || !outcomeId) {
|
|
472
|
+
res.status(400).json({ error: 'Missing required fields: platform, marketId, outcomeId' });
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
const strategy = resolveStrategy(strategyId, platform, marketId, outcomeId, strategyParams);
|
|
476
|
+
const start = startDate ? new Date(startDate) : new Date(Date.now() - 7 * 86400000);
|
|
477
|
+
const end = endDate ? new Date(endDate) : new Date();
|
|
478
|
+
const result = await backtestEngine.runFromTickRecorder(strategy, {
|
|
479
|
+
platform: platform, marketId, outcomeId, startDate: start, endDate: end,
|
|
480
|
+
initialCapital: initialCapital ?? 10_000, commissionPct: commissionPct ?? 0.1, slippagePct: slippagePct ?? 0.05,
|
|
481
|
+
resolutionMs: 0, riskFreeRate: 5, evalIntervalMs: evalIntervalMs ?? 5_000, priceHistorySize: priceHistorySize ?? 200, includeOrderbook: true,
|
|
482
|
+
}, tickRecorder);
|
|
483
|
+
res.json(formatBacktestResult(result));
|
|
484
|
+
}
|
|
485
|
+
catch (err) {
|
|
486
|
+
logger_js_1.logger.warn({ err }, 'API: Tick-replay backtest failed');
|
|
487
|
+
res.status(500).json({ error: err?.message || 'Backtest failed' });
|
|
488
|
+
}
|
|
489
|
+
});
|
|
490
|
+
router.post('/backtest/compare', async (req, res) => {
|
|
491
|
+
if (!backtestEngine) {
|
|
492
|
+
res.status(404).json({ error: 'Backtest engine not available' });
|
|
493
|
+
return;
|
|
494
|
+
}
|
|
495
|
+
if (!tickRecorder) {
|
|
496
|
+
res.status(404).json({ error: 'Tick recorder not available' });
|
|
497
|
+
return;
|
|
498
|
+
}
|
|
499
|
+
try {
|
|
500
|
+
const { platform, marketId, outcomeId, startDate, endDate, initialCapital, commissionPct, slippagePct, evalIntervalMs, priceHistorySize, strategies: strategyList } = req.body;
|
|
501
|
+
if (!platform || !marketId || !outcomeId) {
|
|
502
|
+
res.status(400).json({ error: 'Missing required fields: platform, marketId, outcomeId' });
|
|
503
|
+
return;
|
|
504
|
+
}
|
|
505
|
+
const ids = strategyList?.map((s) => s.id) ?? ['buy-and-hold', 'mean-reversion', 'momentum'];
|
|
506
|
+
const start = startDate ? new Date(startDate) : new Date(Date.now() - 7 * 86400000);
|
|
507
|
+
const end = endDate ? new Date(endDate) : new Date();
|
|
508
|
+
const tickConfig = {
|
|
509
|
+
platform: platform, marketId, outcomeId, startDate: start, endDate: end,
|
|
510
|
+
initialCapital: initialCapital ?? 10_000, commissionPct: commissionPct ?? 0.1, slippagePct: slippagePct ?? 0.05,
|
|
511
|
+
resolutionMs: 0, riskFreeRate: 5, evalIntervalMs: evalIntervalMs ?? 5_000, priceHistorySize: priceHistorySize ?? 200, includeOrderbook: true,
|
|
512
|
+
};
|
|
513
|
+
const ticks = await tickRecorder.getTicks({ platform: platform, marketId, outcomeId, startTime: start.getTime(), endTime: end.getTime() });
|
|
514
|
+
const orderbooks = await tickRecorder.getOrderbookSnapshots({ platform: platform, marketId, outcomeId, startTime: start.getTime(), endTime: end.getTime() });
|
|
515
|
+
const results = [];
|
|
516
|
+
for (const entry of ids) {
|
|
517
|
+
const params = strategyList?.find((s) => s.id === entry)?.params;
|
|
518
|
+
const strategy = resolveStrategy(entry, platform, marketId, outcomeId, params);
|
|
519
|
+
const result = await backtestEngine.runWithTicks(strategy, tickConfig, ticks, orderbooks);
|
|
520
|
+
results.push(formatBacktestResult(result));
|
|
521
|
+
}
|
|
522
|
+
const ranking = results.slice().sort((a, b) => b.metrics.sharpeRatio - a.metrics.sharpeRatio).map((r) => r.strategyId);
|
|
523
|
+
res.json({ results, ranking });
|
|
524
|
+
}
|
|
525
|
+
catch (err) {
|
|
526
|
+
logger_js_1.logger.warn({ err }, 'API: Backtest compare failed');
|
|
527
|
+
res.status(500).json({ error: err?.message || 'Backtest compare failed' });
|
|
528
|
+
}
|
|
529
|
+
});
|
|
530
|
+
router.post('/backtest/monte-carlo', async (req, res) => {
|
|
531
|
+
if (!backtestEngine) {
|
|
532
|
+
res.status(404).json({ error: 'Backtest engine not available' });
|
|
533
|
+
return;
|
|
534
|
+
}
|
|
535
|
+
if (!tickRecorder) {
|
|
536
|
+
res.status(404).json({ error: 'Tick recorder not available' });
|
|
537
|
+
return;
|
|
538
|
+
}
|
|
539
|
+
try {
|
|
540
|
+
const { platform, marketId, outcomeId, startDate, endDate, initialCapital, commissionPct, slippagePct, evalIntervalMs, priceHistorySize, strategyId, strategyParams, simulations } = req.body;
|
|
541
|
+
if (!platform || !marketId || !outcomeId) {
|
|
542
|
+
res.status(400).json({ error: 'Missing required fields: platform, marketId, outcomeId' });
|
|
543
|
+
return;
|
|
544
|
+
}
|
|
545
|
+
const strategy = resolveStrategy(strategyId, platform, marketId, outcomeId, strategyParams);
|
|
546
|
+
const start = startDate ? new Date(startDate) : new Date(Date.now() - 7 * 86400000);
|
|
547
|
+
const end = endDate ? new Date(endDate) : new Date();
|
|
548
|
+
const result = await backtestEngine.runFromTickRecorder(strategy, {
|
|
549
|
+
platform: platform, marketId, outcomeId, startDate: start, endDate: end,
|
|
550
|
+
initialCapital: initialCapital ?? 10_000, commissionPct: commissionPct ?? 0.1, slippagePct: slippagePct ?? 0.05,
|
|
551
|
+
resolutionMs: 0, riskFreeRate: 5, evalIntervalMs: evalIntervalMs ?? 5_000, priceHistorySize: priceHistorySize ?? 200, includeOrderbook: true,
|
|
552
|
+
}, tickRecorder);
|
|
553
|
+
const numSims = Math.min(simulations ?? 1000, 10_000);
|
|
554
|
+
const mc = backtestEngine.monteCarlo(result, numSims);
|
|
555
|
+
res.json({ backtest: formatBacktestResult(result), monteCarlo: mc });
|
|
556
|
+
}
|
|
557
|
+
catch (err) {
|
|
558
|
+
logger_js_1.logger.warn({ err }, 'API: Backtest Monte Carlo failed');
|
|
559
|
+
res.status(500).json({ error: err?.message || 'Backtest Monte Carlo failed' });
|
|
560
|
+
}
|
|
561
|
+
});
|
|
562
|
+
router.get('/backtest/strategies', (_req, res) => {
|
|
563
|
+
res.json({
|
|
564
|
+
strategies: [
|
|
565
|
+
{ id: 'buy-and-hold', name: 'Buy and Hold', description: 'Buy once and hold — baseline benchmark', params: [] },
|
|
566
|
+
{ id: 'mean-reversion', name: 'Mean Reversion', description: 'Buy below moving average, sell above', params: [
|
|
567
|
+
{ name: 'lookbackPeriod', type: 'number', default: 20 },
|
|
568
|
+
{ name: 'entryThreshold', type: 'number', default: 2 },
|
|
569
|
+
{ name: 'exitThreshold', type: 'number', default: 0.5 },
|
|
570
|
+
] },
|
|
571
|
+
{ id: 'momentum', name: 'Momentum', description: 'Follow price trends using MA crossover', params: [
|
|
572
|
+
{ name: 'shortPeriod', type: 'number', default: 5 },
|
|
573
|
+
{ name: 'longPeriod', type: 'number', default: 20 },
|
|
574
|
+
{ name: 'minMomentum', type: 'number', default: 0.05 },
|
|
575
|
+
] },
|
|
576
|
+
],
|
|
577
|
+
});
|
|
578
|
+
});
|
|
579
|
+
// ══════════════════════════════════════════════════════════════════════════
|
|
580
|
+
// ML PIPELINE — Stats, trigger training, backtest ML predictions
|
|
581
|
+
// ══════════════════════════════════════════════════════════════════════════
|
|
582
|
+
router.get('/ml/stats', (_req, res) => {
|
|
583
|
+
if (!mlPipeline) {
|
|
584
|
+
res.status(404).json({ error: 'ML pipeline not enabled' });
|
|
585
|
+
return;
|
|
586
|
+
}
|
|
587
|
+
res.json({ stats: mlPipeline.getStats(), modelMetrics: mlPipeline.getModel().getMetrics() });
|
|
588
|
+
});
|
|
589
|
+
router.post('/ml/train', async (_req, res) => {
|
|
590
|
+
if (!mlPipeline) {
|
|
591
|
+
res.status(404).json({ error: 'ML pipeline not enabled' });
|
|
592
|
+
return;
|
|
593
|
+
}
|
|
594
|
+
try {
|
|
595
|
+
await mlPipeline.trainNow();
|
|
596
|
+
res.json({ success: true, stats: mlPipeline.getStats() });
|
|
597
|
+
}
|
|
598
|
+
catch (err) {
|
|
599
|
+
res.status(500).json({ error: err?.message || 'Training failed' });
|
|
600
|
+
}
|
|
601
|
+
});
|
|
602
|
+
// POST /api/ml/backtest — Backtest ML model predictions on historical tick data.
|
|
603
|
+
// Uses the trained ML model to generate signals, then backtests them.
|
|
604
|
+
router.post('/ml/backtest', async (req, res) => {
|
|
605
|
+
if (!mlPipeline) {
|
|
606
|
+
res.status(404).json({ error: 'ML pipeline not enabled' });
|
|
607
|
+
return;
|
|
608
|
+
}
|
|
609
|
+
if (!backtestEngine) {
|
|
610
|
+
res.status(404).json({ error: 'Backtest engine not available' });
|
|
611
|
+
return;
|
|
612
|
+
}
|
|
613
|
+
if (!tickRecorder) {
|
|
614
|
+
res.status(404).json({ error: 'Tick recorder not available' });
|
|
615
|
+
return;
|
|
616
|
+
}
|
|
617
|
+
try {
|
|
618
|
+
const { platform, marketId, outcomeId, startDate, endDate, initialCapital, minConfidence } = req.body;
|
|
619
|
+
if (!platform || !marketId || !outcomeId) {
|
|
620
|
+
res.status(400).json({ error: 'Missing required fields: platform, marketId, outcomeId' });
|
|
621
|
+
return;
|
|
622
|
+
}
|
|
623
|
+
const model = mlPipeline.getModel();
|
|
624
|
+
const confidenceThreshold = minConfidence ?? 0.3;
|
|
625
|
+
// Create an ML-driven strategy
|
|
626
|
+
const mlStrategy = {
|
|
627
|
+
config: { id: 'ml-signal', name: 'ML Signal Model', platforms: [platform], intervalMs: 30_000 },
|
|
628
|
+
async evaluate(ctx) {
|
|
629
|
+
const ph = ctx.priceHistory.values().next().value;
|
|
630
|
+
if (!ph || ph.length < 20)
|
|
631
|
+
return [];
|
|
632
|
+
const price = ph[ph.length - 1];
|
|
633
|
+
// Build features from available context
|
|
634
|
+
const prices = ph.slice(-24);
|
|
635
|
+
const change1h = prices.length > 1 ? (price - prices[0]) / prices[0] * 100 : 0;
|
|
636
|
+
const mean = prices.reduce((a, b) => a + b, 0) / prices.length;
|
|
637
|
+
const variance = prices.reduce((s, p) => s + (p - mean) ** 2, 0) / prices.length;
|
|
638
|
+
const volatility = Math.sqrt(variance);
|
|
639
|
+
const gains = prices.slice(1).map((p, i) => Math.max(0, p - prices[i]));
|
|
640
|
+
const losses = prices.slice(1).map((p, i) => Math.max(0, prices[i] - p));
|
|
641
|
+
const avgGain = gains.reduce((a, b) => a + b, 0) / gains.length || 0.001;
|
|
642
|
+
const avgLoss = losses.reduce((a, b) => a + b, 0) / losses.length || 0.001;
|
|
643
|
+
const rs = avgGain / avgLoss;
|
|
644
|
+
const rsi = 100 - 100 / (1 + rs);
|
|
645
|
+
const features = {
|
|
646
|
+
price: { current: price, change1h, change24h: change1h * 2, volatility24h: volatility, rsi14: rsi, momentum: change1h / 100 },
|
|
647
|
+
volume: { current24h: 0, changeVsAvg: 0, buyRatio: 0.5 },
|
|
648
|
+
orderbook: { bidAskRatio: 1, imbalanceScore: 0, spreadPct: 1, depth10Pct: 0 },
|
|
649
|
+
market: { daysToExpiry: 30, totalVolume: 0, marketCap: 0, category: 'crypto' },
|
|
650
|
+
};
|
|
651
|
+
const signal = await model.predict(features);
|
|
652
|
+
if (signal.confidence < confidenceThreshold)
|
|
653
|
+
return [];
|
|
654
|
+
const hasPosition = ctx.positions.size > 0;
|
|
655
|
+
if (signal.direction === 1 && !hasPosition && ctx.availableBalance > 10) {
|
|
656
|
+
return [{ type: 'buy', platform: platform, marketId, outcome: outcomeId, price, size: Math.floor(ctx.availableBalance * 0.5 / price), confidence: signal.confidence, reason: `ML buy (conf=${signal.confidence.toFixed(2)}, probUp=${signal.probUp.toFixed(2)})` }];
|
|
657
|
+
}
|
|
658
|
+
else if (signal.direction === -1 && hasPosition) {
|
|
659
|
+
const pos = ctx.positions.values().next().value;
|
|
660
|
+
return [{ type: 'sell', platform: platform, marketId, outcome: outcomeId, price, size: pos?.size || 0, confidence: signal.confidence, reason: `ML sell (conf=${signal.confidence.toFixed(2)}, probUp=${signal.probUp.toFixed(2)})` }];
|
|
661
|
+
}
|
|
662
|
+
return [];
|
|
663
|
+
},
|
|
664
|
+
};
|
|
665
|
+
const start = startDate ? new Date(startDate) : new Date(Date.now() - 7 * 86400000);
|
|
666
|
+
const end = endDate ? new Date(endDate) : new Date();
|
|
667
|
+
const result = await backtestEngine.runFromTickRecorder(mlStrategy, {
|
|
668
|
+
platform: platform, marketId, outcomeId, startDate: start, endDate: end,
|
|
669
|
+
initialCapital: initialCapital ?? 10_000, commissionPct: 0.1, slippagePct: 0.05,
|
|
670
|
+
resolutionMs: 0, riskFreeRate: 5, evalIntervalMs: 30_000, priceHistorySize: 200, includeOrderbook: true,
|
|
671
|
+
}, tickRecorder);
|
|
672
|
+
res.json({
|
|
673
|
+
...formatBacktestResult(result),
|
|
674
|
+
mlStats: mlPipeline.getStats(),
|
|
675
|
+
modelMetrics: model.getMetrics(),
|
|
676
|
+
});
|
|
677
|
+
}
|
|
678
|
+
catch (err) {
|
|
679
|
+
logger_js_1.logger.warn({ err }, 'API: ML backtest failed');
|
|
680
|
+
res.status(500).json({ error: err?.message || 'ML backtest failed' });
|
|
681
|
+
}
|
|
682
|
+
});
|
|
683
|
+
// ══════════════════════════════════════════════════════════════════════════
|
|
684
|
+
// SIGNAL ROUTER — Control and configuration
|
|
685
|
+
// ══════════════════════════════════════════════════════════════════════════
|
|
686
|
+
router.get('/signal-router/config', (_req, res) => {
|
|
687
|
+
if (!signalRouter) {
|
|
688
|
+
res.status(404).json({ error: 'Signal router not enabled' });
|
|
689
|
+
return;
|
|
690
|
+
}
|
|
691
|
+
res.json({ running: signalRouter.isRunning(), stats: signalRouter.getStats() });
|
|
692
|
+
});
|
|
693
|
+
router.post('/signal-router/config', (req, res) => {
|
|
694
|
+
if (!signalRouter) {
|
|
695
|
+
res.status(404).json({ error: 'Signal router not enabled' });
|
|
696
|
+
return;
|
|
697
|
+
}
|
|
698
|
+
try {
|
|
699
|
+
const updates = req.body;
|
|
700
|
+
const allowed = {};
|
|
701
|
+
if (updates.dryRun !== undefined)
|
|
702
|
+
allowed.dryRun = updates.dryRun;
|
|
703
|
+
if (updates.minStrength !== undefined)
|
|
704
|
+
allowed.minStrength = updates.minStrength;
|
|
705
|
+
if (updates.defaultSizeUsd !== undefined)
|
|
706
|
+
allowed.defaultSizeUsd = updates.defaultSizeUsd;
|
|
707
|
+
if (updates.maxSizeUsd !== undefined)
|
|
708
|
+
allowed.maxSizeUsd = updates.maxSizeUsd;
|
|
709
|
+
if (updates.maxDailyLoss !== undefined)
|
|
710
|
+
allowed.maxDailyLoss = updates.maxDailyLoss;
|
|
711
|
+
if (updates.maxConcurrentPositions !== undefined)
|
|
712
|
+
allowed.maxConcurrentPositions = updates.maxConcurrentPositions;
|
|
713
|
+
if (updates.cooldownMs !== undefined)
|
|
714
|
+
allowed.cooldownMs = updates.cooldownMs;
|
|
715
|
+
if (updates.orderMode !== undefined)
|
|
716
|
+
allowed.orderMode = updates.orderMode;
|
|
717
|
+
if (updates.strengthScaling !== undefined)
|
|
718
|
+
allowed.strengthScaling = updates.strengthScaling;
|
|
719
|
+
if (updates.signalTypes !== undefined)
|
|
720
|
+
allowed.signalTypes = updates.signalTypes;
|
|
721
|
+
signalRouter.updateConfig(allowed);
|
|
722
|
+
res.json({ updated: allowed, stats: signalRouter.getStats() });
|
|
723
|
+
}
|
|
724
|
+
catch (err) {
|
|
725
|
+
res.status(500).json({ error: err?.message || 'Config update failed' });
|
|
726
|
+
}
|
|
727
|
+
});
|
|
728
|
+
router.post('/signal-router/reset', (_req, res) => {
|
|
729
|
+
if (!signalRouter) {
|
|
730
|
+
res.status(404).json({ error: 'Signal router not enabled' });
|
|
731
|
+
return;
|
|
732
|
+
}
|
|
733
|
+
signalRouter.resetDailyStats();
|
|
734
|
+
res.json({ success: true, stats: signalRouter.getStats() });
|
|
735
|
+
});
|
|
736
|
+
// ══════════════════════════════════════════════════════════════════════════
|
|
737
|
+
// POSITION MANAGER — Live managed positions with TP/SL
|
|
738
|
+
// ══════════════════════════════════════════════════════════════════════════
|
|
739
|
+
router.get('/positions/managed', (_req, res) => {
|
|
740
|
+
if (!positionManager) {
|
|
741
|
+
res.status(404).json({ error: 'Position manager not available' });
|
|
742
|
+
return;
|
|
743
|
+
}
|
|
744
|
+
try {
|
|
745
|
+
const positions = positionManager.getPositions();
|
|
746
|
+
const stats = positionManager.getStats();
|
|
747
|
+
res.json({ positions, stats });
|
|
748
|
+
}
|
|
749
|
+
catch (err) {
|
|
750
|
+
res.status(500).json({ error: err?.message || 'Failed to fetch managed positions' });
|
|
751
|
+
}
|
|
752
|
+
});
|
|
753
|
+
router.post('/positions/managed/:id/close', (req, res) => {
|
|
754
|
+
if (!positionManager) {
|
|
755
|
+
res.status(404).json({ error: 'Position manager not available' });
|
|
756
|
+
return;
|
|
757
|
+
}
|
|
758
|
+
try {
|
|
759
|
+
const position = positionManager.getPosition(req.params.id);
|
|
760
|
+
if (!position) {
|
|
761
|
+
res.status(404).json({ error: `Position ${req.params.id} not found` });
|
|
762
|
+
return;
|
|
763
|
+
}
|
|
764
|
+
const closePrice = req.body?.price ?? position.currentPrice;
|
|
765
|
+
positionManager.closePosition(req.params.id, closePrice, 'manual_api_close');
|
|
766
|
+
res.json({ success: true, positionId: req.params.id, closePrice });
|
|
767
|
+
}
|
|
768
|
+
catch (err) {
|
|
769
|
+
res.status(500).json({ error: err?.message || 'Failed to close position' });
|
|
770
|
+
}
|
|
771
|
+
});
|
|
772
|
+
router.get('/positions/managed/:id', (req, res) => {
|
|
773
|
+
if (!positionManager) {
|
|
774
|
+
res.status(404).json({ error: 'Position manager not available' });
|
|
775
|
+
return;
|
|
776
|
+
}
|
|
777
|
+
try {
|
|
778
|
+
const position = positionManager.getPosition(req.params.id);
|
|
779
|
+
if (!position) {
|
|
780
|
+
res.status(404).json({ error: `Position ${req.params.id} not found` });
|
|
781
|
+
return;
|
|
782
|
+
}
|
|
783
|
+
res.json({ position });
|
|
784
|
+
}
|
|
785
|
+
catch (err) {
|
|
786
|
+
res.status(500).json({ error: err?.message || 'Failed to get position' });
|
|
787
|
+
}
|
|
788
|
+
});
|
|
789
|
+
router.get('/positions/managed/by-platform/:platform', (req, res) => {
|
|
790
|
+
if (!positionManager) {
|
|
791
|
+
res.status(404).json({ error: 'Position manager not available' });
|
|
792
|
+
return;
|
|
793
|
+
}
|
|
794
|
+
try {
|
|
795
|
+
const positions = positionManager.getPositionsByPlatform(req.params.platform);
|
|
796
|
+
res.json({ positions, count: positions.length });
|
|
797
|
+
}
|
|
798
|
+
catch (err) {
|
|
799
|
+
res.status(500).json({ error: err?.message || 'Failed to get positions by platform' });
|
|
800
|
+
}
|
|
801
|
+
});
|
|
802
|
+
router.post('/positions/managed', (req, res) => {
|
|
803
|
+
if (!positionManager) {
|
|
804
|
+
res.status(404).json({ error: 'Position manager not available' });
|
|
805
|
+
return;
|
|
806
|
+
}
|
|
807
|
+
try {
|
|
808
|
+
const position = positionManager.updatePosition(req.body);
|
|
809
|
+
res.json({ success: true, position });
|
|
810
|
+
}
|
|
811
|
+
catch (err) {
|
|
812
|
+
res.status(500).json({ error: err?.message || 'Failed to create/update position' });
|
|
813
|
+
}
|
|
814
|
+
});
|
|
815
|
+
router.post('/positions/managed/:id/stop-loss', (req, res) => {
|
|
816
|
+
if (!positionManager) {
|
|
817
|
+
res.status(404).json({ error: 'Position manager not available' });
|
|
818
|
+
return;
|
|
819
|
+
}
|
|
820
|
+
try {
|
|
821
|
+
const { price, percentFromEntry, trailingPercent } = req.body ?? {};
|
|
822
|
+
positionManager.setStopLoss(req.params.id, { price, percentFromEntry, trailingPercent });
|
|
823
|
+
res.json({ success: true, positionId: req.params.id });
|
|
824
|
+
}
|
|
825
|
+
catch (err) {
|
|
826
|
+
res.status(500).json({ error: err?.message || 'Failed to set stop-loss' });
|
|
827
|
+
}
|
|
828
|
+
});
|
|
829
|
+
router.post('/positions/managed/:id/take-profit', (req, res) => {
|
|
830
|
+
if (!positionManager) {
|
|
831
|
+
res.status(404).json({ error: 'Position manager not available' });
|
|
832
|
+
return;
|
|
833
|
+
}
|
|
834
|
+
try {
|
|
835
|
+
const { price, percentFromEntry, partialLevels } = req.body ?? {};
|
|
836
|
+
positionManager.setTakeProfit(req.params.id, { price, percentFromEntry, partialLevels });
|
|
837
|
+
res.json({ success: true, positionId: req.params.id });
|
|
838
|
+
}
|
|
839
|
+
catch (err) {
|
|
840
|
+
res.status(500).json({ error: err?.message || 'Failed to set take-profit' });
|
|
841
|
+
}
|
|
842
|
+
});
|
|
843
|
+
router.delete('/positions/managed/:id/stop-loss', (req, res) => {
|
|
844
|
+
if (!positionManager) {
|
|
845
|
+
res.status(404).json({ error: 'Position manager not available' });
|
|
846
|
+
return;
|
|
847
|
+
}
|
|
848
|
+
try {
|
|
849
|
+
positionManager.removeStopLoss(req.params.id);
|
|
850
|
+
res.json({ success: true, positionId: req.params.id });
|
|
851
|
+
}
|
|
852
|
+
catch (err) {
|
|
853
|
+
res.status(500).json({ error: err?.message || 'Failed to remove stop-loss' });
|
|
854
|
+
}
|
|
855
|
+
});
|
|
856
|
+
router.delete('/positions/managed/:id/take-profit', (req, res) => {
|
|
857
|
+
if (!positionManager) {
|
|
858
|
+
res.status(404).json({ error: 'Position manager not available' });
|
|
859
|
+
return;
|
|
860
|
+
}
|
|
861
|
+
try {
|
|
862
|
+
positionManager.removeTakeProfit(req.params.id);
|
|
863
|
+
res.json({ success: true, positionId: req.params.id });
|
|
864
|
+
}
|
|
865
|
+
catch (err) {
|
|
866
|
+
res.status(500).json({ error: err?.message || 'Failed to remove take-profit' });
|
|
867
|
+
}
|
|
868
|
+
});
|
|
869
|
+
router.put('/positions/managed/:id/price', (req, res) => {
|
|
870
|
+
if (!positionManager) {
|
|
871
|
+
res.status(404).json({ error: 'Position manager not available' });
|
|
872
|
+
return;
|
|
873
|
+
}
|
|
874
|
+
try {
|
|
875
|
+
const { price } = req.body ?? {};
|
|
876
|
+
if (typeof price !== 'number') {
|
|
877
|
+
res.status(400).json({ error: 'Required: price (number)' });
|
|
878
|
+
return;
|
|
879
|
+
}
|
|
880
|
+
positionManager.updatePrice(req.params.id, price);
|
|
881
|
+
res.json({ success: true, positionId: req.params.id, price });
|
|
882
|
+
}
|
|
883
|
+
catch (err) {
|
|
884
|
+
res.status(500).json({ error: err?.message || 'Failed to update price' });
|
|
885
|
+
}
|
|
886
|
+
});
|
|
887
|
+
router.put('/positions/managed/prices', (req, res) => {
|
|
888
|
+
if (!positionManager) {
|
|
889
|
+
res.status(404).json({ error: 'Position manager not available' });
|
|
890
|
+
return;
|
|
891
|
+
}
|
|
892
|
+
try {
|
|
893
|
+
const { updates } = req.body ?? {};
|
|
894
|
+
if (!Array.isArray(updates)) {
|
|
895
|
+
res.status(400).json({ error: 'Required: updates (array)' });
|
|
896
|
+
return;
|
|
897
|
+
}
|
|
898
|
+
positionManager.updatePrices(updates);
|
|
899
|
+
res.json({ success: true, count: updates.length });
|
|
900
|
+
}
|
|
901
|
+
catch (err) {
|
|
902
|
+
res.status(500).json({ error: err?.message || 'Failed to update prices' });
|
|
903
|
+
}
|
|
904
|
+
});
|
|
905
|
+
router.post('/positions/managed/start', (_req, res) => {
|
|
906
|
+
if (!positionManager) {
|
|
907
|
+
res.status(404).json({ error: 'Position manager not available' });
|
|
908
|
+
return;
|
|
909
|
+
}
|
|
910
|
+
try {
|
|
911
|
+
positionManager.start();
|
|
912
|
+
res.json({ success: true, monitoring: true });
|
|
913
|
+
}
|
|
914
|
+
catch (err) {
|
|
915
|
+
res.status(500).json({ error: err?.message || 'Failed to start monitoring' });
|
|
916
|
+
}
|
|
917
|
+
});
|
|
918
|
+
router.post('/positions/managed/stop', (_req, res) => {
|
|
919
|
+
if (!positionManager) {
|
|
920
|
+
res.status(404).json({ error: 'Position manager not available' });
|
|
921
|
+
return;
|
|
922
|
+
}
|
|
923
|
+
try {
|
|
924
|
+
positionManager.stop();
|
|
925
|
+
res.json({ success: true, monitoring: false });
|
|
926
|
+
}
|
|
927
|
+
catch (err) {
|
|
928
|
+
res.status(500).json({ error: err?.message || 'Failed to stop monitoring' });
|
|
929
|
+
}
|
|
930
|
+
});
|
|
931
|
+
// ══════════════════════════════════════════════════════════════════════════
|
|
932
|
+
// FEATURE ENGINE — Market indicators
|
|
933
|
+
// ══════════════════════════════════════════════════════════════════════════
|
|
934
|
+
router.get('/features', (req, res) => {
|
|
935
|
+
if (!featureEngine) {
|
|
936
|
+
res.status(404).json({ error: 'Feature engine not available' });
|
|
937
|
+
return;
|
|
938
|
+
}
|
|
939
|
+
const { platform, marketId, outcomeId } = req.query;
|
|
940
|
+
try {
|
|
941
|
+
if (platform && marketId) {
|
|
942
|
+
res.json({ features: featureEngine.getFeatures(platform, marketId, outcomeId) });
|
|
943
|
+
}
|
|
944
|
+
else {
|
|
945
|
+
res.json({ stats: featureEngine.getStats(), markets: featureEngine.getAllFeatures().slice(0, 50) });
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
catch (err) {
|
|
949
|
+
res.status(500).json({ error: err?.message || 'Failed to fetch features' });
|
|
950
|
+
}
|
|
951
|
+
});
|
|
952
|
+
// ══════════════════════════════════════════════════════════════════════════
|
|
953
|
+
// SIGNALS/STREAM — Server-Sent Events
|
|
954
|
+
// ══════════════════════════════════════════════════════════════════════════
|
|
955
|
+
router.get('/signals/stream', (req, res) => {
|
|
956
|
+
if (!signalBus) {
|
|
957
|
+
res.status(404).json({ error: 'Signal bus not available' });
|
|
958
|
+
return;
|
|
959
|
+
}
|
|
960
|
+
res.writeHead(200, { 'Content-Type': 'text/event-stream', 'Cache-Control': 'no-cache', Connection: 'keep-alive', 'X-Accel-Buffering': 'no' });
|
|
961
|
+
res.flushHeaders();
|
|
962
|
+
const includeTicks = req.query.ticks === 'true';
|
|
963
|
+
res.write(`event: connected\ndata: ${JSON.stringify({ timestamp: new Date().toISOString() })}\n\n`);
|
|
964
|
+
const onSignal = (signal) => { res.write(`event: signal\ndata: ${JSON.stringify(signal)}\n\n`); };
|
|
965
|
+
signalBus.onSignal(onSignal);
|
|
966
|
+
let onTick = null;
|
|
967
|
+
if (includeTicks) {
|
|
968
|
+
let lastTickTime = 0;
|
|
969
|
+
onTick = (update) => {
|
|
970
|
+
const now = Date.now();
|
|
971
|
+
if (now - lastTickTime < 500)
|
|
972
|
+
return;
|
|
973
|
+
lastTickTime = now;
|
|
974
|
+
res.write(`event: tick\ndata: ${JSON.stringify({ platform: update.platform, marketId: update.marketId, outcomeId: update.outcomeId, price: update.price, timestamp: update.timestamp })}\n\n`);
|
|
975
|
+
};
|
|
976
|
+
signalBus.onTick(onTick);
|
|
977
|
+
}
|
|
978
|
+
const heartbeat = setInterval(() => { res.write(`:heartbeat ${Date.now()}\n\n`); }, 30_000);
|
|
979
|
+
req.on('close', () => {
|
|
980
|
+
clearInterval(heartbeat);
|
|
981
|
+
signalBus.removeListener('signal', onSignal);
|
|
982
|
+
if (onTick)
|
|
983
|
+
signalBus.removeListener('tick', onTick);
|
|
984
|
+
});
|
|
985
|
+
});
|
|
986
|
+
// ══════════════════════════════════════════════════════════════════════════
|
|
987
|
+
// DASHBOARD — Unified system overview
|
|
988
|
+
// ══════════════════════════════════════════════════════════════════════════
|
|
989
|
+
router.get('/dashboard', (_req, res) => {
|
|
990
|
+
try {
|
|
991
|
+
const signalRouterStatus = signalRouter
|
|
992
|
+
? { enabled: true, running: signalRouter.isRunning(), stats: signalRouter.getStats() }
|
|
993
|
+
: { enabled: false, running: false, stats: null };
|
|
994
|
+
const orchestratorStatus = orchestrator?.getStats() ?? null;
|
|
995
|
+
const safetyStatus = safety?.getState() ?? null;
|
|
996
|
+
const circuitBreaker = execution?.getCircuitBreakerState?.() ?? null;
|
|
997
|
+
const dbPositions = db.getPositions('default');
|
|
998
|
+
const pmStats = positionManager?.getStats() ?? null;
|
|
999
|
+
const feStats = featureEngine?.getStats() ?? null;
|
|
1000
|
+
const bots = botManager?.getAllBotStatuses() ?? [];
|
|
1001
|
+
const activeBots = bots.filter((b) => b.status === 'running').length;
|
|
1002
|
+
const recentTrades = tradeLogger?.getTrades({ limit: 10 }) ?? [];
|
|
1003
|
+
const tradeStats = tradeLogger?.getStats() ?? null;
|
|
1004
|
+
const recentSignals = signalRouter?.getRecentExecutions(10) ?? [];
|
|
1005
|
+
const mlStats = mlPipeline?.getStats() ?? null;
|
|
1006
|
+
res.json({
|
|
1007
|
+
timestamp: new Date().toISOString(),
|
|
1008
|
+
system: { signalRouter: signalRouterStatus, orchestrator: orchestratorStatus, safety: safetyStatus, circuitBreaker },
|
|
1009
|
+
positions: { db: { count: dbPositions.length }, managed: pmStats },
|
|
1010
|
+
features: feStats,
|
|
1011
|
+
bots: { total: bots.length, active: activeBots, list: bots.map((b) => ({ id: b.id, status: b.status, name: b.name })) },
|
|
1012
|
+
trading: {
|
|
1013
|
+
stats: tradeStats,
|
|
1014
|
+
recentTrades: recentTrades.slice(0, 5).map((t) => ({ id: t.id, platform: t.platform, side: t.side, price: t.price, size: t.size, status: t.status, pnl: t.pnl, timestamp: t.timestamp })),
|
|
1015
|
+
},
|
|
1016
|
+
signals: { recent: recentSignals.slice(0, 5).map((e) => ({ id: e.id, type: e.signal?.type, direction: e.signal?.direction, market: e.signal?.marketId, status: e.status, timestamp: e.timestamp })) },
|
|
1017
|
+
ml: mlStats,
|
|
1018
|
+
});
|
|
1019
|
+
}
|
|
1020
|
+
catch (err) {
|
|
1021
|
+
logger_js_1.logger.warn({ err }, 'API: Dashboard failed');
|
|
1022
|
+
res.status(500).json({ error: err?.message || 'Dashboard failed' });
|
|
1023
|
+
}
|
|
1024
|
+
});
|
|
1025
|
+
logger_js_1.logger.info('Trading API routes initialized');
|
|
1026
|
+
return router;
|
|
1027
|
+
}
|
|
1028
|
+
//# sourceMappingURL=api-routes.js.map
|