Developers · Webhooks
Events, pushed to you.
Instead of polling the API, register an HTTPS endpoint and Amphora POSTs a signed JSON body when something happens. Free, no key needed.
Create a webhook
Events
position.health · A watched wallet's loan fell below your health factor (checked every 5 minutes, at most hourly).liquidation · A liquidation on HyperEVM lenders at or above your minimum size.oracle.alert · A lender's oracle drifted from Hyperliquid's price or stopped updating.param.change · A lender or vault curator changed a risk setting (LTV, threshold, caps, freeze, pause, allocation).status.incident · An Amphora data source or job went down.risk.system · A lender, Morpho market or vault's safety grade fell, or liquidations would outrun the order book at a smaller drop.API
curl -X POST https://amphora.markets/api/v1/webhooks \
-H 'content-type: application/json' \
-d '{"url":"https://your-app.com/amphora","events":["liquidation","position.health"],
"wallet":"0xYourWallet","hf":1.2,"minUsd":25000,"protocols":["morpho","felix"]}'
# → 201 { "hook": { "id": "wh_…" }, "token": "whtok_…", "signingSecret": "whsec_…" }
GET /api/v1/webhooks/{id} Authorization: Bearer whtok_… settings + delivery stats
POST /api/v1/webhooks/{id}/test Authorization: Bearer whtok_… send a ping now
DELETE /api/v1/webhooks/{id} Authorization: Bearer whtok_… removeDelivery
POST https://your-app.com/amphora
x-amphora-event: liquidation
x-amphora-signature: t=1796000000,v1=5f1c…
{ "id": "evt_…", "type": "liquidation", "at": 1796000000123,
"data": { "protocol": "Morpho", "market": "WHYPE/USDC", "borrower": "0x…", "repaidUsd": 48210.5, "time": 1795999800000, "tx": "0x…" } }Verify (Node)
import { createHmac, timingSafeEqual } from "node:crypto";
function verify(rawBody, header, signingSecret) {
const { t, v1 } = Object.fromEntries(header.split(",").map((p) => p.split("=")));
if (Math.abs(Date.now() / 1000 - Number(t)) > 300) return false; // reject replays older than 5 minutes
const want = createHmac("sha256", signingSecret).update(`${t}.${rawBody}`).digest("hex");
return timingSafeEqual(Buffer.from(want), Buffer.from(v1));
}Answer with any 2xx within 5 seconds. Redirects are not followed. After 20 failed deliveries in a row the webhook is paused; a successful test resumes it. Each event is sent once; position.health repeats at most hourly while the loan stays below your line. Endpoints must be public HTTPS hosts.