# TradingView webhooks for Hyperliquid

Source: https://app.hypr.markets/tradingview-hyperliquid-webhooks

Rolling out · Webhooks for TradingView · Every plan

# TradingView alerts in. Hyperliquid orders out.

Your clients paste a webhook URL and a message into a TradingView alert. When the alert fires, the order goes to their own Hyperliquid account through a key that can trade but never withdraw, inside the limits you and they set, with your trading fee on it.

- Set up inside your terminal: one wallet approval, no code
- Nine actions, from a market buy to matching a strategy's position
- Your trading fee (the builder fee) on every webhook order

Alert message

```
{
  "id": "{{ticker}}-{{interval}}-{{timenow}}",
  "ts": "{{timenow}}",
  "action": "buy",
  "symbol": "{{ticker}}",
  "size_usd": 100,
  "sl_pct": 2,
  "tp_pct": 4,
  "leverage": 5
}
```

Alert log in your terminal

- Donebuy BTC $100, stop and target set · 3 steps
- RefusedETH $2,500 is above the $1,000 order limit
- Nothing to dotarget long 0.001 BTC: already there

Every alert, with each signed step and the reason for any refusal. Example data.

How it works

## Four steps for the client. No code, nothing to install.

Three steps happen in your terminal, one in TradingView. The client never has to leave your site to set anything up.

1. 1Your terminalApprove the TradingView keyOn the TradingView page of your terminal the client approves a separate trading key named hypr-tv with their wallet, valid for up to 180 days, plus your trading fee if they have not approved it yet. The key can place and cancel orders and set leverage. It can never withdraw or move money.
2. 2Your terminalCreate a webhookEach webhook gets its own URL, its own limits and its own alert log. The URL is shown once and stored only as a fingerprint. An optional passphrase of at least 8 characters adds a second secret every message must carry.
3. 3Your terminalGenerate the alert messageThe message generator writes the JSON for the chosen action: an indicator alert, a strategy's order fills, or a strategy's target position. The Test button runs a dry run against the webhook's limits and the live price. Nothing is signed or sent.
4. 4TradingViewPaste both into a TradingView alertIn the alert dialog the client pastes the message into the Message box, ticks Webhook URL under Notifications and pastes the URL. From then on, every time the alert fires, TradingView sends the message and the order is placed on their own account.

### What happens when an alert fires

1. 01TradingView alertTradingView sends the message to the webhook URL from its own servers, so nothing has to stay open on the client's computer.POST /api/hooks/tv/v1/…
2. 02Receiver checksTradingView's addresses, the passphrase, the alert's age and duplicates. The answer goes back to TradingView before any order is placed.ip, passphrase, ts, id
3. 03Plan the orderThe ticker is mapped to a Hyperliquid market, the size worked out and checked against the webhook's and your limits.BTCUSDT.P -> BTC
4. 04Policy signerChecks your limits again, writes a signed receipt for every step, then signs with the client's trade-only key.caps, markets, price band
5. 05Client's Hyperliquid accountHyperliquid matches and settles the order. The alert log shows what happened, step by step.fill + builder fee

### What the client needs

