Documentation
Everything you need to write, test and run a task. Start with the quickstart if you just want to see a reflex fire.
Overview
Reflex is an autonomous agent that turns live information into trades. You describe an event and an action; the agent watches for the event continuously and executes the action the moment the event occurs.
The whole product reduces to one sentence: IF something happens, THEN execute an action. The work is in making "something happens" mean what you meant. A post that mentions an asset is not the same as a post that endorses it; an analyst expecting a purchase is not a purchase. Reflex reads every event in full and scores it before your conditions are evaluated.
What it is not
- Not a signal service. Reflex doesn't decide what to trade; you do, in advance.
- Not custodial. It holds a scoped permission to trade, never your funds.
- Not a keyword matcher. Every source is read by a language model with the event's surrounding context.
Quickstart
Five minutes from nothing to an armed task. You can do all of this in paper mode without a wallet.
- Open the app. Go to Launch app. You start in paper mode; a simulated execution layer fills your orders against live prices.
- Write the rule in plain English. For example:
If Donald Trump posts about Bitcoin, buy $10,000 of BTC. Press ⌘↵ or click Parse.
- Review the compiled task. Reflex shows the source, the account it resolved, the entity, the sentiment requirement and the action. If something is wrong, edit the text and parse again, or adjust the fields directly.
- Set limits. Max size, fills per day and cooldown default to conservative values. Change them if you need to.
- Arm it. The task goes live immediately. You'll see it in the list with a red dot, and every event the agent evaluates against it appears in the feed.
To execute real trades, connect a wallet from the top bar and switch the task to live. Paper tasks and live tasks can run side by side.
Paper vs live
Paper tasks see the same event stream as live tasks and run through the same context engine and condition checks. When a paper task fires, the execution layer records a simulated fill at the current mid-price plus modelled slippage for the size. Positions and P&L are tracked so you can judge a strategy before it touches capital.
Live tasks sign real orders with your session key and route them to the configured venue. A live task requires a connected wallet with a valid session key (or a trade-only exchange API key) and sufficient balance for the action's size.
Switch a task between modes from its menu. Switching to live re-validates limits against your account's global caps.
Tasks
A task has four parts: a name, one or more conditions (when), an action (then), and limits. Tasks are written in plain English in the app and compiled into the spec below; you can also write the spec directly or submit it through the API.
yamlname: Trump → BTC
when:
- source: truth_social
account: "@realDonaldTrump"
about: BTC
sentiment: any
then:
type: buy
asset: BTC
size: 10000 USD
venue: auto
limits:
fills_per_day: 1
cooldown: 6h
max_slippage: 0.5%
Lifecycle
draft→armed→triggered→executing→filled→cooldown→armed
A task can be paused from any state and resumes to armed. A failed execution (insufficient balance, venue rejection, slippage exceeded) moves the task to error and notifies you; it does not retry on its own. The kill switch moves every task to paused in a single operation.
Triggers
A trigger is one condition on one source. Fields differ by source; the ones below are the most used.
Social (X, Truth Social, Telegram, Discord)
| account | Handle or channel to watch. Well-known people resolve automatically ("Elon Musk" → @elonmusk). |
| about | Asset or topic the post must concern. Resolved by the context engine, not string match: "doge", "dogecoin" and "the dog coin" all resolve to DOGE. |
| sentiment | positive, negative or any. Threshold defaults to ±0.35 on a −1..1 scale; set min_sentiment to override. |
| novelty | new (default) ignores re-posts and restatements of an already-known position; any fires on every post. |
News & filings
| event | breaking, corporate_purchase, corporate_sale, listing, delisting, hack, regulatory, earnings, any. |
| about | Affected asset, resolved from the body, not the headline alone. |
| min_tier | Minimum source tier (1 = wire services and primary filings, 3 = aggregators). Default 2. |
| confirmed | Require a primary source (filing, official statement) rather than reporting about one. Default true for corporate_purchase. |
Market
| metric | price, volume, open_interest, funding, liquidations. |
| change | Signed percentage, e.g. +30%, -5%. Evaluated over window. |
| window | 1m, 5m, 15m, 1h, 24h. |
| venue | Restrict to one venue's data, or aggregate (default). |
Onchain
| chain | solana, ethereum, base, bsc. |
| event | transfer, swap, deploy, mint, liquidity_add, liquidity_remove. |
| wallet | Address or watchlist name. Labels for known entities (exchanges, funds, bridges) are applied automatically. |
| min_usd | Minimum notional value for the event to count. |
Combining conditions
Conditions are combined with all, any and an optional within window. When within is set, the conditions must each have fired inside that window for the task to trigger; the window starts at the first condition to fire.
yamlwhen:
all:
- source: x
account: "@watched_account"
about: $TOKEN
- source: market
metric: volume
change: +30%
window: 5m
within: 5m
Use scale_by_signals in the action to size a position by how many any conditions fired at once. With three conditions and size: 2000 USD, two signals firing in the window executes $4,000, three executes $6,000, capped by the task's max_size.
Actions
| buy / sell | Spot market order via the best available DEX or your exchange account. sell with no quantity sells the position the task opened; sell: 40% sells a fraction of your holding. |
| long / short | Perpetual position on Hyperliquid. Accepts leverage (default 1×, max 10×) and optional take_profit and stop_loss as percentages. |
| close | Close the position this task, or a named task, opened. |
| notify | No trade. Sends the enriched event to your webhook, Telegram or email. Useful for testing a condition before adding an action. |
Sizing
Size is a fixed notional (10000 USD), a quantity (0.25 BTC), or a fraction of available balance (5%). The context engine exposes a confidence score per event; set size_by_confidence: true to scale linearly between min_size and size.
Routing
venue: auto quotes every venue you've connected and takes the best expected fill net of fees and modelled price impact. Name a venue to force it. Orders that would exceed max_slippage are not sent; the task records a skipped event instead.
Context engine
Every event passes through a language model before any condition is checked. The model produces a small structured record that your conditions are evaluated against:
json{
"entities": [{ "symbol": "BTC", "role": "subject" }],
"stance": "endorsing", // endorsing · dismissive · neutral · reporting
"sentiment": 0.71, // −1 .. 1 toward the subject entity
"event_type": "statement", // statement · corporate_purchase · speculation …
"novelty": "new", // new · repeat · update
"credibility": 0.93, // source tier × author reliability
"confidence": 0.88 // the model's certainty in this record
}
What doesn't fire
- A dismissive or sarcastic mention does not satisfy
sentiment: positive.
- Speculation about a corporate purchase does not satisfy
event: corporate_purchase unless confirmed: false.
- A repeat of a known position (re-posts, quote-posts of old news) does not fire unless
novelty: any.
- Events below the task's
min_confidence (default 0.6) are logged as below threshold and skipped.
Latency for this stage is ~180 ms at the median. It is the single largest component of end-to-end time and the one that makes the rest worth doing.
Limits & risk controls
| max_size | Largest notional a single fill may have, in USD. Task-level. |
| fills_per_day | How many times the task may execute in a rolling 24 h. Default 1. |
| cooldown | Minimum time between executions of the same task. Default 6h. |
| max_slippage | Reject the order if the quoted price is worse than mid by more than this. Default 0.5%. |
| daily_loss_limit | Account-level. When realised + unrealised losses for the day cross it, every task is paused. |
| session_cap | Wallet-level. The total the session key may spend before it expires. Enforced on-chain, not by Reflex. |
The kill switch in the app pauses every task and revokes the active session key. It is one tap, it is never behind a confirmation dialog, and it cannot be disabled by a task.
Sources
| id | Coverage | Publish latency |
| x | Posts, replies, quotes from watched accounts and topic streams. Images and linked articles are read. | ~1 s |
| truth_social | Posts and re-posts from watched accounts. | ~2 s |
| news | Reuters, Bloomberg, AP, CoinDesk, The Block and 40+ outlets, tiered 1–3. | ~3 s |
| filings | SEC EDGAR 8-K, 10-Q, 13F; company press releases. | ~5 s |
| telegram | Channels you add (public or via bot invite). | ~1 s |
| discord | Servers and channels you add via bot invite. | ~1 s |
| market | Price, volume, OI, funding, liquidations from Binance, Bybit, OKX, Hyperliquid, Jupiter, Uniswap. | <100 ms |
| onchain | Solana, Ethereum, Base, BSC. Labelled addresses for exchanges, funds, bridges and known traders. | ~400 ms |
| prediction | Polymarket and Kalshi odds changes. | ~2 s |
Task spec
The canonical form of a task. The app compiles English into this; the API accepts it as JSON or YAML.
json{
"name": "Watched account + volume → buy",
"mode": "paper",
"when": {
"all": [
{ "source": "x", "account": "@watched_account", "about": "$TOKEN", "sentiment": "any" },
{ "source": "market", "metric": "volume", "change": "+30%", "window": "5m" }
],
"within": "5m"
},
"then": { "type": "buy", "asset": "$TOKEN", "size": { "usd": 3000 }, "venue": "jupiter" },
"limits": { "max_size": 5000, "fills_per_day": 2, "cooldown": "2h", "max_slippage": "1%" }
}
REST API
Base URL https://api.reflex.trade/v1. Authenticate with Authorization: Bearer rfx_…. Keys are created in Settings and are scoped to an account; they can never withdraw.
| POST /tasks | Create a task from a spec, or from {"text": "If …, then …"} to have it compiled. Returns the task with state: draft. |
| GET /tasks | List tasks. Filter with ?state=armed. |
| GET /tasks/:id | One task with its last 50 evaluations. |
| POST /tasks/:id/arm | Arm a draft or paused task. Validates limits and balance. |
| POST /tasks/:id/pause | Pause without deleting. |
| DELETE /tasks/:id | Delete. Open positions are left as they are. |
| GET /events | Enriched events the engine evaluated. ?task= to filter, ?since= for an ISO timestamp. |
| GET /fills | Executed orders with venue, price, slippage and latency. |
| POST /kill | Pause every task and revoke the session key. |
bash# create from plain English
curl -X POST https://api.reflex.trade/v1/tasks \
-H "Authorization: Bearer $REFLEX_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"If Elon Musk posts positively about DOGE, buy $2,000 of DOGE","mode":"live"}'
# arm it
curl -X POST https://api.reflex.trade/v1/tasks/tsk_9q2m/arm \
-H "Authorization: Bearer $REFLEX_KEY"
Webhooks
Register a URL in Settings to receive a POST for each of the events below. Payloads are signed with X-Reflex-Signature (HMAC-SHA256 over the raw body using your webhook secret).
| task.triggered | Conditions satisfied; includes the enriched event and the planned action. |
| fill.executed | Order filled; includes venue, price, quantity, slippage, latency and the transaction hash or exchange order id. |
| task.skipped | Triggered but not executed: below confidence, slippage exceeded, limit reached. |
| task.error | Execution failed. The task is now in error. |
| source.degraded | A source the task depends on is delayed or disconnected. |
Engine protocol
The app can connect directly to an engine over WebSocket. In Settings, set Engine endpoint to a wss:// URL and the app will stream that engine's events and fills instead of the paper simulator. This is how self-hosted and Desk deployments are wired up.
Messages are JSON objects with a type field:
json// engine → app
{ "type": "event", "ts": "2026-08-22T10:42:07.311Z", "source": "x", "account": "@elonmusk",
"summary": "post references DOGE", "entity": "DOGE", "sentiment": 0.86, "event_type": "statement", "confidence": 0.9 }
{ "type": "fill", "task": "tsk_9q2m", "side": "buy", "asset": "DOGE", "qty": 48200, "price": 0.0831, "venue": "jupiter", "latency_ms": 291 }
{ "type": "status", "sources": { "x": "ok", "news": "degraded" } }
// app → engine
{ "type": "subscribe", "tasks": [ …task specs… ] }
{ "type": "kill" }
Events that match an armed task in the app are marked in the feed whether or not the engine reported a fill; fills reported by the engine are recorded in Activity and positions.
Connecting a wallet
Click Connect wallet in the top bar. Reflex discovers every injected wallet in your browser (via EIP-6963 on EVM, and the Phantom / Solana wallet standard) and lists them. Pick one and approve the connection request in the wallet.
- EVM — MetaMask, Rabby, Coinbase Wallet and any EIP-6963 provider. Mainnet, Base and Arbitrum are supported for execution.
- Solana — Phantom, Backpack, Solflare.
Connecting a wallet does not grant any trading permission. That happens in the next step.
Session keys
When you switch a task to live, Reflex asks your wallet to authorise a session key: a separate signing key that may only submit swap and perp orders from your address, up to a spend cap, until an expiry you choose. On EVM this is a scoped permission on a smart account; on Solana it is a delegate authority on a program-derived account that holds only the balance you move into it.
- The key cannot transfer funds to any address other than a venue contract.
- The cap and expiry are enforced by the chain, not by Reflex.
- Revoke at any time from Settings or with the kill switch. Revocation is immediate.
For exchange accounts, create an API key with trade permission only and withdrawals disabled. Reflex rejects keys that have withdrawal enabled.
Venues
| jupiter | Solana spot via Jupiter aggregation. Default for Solana assets. |
| oneinch | EVM spot via 1inch on Ethereum, Base, Arbitrum. |
| uniswap | EVM spot via Uniswap v3/v4 directly, when you want to pin the pool. |
| hyperliquid | Perpetuals. Required for short and leveraged long. |
| binance · bybit · okx | Spot and perps through your exchange API key. |
Security model
- Custody. Reflex never holds private keys or funds. Session keys are generated in your wallet and scoped on-chain.
- Least permission. Every permission the agent holds is the minimum needed to place the trades you've defined: trade-only, capped, expiring.
- No silent retries. A failed execution stops the task and tells you. It never re-sizes or re-routes without a rule that says so.
- Determinism. The condition check is pure; given the same enriched event and task state, it produces the same decision. Every decision is logged with the record it was made on.
- Kill switch. One tap pauses all tasks and revokes the session key, in that order.
Examples
Trump mentions Bitcoin → buy $10,000 BTC
when: source truth_social · account @realDonaldTrump · about BTC · sentiment any
then: buy BTC · 10000 USD · venue auto
limits: fills_per_day 1 · cooldown 6h
Musk positive on DOGE → buy DOGE
when: source x · account @elonmusk · about DOGE · sentiment positive (≥ 0.35)
then: buy DOGE · 2000 USD · venue jupiter
limits: fills_per_day 2 · cooldown 1h
Company discloses a BTC purchase → buy BTC
when: source filings · event corporate_purchase · about BTC · confirmed true
then: buy BTC · 5000 USD
limits: fills_per_day 3 · cooldown 30m
Account mentions token and 5m volume +30% → buy
when: all · within 5m
- source x · account @watched_account · about $TOKEN
- source market · metric volume · change +30% · window 5m
then: buy $TOKEN · 3000 USD · venue jupiter · max_slippage 1%
Breaking negative news → sell, or short
when: source news · event breaking · about ETH · sentiment negative · min_tier 1
then: short ETH · 5% of balance · venue hyperliquid · leverage 2 · stop_loss 4%
Multiple signals together → larger position
when: any · within 10m
- source x · account @elonmusk · about DOGE · sentiment positive
- source market · metric volume · change +50% · window 15m · about DOGE
- source onchain · chain solana · event swap · min_usd 250000 · about DOGE
then: buy DOGE · 2000 USD · scale_by_signals true · max_size 6000
Risk disclosure
Reflex is software that executes instructions you define. It does not provide investment advice and makes no representation about the profitability of any task. Trading digital assets, and in particular automated trading on unpredictable events, can result in rapid and substantial losses, including the full amount committed to a session key. Sources can be delayed, wrong or manipulated; models can misread context; venues can fail to fill. Set limits you can afford to hit.