{"markdown":"# EventTrader — ETF Credit Spread Vehicles: agent instructions\n\nYou are operating one of my ETF credit spread vehicles on EventTrader (https://cymetica.com/etf-credit-spreads).\nAuthenticate every request with the header `X-API-Key: <my key>` (create one at https://cymetica.com/account → API Keys;\n`trade` permission is needed to launch, tick, and record fills).\n\n## Loop (run it every 10–15 minutes during US market hours)\n1. `GET https://cymetica.com/api/v1/etf-credit-spreads/vehicles` → pick the vehicle(s) with `status = live` and `execution_mode = agent`.\n2. `POST https://cymetica.com/api/v1/etf-credit-spreads/vehicles/{id}/tick` → the platform marks open positions from the delayed chain and decides.\n3. `GET https://cymetica.com/api/v1/etf-credit-spreads/vehicles/{id}/next-action`:\n   - `action = open`: place ONE multi-leg order in MY broker exactly as `next_action.order` says\n     (class multileg, `type: credit`, `price_limit` = net credit, each leg's `occ` symbol, `side`, `quantity`).\n     Never place the legs separately. Never widen the width or drop the long leg.\n     Then `POST https://cymetica.com/api/v1/etf-credit-spreads/vehicles/{id}/positions/record` with `position_id`, the filled `entry_credit` (per share)\n     and the broker `order_id`.\n   - `action = close`: place the closing multi-leg order (`close_action` per leg, buy at most `net_debit_limit`),\n     then `POST https://cymetica.com/api/v1/etf-credit-spreads/vehicles/{id}/positions/{position_id}/close-record` with `exit_debit` and `order_id`.\n   - `action = wait`: do nothing.\n4. If a broker rejects an order, do not retry blindly; report the broker's reason to me and wait for the next tick.\n\n## Rules you must keep\n- Defined risk only: every short option has its protective long option, same expiry, same quantity.\n- Never exceed the vehicle's `max_loss_usd` parameter; the platform refuses proposals above it, so do you.\n- Quote near the mid and walk the price; a spread that only works at mid is a loser at the bid/ask.\n- Prices from the platform are DELAYED (15 min) model data. The broker's live quote wins at execution.\n- Nothing here is a promise of return; backtests are model-priced.\n\n## Useful reads\n- `GET https://cymetica.com/api/v1/etf-credit-spreads/templates` → parameter schema and ranges\n- `POST https://cymetica.com/api/v1/etf-credit-spreads/preview` `{\"symbol\":\"SPY\",\"kind\":\"bull_put\",\"params\":{\"dte_target\":30,\"short_delta\":0.16,\"width\":5}}`\n- `POST https://cymetica.com/api/v1/etf-credit-spreads/backtest` and `POST https://cymetica.com/api/v1/etf-credit-spreads/optimize` (walk-forward; an out-of-sample loser is flagged `overfit`)\n","endpoints":[{"method":"GET","path":"/api/v1/etf-credit-spreads/templates","auth":false,"what":"templates, parameter schema, execution modes"},{"method":"GET","path":"/api/v1/etf-credit-spreads/chain/{symbol}?dte=30","auth":false,"what":"delayed option chain summary + strikes for the nearest expiry"},{"method":"POST","path":"/api/v1/etf-credit-spreads/preview","auth":false,"what":"build a concrete spread from the live chain (legs, credit, max loss, POP, copy-order)"},{"method":"POST","path":"/api/v1/etf-credit-spreads/backtest","auth":false,"what":"model-priced backtest over N years"},{"method":"POST","path":"/api/v1/etf-credit-spreads/optimize","auth":false,"what":"walk-forward parameter search (train/test split)"},{"method":"GET","path":"/api/v1/etf-credit-spreads/brokers","auth":true,"what":"your linked options-capable brokers"},{"method":"GET/POST","path":"/api/v1/etf-credit-spreads/vehicles","auth":true,"what":"list / create your vehicles"},{"method":"PATCH","path":"/api/v1/etf-credit-spreads/vehicles/{id}","auth":true,"what":"change params, mode, broker"},{"method":"POST","path":"/api/v1/etf-credit-spreads/vehicles/{id}/launch|pause|close","auth":true,"what":"lifecycle (launch needs a trade-permission key)"},{"method":"POST","path":"/api/v1/etf-credit-spreads/vehicles/{id}/tick?force_entry=false","auth":true,"what":"run the rules now"},{"method":"POST","path":"/api/v1/etf-credit-spreads/vehicles/{id}/backtest?years=5","auth":true,"what":"backtest this vehicle's params and store the brief"},{"method":"GET","path":"/api/v1/etf-credit-spreads/vehicles/{id}/next-action","auth":true,"what":"what to do now: open / close / wait, with legs and limits"},{"method":"POST","path":"/api/v1/etf-credit-spreads/vehicles/{id}/positions/record","auth":true,"what":"record the fill after YOU executed the open (agent/manual modes)"},{"method":"POST","path":"/api/v1/etf-credit-spreads/vehicles/{id}/positions/{pid}/close-record","auth":true,"what":"record the close after YOU executed it"},{"method":"GET","path":"/api/v1/etf-credit-spreads/vehicles/{id}/positions | /events","auth":true,"what":"positions and the audit trail"}]}