- A TradingView plan that includes webhook notifications (TradingView's plan comparison lists them)
- Two-factor authentication switched on: TradingView sends webhooks only then
- A wallet connected to your terminal, to approve the key and the trading fee once

TradingView's own rules for webhooks are on [its webhook help page](https://www.tradingview.com/support/solutions/43000529348-how-to-configure-webhook-alerts/): ports 80 and 443 only, an answer within three seconds, and alerts sent from four published addresses.

Alert messages

## One JSON message per alert. Every action, ready to paste.

The generator in your terminal writes these for each client. The same generator, with a checker, is free on our [TradingView alert message generator](/tools/tradingview-alert-message-generator).

- Buy / longA market buy worth $100 of the chart's market, with a stop-loss 2% and a take-profit 4% from the entry, at 5x leverage. The id and ts lines stop a repeated alert from trading twice.`{ "id": "{{ticker}}-{{interval}}-{{timenow}}", "ts": "{{timenow}}", "action": "buy", "symbol": "{{ticker}}", "size_usd": 100, "sl_pct": 2, "tp_pct": 4, "leverage": 5 }`
- Sell / shortA limit sell at the bar's close for 5% of the account value, resting on the book until filled or cancelled.`{ "action": "sell", "symbol": "{{ticker}}", "size_pct": 5, "order_type": "limit", "price": "{{close}}", "tif": "gtc" }`
- Close the positionCloses half of the position in the chart's market, long or short, with a reduce-only order. Leave out size_pct to close all of it.`{ "action": "close", "symbol": "{{ticker}}", "size_pct": 50 }`
- Close a long onlyCloses the position only if it is a long. close_short does the same for a short, so one alert can never close the wrong side.`{ "action": "close_long", "symbol": "{{ticker}}" }`
- Close everythingCancels open orders and closes every position in the webhook's markets. It takes no symbol and no size.`{ "action": "flat" }`
- Cancel open ordersCancels the open orders in one market, or in every market of the webhook when the symbol is left out. Positions stay open.`{ "action": "cancel_all", "symbol": "{{ticker}}" }`
- Reverse the positionCloses the current position with a reduce-only order, then opens the other way. Without a size it opens the same size again.`{ "action": "reverse", "symbol": "{{ticker}}", "size_usd": 200 }`
- Strategy: match the positionBrings the account to the strategy's own position on every alert: long, short or flat, with the strategy's size. A missed alert is corrected by the next one.`{ "id": "{{strategy.order.id}}-{{timenow}}", "ts": "{{timenow}}", "action": "target", "symbol": "{{ticker}}", "market_position": "{{strategy.market_position}}", "position_size": "{{strategy.position_size}}" }`
- Strategy: follow each orderCopies each order the strategy places, buy or sell, with its size in coins. TradingView fills in the action and the size.`{ "id": "{{strategy.order.id}}-{{timenow}}", "ts": "{{timenow}}", "action": "{{strategy.order.action}}", "symbol": "{{ticker}}", "size_coins": "{{strategy.order.contracts}}" }`

Message reference

## Every field the message can carry

Every number may also arrive as text ("0.25"), because TradingView fills placeholders in as text. Unknown fields are refused, so a typo such as "stoploss" can never place an order without its stop.

| Field | Values | What it does |
| --- | --- | --- |
| action | buy, sell, close, close_long, close_short, flat, cancel_all, reverse, target | What the alert does. long, short, exit and close_all are accepted as buy, sell, close and flat. |
| symbol | {{ticker}} or a Hyperliquid name | The market. Needed for every action except flat and cancel_all. |
| size_usd, size_pct, size_coins | a number above 0 (size_pct up to 100) | Exactly one for buy and sell: dollars of notional, a share of the account value, or coins. A close takes only size_pct. |
| order_type, price, tif | market or limit; a price; gtc, ioc or alo | Market is the default and fills immediately or not at all. A limit needs a price; alo is post-only. |
| sl, sl_pct, tp, tp_pct | a price, or a % from the entry | Stop-loss and take-profit, placed as reduce-only triggers right after the entry. One form of each. |
| leverage, margin | 1 to 50; cross or isolated | Set before the order, never above the leverage the site allows. Cross is the default. |
| reduce_only, slippage_bps | true or false; 1 to 500 | A buy or sell that can only shrink a position; the most a market order may cross the book, capped by the webhook. |
| market_position, position_size | long, short or flat; a size | The target action only: the strategy's position from {{strategy.market_position}} and {{strategy.position_size}}. |
| id, ts | up to 128 characters; {{timenow}} | A second alert with the same id on the same webhook is ignored. With ts, alerts older than the webhook's maximum age are refused. |
| passphrase, v, comment | the webhook's passphrase; 1; free text | The passphrase, when the webhook has one, is never stored or logged. v is the message version. comment is ignored. |

Ticker mapping

## Chart tickers become Hyperliquid markets

Put {{ticker}} in the message and the chart's own ticker arrives with each alert. The receiver maps it to a Hyperliquid market by these rules.

| TradingView ticker | Hyperliquid market | Rule |
| --- | --- | --- |
| BTCUSDT.P | BTC | The perpetual suffix .P and the quote currency are dropped |
| BINANCE:ETHUSDT | ETH | An exchange prefix is dropped |
| BYBIT:SOLUSDT.P | SOL | Prefix, quote and suffix together |
| HYPEUSDC.P | HYPE | USDC, USD, USDE, FDUSD and BUSD quotes work the same way |
| 1000PEPEUSDT.P | kPEPE | Tickers multiplied by 1,000 map to Hyperliquid's k markets |
| XBTUSD | BTC | XBT is read as BTC |
| BTC | BTC | A Hyperliquid name is used as it is |
| xyz:TSLA | Refused | Recognised as a HIP-3 market and refused: webhook keys trade the main Hyperliquid perpetuals |

For a ticker the rules do not know, each webhook has its own symbol map of up to 50 lines such as MYTICKER=ETH, and the map wins over every rule. A ticker that maps to no market is refused before anything is signed.

Pine Script strategies

## Follow each order, or match the position

Strategy alerts carry TradingView's strategy placeholders. Two templates turn them into Hyperliquid orders in different ways.

### Match the strategy's position

The message sends where the strategy should be, not what it just did. Each alert compares that target with the account's position on Hyperliquid and sends only the difference.

- Crossing from long to short closes first, then opens the other way
- A smaller position on the same side is reduced with a reduce-only order
- A missed or late alert is corrected by the next one
- A change worth less than $10 is reported as nothing to do

### Follow each order

The message copies each order the strategy places, with its size in coins. It mirrors the strategy fill by fill, so a missed alert leaves the account out of step until the client corrects it.

- TradingView fills in buy or sell and the contracts of each order
- Simple to read in the alert log: one alert, one order
- Every alert has to arrive: a missed one is not corrected by the next
- Size can be fixed in USD or % instead of the strategy's contracts

A TradingView backtest does not include Hyperliquid's fees, your trading fee, funding or slippage unless the strategy adds them. Test with small limits first: an automated strategy can lose money as fast as it makes it.

Non-custodial

## A webhook can trade. It can never move money.

Every alert is checked against the webhook's limits and your site's limits before anything is signed, and every signed step leaves a receipt.

- A key that can trade, never withdrawThe TradingView key is a separate key named hypr-tv. It can place and cancel orders and set leverage. It can never withdraw, transfer or approve anything, and it is never the client's MetaTrader 5 key.
- Limits per webhookLargest order, a daily limit, orders per minute, the markets allowed and the highest slippage. A new webhook starts at $100 per order and $1,000 a day, or your site's limits if they are lower.
- Only TradingView's serversEach webhook accepts alerts only from the four addresses TradingView publishes, unless the client turns that off. Requests are also limited per URL and per address, and large bodies are refused.
- No double ordersAn alert with an id already seen on that webhook is ignored. Without an id, identical messages within 10 seconds are dropped as duplicates; the client can set that window from 0 to 300 seconds.
- No late ordersWith a ts line, alerts older than the webhook's maximum age (60 seconds to start) are refused. An alert that cannot be executed within 20 seconds of arriving is marked failed and never retried later.
- A receipt for every stepEach leverage change, close, order, stop and cancel passes the policy signer, which writes a signed receipt before anything is sent. The alert log shows every step and why it was allowed or refused.
- Pause, new URL, stop everythingPause one webhook, give it a new URL (the old one stops at once), delete it, or revoke the key and every webhook in one go. Open orders and positions stay as they are, and stay closable in your terminal.
- Passphrase and secretsThe URL and the passphrase are stored only as fingerprints, never logged, and removed from the stored copy of each alert. Anyone without both cannot send alerts to a webhook with a passphrase.

For operators

## Your fee on every alert

- Your trading fee (the builder fee) on every order a webhook places, the same as in your web terminal
- A reason for clients who automate with TradingView to trade on your terminal
- A switch for your whole site, on every plan, Free included
- The markets alerts may trade, the largest order, a daily limit per client, orders per minute, highest leverage and slippage
- How many webhooks one client can create (1 to 20)
- A view of clients, active webhooks and the alerts of the last 24 hours, with what was done and what was refused
- Pause any client's webhook at once; their positions stay open and closable
- No custody of client money and no server or code of yours: the receiver, keys and receipts are run by the platform

### Your limits, set in the console

Defaults for a new site. Change any of them in the console's TradingView webhooks tab; the platform keeps its own per-order cap on top, and the tightest limit always wins.

Good to know

## The limits, said plainly

What Webhooks for TradingView does not do yet, and where the edges are.

- Main Hyperliquid perpetuals only: HIP-3 markets and spot are not offered to webhooks yet
- An opening order must be worth at least $10, as on Hyperliquid; one just below is raised one size step if that stays inside the limit, otherwise refused
- An order above a per-order limit is refused, never shrunk
- A stop-loss or take-profit on a limit entry that has not filled yet can be refused by Hyperliquid; the alert then shows as partly done
- % sizing uses the perpetuals account value
- The webhook URL is on the platform's own address, not your domain
- No per-alert email or push notification yet: the alert log is the record
- TradingView decides when an alert fires and can occasionally fail to deliver one; its own alert log shows each delivery

FAQ

## Questions operators ask

When an alert fires, TradingView sends its message to the webhook URL the client created in your terminal. The platform checks the message, maps the ticker to a Hyperliquid market, checks the limits, and signs the order with the client's trade-only TradingView key. Hyperliquid matches and settles it on the client's own account.

No. The TradingView key can place and cancel orders and set leverage, and can never withdraw, transfer or approve anything. Neither you nor Hypr Markets holds client funds. A leaked URL can only trade inside the webhook's limits, and the client can give it a new URL or delete it at once.

Every plan, Free included. You switch it on for your site in the console's TradingView webhooks tab and set the limits every alert must stay inside. Orders from webhooks carry your trading fee like any other order.

A plan that includes webhook notifications and two-factor authentication on their TradingView account, which TradingView requires before it sends webhooks. Nothing else: there is no TradingView connection to authorize and nothing to install.

Yes. The generator has two strategy templates: one follows each order the strategy places, the other keeps the account at the strategy's position, which corrects a missed alert on the next one. A TradingView backtest leaves out Hyperliquid's fees, funding and slippage unless the strategy adds them, so clients should start with small limits.

An alert with an id the webhook has already seen is ignored. Without an id, identical messages within the webhook's duplicate window, 10 seconds to start, are dropped. Refused alerts and Test runs never block a real alert.

No. Webhooks for TradingView uses TradingView's standard webhook alerts, which send a message to any URL. There is no partnership and no TradingView API involved. TradingView is a trademark of TradingView, Inc., and Hypr Markets is not affiliated with, endorsed or sponsored by TradingView.

## Switch on TradingView webhooks. Keep your fee on every alert.

Webhooks for TradingView is on every plan, Free included. Launch your terminal, switch it on in the console and set your limits; your clients do the rest inside your terminal.

See also the [bridge for MetaTrader 5](/mt5-hyperliquid-bridge), the [bridge for cTrader](/ctrader-hyperliquid-bridge) (coming soon), the [step-by-step guide](/blog/tradingview-webhooks-hyperliquid) and [plans and pricing](/pricing).

TradingView is a trademark of TradingView, Inc. Hypr Markets is not affiliated with, endorsed or sponsored by TradingView. Trading perpetual futures carries a high risk of loss, and automated orders can lose money as fast as manual ones. Operators are responsible for licensing and the laws that apply where they offer a terminal.
