Webhooks
A signed HTTPS POST to a URL you choose when something you watch changes: a position leaves its price range or comes back into it, or a pool’s TVL or price crosses a value you set. No polling.
Webhooks are set up in the portal, on the Webhooks page. There is no /v1 route to manage them yet. Deliveries do not use API units.
How it fits together
An endpoint is a URL that receives events. A watch is what you want to hear about: one position, every open position of a wallet, or a pool with thresholds. Each watch sends to all your endpoints or to the ones you pick, and each endpoint can take every event type or only the types you tick.
- Add an endpoint. Its signing secret (
whsec_…) is shown once; store it with your other secrets. - Press Send test and check that your server answers
2xxand that the signature verifies (below). - Add watches.
Adding an endpoint, changing its URL, and showing or rotating its secret need a sign-in from the last 15 minutes; the portal asks you to sign in again otherwise.
Events
| Type | Sent when |
|---|---|
position.range.exited | A watched position’s pool price moves outside its range. |
position.range.entered | It moves back inside. |
pool.tvl.crossed | A watched pool’s TVL (USD) crosses a threshold you set. |
pool.price.crossed | A watched pool’s price (token1 per token0) crosses a threshold you set. |
webhook.test | You press Send test. Always delivered, whatever types the endpoint takes. |
A position is in range when tickLower ≤ tick < tickUpper (Uniswap’s rule), so a tick exactly at tickUpper is out of range, on the above side.
Watches
| Watch | What it covers |
|---|---|
| One position | An open position by chain and position id. Range exits and returns. |
| A wallet | Every open position the wallet holds on one chain, including positions it opens later (up to 1,000). Range exits and returns for each. |
| A pool | Up to 5 thresholds on the pool’s TVL in USD or its price (token1 per token0), each “goes above” or “goes below” a value. |
- Changes only. A new watch first takes a reading (within a few minutes) and sends nothing for the state it finds. Events start from changes after that.
- Timing. Watched pools are re-read about every 5 minutes, so an event can arrive a few minutes after the change on chain.
poolDataAtin each event says when the pool data was read. - No flapping. At most one event per position, or per threshold, in any 15 minutes. A position that leaves its range and comes back within 15 minutes sends nothing; one that is still out when the 15 minutes end sends its event then.
- Thresholds fire once per crossing. After firing, a threshold waits until the value moves back past it by a small margin (1% for TVL, 0.5% for price) before it can fire again, so a value hovering at the line does not repeat.
- A watch can be paused and resumed. A closed position cannot be watched; a wallet watch drops positions as they close.
The request
Each delivery is a POST with a JSON body and three signature headers, the Standard Webhooks layout:
POST /webhooks/tickwise HTTP/1.1
Content-Type: application/json
User-Agent: TickWise-Webhooks/1
webhook-id: evt_01M8RAH4QE5WG8N2D3802GB5H0
webhook-timestamp: 1796112683
webhook-signature: v1,8/rXDrxmocZxWoy/HftXZ7B8tzPOpsaYBexquiE/7EQ=| Header | Meaning |
|---|---|
webhook-id | The event id. The same on every retry and every resend of one event: use it to drop duplicates. |
webhook-timestamp | Unix seconds when this attempt was signed. |
webhook-signature | v1, + a base64 HMAC-SHA256. Two entries, space-separated, while a secret rotation overlaps. |
The body has a fixed shape:
| Field | Meaning |
|---|---|
id | The event id (evt_…), equal to webhook-id. |
type | One of the event types above. |
apiVersion | The payload version, 2026-12-01. It changes only for a breaking payload change. |
createdAt | When the event was recorded (ISO 8601). |
occurredAt | When the change was observed (ISO 8601). |
data | The event’s details, below. |
watch | { "id": … } of the watch that produced it. Absent on webhook.test. |
Position range events
{
"id": "evt_01M8RAH4QE5WG8N2D3802GB5H0",
"type": "position.range.exited",
"apiVersion": "2026-12-01",
"createdAt": "2026-12-02T09:15:04.512Z",
"occurredAt": "2026-12-02T09:15:04.498Z",
"data": {
"chainId": 1,
"protocol": "uniswap-v4",
"positionId": "536229",
"poolId": "0x18751159db0cce3571f995c0aab0968f7b7461b12c057be4cf074e5558ac483c",
"owner": "0x280bba69cda3aa8ac5e07a7fb699d5d70199f50e",
"inRange": false,
"side": "above",
"tick": -195800,
"tickLower": -196200,
"tickUpper": -195900,
"seq": 3,
"observedAt": "2026-12-02T09:15:04.498Z",
"poolDataAt": "2026-12-02T09:12:31.007Z"
},
"watch": { "id": "6b0e82279a883a3470dd8f86" }
}| data field | Meaning |
|---|---|
inRange | false for position.range.exited, true for position.range.entered. |
side | above (tick ≥ tickUpper) or below (tick < tickLower) on an exit; null on a return. |
tick | The pool’s tick that was judged. |
tickLower, tickUpper | The position’s range. |
owner | The position’s owner, or null when unknown. |
seq | Goes up by one with each range change of the position. Deliveries can arrive out of order; the higher seq is the newer state. |
observedAt, poolDataAt | When the change was judged, and when the pool data it was judged on was read. |
Pool threshold events
{
"id": "evt_01M8RC9W0T3J7Q4ZK2N6XB1Y8D",
"type": "pool.tvl.crossed",
"apiVersion": "2026-12-01",
"createdAt": "2026-12-02T10:02:11.230Z",
"occurredAt": "2026-12-02T10:02:11.214Z",
"data": {
"chainId": 1,
"protocol": "uniswap-v4",
"poolId": "0x18751159db0cce3571f995c0aab0968f7b7461b12c057be4cf074e5558ac483c",
"token0": "ETH",
"token1": "USDC",
"ruleId": "r_3fa91c2e",
"metric": "tvlUsd",
"op": "below",
"threshold": 1000000,
"value": 987412.55,
"previousValue": 1004380.12,
"unit": "USD",
"observedAt": "2026-12-02T10:02:11.214Z",
"poolDataAt": "2026-12-02T09:58:40.661Z"
},
"watch": { "id": "6b0e83119a883a3470dd9021" }
}| data field | Meaning |
|---|---|
metric | tvlUsd (pool.tvl.crossed) or price (pool.price.crossed). |
op, threshold | The rule: above or below, and the value you set. |
value, previousValue | The reading that crossed, and the reading before it (null if none). |
unit | USD for TVL; “token1 per token0” for price. |
token0, token1 | The pool’s token symbols, or null. |
ruleId | Which of the watch’s thresholds fired. |
Test events
{
"id": "evt_01M8RAH4QE5WG8N2D3802GB5H0",
"type": "webhook.test",
"apiVersion": "2026-12-01",
"createdAt": "2026-12-01T08:11:23.758Z",
"occurredAt": "2026-12-01T08:11:23.758Z",
"data": {
"message": "A test event from TickWise. Verify its signature with your endpoint secret.",
"endpointId": "6b0e811b9a883a3470dd58b9"
}
}A test is tried once, never retried, and never counts against the endpoint’s health.
Verifying a delivery
Verify every request before you act on it. The signature is HMAC-SHA256 over <webhook-id>.<webhook-timestamp>.<body>, keyed with the base64-decoded part of your secret after whsec_, sent base64-encoded after v1,. Use the body exactly as received: re-serialised JSON will not match.
import crypto from 'node:crypto';
// secret: the endpoint's signing secret, "whsec_…" (Webhooks page in the portal)
// headers: the request headers; rawBody: the body exactly as received, BEFORE JSON.parse
export function verifyTickwiseWebhook(secret, headers, rawBody) {
const id = headers['webhook-id'];
const timestamp = headers['webhook-timestamp'];
const signatures = headers['webhook-signature'] ?? '';
// Refuse anything more than 5 minutes off your clock (replays).
if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false;
const key = Buffer.from(secret.replace(/^whsec_/, ''), 'base64');
const expected = crypto.createHmac('sha256', key).update(`${id}.${timestamp}.${rawBody}`).digest('base64');
// Several signatures (space-separated) while a secret rotation overlaps: any one may match.
return signatures.split(' ').some((entry) => {
const [version, signature] = entry.split(',');
return (
version === 'v1' &&
signature?.length === expected.length &&
crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected))
);
});
}The Standard Webhooks libraries (JavaScript, Python, Go, Ruby, PHP and others) verify the same format given the whsec_… secret.
Rotating the secret. Rotate from the portal: the new secret starts signing at once and the old one keeps signing alongside it for 24 hours, so each request carries two signatures until you have deployed the new one.
Answering, retries and failures
- Answer any
2xxwithin 10 seconds. Do the work after you answer; a slow handler reads as a failure. - Anything else is retried: a non-
2xxstatus, a timeout, a connection or TLS error, and a redirect (redirects are not followed). Retries come after 30 s, 2 min, 10 min, 30 min, 1 h, 3 h, 6 h and 12 h: 9 attempts over about 23 hours, then the delivery is given up. - Delivery is at least once: the same event can arrive twice (a retry after a slow answer, or a resend). Drop repeats by
webhook-id. - An endpoint that has had no success for 3 days and at least 20 failures in a row is turned off, its pending deliveries are dropped, and the account’s email address (if it has one) gets a notice. Turn it back on from the portal once it answers again.
- The portal keeps a log of every delivery for 30 days: status, each attempt, the first 1 KB of the latest response, and the event’s data. Any finished delivery can be resent from there.
Endpoint URLs
https://only, on port 443 or 1024 and above, with no user name or password in the URL.- Private and internal addresses are refused (local networks, loopback, cloud metadata addresses,
localhostand similar names), checked again on every delivery. - A token in the URL’s query works, and the portal shows the URL without its query. Logs and emails name only the host.
Limits by plan
| Plan | Endpoints | Watches |
|---|---|---|
| Free | 1 | 10 |
| Standard | 3 | 500 |
| Pro | 10 | 5,000 |
| Enterprise | Unlimited | Unlimited |
A position or pool watch counts as one. A wallet watch counts one for each position it tracks: when a wallet holds more open positions than your plan has room for, the watch tracks as many as fit and the portal shows how many. Moving to a smaller plan keeps what you already have; you cannot add more until you are under the new limit. See Pricing.