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,1336 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Futures Execution Service - Perpetuals/Futures trading infrastructure
|
|
4
|
+
*
|
|
5
|
+
* Supports: Binance Futures, Bybit, MEXC, Hyperliquid
|
|
6
|
+
*
|
|
7
|
+
* Key differences from prediction market ExecutionService:
|
|
8
|
+
* - Long/short positions (not yes/no outcomes)
|
|
9
|
+
* - Leverage support
|
|
10
|
+
* - Margin types (isolated/cross)
|
|
11
|
+
* - Position sizing in contracts or base currency
|
|
12
|
+
* - Funding rates awareness
|
|
13
|
+
*/
|
|
14
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
15
|
+
if (k2 === undefined) k2 = k;
|
|
16
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
17
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
18
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
19
|
+
}
|
|
20
|
+
Object.defineProperty(o, k2, desc);
|
|
21
|
+
}) : (function(o, m, k, k2) {
|
|
22
|
+
if (k2 === undefined) k2 = k;
|
|
23
|
+
o[k2] = m[k];
|
|
24
|
+
}));
|
|
25
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
26
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
27
|
+
}) : function(o, v) {
|
|
28
|
+
o["default"] = v;
|
|
29
|
+
});
|
|
30
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
31
|
+
var ownKeys = function(o) {
|
|
32
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
33
|
+
var ar = [];
|
|
34
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
35
|
+
return ar;
|
|
36
|
+
};
|
|
37
|
+
return ownKeys(o);
|
|
38
|
+
};
|
|
39
|
+
return function (mod) {
|
|
40
|
+
if (mod && mod.__esModule) return mod;
|
|
41
|
+
var result = {};
|
|
42
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
43
|
+
__setModuleDefault(result, mod);
|
|
44
|
+
return result;
|
|
45
|
+
};
|
|
46
|
+
})();
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.createFuturesExecutionService = createFuturesExecutionService;
|
|
49
|
+
const logger_1 = require("../utils/logger");
|
|
50
|
+
const crypto_1 = require("crypto");
|
|
51
|
+
const ethers_1 = require("ethers");
|
|
52
|
+
const bybit = __importStar(require("../exchanges/bybit"));
|
|
53
|
+
const mexc = __importStar(require("../exchanges/mexc"));
|
|
54
|
+
const hyperliquid = __importStar(require("../exchanges/hyperliquid"));
|
|
55
|
+
// Helper to derive wallet address from private key
|
|
56
|
+
function getWalletAddress(privateKey) {
|
|
57
|
+
const wallet = new ethers_1.Wallet(privateKey.startsWith('0x') ? privateKey : `0x${privateKey}`);
|
|
58
|
+
return wallet.address;
|
|
59
|
+
}
|
|
60
|
+
// =============================================================================
|
|
61
|
+
// MEXC margin type preference (per-order, tracked locally)
|
|
62
|
+
// =============================================================================
|
|
63
|
+
const mexcMarginPreference = new Map();
|
|
64
|
+
// =============================================================================
|
|
65
|
+
// BINANCE FUTURES
|
|
66
|
+
// =============================================================================
|
|
67
|
+
const BINANCE_FUTURES_URL = 'https://fapi.binance.com';
|
|
68
|
+
const BINANCE_FUTURES_TESTNET_URL = 'https://testnet.binancefuture.com';
|
|
69
|
+
function getBinanceUrl(testnet) {
|
|
70
|
+
return testnet ? BINANCE_FUTURES_TESTNET_URL : BINANCE_FUTURES_URL;
|
|
71
|
+
}
|
|
72
|
+
function signBinanceRequest(params, secretKey) {
|
|
73
|
+
const queryString = Object.entries(params)
|
|
74
|
+
.map(([k, v]) => `${k}=${v}`)
|
|
75
|
+
.join('&');
|
|
76
|
+
return (0, crypto_1.createHmac)('sha256', secretKey).update(queryString).digest('hex');
|
|
77
|
+
}
|
|
78
|
+
async function binanceFuturesRequest(config, method, endpoint, params = {}) {
|
|
79
|
+
const baseUrl = getBinanceUrl(config.testnet);
|
|
80
|
+
const timestamp = Date.now();
|
|
81
|
+
const allParams = { ...params, timestamp, recvWindow: 5000 };
|
|
82
|
+
const signature = signBinanceRequest(allParams, config.secretKey);
|
|
83
|
+
const queryString = Object.entries(allParams)
|
|
84
|
+
.map(([k, v]) => `${k}=${encodeURIComponent(v)}`)
|
|
85
|
+
.join('&') + `&signature=${signature}`;
|
|
86
|
+
const url = `${baseUrl}${endpoint}?${queryString}`;
|
|
87
|
+
const response = await fetch(url, {
|
|
88
|
+
method,
|
|
89
|
+
headers: {
|
|
90
|
+
'X-MBX-APIKEY': config.apiKey,
|
|
91
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
const data = await response.json();
|
|
95
|
+
if (!response.ok) {
|
|
96
|
+
throw new Error(data.msg || `HTTP ${response.status}`);
|
|
97
|
+
}
|
|
98
|
+
return data;
|
|
99
|
+
}
|
|
100
|
+
async function placeBinanceFuturesOrder(config, request) {
|
|
101
|
+
try {
|
|
102
|
+
const params = {
|
|
103
|
+
symbol: request.symbol,
|
|
104
|
+
side: request.side === 'long' ? 'BUY' : 'SELL',
|
|
105
|
+
type: request.orderType || 'MARKET',
|
|
106
|
+
quantity: request.size,
|
|
107
|
+
};
|
|
108
|
+
if (request.price && (request.orderType === 'LIMIT' || request.orderType === 'STOP_LIMIT' || request.orderType === 'TAKE_PROFIT_LIMIT')) {
|
|
109
|
+
params.price = request.price;
|
|
110
|
+
}
|
|
111
|
+
if (request.timeInForce) {
|
|
112
|
+
params.timeInForce = request.timeInForce;
|
|
113
|
+
}
|
|
114
|
+
else if (request.orderType === 'LIMIT') {
|
|
115
|
+
params.timeInForce = 'GTC';
|
|
116
|
+
}
|
|
117
|
+
if (request.reduceOnly) {
|
|
118
|
+
params.reduceOnly = 'true';
|
|
119
|
+
}
|
|
120
|
+
if (request.stopPrice) {
|
|
121
|
+
params.stopPrice = request.stopPrice;
|
|
122
|
+
}
|
|
123
|
+
if (request.closePosition) {
|
|
124
|
+
params.closePosition = 'true';
|
|
125
|
+
}
|
|
126
|
+
const data = await binanceFuturesRequest(config, 'POST', '/fapi/v1/order', params);
|
|
127
|
+
return {
|
|
128
|
+
success: true,
|
|
129
|
+
orderId: data.orderId?.toString(),
|
|
130
|
+
clientOrderId: data.clientOrderId,
|
|
131
|
+
filledSize: parseFloat(data.executedQty || '0'),
|
|
132
|
+
avgFillPrice: parseFloat(data.avgPrice || '0'),
|
|
133
|
+
status: data.status,
|
|
134
|
+
commission: parseFloat(data.commission || '0'),
|
|
135
|
+
commissionAsset: data.commissionAsset,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
catch (error) {
|
|
139
|
+
logger_1.logger.error({ error, request }, 'Binance Futures order failed');
|
|
140
|
+
return {
|
|
141
|
+
success: false,
|
|
142
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
async function cancelBinanceFuturesOrder(config, symbol, orderId) {
|
|
147
|
+
try {
|
|
148
|
+
await binanceFuturesRequest(config, 'DELETE', '/fapi/v1/order', {
|
|
149
|
+
symbol,
|
|
150
|
+
orderId: parseInt(orderId, 10),
|
|
151
|
+
});
|
|
152
|
+
return true;
|
|
153
|
+
}
|
|
154
|
+
catch (error) {
|
|
155
|
+
logger_1.logger.error({ error, symbol, orderId }, 'Failed to cancel Binance Futures order');
|
|
156
|
+
return false;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
async function getBinanceFuturesPositions(config, symbol) {
|
|
160
|
+
try {
|
|
161
|
+
const data = await binanceFuturesRequest(config, 'GET', '/fapi/v2/positionRisk');
|
|
162
|
+
return data
|
|
163
|
+
.filter(p => parseFloat(p.positionAmt) !== 0)
|
|
164
|
+
.filter(p => !symbol || p.symbol === symbol)
|
|
165
|
+
.map(p => ({
|
|
166
|
+
platform: 'binance',
|
|
167
|
+
symbol: p.symbol,
|
|
168
|
+
side: parseFloat(p.positionAmt) > 0 ? 'long' : 'short',
|
|
169
|
+
size: Math.abs(parseFloat(p.positionAmt)),
|
|
170
|
+
entryPrice: parseFloat(p.entryPrice),
|
|
171
|
+
markPrice: parseFloat(p.markPrice),
|
|
172
|
+
liquidationPrice: parseFloat(p.liquidationPrice),
|
|
173
|
+
leverage: parseInt(p.leverage, 10),
|
|
174
|
+
marginType: p.marginType.toLowerCase(),
|
|
175
|
+
unrealizedPnl: parseFloat(p.unRealizedProfit),
|
|
176
|
+
margin: parseFloat(p.isolatedMargin),
|
|
177
|
+
notional: Math.abs(parseFloat(p.notional)),
|
|
178
|
+
}));
|
|
179
|
+
}
|
|
180
|
+
catch (error) {
|
|
181
|
+
logger_1.logger.error({ error }, 'Failed to get Binance Futures positions');
|
|
182
|
+
return [];
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
async function getBinanceFuturesOpenOrders(config, symbol) {
|
|
186
|
+
try {
|
|
187
|
+
const params = {};
|
|
188
|
+
if (symbol)
|
|
189
|
+
params.symbol = symbol;
|
|
190
|
+
const data = await binanceFuturesRequest(config, 'GET', '/fapi/v1/openOrders', params);
|
|
191
|
+
return data.map(o => ({
|
|
192
|
+
orderId: o.orderId.toString(),
|
|
193
|
+
clientOrderId: o.clientOrderId,
|
|
194
|
+
platform: 'binance',
|
|
195
|
+
symbol: o.symbol,
|
|
196
|
+
side: o.side === 'BUY' ? 'long' : 'short',
|
|
197
|
+
price: parseFloat(o.price),
|
|
198
|
+
originalSize: parseFloat(o.origQty),
|
|
199
|
+
filledSize: parseFloat(o.executedQty),
|
|
200
|
+
remainingSize: parseFloat(o.origQty) - parseFloat(o.executedQty),
|
|
201
|
+
orderType: o.type,
|
|
202
|
+
timeInForce: o.timeInForce,
|
|
203
|
+
status: o.status,
|
|
204
|
+
reduceOnly: o.reduceOnly,
|
|
205
|
+
stopPrice: o.stopPrice ? parseFloat(o.stopPrice) : undefined,
|
|
206
|
+
createdAt: new Date(o.time),
|
|
207
|
+
}));
|
|
208
|
+
}
|
|
209
|
+
catch (error) {
|
|
210
|
+
logger_1.logger.error({ error }, 'Failed to get Binance Futures open orders');
|
|
211
|
+
return [];
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
async function getBinanceFuturesBalance(config) {
|
|
215
|
+
try {
|
|
216
|
+
const data = await binanceFuturesRequest(config, 'GET', '/fapi/v2/account');
|
|
217
|
+
return data.assets
|
|
218
|
+
.filter(a => parseFloat(a.walletBalance) > 0 || parseFloat(a.marginBalance) > 0)
|
|
219
|
+
.map(a => ({
|
|
220
|
+
platform: 'binance',
|
|
221
|
+
asset: a.asset,
|
|
222
|
+
balance: parseFloat(a.walletBalance),
|
|
223
|
+
availableBalance: parseFloat(a.availableBalance),
|
|
224
|
+
unrealizedPnl: parseFloat(a.unrealizedProfit),
|
|
225
|
+
marginBalance: parseFloat(a.marginBalance),
|
|
226
|
+
maintenanceMargin: parseFloat(a.maintMargin),
|
|
227
|
+
initialMargin: parseFloat(a.initialMargin),
|
|
228
|
+
}));
|
|
229
|
+
}
|
|
230
|
+
catch (error) {
|
|
231
|
+
logger_1.logger.error({ error }, 'Failed to get Binance Futures balance');
|
|
232
|
+
return [];
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
async function getBinanceFundingRate(config, symbol) {
|
|
236
|
+
try {
|
|
237
|
+
const data = await binanceFuturesRequest(config, 'GET', '/fapi/v1/premiumIndex', { symbol });
|
|
238
|
+
return {
|
|
239
|
+
platform: 'binance',
|
|
240
|
+
symbol: data.symbol,
|
|
241
|
+
fundingRate: parseFloat(data.lastFundingRate),
|
|
242
|
+
fundingTime: new Date(data.time),
|
|
243
|
+
nextFundingTime: new Date(data.nextFundingTime),
|
|
244
|
+
markPrice: parseFloat(data.markPrice),
|
|
245
|
+
indexPrice: parseFloat(data.indexPrice),
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
catch (error) {
|
|
249
|
+
logger_1.logger.error({ error, symbol }, 'Failed to get Binance funding rate');
|
|
250
|
+
return null;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
async function setBinanceLeverage(config, symbol, leverage) {
|
|
254
|
+
try {
|
|
255
|
+
await binanceFuturesRequest(config, 'POST', '/fapi/v1/leverage', {
|
|
256
|
+
symbol,
|
|
257
|
+
leverage,
|
|
258
|
+
});
|
|
259
|
+
return true;
|
|
260
|
+
}
|
|
261
|
+
catch (error) {
|
|
262
|
+
logger_1.logger.error({ error, symbol, leverage }, 'Failed to set Binance leverage');
|
|
263
|
+
return false;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
async function setBinanceMarginType(config, symbol, marginType) {
|
|
267
|
+
try {
|
|
268
|
+
await binanceFuturesRequest(config, 'POST', '/fapi/v1/marginType', {
|
|
269
|
+
symbol,
|
|
270
|
+
marginType: marginType.toUpperCase(),
|
|
271
|
+
});
|
|
272
|
+
return true;
|
|
273
|
+
}
|
|
274
|
+
catch (error) {
|
|
275
|
+
// Error code -4046 means margin type is already set
|
|
276
|
+
const errMsg = error instanceof Error ? error.message : '';
|
|
277
|
+
if (errMsg.includes('-4046')) {
|
|
278
|
+
return true;
|
|
279
|
+
}
|
|
280
|
+
logger_1.logger.error({ error, symbol, marginType }, 'Failed to set Binance margin type');
|
|
281
|
+
return false;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
// =============================================================================
|
|
285
|
+
// BYBIT FUTURES
|
|
286
|
+
// =============================================================================
|
|
287
|
+
async function placeBybitFuturesOrder(config, request) {
|
|
288
|
+
try {
|
|
289
|
+
const bybitConfig = {
|
|
290
|
+
apiKey: config.apiKey,
|
|
291
|
+
apiSecret: config.secretKey,
|
|
292
|
+
testnet: config.testnet,
|
|
293
|
+
};
|
|
294
|
+
let result;
|
|
295
|
+
if (request.reduceOnly || request.closePosition) {
|
|
296
|
+
// Close position
|
|
297
|
+
const closeResult = await bybit.closePosition(bybitConfig, request.symbol);
|
|
298
|
+
if (!closeResult) {
|
|
299
|
+
return { success: true }; // No position to close
|
|
300
|
+
}
|
|
301
|
+
result = closeResult;
|
|
302
|
+
}
|
|
303
|
+
else if (request.orderType === 'LIMIT' && request.price) {
|
|
304
|
+
// Limit order
|
|
305
|
+
if (request.leverage) {
|
|
306
|
+
await bybit.setLeverage(bybitConfig, request.symbol, request.leverage);
|
|
307
|
+
}
|
|
308
|
+
result = await bybit.placeLimitOrder(bybitConfig, request.symbol, request.side === 'long' ? 'Buy' : 'Sell', request.size, request.price, { reduceOnly: request.reduceOnly, timeInForce: request.timeInForce });
|
|
309
|
+
}
|
|
310
|
+
else if ((request.orderType === 'STOP_LOSS' || request.orderType === 'TAKE_PROFIT') && request.stopPrice) {
|
|
311
|
+
// Stop order
|
|
312
|
+
result = await bybit.placeStopOrder(bybitConfig, request.symbol, request.side === 'long' ? 'Buy' : 'Sell', request.size, request.stopPrice, { price: request.price });
|
|
313
|
+
}
|
|
314
|
+
else if (request.side === 'long') {
|
|
315
|
+
result = await bybit.openLong(bybitConfig, request.symbol, request.size, request.leverage);
|
|
316
|
+
}
|
|
317
|
+
else {
|
|
318
|
+
result = await bybit.openShort(bybitConfig, request.symbol, request.size, request.leverage);
|
|
319
|
+
}
|
|
320
|
+
return {
|
|
321
|
+
success: true,
|
|
322
|
+
orderId: result.orderId,
|
|
323
|
+
filledSize: result.cumExecQty,
|
|
324
|
+
avgFillPrice: result.avgPrice,
|
|
325
|
+
status: result.orderStatus === 'Filled' ? 'FILLED' : 'NEW',
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
catch (error) {
|
|
329
|
+
logger_1.logger.error({ error, request }, 'Bybit Futures order failed');
|
|
330
|
+
return {
|
|
331
|
+
success: false,
|
|
332
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
async function cancelBybitFuturesOrder(config, symbol, orderId) {
|
|
337
|
+
try {
|
|
338
|
+
const bybitConfig = {
|
|
339
|
+
apiKey: config.apiKey,
|
|
340
|
+
apiSecret: config.secretKey,
|
|
341
|
+
testnet: config.testnet,
|
|
342
|
+
};
|
|
343
|
+
return await bybit.cancelOrder(bybitConfig, symbol, orderId);
|
|
344
|
+
}
|
|
345
|
+
catch (error) {
|
|
346
|
+
logger_1.logger.error({ error, symbol, orderId }, 'Failed to cancel Bybit order');
|
|
347
|
+
return false;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
async function getBybitFuturesPositions(config, symbol) {
|
|
351
|
+
try {
|
|
352
|
+
const bybitConfig = {
|
|
353
|
+
apiKey: config.apiKey,
|
|
354
|
+
apiSecret: config.secretKey,
|
|
355
|
+
testnet: config.testnet,
|
|
356
|
+
};
|
|
357
|
+
const positions = await bybit.getPositions(bybitConfig);
|
|
358
|
+
return positions
|
|
359
|
+
.filter(p => !symbol || p.symbol === symbol)
|
|
360
|
+
.map(p => ({
|
|
361
|
+
platform: 'bybit',
|
|
362
|
+
symbol: p.symbol,
|
|
363
|
+
side: p.side === 'Buy' ? 'long' : 'short',
|
|
364
|
+
size: p.size,
|
|
365
|
+
entryPrice: p.entryPrice,
|
|
366
|
+
markPrice: p.markPrice,
|
|
367
|
+
liquidationPrice: p.liqPrice,
|
|
368
|
+
leverage: p.leverage,
|
|
369
|
+
marginType: 'isolated', // Bybit unified account
|
|
370
|
+
unrealizedPnl: p.unrealisedPnl,
|
|
371
|
+
margin: p.positionValue / p.leverage,
|
|
372
|
+
notional: p.positionValue,
|
|
373
|
+
}));
|
|
374
|
+
}
|
|
375
|
+
catch (error) {
|
|
376
|
+
logger_1.logger.error({ error }, 'Failed to get Bybit positions');
|
|
377
|
+
return [];
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
async function getBybitFuturesOpenOrders(config, symbol) {
|
|
381
|
+
try {
|
|
382
|
+
const bybitConfig = {
|
|
383
|
+
apiKey: config.apiKey,
|
|
384
|
+
apiSecret: config.secretKey,
|
|
385
|
+
testnet: config.testnet,
|
|
386
|
+
};
|
|
387
|
+
const orders = await bybit.getOpenOrders(bybitConfig, symbol);
|
|
388
|
+
return orders.map(o => ({
|
|
389
|
+
orderId: o.orderId,
|
|
390
|
+
platform: 'bybit',
|
|
391
|
+
symbol: o.symbol,
|
|
392
|
+
side: o.side === 'Buy' ? 'long' : 'short',
|
|
393
|
+
price: o.price,
|
|
394
|
+
originalSize: o.qty,
|
|
395
|
+
filledSize: o.cumExecQty,
|
|
396
|
+
remainingSize: o.qty - o.cumExecQty,
|
|
397
|
+
orderType: (o.orderType === 'Market' ? 'MARKET' : 'LIMIT'),
|
|
398
|
+
timeInForce: 'GTC',
|
|
399
|
+
status: o.orderStatus,
|
|
400
|
+
reduceOnly: false,
|
|
401
|
+
createdAt: new Date(),
|
|
402
|
+
}));
|
|
403
|
+
}
|
|
404
|
+
catch (error) {
|
|
405
|
+
logger_1.logger.error({ error }, 'Failed to get Bybit open orders');
|
|
406
|
+
return [];
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
async function getBybitFuturesBalance(config) {
|
|
410
|
+
try {
|
|
411
|
+
const bybitConfig = {
|
|
412
|
+
apiKey: config.apiKey,
|
|
413
|
+
apiSecret: config.secretKey,
|
|
414
|
+
testnet: config.testnet,
|
|
415
|
+
};
|
|
416
|
+
const balances = await bybit.getBalance(bybitConfig);
|
|
417
|
+
return balances.map(b => ({
|
|
418
|
+
platform: 'bybit',
|
|
419
|
+
asset: b.coin,
|
|
420
|
+
balance: b.walletBalance,
|
|
421
|
+
availableBalance: b.availableBalance,
|
|
422
|
+
unrealizedPnl: b.unrealisedPnl,
|
|
423
|
+
marginBalance: b.equity,
|
|
424
|
+
maintenanceMargin: 0,
|
|
425
|
+
initialMargin: b.equity - b.availableBalance,
|
|
426
|
+
}));
|
|
427
|
+
}
|
|
428
|
+
catch (error) {
|
|
429
|
+
logger_1.logger.error({ error }, 'Failed to get Bybit balance');
|
|
430
|
+
return [];
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
async function getBybitFundingRate(config, symbol) {
|
|
434
|
+
try {
|
|
435
|
+
const bybitConfig = {
|
|
436
|
+
apiKey: config.apiKey,
|
|
437
|
+
apiSecret: config.secretKey,
|
|
438
|
+
testnet: config.testnet,
|
|
439
|
+
};
|
|
440
|
+
const data = await bybit.getFundingRate(bybitConfig, symbol);
|
|
441
|
+
return {
|
|
442
|
+
platform: 'bybit',
|
|
443
|
+
symbol: data.symbol,
|
|
444
|
+
fundingRate: data.fundingRate,
|
|
445
|
+
fundingTime: new Date(),
|
|
446
|
+
nextFundingTime: new Date(data.fundingRateTimestamp),
|
|
447
|
+
markPrice: data.markPrice,
|
|
448
|
+
indexPrice: data.indexPrice,
|
|
449
|
+
};
|
|
450
|
+
}
|
|
451
|
+
catch (error) {
|
|
452
|
+
logger_1.logger.error({ error, symbol }, 'Failed to get Bybit funding rate');
|
|
453
|
+
return null;
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
async function setBybitLeverage(config, symbol, leverage) {
|
|
457
|
+
try {
|
|
458
|
+
const bybitConfig = {
|
|
459
|
+
apiKey: config.apiKey,
|
|
460
|
+
apiSecret: config.secretKey,
|
|
461
|
+
testnet: config.testnet,
|
|
462
|
+
};
|
|
463
|
+
await bybit.setLeverage(bybitConfig, symbol, leverage);
|
|
464
|
+
return true;
|
|
465
|
+
}
|
|
466
|
+
catch (error) {
|
|
467
|
+
logger_1.logger.error({ error, symbol, leverage }, 'Failed to set Bybit leverage');
|
|
468
|
+
return false;
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
// =============================================================================
|
|
472
|
+
// MEXC FUTURES
|
|
473
|
+
// =============================================================================
|
|
474
|
+
async function placeMexcFuturesOrder(config, request) {
|
|
475
|
+
try {
|
|
476
|
+
const mexcConfig = {
|
|
477
|
+
apiKey: config.apiKey,
|
|
478
|
+
apiSecret: config.secretKey,
|
|
479
|
+
};
|
|
480
|
+
const openType = mexcMarginPreference.get(request.symbol) === 'cross' ? 2 : 1;
|
|
481
|
+
let result;
|
|
482
|
+
if (request.reduceOnly || request.closePosition) {
|
|
483
|
+
result = await mexc.closePosition(mexcConfig, request.symbol);
|
|
484
|
+
if (!result) {
|
|
485
|
+
return { success: true }; // No position to close
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
else if (request.orderType === 'LIMIT' && request.price) {
|
|
489
|
+
// Limit order
|
|
490
|
+
const side = request.side === 'long'
|
|
491
|
+
? (request.reduceOnly ? 4 : 1) // 1=open long, 4=close short
|
|
492
|
+
: (request.reduceOnly ? 2 : 3); // 3=open short, 2=close long
|
|
493
|
+
result = await mexc.placeLimitOrder(mexcConfig, request.symbol, side, request.size, request.price, { leverage: request.leverage, openType });
|
|
494
|
+
}
|
|
495
|
+
else if ((request.orderType === 'STOP_LOSS' || request.orderType === 'TAKE_PROFIT') && request.stopPrice) {
|
|
496
|
+
// Stop order
|
|
497
|
+
const side = request.side === 'long' ? 4 : 2; // Close sides for stops
|
|
498
|
+
result = await mexc.placeStopOrder(mexcConfig, request.symbol, side, request.size, request.stopPrice, { price: request.price, openType });
|
|
499
|
+
}
|
|
500
|
+
else if (request.side === 'long') {
|
|
501
|
+
result = await mexc.openLong(mexcConfig, request.symbol, request.size, request.leverage, openType);
|
|
502
|
+
}
|
|
503
|
+
else {
|
|
504
|
+
result = await mexc.openShort(mexcConfig, request.symbol, request.size, request.leverage, openType);
|
|
505
|
+
}
|
|
506
|
+
return {
|
|
507
|
+
success: true,
|
|
508
|
+
orderId: result.orderId,
|
|
509
|
+
filledSize: result.dealVol,
|
|
510
|
+
avgFillPrice: result.dealAvgPrice,
|
|
511
|
+
status: result.state === 2 ? 'FILLED' : 'NEW',
|
|
512
|
+
};
|
|
513
|
+
}
|
|
514
|
+
catch (error) {
|
|
515
|
+
logger_1.logger.error({ error, request }, 'MEXC Futures order failed');
|
|
516
|
+
return {
|
|
517
|
+
success: false,
|
|
518
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
async function cancelMexcFuturesOrder(config, symbol, orderId) {
|
|
523
|
+
try {
|
|
524
|
+
const mexcConfig = {
|
|
525
|
+
apiKey: config.apiKey,
|
|
526
|
+
apiSecret: config.secretKey,
|
|
527
|
+
};
|
|
528
|
+
return await mexc.cancelOrder(mexcConfig, symbol, orderId);
|
|
529
|
+
}
|
|
530
|
+
catch (error) {
|
|
531
|
+
logger_1.logger.error({ error, symbol, orderId }, 'Failed to cancel MEXC order');
|
|
532
|
+
return false;
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
async function getMexcFuturesPositions(config, symbol) {
|
|
536
|
+
try {
|
|
537
|
+
const mexcConfig = {
|
|
538
|
+
apiKey: config.apiKey,
|
|
539
|
+
apiSecret: config.secretKey,
|
|
540
|
+
};
|
|
541
|
+
const positions = await mexc.getPositions(mexcConfig);
|
|
542
|
+
return positions
|
|
543
|
+
.filter(p => !symbol || p.symbol === symbol)
|
|
544
|
+
.map(p => ({
|
|
545
|
+
platform: 'mexc',
|
|
546
|
+
symbol: p.symbol,
|
|
547
|
+
side: p.positionType === 1 ? 'long' : 'short',
|
|
548
|
+
size: p.holdVol,
|
|
549
|
+
entryPrice: p.openAvgPrice,
|
|
550
|
+
markPrice: p.markPrice,
|
|
551
|
+
liquidationPrice: p.liquidatePrice,
|
|
552
|
+
leverage: p.leverage,
|
|
553
|
+
marginType: 'isolated',
|
|
554
|
+
unrealizedPnl: p.unrealisedPnl,
|
|
555
|
+
margin: p.positionValue / p.leverage,
|
|
556
|
+
notional: p.positionValue,
|
|
557
|
+
}));
|
|
558
|
+
}
|
|
559
|
+
catch (error) {
|
|
560
|
+
logger_1.logger.error({ error }, 'Failed to get MEXC positions');
|
|
561
|
+
return [];
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
async function getMexcFuturesOpenOrders(config, symbol) {
|
|
565
|
+
try {
|
|
566
|
+
const mexcConfig = {
|
|
567
|
+
apiKey: config.apiKey,
|
|
568
|
+
apiSecret: config.secretKey,
|
|
569
|
+
};
|
|
570
|
+
const orders = await mexc.getOpenOrders(mexcConfig, symbol);
|
|
571
|
+
return orders.map(o => ({
|
|
572
|
+
orderId: o.orderId,
|
|
573
|
+
platform: 'mexc',
|
|
574
|
+
symbol: o.symbol,
|
|
575
|
+
side: (o.side === 1 || o.side === 2) ? 'long' : 'short',
|
|
576
|
+
price: o.price,
|
|
577
|
+
originalSize: o.vol,
|
|
578
|
+
filledSize: o.dealVol,
|
|
579
|
+
remainingSize: o.vol - o.dealVol,
|
|
580
|
+
orderType: (o.orderType === 5 ? 'MARKET' : 'LIMIT'),
|
|
581
|
+
timeInForce: 'GTC',
|
|
582
|
+
status: String(o.state),
|
|
583
|
+
reduceOnly: o.side === 2 || o.side === 4,
|
|
584
|
+
createdAt: new Date(),
|
|
585
|
+
}));
|
|
586
|
+
}
|
|
587
|
+
catch (error) {
|
|
588
|
+
logger_1.logger.error({ error }, 'Failed to get MEXC open orders');
|
|
589
|
+
return [];
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
async function getMexcFuturesBalance(config) {
|
|
593
|
+
try {
|
|
594
|
+
const mexcConfig = {
|
|
595
|
+
apiKey: config.apiKey,
|
|
596
|
+
apiSecret: config.secretKey,
|
|
597
|
+
};
|
|
598
|
+
const balances = await mexc.getBalance(mexcConfig);
|
|
599
|
+
return balances.map(b => ({
|
|
600
|
+
platform: 'mexc',
|
|
601
|
+
asset: b.currency,
|
|
602
|
+
balance: b.equity,
|
|
603
|
+
availableBalance: b.availableBalance,
|
|
604
|
+
unrealizedPnl: b.unrealisedPnl,
|
|
605
|
+
marginBalance: b.equity,
|
|
606
|
+
maintenanceMargin: 0,
|
|
607
|
+
initialMargin: b.frozenBalance,
|
|
608
|
+
}));
|
|
609
|
+
}
|
|
610
|
+
catch (error) {
|
|
611
|
+
logger_1.logger.error({ error }, 'Failed to get MEXC balance');
|
|
612
|
+
return [];
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
async function getMexcFundingRate(config, symbol) {
|
|
616
|
+
try {
|
|
617
|
+
const mexcConfig = {
|
|
618
|
+
apiKey: config.apiKey,
|
|
619
|
+
apiSecret: config.secretKey,
|
|
620
|
+
};
|
|
621
|
+
const data = await mexc.getFundingRate(mexcConfig, symbol);
|
|
622
|
+
return {
|
|
623
|
+
platform: 'mexc',
|
|
624
|
+
symbol: data.symbol,
|
|
625
|
+
fundingRate: data.fundingRate,
|
|
626
|
+
fundingTime: new Date(),
|
|
627
|
+
nextFundingTime: new Date(data.nextSettleTime),
|
|
628
|
+
markPrice: data.markPrice,
|
|
629
|
+
indexPrice: data.indexPrice,
|
|
630
|
+
};
|
|
631
|
+
}
|
|
632
|
+
catch (error) {
|
|
633
|
+
logger_1.logger.error({ error, symbol }, 'Failed to get MEXC funding rate');
|
|
634
|
+
return null;
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
async function setMexcLeverage(config, symbol, leverage) {
|
|
638
|
+
try {
|
|
639
|
+
const mexcConfig = {
|
|
640
|
+
apiKey: config.apiKey,
|
|
641
|
+
apiSecret: config.secretKey,
|
|
642
|
+
};
|
|
643
|
+
await mexc.setLeverage(mexcConfig, symbol, leverage);
|
|
644
|
+
return true;
|
|
645
|
+
}
|
|
646
|
+
catch (error) {
|
|
647
|
+
logger_1.logger.error({ error, symbol, leverage }, 'Failed to set MEXC leverage');
|
|
648
|
+
return false;
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
// =============================================================================
|
|
652
|
+
// HYPERLIQUID
|
|
653
|
+
// =============================================================================
|
|
654
|
+
async function placeHyperliquidOrder(config, request) {
|
|
655
|
+
try {
|
|
656
|
+
const walletAddress = getWalletAddress(config.privateKey);
|
|
657
|
+
const hlConfig = {
|
|
658
|
+
walletAddress,
|
|
659
|
+
privateKey: config.privateKey,
|
|
660
|
+
testnet: config.testnet,
|
|
661
|
+
vaultAddress: config.vaultAddress,
|
|
662
|
+
};
|
|
663
|
+
// Handle reduce-only / close position
|
|
664
|
+
if (request.reduceOnly || request.closePosition) {
|
|
665
|
+
const state = await hyperliquid.getUserState(walletAddress);
|
|
666
|
+
const position = state.assetPositions.find(p => p.position.coin === request.symbol);
|
|
667
|
+
if (!position || parseFloat(position.position.szi) === 0) {
|
|
668
|
+
return { success: true }; // No position to close
|
|
669
|
+
}
|
|
670
|
+
const positionSize = Math.abs(parseFloat(position.position.szi));
|
|
671
|
+
const isLong = parseFloat(position.position.szi) > 0;
|
|
672
|
+
const result = await hyperliquid.placePerpOrder(hlConfig, {
|
|
673
|
+
coin: request.symbol,
|
|
674
|
+
side: isLong ? 'SELL' : 'BUY',
|
|
675
|
+
size: positionSize,
|
|
676
|
+
type: 'MARKET',
|
|
677
|
+
reduceOnly: true,
|
|
678
|
+
});
|
|
679
|
+
return {
|
|
680
|
+
success: result.success,
|
|
681
|
+
orderId: result.orderId?.toString(),
|
|
682
|
+
error: result.error,
|
|
683
|
+
};
|
|
684
|
+
}
|
|
685
|
+
// Regular order (LIMIT or MARKET)
|
|
686
|
+
// Note: For stop/TP orders, Hyperliquid uses trigger orders via SDK.
|
|
687
|
+
// placePerpOrder handles LIMIT and MARKET; stop orders are placed as
|
|
688
|
+
// reduce-only market orders immediately (use trading/futures module
|
|
689
|
+
// for proper trigger-based stop orders with the raw API).
|
|
690
|
+
const result = await hyperliquid.placePerpOrder(hlConfig, {
|
|
691
|
+
coin: request.symbol,
|
|
692
|
+
side: request.side === 'long' ? 'BUY' : 'SELL',
|
|
693
|
+
size: request.size,
|
|
694
|
+
price: request.price,
|
|
695
|
+
type: request.orderType === 'LIMIT' ? 'LIMIT' : 'MARKET',
|
|
696
|
+
reduceOnly: request.reduceOnly,
|
|
697
|
+
});
|
|
698
|
+
return {
|
|
699
|
+
success: result.success,
|
|
700
|
+
orderId: result.orderId?.toString(),
|
|
701
|
+
error: result.error,
|
|
702
|
+
};
|
|
703
|
+
}
|
|
704
|
+
catch (error) {
|
|
705
|
+
logger_1.logger.error({ error, request }, 'Hyperliquid order failed');
|
|
706
|
+
return {
|
|
707
|
+
success: false,
|
|
708
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
709
|
+
};
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
async function cancelHyperliquidOrder(config, symbol, orderId) {
|
|
713
|
+
try {
|
|
714
|
+
const walletAddress = getWalletAddress(config.privateKey);
|
|
715
|
+
const hlConfig = {
|
|
716
|
+
walletAddress,
|
|
717
|
+
privateKey: config.privateKey,
|
|
718
|
+
testnet: config.testnet,
|
|
719
|
+
vaultAddress: config.vaultAddress,
|
|
720
|
+
};
|
|
721
|
+
const result = await hyperliquid.cancelOrder(hlConfig, symbol, parseInt(orderId, 10));
|
|
722
|
+
return result.success;
|
|
723
|
+
}
|
|
724
|
+
catch (error) {
|
|
725
|
+
logger_1.logger.error({ error, symbol, orderId }, 'Failed to cancel Hyperliquid order');
|
|
726
|
+
return false;
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
async function getHyperliquidPositions(config, symbol) {
|
|
730
|
+
try {
|
|
731
|
+
const walletAddress = getWalletAddress(config.privateKey);
|
|
732
|
+
const [state, mids] = await Promise.all([
|
|
733
|
+
hyperliquid.getUserState(walletAddress),
|
|
734
|
+
hyperliquid.getAllMids(),
|
|
735
|
+
]);
|
|
736
|
+
return state.assetPositions
|
|
737
|
+
.filter(p => parseFloat(p.position.szi) !== 0)
|
|
738
|
+
.filter(p => !symbol || p.position.coin === symbol)
|
|
739
|
+
.map(p => {
|
|
740
|
+
const size = parseFloat(p.position.szi);
|
|
741
|
+
const entryPrice = parseFloat(p.position.entryPx);
|
|
742
|
+
const unrealizedPnl = parseFloat(p.position.unrealizedPnl);
|
|
743
|
+
const markPrice = parseFloat(mids[p.position.coin] || '0') || entryPrice;
|
|
744
|
+
const leverage = p.position.leverage?.value || 10;
|
|
745
|
+
const isCross = p.position.leverage?.type === 'cross';
|
|
746
|
+
const margin = parseFloat(p.position.marginUsed || '0') || Math.abs(size * markPrice) / leverage;
|
|
747
|
+
return {
|
|
748
|
+
platform: 'hyperliquid',
|
|
749
|
+
symbol: p.position.coin,
|
|
750
|
+
side: size > 0 ? 'long' : 'short',
|
|
751
|
+
size: Math.abs(size),
|
|
752
|
+
entryPrice,
|
|
753
|
+
markPrice,
|
|
754
|
+
liquidationPrice: parseFloat(p.position.liquidationPx || '0'),
|
|
755
|
+
leverage,
|
|
756
|
+
marginType: isCross ? 'cross' : 'isolated',
|
|
757
|
+
unrealizedPnl,
|
|
758
|
+
margin,
|
|
759
|
+
notional: Math.abs(size * markPrice),
|
|
760
|
+
};
|
|
761
|
+
});
|
|
762
|
+
}
|
|
763
|
+
catch (error) {
|
|
764
|
+
logger_1.logger.error({ error }, 'Failed to get Hyperliquid positions');
|
|
765
|
+
return [];
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
async function getHyperliquidOpenOrders(config, symbol) {
|
|
769
|
+
try {
|
|
770
|
+
const walletAddress = getWalletAddress(config.privateKey);
|
|
771
|
+
const orders = await hyperliquid.getOpenOrders(walletAddress);
|
|
772
|
+
return orders
|
|
773
|
+
.filter(o => !symbol || o.coin === symbol)
|
|
774
|
+
.map(o => ({
|
|
775
|
+
orderId: o.oid.toString(),
|
|
776
|
+
platform: 'hyperliquid',
|
|
777
|
+
symbol: o.coin,
|
|
778
|
+
side: o.side === 'B' ? 'long' : 'short',
|
|
779
|
+
price: parseFloat(o.limitPx),
|
|
780
|
+
originalSize: parseFloat(o.sz),
|
|
781
|
+
filledSize: 0,
|
|
782
|
+
remainingSize: parseFloat(o.sz),
|
|
783
|
+
orderType: 'LIMIT',
|
|
784
|
+
timeInForce: 'GTC',
|
|
785
|
+
status: 'open',
|
|
786
|
+
reduceOnly: false,
|
|
787
|
+
createdAt: new Date(o.timestamp),
|
|
788
|
+
}));
|
|
789
|
+
}
|
|
790
|
+
catch (error) {
|
|
791
|
+
logger_1.logger.error({ error }, 'Failed to get Hyperliquid open orders');
|
|
792
|
+
return [];
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
async function getHyperliquidBalance(config) {
|
|
796
|
+
try {
|
|
797
|
+
const walletAddress = getWalletAddress(config.privateKey);
|
|
798
|
+
const state = await hyperliquid.getUserState(walletAddress);
|
|
799
|
+
const accountValue = parseFloat(state.marginSummary.accountValue);
|
|
800
|
+
const marginUsed = parseFloat(state.marginSummary.totalMarginUsed);
|
|
801
|
+
const unrealizedPnl = state.assetPositions.reduce((sum, p) => sum + parseFloat(p.position.unrealizedPnl || '0'), 0);
|
|
802
|
+
return [{
|
|
803
|
+
platform: 'hyperliquid',
|
|
804
|
+
asset: 'USDC',
|
|
805
|
+
balance: accountValue,
|
|
806
|
+
availableBalance: accountValue - marginUsed,
|
|
807
|
+
unrealizedPnl,
|
|
808
|
+
marginBalance: accountValue,
|
|
809
|
+
maintenanceMargin: marginUsed * 0.5,
|
|
810
|
+
initialMargin: marginUsed,
|
|
811
|
+
}];
|
|
812
|
+
}
|
|
813
|
+
catch (error) {
|
|
814
|
+
logger_1.logger.error({ error }, 'Failed to get Hyperliquid balance');
|
|
815
|
+
return [];
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
async function getHyperliquidFundingRate(symbol) {
|
|
819
|
+
try {
|
|
820
|
+
const [rates, mids] = await Promise.all([
|
|
821
|
+
hyperliquid.getFundingRates(),
|
|
822
|
+
hyperliquid.getAllMids(),
|
|
823
|
+
]);
|
|
824
|
+
const rate = rates.find(r => r.coin === symbol);
|
|
825
|
+
if (!rate)
|
|
826
|
+
return null;
|
|
827
|
+
const midPrice = parseFloat(mids[symbol] || '0');
|
|
828
|
+
const premium = parseFloat(rate.premium || '0');
|
|
829
|
+
// HL index (oracle) price derived from mark and premium: index = mark / (1 + premium)
|
|
830
|
+
const indexPrice = premium !== 0 ? midPrice / (1 + premium) : midPrice;
|
|
831
|
+
return {
|
|
832
|
+
platform: 'hyperliquid',
|
|
833
|
+
symbol: rate.coin,
|
|
834
|
+
fundingRate: parseFloat(rate.funding),
|
|
835
|
+
fundingTime: new Date(),
|
|
836
|
+
nextFundingTime: new Date(Date.now() + 60 * 60 * 1000), // 1 hour
|
|
837
|
+
markPrice: midPrice,
|
|
838
|
+
indexPrice,
|
|
839
|
+
};
|
|
840
|
+
}
|
|
841
|
+
catch (error) {
|
|
842
|
+
logger_1.logger.error({ error, symbol }, 'Failed to get Hyperliquid funding rate');
|
|
843
|
+
return null;
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
async function setHyperliquidLeverage(config, symbol, leverage) {
|
|
847
|
+
try {
|
|
848
|
+
const walletAddress = getWalletAddress(config.privateKey);
|
|
849
|
+
const hlConfig = {
|
|
850
|
+
walletAddress,
|
|
851
|
+
privateKey: config.privateKey,
|
|
852
|
+
testnet: config.testnet,
|
|
853
|
+
vaultAddress: config.vaultAddress,
|
|
854
|
+
};
|
|
855
|
+
const result = await hyperliquid.updateLeverage(hlConfig, symbol, leverage, true);
|
|
856
|
+
return result.success;
|
|
857
|
+
}
|
|
858
|
+
catch (error) {
|
|
859
|
+
logger_1.logger.error({ error, symbol, leverage }, 'Failed to set Hyperliquid leverage');
|
|
860
|
+
return false;
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
async function getBinanceIncomeHistory(config, params) {
|
|
864
|
+
try {
|
|
865
|
+
const reqParams = { limit: params?.limit || 50 };
|
|
866
|
+
if (params?.symbol)
|
|
867
|
+
reqParams.symbol = params.symbol;
|
|
868
|
+
const data = await binanceFuturesRequest(config, 'GET', '/fapi/v1/income', reqParams);
|
|
869
|
+
return data.map(d => ({
|
|
870
|
+
symbol: d.symbol,
|
|
871
|
+
type: d.incomeType,
|
|
872
|
+
amount: parseFloat(d.income),
|
|
873
|
+
time: new Date(d.time),
|
|
874
|
+
}));
|
|
875
|
+
}
|
|
876
|
+
catch (error) {
|
|
877
|
+
logger_1.logger.error({ error }, 'Failed to get Binance income history');
|
|
878
|
+
return [];
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
async function getBybitIncomeHistory(config, params) {
|
|
882
|
+
try {
|
|
883
|
+
const bybitConfig = {
|
|
884
|
+
apiKey: config.apiKey,
|
|
885
|
+
apiSecret: config.secretKey,
|
|
886
|
+
testnet: config.testnet,
|
|
887
|
+
};
|
|
888
|
+
const records = await bybit.getIncomeHistory(bybitConfig, params);
|
|
889
|
+
return records.map(r => ({
|
|
890
|
+
symbol: r.symbol,
|
|
891
|
+
type: r.type,
|
|
892
|
+
amount: r.amount,
|
|
893
|
+
time: r.time,
|
|
894
|
+
}));
|
|
895
|
+
}
|
|
896
|
+
catch (error) {
|
|
897
|
+
logger_1.logger.error({ error }, 'Failed to get Bybit income history');
|
|
898
|
+
return [];
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
async function getMexcIncomeHistory(config, params) {
|
|
902
|
+
try {
|
|
903
|
+
const mexcConfig = {
|
|
904
|
+
apiKey: config.apiKey,
|
|
905
|
+
apiSecret: config.secretKey,
|
|
906
|
+
};
|
|
907
|
+
const records = await mexc.getIncomeHistory(mexcConfig, params);
|
|
908
|
+
return records.map(r => ({
|
|
909
|
+
symbol: r.symbol,
|
|
910
|
+
type: r.type,
|
|
911
|
+
amount: r.amount,
|
|
912
|
+
time: r.time,
|
|
913
|
+
}));
|
|
914
|
+
}
|
|
915
|
+
catch (error) {
|
|
916
|
+
logger_1.logger.error({ error }, 'Failed to get MEXC income history');
|
|
917
|
+
return [];
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
async function getHyperliquidIncomeHistory(hlConfig, params) {
|
|
921
|
+
try {
|
|
922
|
+
const walletAddress = getWalletAddress(hlConfig.privateKey);
|
|
923
|
+
const startTime = Date.now() - 30 * 24 * 60 * 60 * 1000; // 30 days
|
|
924
|
+
const data = await hyperliquid.getUserFunding(walletAddress, startTime);
|
|
925
|
+
return data
|
|
926
|
+
.filter(d => !params?.symbol || d.coin === params.symbol)
|
|
927
|
+
.slice(0, params?.limit || 50)
|
|
928
|
+
.map(d => ({
|
|
929
|
+
symbol: d.coin,
|
|
930
|
+
type: 'FUNDING',
|
|
931
|
+
amount: parseFloat(d.usdc),
|
|
932
|
+
time: new Date(d.time),
|
|
933
|
+
}));
|
|
934
|
+
}
|
|
935
|
+
catch (error) {
|
|
936
|
+
logger_1.logger.error({ error }, 'Failed to get Hyperliquid income history');
|
|
937
|
+
return [];
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
// =============================================================================
|
|
941
|
+
// HYPERLIQUID MARGIN TYPE
|
|
942
|
+
// =============================================================================
|
|
943
|
+
async function setHyperliquidMarginType(hlConfig, symbol, marginType) {
|
|
944
|
+
try {
|
|
945
|
+
const walletAddress = getWalletAddress(hlConfig.privateKey);
|
|
946
|
+
const config = {
|
|
947
|
+
walletAddress,
|
|
948
|
+
privateKey: hlConfig.privateKey,
|
|
949
|
+
testnet: hlConfig.testnet,
|
|
950
|
+
vaultAddress: hlConfig.vaultAddress,
|
|
951
|
+
};
|
|
952
|
+
// Get current leverage from user state
|
|
953
|
+
const state = await hyperliquid.getUserState(walletAddress);
|
|
954
|
+
const position = state.assetPositions.find(p => p.position.coin === symbol);
|
|
955
|
+
const currentLeverage = position?.position.leverage?.value || 10;
|
|
956
|
+
const isCross = marginType === 'cross';
|
|
957
|
+
const result = await hyperliquid.updateLeverage(config, symbol, currentLeverage, isCross);
|
|
958
|
+
return result.success;
|
|
959
|
+
}
|
|
960
|
+
catch (error) {
|
|
961
|
+
logger_1.logger.error({ error, symbol, marginType }, 'Failed to set Hyperliquid margin type');
|
|
962
|
+
return false;
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
// =============================================================================
|
|
966
|
+
// SERVICE FACTORY
|
|
967
|
+
// =============================================================================
|
|
968
|
+
function createFuturesExecutionService(config) {
|
|
969
|
+
const defaultLeverage = config.defaultLeverage || 10;
|
|
970
|
+
const defaultMarginType = config.defaultMarginType || 'isolated';
|
|
971
|
+
const maxPositionSize = config.maxPositionSize || 10000; // $10k default
|
|
972
|
+
async function executeOrder(request) {
|
|
973
|
+
// Validate position size
|
|
974
|
+
if (request.size * (request.price || 1) > maxPositionSize) {
|
|
975
|
+
return {
|
|
976
|
+
success: false,
|
|
977
|
+
error: `Position size exceeds max $${maxPositionSize}`,
|
|
978
|
+
};
|
|
979
|
+
}
|
|
980
|
+
// Dry run
|
|
981
|
+
if (config.dryRun) {
|
|
982
|
+
logger_1.logger.info({ ...request, dryRun: true }, 'Dry run futures order');
|
|
983
|
+
return {
|
|
984
|
+
success: true,
|
|
985
|
+
orderId: `dry_${(0, crypto_1.randomBytes)(8).toString('hex')}`,
|
|
986
|
+
status: 'FILLED',
|
|
987
|
+
filledSize: request.size,
|
|
988
|
+
avgFillPrice: request.price,
|
|
989
|
+
};
|
|
990
|
+
}
|
|
991
|
+
// Route to appropriate exchange
|
|
992
|
+
switch (request.platform) {
|
|
993
|
+
case 'binance':
|
|
994
|
+
if (!config.binance) {
|
|
995
|
+
return { success: false, error: 'Binance Futures not configured' };
|
|
996
|
+
}
|
|
997
|
+
return placeBinanceFuturesOrder(config.binance, request);
|
|
998
|
+
case 'bybit':
|
|
999
|
+
if (!config.bybit) {
|
|
1000
|
+
return { success: false, error: 'Bybit not configured' };
|
|
1001
|
+
}
|
|
1002
|
+
return placeBybitFuturesOrder(config.bybit, request);
|
|
1003
|
+
case 'mexc':
|
|
1004
|
+
if (!config.mexc) {
|
|
1005
|
+
return { success: false, error: 'MEXC not configured' };
|
|
1006
|
+
}
|
|
1007
|
+
return placeMexcFuturesOrder(config.mexc, request);
|
|
1008
|
+
case 'hyperliquid':
|
|
1009
|
+
if (!config.hyperliquid) {
|
|
1010
|
+
return { success: false, error: 'Hyperliquid not configured' };
|
|
1011
|
+
}
|
|
1012
|
+
return placeHyperliquidOrder(config.hyperliquid, request);
|
|
1013
|
+
default:
|
|
1014
|
+
return { success: false, error: `Unknown platform: ${request.platform}` };
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
const service = {
|
|
1018
|
+
async openLong(request) {
|
|
1019
|
+
return executeOrder({
|
|
1020
|
+
...request,
|
|
1021
|
+
side: 'long',
|
|
1022
|
+
leverage: request.leverage || defaultLeverage,
|
|
1023
|
+
marginType: request.marginType || defaultMarginType,
|
|
1024
|
+
});
|
|
1025
|
+
},
|
|
1026
|
+
async openShort(request) {
|
|
1027
|
+
return executeOrder({
|
|
1028
|
+
...request,
|
|
1029
|
+
side: 'short',
|
|
1030
|
+
leverage: request.leverage || defaultLeverage,
|
|
1031
|
+
marginType: request.marginType || defaultMarginType,
|
|
1032
|
+
});
|
|
1033
|
+
},
|
|
1034
|
+
async closeLong(request) {
|
|
1035
|
+
return executeOrder({
|
|
1036
|
+
...request,
|
|
1037
|
+
side: 'short', // Sell to close long
|
|
1038
|
+
reduceOnly: true,
|
|
1039
|
+
});
|
|
1040
|
+
},
|
|
1041
|
+
async closeShort(request) {
|
|
1042
|
+
return executeOrder({
|
|
1043
|
+
...request,
|
|
1044
|
+
side: 'long', // Buy to close short
|
|
1045
|
+
reduceOnly: true,
|
|
1046
|
+
});
|
|
1047
|
+
},
|
|
1048
|
+
async closePosition(platform, symbol) {
|
|
1049
|
+
const positions = await this.getPositions(platform, symbol);
|
|
1050
|
+
const position = positions.find(p => p.symbol === symbol);
|
|
1051
|
+
if (!position) {
|
|
1052
|
+
return { success: true }; // No position to close
|
|
1053
|
+
}
|
|
1054
|
+
return executeOrder({
|
|
1055
|
+
platform,
|
|
1056
|
+
symbol,
|
|
1057
|
+
side: position.side === 'long' ? 'short' : 'long',
|
|
1058
|
+
size: position.size,
|
|
1059
|
+
orderType: 'MARKET',
|
|
1060
|
+
reduceOnly: true,
|
|
1061
|
+
closePosition: true,
|
|
1062
|
+
});
|
|
1063
|
+
},
|
|
1064
|
+
async placeLimitOrder(request) {
|
|
1065
|
+
return executeOrder({
|
|
1066
|
+
...request,
|
|
1067
|
+
orderType: 'LIMIT',
|
|
1068
|
+
timeInForce: request.timeInForce || 'GTC',
|
|
1069
|
+
});
|
|
1070
|
+
},
|
|
1071
|
+
async placeMarketOrder(request) {
|
|
1072
|
+
return executeOrder({
|
|
1073
|
+
...request,
|
|
1074
|
+
orderType: 'MARKET',
|
|
1075
|
+
});
|
|
1076
|
+
},
|
|
1077
|
+
async placeStopLoss(request) {
|
|
1078
|
+
return executeOrder({
|
|
1079
|
+
...request,
|
|
1080
|
+
orderType: 'STOP_LOSS',
|
|
1081
|
+
reduceOnly: true,
|
|
1082
|
+
});
|
|
1083
|
+
},
|
|
1084
|
+
async placeTakeProfit(request) {
|
|
1085
|
+
return executeOrder({
|
|
1086
|
+
...request,
|
|
1087
|
+
orderType: 'TAKE_PROFIT',
|
|
1088
|
+
reduceOnly: true,
|
|
1089
|
+
});
|
|
1090
|
+
},
|
|
1091
|
+
async cancelOrder(platform, symbol, orderId) {
|
|
1092
|
+
if (config.dryRun) {
|
|
1093
|
+
logger_1.logger.info({ platform, symbol, orderId, dryRun: true }, 'Dry run cancel');
|
|
1094
|
+
return true;
|
|
1095
|
+
}
|
|
1096
|
+
switch (platform) {
|
|
1097
|
+
case 'binance':
|
|
1098
|
+
if (!config.binance)
|
|
1099
|
+
return false;
|
|
1100
|
+
return cancelBinanceFuturesOrder(config.binance, symbol, orderId);
|
|
1101
|
+
case 'bybit':
|
|
1102
|
+
if (!config.bybit)
|
|
1103
|
+
return false;
|
|
1104
|
+
return cancelBybitFuturesOrder(config.bybit, symbol, orderId);
|
|
1105
|
+
case 'mexc':
|
|
1106
|
+
if (!config.mexc)
|
|
1107
|
+
return false;
|
|
1108
|
+
return cancelMexcFuturesOrder(config.mexc, symbol, orderId);
|
|
1109
|
+
case 'hyperliquid':
|
|
1110
|
+
if (!config.hyperliquid)
|
|
1111
|
+
return false;
|
|
1112
|
+
return cancelHyperliquidOrder(config.hyperliquid, symbol, orderId);
|
|
1113
|
+
default:
|
|
1114
|
+
logger_1.logger.warn({ platform }, 'Cancel not implemented for platform');
|
|
1115
|
+
return false;
|
|
1116
|
+
}
|
|
1117
|
+
},
|
|
1118
|
+
async cancelAllOrders(platform, symbol) {
|
|
1119
|
+
if (config.dryRun) {
|
|
1120
|
+
logger_1.logger.info({ platform, symbol, dryRun: true }, 'Dry run cancel all');
|
|
1121
|
+
return 0;
|
|
1122
|
+
}
|
|
1123
|
+
let count = 0;
|
|
1124
|
+
if (platform === 'binance' || !platform) {
|
|
1125
|
+
if (config.binance) {
|
|
1126
|
+
const orders = await getBinanceFuturesOpenOrders(config.binance, symbol);
|
|
1127
|
+
for (const order of orders) {
|
|
1128
|
+
if (await cancelBinanceFuturesOrder(config.binance, order.symbol, order.orderId)) {
|
|
1129
|
+
count++;
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
if (platform === 'bybit' || !platform) {
|
|
1135
|
+
if (config.bybit) {
|
|
1136
|
+
const orders = await getBybitFuturesOpenOrders(config.bybit, symbol);
|
|
1137
|
+
for (const order of orders) {
|
|
1138
|
+
if (await cancelBybitFuturesOrder(config.bybit, order.symbol, order.orderId)) {
|
|
1139
|
+
count++;
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
if (platform === 'mexc' || !platform) {
|
|
1145
|
+
if (config.mexc) {
|
|
1146
|
+
const orders = await getMexcFuturesOpenOrders(config.mexc, symbol);
|
|
1147
|
+
for (const order of orders) {
|
|
1148
|
+
if (await cancelMexcFuturesOrder(config.mexc, order.symbol, order.orderId)) {
|
|
1149
|
+
count++;
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
if (platform === 'hyperliquid' || !platform) {
|
|
1155
|
+
if (config.hyperliquid) {
|
|
1156
|
+
const orders = await getHyperliquidOpenOrders(config.hyperliquid, symbol);
|
|
1157
|
+
for (const order of orders) {
|
|
1158
|
+
if (await cancelHyperliquidOrder(config.hyperliquid, order.symbol, order.orderId)) {
|
|
1159
|
+
count++;
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
return count;
|
|
1165
|
+
},
|
|
1166
|
+
async getOpenOrders(platform, symbol) {
|
|
1167
|
+
const orders = [];
|
|
1168
|
+
if ((!platform || platform === 'binance') && config.binance) {
|
|
1169
|
+
orders.push(...await getBinanceFuturesOpenOrders(config.binance, symbol));
|
|
1170
|
+
}
|
|
1171
|
+
if ((!platform || platform === 'bybit') && config.bybit) {
|
|
1172
|
+
orders.push(...await getBybitFuturesOpenOrders(config.bybit, symbol));
|
|
1173
|
+
}
|
|
1174
|
+
if ((!platform || platform === 'mexc') && config.mexc) {
|
|
1175
|
+
orders.push(...await getMexcFuturesOpenOrders(config.mexc, symbol));
|
|
1176
|
+
}
|
|
1177
|
+
if ((!platform || platform === 'hyperliquid') && config.hyperliquid) {
|
|
1178
|
+
orders.push(...await getHyperliquidOpenOrders(config.hyperliquid, symbol));
|
|
1179
|
+
}
|
|
1180
|
+
return orders;
|
|
1181
|
+
},
|
|
1182
|
+
async getPositions(platform, symbol) {
|
|
1183
|
+
const positions = [];
|
|
1184
|
+
if ((!platform || platform === 'binance') && config.binance) {
|
|
1185
|
+
positions.push(...await getBinanceFuturesPositions(config.binance, symbol));
|
|
1186
|
+
}
|
|
1187
|
+
if ((!platform || platform === 'bybit') && config.bybit) {
|
|
1188
|
+
positions.push(...await getBybitFuturesPositions(config.bybit, symbol));
|
|
1189
|
+
}
|
|
1190
|
+
if ((!platform || platform === 'mexc') && config.mexc) {
|
|
1191
|
+
positions.push(...await getMexcFuturesPositions(config.mexc, symbol));
|
|
1192
|
+
}
|
|
1193
|
+
if ((!platform || platform === 'hyperliquid') && config.hyperliquid) {
|
|
1194
|
+
positions.push(...await getHyperliquidPositions(config.hyperliquid, symbol));
|
|
1195
|
+
}
|
|
1196
|
+
return positions;
|
|
1197
|
+
},
|
|
1198
|
+
async getBalance(platform) {
|
|
1199
|
+
const balances = [];
|
|
1200
|
+
if ((!platform || platform === 'binance') && config.binance) {
|
|
1201
|
+
balances.push(...await getBinanceFuturesBalance(config.binance));
|
|
1202
|
+
}
|
|
1203
|
+
if ((!platform || platform === 'bybit') && config.bybit) {
|
|
1204
|
+
balances.push(...await getBybitFuturesBalance(config.bybit));
|
|
1205
|
+
}
|
|
1206
|
+
if ((!platform || platform === 'mexc') && config.mexc) {
|
|
1207
|
+
balances.push(...await getMexcFuturesBalance(config.mexc));
|
|
1208
|
+
}
|
|
1209
|
+
if ((!platform || platform === 'hyperliquid') && config.hyperliquid) {
|
|
1210
|
+
balances.push(...await getHyperliquidBalance(config.hyperliquid));
|
|
1211
|
+
}
|
|
1212
|
+
return balances;
|
|
1213
|
+
},
|
|
1214
|
+
async getFundingRate(platform, symbol) {
|
|
1215
|
+
switch (platform) {
|
|
1216
|
+
case 'binance':
|
|
1217
|
+
if (!config.binance)
|
|
1218
|
+
return null;
|
|
1219
|
+
return getBinanceFundingRate(config.binance, symbol);
|
|
1220
|
+
case 'bybit':
|
|
1221
|
+
if (!config.bybit)
|
|
1222
|
+
return null;
|
|
1223
|
+
return getBybitFundingRate(config.bybit, symbol);
|
|
1224
|
+
case 'mexc':
|
|
1225
|
+
if (!config.mexc)
|
|
1226
|
+
return null;
|
|
1227
|
+
return getMexcFundingRate(config.mexc, symbol);
|
|
1228
|
+
case 'hyperliquid':
|
|
1229
|
+
return getHyperliquidFundingRate(symbol);
|
|
1230
|
+
default:
|
|
1231
|
+
return null;
|
|
1232
|
+
}
|
|
1233
|
+
},
|
|
1234
|
+
async setLeverage(platform, symbol, leverage) {
|
|
1235
|
+
if (config.dryRun) {
|
|
1236
|
+
logger_1.logger.info({ platform, symbol, leverage, dryRun: true }, 'Dry run set leverage');
|
|
1237
|
+
return true;
|
|
1238
|
+
}
|
|
1239
|
+
switch (platform) {
|
|
1240
|
+
case 'binance':
|
|
1241
|
+
if (!config.binance)
|
|
1242
|
+
return false;
|
|
1243
|
+
return setBinanceLeverage(config.binance, symbol, leverage);
|
|
1244
|
+
case 'bybit':
|
|
1245
|
+
if (!config.bybit)
|
|
1246
|
+
return false;
|
|
1247
|
+
return setBybitLeverage(config.bybit, symbol, leverage);
|
|
1248
|
+
case 'mexc':
|
|
1249
|
+
if (!config.mexc)
|
|
1250
|
+
return false;
|
|
1251
|
+
return setMexcLeverage(config.mexc, symbol, leverage);
|
|
1252
|
+
case 'hyperliquid':
|
|
1253
|
+
if (!config.hyperliquid)
|
|
1254
|
+
return false;
|
|
1255
|
+
return setHyperliquidLeverage(config.hyperliquid, symbol, leverage);
|
|
1256
|
+
default:
|
|
1257
|
+
logger_1.logger.warn({ platform }, 'Set leverage not implemented for platform');
|
|
1258
|
+
return false;
|
|
1259
|
+
}
|
|
1260
|
+
},
|
|
1261
|
+
async setMarginType(platform, symbol, marginType) {
|
|
1262
|
+
if (config.dryRun) {
|
|
1263
|
+
logger_1.logger.info({ platform, symbol, marginType, dryRun: true }, 'Dry run set margin type');
|
|
1264
|
+
return true;
|
|
1265
|
+
}
|
|
1266
|
+
switch (platform) {
|
|
1267
|
+
case 'binance':
|
|
1268
|
+
if (!config.binance)
|
|
1269
|
+
return false;
|
|
1270
|
+
return setBinanceMarginType(config.binance, symbol, marginType);
|
|
1271
|
+
case 'bybit':
|
|
1272
|
+
// Bybit unified account doesn't have separate margin type setting
|
|
1273
|
+
logger_1.logger.info({ symbol, marginType }, 'Bybit unified account - margin type set via leverage');
|
|
1274
|
+
return true;
|
|
1275
|
+
case 'mexc':
|
|
1276
|
+
// MEXC sets margin type via openType in order (1=isolated, 2=cross)
|
|
1277
|
+
mexcMarginPreference.set(symbol, marginType);
|
|
1278
|
+
logger_1.logger.info({ symbol, marginType }, 'MEXC margin type preference saved (applied per-order)');
|
|
1279
|
+
return true;
|
|
1280
|
+
case 'hyperliquid':
|
|
1281
|
+
if (!config.hyperliquid)
|
|
1282
|
+
return false;
|
|
1283
|
+
return setHyperliquidMarginType(config.hyperliquid, symbol, marginType);
|
|
1284
|
+
default:
|
|
1285
|
+
logger_1.logger.warn({ platform }, 'Set margin type not implemented for platform');
|
|
1286
|
+
return false;
|
|
1287
|
+
}
|
|
1288
|
+
},
|
|
1289
|
+
async getIncomeHistory(platform, params) {
|
|
1290
|
+
switch (platform) {
|
|
1291
|
+
case 'binance':
|
|
1292
|
+
if (!config.binance)
|
|
1293
|
+
return [];
|
|
1294
|
+
return getBinanceIncomeHistory(config.binance, params);
|
|
1295
|
+
case 'bybit':
|
|
1296
|
+
if (!config.bybit)
|
|
1297
|
+
return [];
|
|
1298
|
+
return getBybitIncomeHistory(config.bybit, params);
|
|
1299
|
+
case 'mexc':
|
|
1300
|
+
if (!config.mexc)
|
|
1301
|
+
return [];
|
|
1302
|
+
return getMexcIncomeHistory(config.mexc, params);
|
|
1303
|
+
case 'hyperliquid':
|
|
1304
|
+
if (!config.hyperliquid)
|
|
1305
|
+
return [];
|
|
1306
|
+
return getHyperliquidIncomeHistory(config.hyperliquid, params);
|
|
1307
|
+
default:
|
|
1308
|
+
return [];
|
|
1309
|
+
}
|
|
1310
|
+
},
|
|
1311
|
+
calculateLiquidationPrice(params) {
|
|
1312
|
+
// Simplified liquidation price calculation
|
|
1313
|
+
// Real calculation is more complex and varies by exchange
|
|
1314
|
+
const { side, entryPrice, leverage } = params;
|
|
1315
|
+
// Maintenance margin rate (simplified - typically 0.4% for BTC on Binance)
|
|
1316
|
+
const mmr = 0.004;
|
|
1317
|
+
if (side === 'long') {
|
|
1318
|
+
// Liq price for long = Entry * (1 - 1/leverage + mmr)
|
|
1319
|
+
return entryPrice * (1 - 1 / leverage + mmr);
|
|
1320
|
+
}
|
|
1321
|
+
else {
|
|
1322
|
+
// Liq price for short = Entry * (1 + 1/leverage - mmr)
|
|
1323
|
+
return entryPrice * (1 + 1 / leverage - mmr);
|
|
1324
|
+
}
|
|
1325
|
+
},
|
|
1326
|
+
};
|
|
1327
|
+
logger_1.logger.info({
|
|
1328
|
+
binance: !!config.binance,
|
|
1329
|
+
bybit: !!config.bybit,
|
|
1330
|
+
mexc: !!config.mexc,
|
|
1331
|
+
hyperliquid: !!config.hyperliquid,
|
|
1332
|
+
dryRun: !!config.dryRun,
|
|
1333
|
+
}, 'Futures Execution Service initialized');
|
|
1334
|
+
return service;
|
|
1335
|
+
}
|
|
1336
|
+
//# sourceMappingURL=futures.js.map
|