[Alerts]

AXIS local alerts: price crosses, drawings, Pine conditions, on-chain spikes. Persist axis.alerts.v1. Not HOOX orders.

Alerts

Abstract

AXIS ships a client-side alert book (src/alerts/) with an Alerts panel. Kinds cover price, percent change, drawing touch, Pine conditions, and on-chain TVL spikes. State persists in axis.alerts.v1. Optional browser notifications and a webhook URL are local to the PWA.

These alerts are not HOOX trade-worker orders and are not the PYNE Pro API alert() L2 webhook export — though a Pine alert() / alertcondition() can surface as pine_condition if the engine returns it.

Conceptual model

Interface surface

Kinds implemented in src/alerts/:

KindFires when
price_crossPrice crosses a level
price_above / price_belowPrice vs level
pct_changeBar-to-bar (or window) percent move
drawing_touchUser drawing intersects price
pine_conditionEngine-exported Pine condition / alert()
onchain_tvl_spikeDefiLlama TVL jump (see On-Chain)
onchain_eventCatalogued on-chain event

UI: src/ui/AlertsPanel.tsx. Persistence key: axis.alerts.v1.

PYNE language alert() / alertcondition() on Flask / pyne-worker is documented at PYNE alerts. Pointing AXIS's local webhook at the HOOX gateway is possible and dangerous — you are then inventing an execution path the PWA does not certify.

Internals

PathRole
src/alerts/Engine + format + storage
src/ui/AlertsPanel.tsxPanel
src/onchain/TVL spike helpers (buildTvlSpikeEvents)

Invariants & edge cases

  1. Alerts survive reload via local storage, not the Worker D1 script registry.
  2. Closing the tab stops evaluation unless a stream + engine is still running.
  3. On-chain kinds require the on-chain proxy (/api/onchain) to be reachable.
  4. lastRun strategy results are not persisted; do not assume alert history equals a backtest.

Worked examples

  1. Open Alerts panel.
  2. Add price_cross on the active symbol / TF.
  3. Enable browser notifications in the browser, then in the panel.
  4. For Pine: run a script that calls alertcondition; confirm pine_condition rows after a successful engine run.

On-chain: attach a TVL series, then add onchain_tvl_spike (default ~10% day-over-day in buildTvlSpikeEvents).

Failure modes

SymptomCauseFix
No rowsEngine not running / no streamStart live or replay bars
Pine kind never firesEngine dropped alertsUse Flask interpret; see PYNE alerts
On-chain silentProxy HTML / CORSUse Worker /api/onchain, not the SPA origin
Webhook posted a tradeYou pointed it at HOOXUse pyne-worker instead

See also