/** * Standalone DSL runner — LIVE: real MCP (prices, editPosition, getOrderStatus, closePosition). * You open positions manually; this script registers them with the DSL and runs the monitor. * * Required in .env or env (for testing live flow): * SENPI_API_KEY * DSL_POSITION_WALLET wallet holding the positions * DSL_POSITION_ASSETS comma- or space-separated tickers, e.g. "SOL,BTC" or "SOL BTC ETH" * (legacy: DSL_POSITION_COIN for a single asset only) * DSL_STATE_DIR directory for persisted DSL state * * Optional: DSL_POSITION_ADDRESS (defaults to DSL_POSITION_WALLET — strategy id used for state paths). * Size, entry, and leverage come from one strategy_get_clearinghouse_state call per run. Set DSL_POSITION_DEX (e.g. "xyz") * to disambiguate if the same coin exists on multiple DEXes. Optional overrides (single asset only): * DSL_POSITION_SZI, DSL_POSITION_ENTRY_PX — skip clearing house for that one row * Optional: DSL_POSITION_LEVERAGE (with overrides), DSL_PRESET (default "default") * * Optional for testing close / flip / size change (simulates hooks; no exchange call for these emits): * --close-after N emits on_position_closed for every registered asset after N seconds * --flip-after N requires exactly one asset; set DSL_NEW_COIN (same market as the open leg, e.g. xyz:BASE or BASE with DSL_POSITION_DEX). * At emit time, clearing house must already show the **new** direction/size (flip on the venue before the timer fires). DSL_NEW_SZI / DSL_NEW_ENTRY_PX / DSL_NEW_LEVERAGE are optional (auto-read when omitted). * --increase-after N: optionally set DSL_INCREASE_SZI / DSL_INCREASE_ENTRY_PX / DSL_INCREASE_LEVERAGE. * If omitted, values are auto-read from live clearing house at emit time. With multiple tracked positions, * set DSL_INCREASE_ASSET to the ticker (matches clearing-house coin, case-insensitive). * --decrease-after N: optionally set DSL_DECREASE_SZI / DSL_DECREASE_ENTRY_PX / DSL_DECREASE_LEVERAGE. * If omitted, values are auto-read from live clearing house at emit time. With multiple positions, * set DSL_DECREASE_ASSET. * (Increase/decrease use bus event names on_position_increased / on_position_decreased, same as HookSystem.fire.) * * Optional — DSL notifications (same behavior as runtime DslPlugin): * - Delivery needs a resolvable Senpi auth token (SENPI_AUTH_TOKEN / SENPI_API_KEY); * the ingest URL comes from NOTIFICATIONS_INGEST_URL, defaulting to production. * Recipe (--config) top-level `notifications.dsl_lifecycle: false` skips wiring * the subscriber in this dev script (a standalone-only convenience; the runtime * always emits). * - With dsl_lifecycle: false, or with no resolvable auth token, only * console bus logs run (see below). * Bus listeners always print DSL_EVENTS to stdout for debugging. * * Usage (after build): * npm run run:dsl:live * node dist/scripts/run-dsl-standalone-live.js --seconds 3600 * node dist/scripts/run-dsl-standalone-live.js --config examples/strategies/iguana/recipe.yaml * node dist/scripts/run-dsl-standalone-live.js --seconds 120 --close-after 30 # emit position.closed for each asset * node dist/scripts/run-dsl-standalone-live.js --seconds 120 --flip-after 30 # single asset + DSL_NEW_* * node dist/scripts/run-dsl-standalone-live.js --seconds 300 --increase-after 60 # single asset + DSL_INCREASE_* * node dist/scripts/run-dsl-standalone-live.js --seconds 300 --decrease-after 90 # single asset + DSL_DECREASE_* */ import "dotenv/config"; //# sourceMappingURL=run-dsl-standalone-live.d.ts.map