About flox-foundation/flox-mcp
flox-foundation/flox-mcp is an MCP server published by FLOX-Foundation in the Finance category: mcp`. Conduid read 38 tools from its source: amm_price_impact, cancel_all, cancel_order, compute_indicator, docs_search, explain_decision and 32 more. No package is published for it, so it installs from a source checkout.
The repository has 233 stars and 41 forks, and its last commit was on 23 Nov 2026. The latest release is v0.12.1 (14 Nov 2026). It follows v0.12.0 (14 Nov 2026), and the 5 most recent releases go back to v0.10.0 (24 Sep 2026). Its topics include algorithmic-trading, algotrading, backtesting, codon, cpp and framework.
Install
git clone https://github.com/FLOX-Foundation/floxTools (38)
amm_price_impactThe depth / slippage table for one AMM pool: the realized average price and price impact for each of a list of trade sizes, exact to the wei. Use this to reason about how large a trade a pool can absorb before quoting. Sizes are human 'NUMBER SYMBOL' strings. Requires the optional `lrvx` dependency.cancel_allCancel every open order, optionally filtered by symbol. Default dry_run=true. The most common 'panic stop' primitive after set_kill_switch. account is required and gated the same way as place_order: paper scope may only target paper-prefixed accounts.cancel_orderCancel one open order by id. Talks HTTP to the local ControlServer. Default dry_run=true. Useful for operator-driven cleanup or panic stop. account is required and gated the same way as place_order: paper scope may only target paper-prefixed accounts.compute_indicatorRun a single lrvx indicator over a list of floats and return the output. Use this to sanity-check an indicator's behaviour on a small price array BEFORE wiring it into a strategy — especially when the indicator has window / period / smoothing parameters whose effect isn't obvious from the name. Input is capped at 1 MiB. Requires the optional `lrvx` dependency.docs_searchTop-k full-text search over the lrvx documentation (how-to guides, reference pages, tutorials, error codes, bindings overviews, explanations). Use this to ground answers about lrvx behavior, configuration, or APIs in the actual docs instead of relying on training data — call it whenever the user asks 'how do I X' / 'what does Y do' / 'where is Z documented'. The index is built from a strict allowlist; private tracker / strategy / author files are NEVER indexed.
Query syntax: plain word lists are AND-matched (every token must appear). Wrap a phrase in double quotes for exact match: `"walk forward"`. FTS5 operators (OR, NEAR, *, parens) pass through.
Canonical workflow queries (run these instead of guessing the canonical path from training data):
• User wants to record market data → `docs_search('record tape')`. Covers live capture and the ccxt.fetch_ohlcv historical-backfill pattern.
• User asks 'how should I structure a lrvx project' → `docs_search('project layout')`.
• User mentions an exchange / live data → `docs_search('ccxt')`.
• User wants to backtest a strategy on a recorded tape → `docs_search('backtest')`.
• User mentions strategy traces, signals, or `.lrvxrun` → `docs_search('lrvxrun')`.explain_decisionWalk an event's causal-parent chain back toward the root. Returns the chain in order from the requested event to its root. Use when the user asks 'why did this fill happen' / 'trace the cause of order 42' — the chain shows which signal produced the order, which event triggered the signal, etc.explain_eventDescribe the fields of a lrvx event struct. Accepts a type name ('LrvxTradeData', 'LrvxBookData', 'LrvxBarData', 'LrvxSymbolContext', 'LrvxSignal') OR a raw event dict; returns each field's name, type, units, and human description. Use when the user asks 'what's in this event'.flatten_positionsClose every open position with opposite-side market orders, optionally filtered by symbol. Default dry_run=true. Use for 'close everything' operator actions or end-of-day flatten. account is required and gated the same way as place_order: paper scope may only target paper-prefixed accounts, and rows the positions accessor tags with a different account are skipped.get_event_logQuery the engine event log (signals emitted, orders placed, fills received, risk checks). Filters AND-compose. Read-only. Use for 'what happened in the last 5 minutes' / 'show me all the signals from ema-trend'. Default limit 100.get_exampleReturn canonical lrvx example code for a topic, filtered optionally by language. Use this when the user asks 'show me how to {backtest|connect to ccxt|wire an indicator}' BEFORE writing fresh code from memory — the bundled examples are CI-validated, your generated code is not. Topics: strategy, connector, indicator, event-handler, risk, backtest. Languages: python, node, codon, cpp.get_indicator_valuesReturn the live values of indicators inside a strategy. Optional name filter narrows to one indicator. Read-only. Use for 'what's the EMA reading' / 'is the RSI overbought now'.get_kill_switchRead kill-switch state from the runtime state snapshot. Returns {active, reason, since_ns}. Use this for 'is trading halted' / 'why was the kill switch tripped'. When no engine has written a snapshot, returns the idle response with active=false (there is no live trading to halt). Read-only — to flip the switch use set_kill_switch.get_open_ordersRead in-flight orders from the runtime state snapshot. Use this for 'what orders are pending' / 'do I have anything sitting on Bybit'. Optional substring filter matches against symbol_name or strategy. Returns the engine_not_running idle response when no snapshot is present yet (no error). Read-only.get_pnlRead PnL totals plus per-strategy breakdown from the runtime state snapshot. Use this for 'what's my PnL' / 'how is strategy X doing today'. Returns realized + unrealized + fees per strategy. Returns the engine_not_running idle response when no snapshot is present yet (no error). Read-only.get_positionsRead positions from a running lrvx engine via its runtime state snapshot. Use this when the user asks 'what's in my positions' / 'show me the BTC position' / 'is strategy X long or short'. Returns a JSON object {snapshot_age_ms, data:[{account, strategy, symbol_id, symbol_name, qty, avg_price, unrealized_pnl}, ...]}. Snapshot path is LRVX_RUNTIME_STATE env var or the passed `state_path`; the user app is responsible for writing the snapshot. When no engine has written a snapshot yet, returns {engine: 'not_running', data: [], hint: ...} instead of an error — that's a normal pre-engine state, not a problem to surface to the user. Read-only — never modifies state.get_strategy_stateReturn one strategy's current state as a JSON dict — params, position view, last decisions. Read-only. Use when the user asks 'what does strategy X think right now' / 'show me state for ema-trend'.init_projectCreate a new lrvx project from a bundled template. Thin wrapper around the canonical `lrvx new` CLI — the CLI stays the source of truth, this tool only makes it discoverable from MCP. Use when the user asks 'set up a new lrvx project' / 'I want to scaffold a research notebook' / 'start a live trading bot'. Three templates ship with lrvx: `research` (notebook + sample data + main.py), `live` (CCXT broker + dry-run safety harness), `indicator-library` (standalone indicator package with tests). Result includes the CLI output and a Next steps section with `docs_search` queries.list_bindingsEnumerate the public exports of one lrvx binding surface (C-API / Python / Node / Codon / QuickJS). Use this when the user asks 'what does the {Python|Node|Codon} binding expose?' or when they want to browse a binding before picking a symbol. Substring filter is case-insensitive.list_capi_functionsSearch the lrvx C-API surface from the committed ABI snapshot. Returns name + return type + parameter types for every exported `lrvx_*` function. Use when the user is writing FFI code (Codon, QuickJS, Rust cgo, ctypes) or asks 'what C symbols can I call'.list_indicatorsList every indicator exposed by the lrvx Python binding with its class signature, batch function (if any), and shape (single-input scalar, OHLC tuple, multi-output, …). Use this when the user asks 'what indicators does lrvx support' or before suggesting an indicator name.list_strategiesList the strategies the running lrvx engine knows about, with name, status, and the symbols each one subscribes to. Read-only. Use when the user asks 'what's running' / 'which strategies are active'.lookup_error_codeResolve a lrvx error code (e.g. 'E_SYM_001') to its full Markdown documentation page — fix recipe, common causes, diagnostics. Use whenever a LrvxError is raised in user code; never guess at a fix from the message alone.lookup_symbolResolve a lrvx symbol across every surface (C++, C-API, Python, Node, Codon, QuickJS). Methods resolve too, reported as Owner.method. Returns the local name, kind, and signature for each binding that exports it. Use this whenever the user names a struct, function, or indicator and you need to know what it's called in *their* language — never guess at the cross-language spelling. Accepts any spelling the user knows ('LrvxBarData', 'BarData', 'lrvx_indicator_ema', 'ema', 'Ema'). Filter to one language with the `language` arg if the user is writing in a specific binding. When the symbol has hand-curated semantic gotchas (silent quantization, ordering preconditions, subscribed-vs-registry distinctions), they appear under a `## Gotchas` section in the response.lrvx_overviewCall this FIRST when you don't know which lrvx MCP tool to use. Returns a Markdown narrative of the toolkit organised by category (discovery, building a backtest, live engine inspection, calibration), with canonical workflows for the most common tasks and a recent-additions section. No arguments. Cheap; pure bundled text. Cuts the AI-agent cycles spent rediscovering what the surface is on every fresh session.lrvx_venue_guideUse when the user wants to BUILD A MARKET rather than trade on one: simulate several agents/strategies against one shared order book, model market impact with reacting counterparties, or run a matching engine, clearing ledger, margin/liquidation, market-data feed or venue gateway. Returns a Markdown guide to the optional lrvx venue module (lrvx::venue): headers, order vocabulary, derivatives waterfall, the multi-agent demo, build flag, and verification posture. No arguments. Cheap; pure bundled text. NOT for an ordinary single-strategy backtest over historical data -- use run_backtest.place_orderPlace an order through the user's running lrvx engine. Talks HTTP to the local ControlServer the user app embeds; reads URL + bearer token from LRVX_CONTROL_URL and LRVX_CONTROL_TOKEN. Default dry_run=true; the server simulates acceptance without dispatching to the executor. live tier additionally requires an approve_token issued out of band by the operator. Use this for manual hedges or operator-driven order entry.price_amm_swapPrice a DEX swap against an AMM pool, exact to the wei, through lrvx's integer curves. Use this to quote a fill or measure price impact on a constant-product (Uniswap v2), Raydium CP (Solana), or Uniswap v3 concentrated-liquidity pool from its on-chain state. Amounts are decimal strings (native wei / lamports), so 256-bit values are lossless. Requires the optional `lrvx` dependency.record_dataCapture market data into a `.lrvx` tape. Wraps the canonical recording paths — for `mode=live` shells out to the `lrvx tape record` CLI; for `mode=historical` shells out to `scripts/backfill_to_tape.py` which uses ccxt's `fetch_ohlcv` / `fetch_trades`. Use this when the user asks to 'record some BTC data' / 'pull a month of klines for backtest' / 'tape the last hour of trades'. The result is a `.lrvx` directory drivable by `BacktestRunner.run_tape`.replay_pool_tapeBacktest a DEX position from a recorded pool history. Replays a list of swaps (or decoded Uniswap v2 Swap logs) through the exact curve and returns the price / reserves / LP-value / impermanent-loss / drift series over time. Use this to evaluate an LP position or a trading sequence against a real transcript. Requires the optional `lrvx` dependency.replay_windowRun a sandbox replay over a time window. The engine side decides what 'replay' means: typical setups use the bundled tape primitives to drive a SimulatedExecutor over a tape slice. Read-only (sandbox-only mutations). Use for 'replay the last hour' / 'rerun this period in sandbox'.route_amm_swapBest execution for a DEX swap across a set of AMM pools, exact to the wei. Give it the same notional and several venues (constant-product, Raydium CP, Uniswap v3) and it returns the venue that fills the most, the fill, and a per-venue comparison. Amounts are human 'NUMBER SYMBOL' strings (e.g. '50000 USDC'); each pool carries its token symbols and decimals, so directions are by symbol and a mis-routed swap raises instead of returning a quiet zero. Requires the optional `lrvx` dependency.run_backtestRun a Python lrvx strategy against a CSV dataset in a sandboxed subprocess (rlimits on CPU / memory / output size + a wall-clock timeout). Use this when the user asks 'try this strategy on my data' or 'does this code actually work'. Treat as MVP sandbox: it caps resources but does NOT isolate the filesystem or network — never aim it at untrusted code outside a developer's own machine. Returns the backtest stats dict as JSON plus any stdout the strategy printed.
Dispatch routing: the worker introspects the strategy class. If `on_bar` is overridden the dataset is dispatched as real `BarEvent`s through `run_bars` (CSV columns: ts,open,high,low,close,volume); otherwise the rows are synthesised into trades for `on_trade` via `run_csv`. A strategy that overrides neither hook fails loudly.scaffold_strategyReturn a starter lrvx strategy class that compiles and passes `validate_strategy`. Use this as the *first* thing you write when the user asks to 'build a new strategy' — start from this canonical shell, then edit the indicator + signal logic, instead of writing the lrvx bookkeeping (constructor, hook names, signal builder) from memory. `language` is required — lrvx is polyglot and picking the binding for the user is wrong; ask which language they want first. Supported: python, node, codon, quickjs. Three kinds: bar-driven (TA on bar close), trade-driven (tick-by-tick), hybrid (both). The result includes a `Next steps` section with `docs_search` queries for the recording / backtest / layout follow-ups; follow them in order.set_kill_switchSet the engine's kill-switch state. active=true halts all trading; active=false resumes. Default dry_run=true; explicit dry_run=false applies the change. Use for emergency halt and for resuming after manual review. The kill switch is engine-level, not per-account, so only live scope may call this -- paper tokens are refused even with dry_run=false.suggest_indicatorRecommend lrvx indicators for an English description of the user's intent ('trend filter', 'momentum oscillator', 'volatility band', 'mean revert', 'regime test'). Use this when the user describes what they want without naming an indicator — the tool maps phrasing to a ranked shortlist of real lrvx indicators. Pure keyword heuristic; no LLM call. Always confirm shape with `list_indicators` after picking one.validate_strategyStatic-analysis check on a Python lrvx strategy: AST parses, expected hooks present (on_trade / on_bar), no forbidden patterns (eval, exec, __import__ tricks). Use this before running user-authored strategy code. Does NOT execute the code.validate_strategy_no_lookaheadStatic-analysis check for the most common backtest bug: lookahead bias. Walks the strategy code's AST and flags .shift(-N) and np.roll(a, -N), forward-index arithmetic like df.iloc[i+1], forward slices like close[i:i+3], open-upper slices inside per-bar callbacks, and attribute names that look future-dated (next_*, future_*, lookahead_*). Only literal offsets are resolved; an offset held in a variable is not flagged. Heuristic, not a proof. Run before trusting any backtest result.whatifCounterfactual replay: same as replay_window plus a strategy-name filter and required param_overrides. Use for 'what if EMA period was 50 instead of 21' / 'show me the PnL if I had used a wider stop'.Security checks
6 checks have not been run yet.