Skip to content
Liquidity Lens

Tripwire, Execution and flow alerts

API docs

An add-on for Truefill and Poolscope keys: one Server-Sent Events stream that flags a token when its execution gap widens past its baseline, and a pool when bots or aggregators take a markedly different share of its swaps.

Base URL https://llens.abanchev.com/api/v1. Authentication, deadlines, metering and errors are on Getting started. See the Tripwire live demo.

Example values are illustrative. Token addresses are real Base contracts; amounts are raw integer units as decimal strings.

GET/api/v1/public/oracle/stream

Keyed alert stream

One Server-Sent Events connection per key. It opens with a snapshot of everything you watch, then sends health-flag when a watched token × size crosses into or out of the flagged state, and traffic-jump when a watched pool's aggregator or bot share moves away from its 7-day share.

Cost
opening is free; each evaluation costs the key 50 CU + 1 CU per watched token × size (health) or 50 CU (traffic)
Headers
Send your key in x-api-key.
QueryRequiredDescription
chainIdyes8453 (Base) or 146 (Sonic).
healthnoComma-separated token:sizeUsd items, at most 25.
poolsnoComma-separated pool addresses (needs the traffic grant).

Keep-alive is an SSE comment (: ping) every 15 s. A stream lasts up to 60 minutes and ends with a closed event; reconnect with Last-Event-ID to replay buffered traffic jumps.

curl -N "https://llens.abanchev.com/api/v1/public/oracle/stream?chainId=8453&health=0x4200000000000000000000000000000000000006:100000&pools=0xd0b53d9277642d899df5c87a3966a349a798f224" \
  -H "x-api-key: $LL_API_KEY" \
  -H "accept: text/event-stream"
Example events
id: a41f09c2-1
event: snapshot
data: {"chainId":"8453","health":[{"token":"0x4200000000000000000000000000000000000006","sizeUsd":"100000","flagged":false,"gapPercent":"0.2230352656","baselinePercent":"0.1874","baselineUnavailable":null,"unavailable":null,"gapMultiple":3,"blockNumber":"52914031","evaluatedAt":"2026-10-19T14:23:42.118Z"}],"pools":["0xd0b53d9277642d899df5c87a3966a349a798f224"],"attributedThroughHour":"1792414800","trafficEvaluatedHour":"1792414800","replay":"none","healthIntervalSeconds":60}

id: a41f09c2-2
event: health-flag
data: {"token":"0x4200000000000000000000000000000000000006","sizeUsd":"100000","flagged":true,"gapPercent":"0.6118204411","baselinePercent":"0.1874","baselineUnavailable":null,"unavailable":null,"gapMultiple":3,"blockNumber":"52914211","evaluatedAt":"2026-10-19T14:29:42.402Z","chainId":"8453","previous":false}

id: a41f09c2-3
event: traffic-jump
data: {"chainId":"8453","pool":"0xd0b53d9277642d899df5c87a3966a349a798f224","hour":"1792418400","bucket":"bot","latestSharePct":"61.40","trailingSharePct":"38.12","deltaPoints":"23.28","thresholdPoints":20,"latestSwaps":"307","trailingSwaps":"28410"}
POST/api/v1/ext/oracle/health

Token health

Per token and size: the round-trip gap between spot and executable price now, its 24-hour baseline from stored reference samples, and a flag when the gap is above the configured multiple of the baseline.

Cost
50 CU + 1 CU per token × size
Headers
Send your key in x-api-key and a compute budget in x-compute-budget-ms (1 to 5000 ms; the example uses 2000).
BodyRequiredDescription
chainIdyes8453 (Base) or 146 (Sonic).
itemsyesUp to 25 distinct { token, sizeUsd } pairs.
minBlocknoAnswer only from this block or later; 409 when our indexed state has not reached it yet.

Baselines exist for the reference sizes ($10K and $100K) of sampled assets. Anything else answers baseline: null with the reason.

curl -s -X POST "https://llens.abanchev.com/api/v1/ext/oracle/health" \
  -H "x-api-key: $LL_API_KEY" \
  -H "x-compute-budget-ms: 2000" \
  -H "content-type: application/json" \
  -d '{"chainId":"8453","items":[{"token":"0x4200000000000000000000000000000000000006","sizeUsd":"100000"},{"token":"0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf","sizeUsd":"10000"}]}'
Example response
{
  "chainId": "8453",
  "sequence": "1843207",
  "blockNumber": "52914031",
  "blockHash": "0x7c1e5f0b9a2d43e8c6f1a0b7d9e2c4f6a8b0d1e3f5a7c9b2d4e6f8a0c2e4b6d8",
  "stateDigest": "4b9e0c7f2a1d3e5b8c6a9f0d2e4b7c1a3f5e8d0b2c4a6e9f1d3b5c7a0e2f4d6b",
  "blockTimestamp": "1792419821",
  "stateAgeMs": 412,
  "canonicalStable": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
  "gapMultiple": 3,
  "minSamples": 144,
  "items": [
    {
      "token": "0x4200000000000000000000000000000000000006",
      "sizeUsd": "100000",
      "spotUsd": "2618.42",
      "sellImpactPercent": "0.1103719037",
      "buyImpactPercent": "0.1126633619",
      "gapPercent": "0.2230352656",
      "unavailable": null,
      "baseline": {
        "percent": "0.1874",
        "samples": 24,
        "from": "2026-10-18T14:23:41.000Z",
        "to": "2026-10-19T14:23:41.000Z"
      },
      "baselineUnavailable": null,
      "flag": false
    },
    {
      "token": "0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf",
      "sizeUsd": "10000",
      "spotUsd": "108412.55",
      "sellImpactPercent": "0.0211",
      "buyImpactPercent": "0.0234",
      "gapPercent": "0.0445",
      "unavailable": null,
      "baseline": {
        "percent": "0.0131",
        "samples": 281,
        "from": "2026-10-18T14:23:41.000Z",
        "to": "2026-10-19T14:23:41.000Z"
      },
      "baselineUnavailable": null,
      "flag": true
    }
  ]
}
Liquidity LensPrices are informational and instantaneous. They are not investment advice or a guarantee of execution.