---
title: "Api V2 Signals Advanced Trap-Detection Get"
method: GET
path: "/api/v2/signals/advanced/trap-detection"
tags: ["Trade Signals (v2)"]
---

# Api V2 Signals Advanced Trap-Detection Get

`GET /api/v2/signals/advanced/trap-detection`

## Request

- Base URL: `https://api.zerogex.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.zerogex.io/api/v2/signals/advanced/trap-detection`
- Auth: HTTP bearer

Trap detector — failed-breakout fade opportunities at gamma walls.

Flags failed breakouts (bull trap / bear trap) as fade opportunities when
dealer long gamma reinforces a reversal at a resistance/support wall.
Standalone detector, not part of the MSI composite.

**Logic highlights** (`src/signals/advanced/trap_detection.py`):
- `breakout_buffer_pct = min(0.1%, 0.15 × realized_sigma × √5)` — vol-scaled noise floor.
- Upside-fail (bear fade): `close > resistance + buffer` AND `net_gex > 0`
  AND gamma strengthening AND call wall NOT migrating up.
- Downside-fail (bull fade): mirror, with put wall NOT migrating down.
- Score = `0.4 + 0.4 × distance_strength + 0.2 × gex_boost`, then flow multiplier.
- **Triggered when `|score| ≥ 25` (clamped 0.25).**

**Params:** `symbol` (default `SPY`). Returns 404 when no data exists.

**Returns:**
```json
{
  "score": -35.0, "clamped_score": -0.35, "direction": "bearish",
  "triggered": true,
  "signal": "bearish_fade",
  "breakout_up": true, "breakout_down": false,
  "net_gex_delta": 840000000.0,
  "net_gex_delta_pct": 0.018,
  "broken_resistance_level": 680.0,
  "broken_support_level": null,
  "breakout_buffer_pct": 0.0008,
  "call_wall": 680.0, "prior_call_wall": 680.0,
  "put_wall": 670.0, "prior_put_wall": 670.0,
  "call_wall_migrated_up": false, "put_wall_migrated_down": false,
  "context_values": {"...close, realized_sigma, long_gamma, gamma_strengthening, call_flow_decelerating, put_flow_decelerating..."},
  "score_history": [{"score": -35.0, "timestamp": "..."}, "...up to 90"]
}
```

- `score` — [-100, +100].
- `signal` — `"bullish_fade"` | `"bearish_fade"` | `"none"`.
- `triggered` — `true` when `|score| ≥ 25`.
- `breakout_up` / `breakout_down` — whether price has crossed the buffer.
- `call_wall` / `prior_call_wall` — current and ~30min-ago resistance level.
- `put_wall` / `prior_put_wall` — current and ~30min-ago support level.
- `call_wall_migrated_up` — invalidates a bear fade when `true`.
- `put_wall_migrated_down` — invalidates a bull fade when `true`.

**Trader interpretation:**
- `signal == "bearish_fade"` + `breakout_up == true` → price poked above the
  `broken_resistance_level` (now sitting *below* close) but dealers are long
  gamma and the call wall hasn't migrated; short-call-spread / put-debit.
- `signal == "bullish_fade"` → mirror play; price slipped beneath
  `broken_support_level` (now sitting *above* close), put wall hasn't
  migrated, and is set up for a reclaim.
- `call_wall_migrated_up == true` (bear fade) or `put_wall_migrated_down == true`
  (bull fade) → setup invalidated; dealers repositioning with price.

**Note on field naming.** `broken_resistance_level` and `broken_support_level`
refer to the level *price has just breached* — so on an upside breakout the
"broken resistance" sits below close, and on a downside breakdown the
"broken support" sits above close. This is intentional: the trap setup keys
off the recently-breached level, not the next unbroken one above/below.

**Page design.** Price ladder showing broken_support / close / broken_resistance
with breakout-buffer bands. Red/green "TRAP" badge when triggered. Chips for
`gamma_strengthening`, `call_wall_migrated_up`, `put_wall_migrated_down`.

## Query parameters

- `symbol` string

## Response `200`

Successful Response

- EnvelopeAny
  - `data` unknown, required
  - `freshness` Freshness, required: The v2 freshness envelope. Present on every ``/api/v2/*`` response.
    - `evaluated_at` string, date-time, required: When the API evaluated this response (server wall clock, UTC). Endpoint-health signal: advances on every request even when the underlying data is unchanged.
    - `generated_at` string, date-time, required: When the served data was computed. Equals the snapshot stamp for cycle-backed endpoints, or evaluated_at for endpoints computed on demand for this request.
    - `source_timestamp` string, date-time, nullable: Timestamp of the upstream market observation the payload derives from. This is what freshness_status is measured against. Null when the endpoint has no upstream feed or returned no rows.
    - `latest_event_at` string, date-time, nullable: Newest event timestamp present in the payload (last bar, last trade, last scored row). Best-effort on very large responses, which are sampled rather than fully walked.
    - `age_seconds` number, nullable: evaluated_at - source_timestamp, in seconds. Null when source_timestamp is null.
    - `market_session_status` string, required: pre-market | regular | after-hours | closed (US/Eastern).
    - `expected_update_cadence` string, nullable: ISO-8601 duration for how often this endpoint's data is expected to change right now, e.g. PT60S. Null means no updates are expected (weekend, holiday, or a feed that only runs during the session).
    - `expected_update_cadence_seconds` number, nullable: expected_update_cadence as a number of seconds.
    - `cadence_profile` string, required: Identifier of the cadence class this endpoint belongs to, e.g. analytics_cycle. Stable across releases; the seconds behind it may be retuned.
    - `stale_after` string, date-time, nullable: Instant after which this payload should be treated as stale. Null whenever expected_update_cadence is null.
    - `freshness_status` 'fresh' | 'aging' | 'stale' | 'session_closed' | 'static' | 'unknown', required: The rolled-up freshness verdict for one response. ``fresh`` ``source_timestamp`` is within one expected update cadence. ``aging`` Past one cadence but not yet past ``stale_after`` — the grace band that absorbs normal cycle jitter. Not an error; a client that polls faster than the cadence sees this routinely. ``stale`` Past ``stale_after`` while updates *were* expected. This is the actionable state: the feed behind this endpoint is late. ``session_closed`` A feed-backed endpoint whose feed is not due to produce anything right now (weekend, holiday, or a feed that only runs during the session). The payload is the last good value — deliberately NOT reported as ``stale``, because an overnight consumer polling a closed market is not observing a fault and should not page on it. ``static`` The endpoint is not feed-backed at all: completed history, or a result computed from the caller's own inputs. Age here carries no health meaning and never becomes a fault. ``unknown`` No source timestamp could be resolved from the payload (e.g. a pure calculator, an admin endpoint, or an empty result set). A consumer should fall back to ``evaluated_at`` for endpoint health and make no claim about data age.

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/zerogex/apis/zerogex-api.md) · [All operations](https://skmtc.dev/zerogex/apis/zerogex-api/llms.txt) · [OpenAPI document](https://skmtc.dev/zerogex/apis/zerogex-api/revisions/753b26bf0592?raw)
