[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/:
| Kind | Fires when |
|---|---|
price_cross | Price crosses a level |
price_above / price_below | Price vs level |
pct_change | Bar-to-bar (or window) percent move |
drawing_touch | User drawing intersects price |
pine_condition | Engine-exported Pine condition / alert() |
onchain_tvl_spike | DefiLlama TVL jump (see On-Chain) |
onchain_event | Catalogued 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
| Path | Role |
|---|---|
src/alerts/ | Engine + format + storage |
src/ui/AlertsPanel.tsx | Panel |
src/onchain/ | TVL spike helpers (buildTvlSpikeEvents) |
Invariants & edge cases
- Alerts survive reload via local storage, not the Worker D1 script registry.
- Closing the tab stops evaluation unless a stream + engine is still running.
- On-chain kinds require the on-chain proxy (
/api/onchain) to be reachable. lastRunstrategy results are not persisted; do not assume alert history equals a backtest.
Worked examples
- Open Alerts panel.
- Add
price_crosson the active symbol / TF. - Enable browser notifications in the browser, then in the panel.
- For Pine: run a script that calls
alertcondition; confirmpine_conditionrows 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
| Symptom | Cause | Fix |
|---|---|---|
| No rows | Engine not running / no stream | Start live or replay bars |
| Pine kind never fires | Engine dropped alerts | Use Flask interpret; see PYNE alerts |
| On-chain silent | Proxy HTML / CORS | Use Worker /api/onchain, not the SPA origin |
| Webhook posted a trade | You pointed it at HOOX | Use pyne-worker instead |