Webhook Block

WebHook block - This block allows you to use external signals from TradingView for example (or any other platform that can send Webhook type signals). This block is an "external signal block" that is triggered when a call to a URL dedicated to your block is called with the right parameters (contained in a payload).

Warning: this block is very technical, it is intended for an informed public and should not be used if you do not understand how it works.

What is a Webhook call?

A Webhook call is a call made between two online services. Just like sending an SMS between two people, a server sends a message to another computer when something happens.

If you use TradingView to monitor cryptocurrency prices, you can set up an alert that will notify you when a given cryptocurrency or indicator reaches a certain target. When this happens, TradingView can also send a message to a unique web address and thus notify a third-party service, such as Kryll.

The Webhook block therefore allows you to receive this type of external call within your strategy. It will be possible to orient your strategy and make it perform various actions according to these external signals using the Webhook Block.

 

Technical basics

A Webhook is a feature that sends an HTTP request (usually POST) to a specific URL when a predefined event occurs. This triggers an automated action on another application or platform in response to the event.

What is a URL: A URL (Uniform Resource Locator) is an address used to access a resource on the Internet, such as a web page or file. It is composed of several parts, including the protocol (usually HTTP or HTTPS), the domain name (like platform.kryll.io) and possibly a path (like /dashboard). In our case, the URL of a webhook block represents the link between the outside world and your Kryll strategy.

What is a payload: A payload is the content of an HTTP request. It is usually the data sent to the server in a POST request. In the case of a Webhook, the payload is used to transmit the details of the event that triggered the request and what to do, such as the pair on which the signal was generated, the identifier of the action to be performed, the parameters of this action etc... Payloads can be encoded in different formats. On Kryll, the format is JSON.

Note: If you are using TradingView for your Webhooks, the payload should be done for you automatically.

Block Configuration

In the parameters of the block, you can configure various elements such as its name, the duration of validity of a call and its scope in terms of pair.

Webhook Block options

Webhook name: Here you can specify a name for your webhook. This name will be used in the logs of your strategy. Remember that a well named webhook is more easily identifiable in the logs.

Signal validity period: Set here how long a Webhook signal will remain valid. When the signal is received, the block will remain valid for the set time and will be invalidated when this time is over. This parameter has no impact when the block is alone, however it is particularly useful if you want to associate this block with another indicator block within an AND block.

Here we can provide a validity period compatible with the time unit of the BOLL block

Signal Validity Scope: Will your signal be valid regardless of the pair on which the strategy is executed or do you want to communicate the pair for which the block should be triggered? This is where you configure this type of signal.
Here you will find these 2 operating options:

  • "Valid for the requested pair": This mode allows you to send the pair for which to validate the Webhook block in the message (payload). The block will be validated only if the strategy runs on the pair in question. In this mode, the message to be sent in the payload contains the action ID and the pair.
The detail of the payload in case of pair detection.
Example: Let's imagine a Kryll strategy that buys an asset on an external signal sent by TradingView (such as a cross of two RSI moving averages). Let's assume that the strategy is run on BTC/USDT, KRL/USDT and ETH/USDT. This mode will allow you to drive the strategy instances separately by sending the pair you want to trigger the block for in the payload. You will then need one TradingView alert per pair for TradingView to drive your 3 Kryll strategies separately.
  • Valid regardless of the pair: Inversely, this mode allows you to validate the Webhook block without providing a pair. The block will then be validated whatever the pair when the external signal is received.
Signal configurations

In this mode, the message to be sent in the payload contains only the action ID.

URL & Message details
Example: Now let's imagine a Kryll strategy that buys an asset on an external signal sent by TradingView (such as a cross of two RSI moving averages on the S&P 500). Let's also assume that the strategy is launched on BTC/USDT, KRL/USDT and ETH/USDT.This mode will allow you to drive all the strategies in parallel by sending a single call when you want to trigger the block. A single TradingView alert will allow you to pilot your 3 Kryll strategies.                                                                                                                                                                                                                                             Note: If you are using TradingView for your Webhooks, the payload should be done for you automatically.

Can I backtest this function?

Since Webhook Blocks are triggered by external signals, it is not possible to backtest any strategy using these blocks.

Dive deeper into Webhooks

Various tutorials are available for more information. The Kryll team has written several other articles on this subject:


Join us on our Telegram and Discord groups as well as our other social networks to share your opinion and your feedback on the Kryll.io platform.

Kryll.io

Happy Trading,

Website : https://kryll.io
Twitter : @Kryll.io
Telegram EN : https://t.me/kryll_io
Telegram FR: https://t.me/kryll_fr
Telegram ES: https://t.me/kryll_es
Discord : https://discord.gg/PDcHd8K
Facebook : https://www.facebook.com/kryll.io
Support : support@kryll.io

Author image

About Sebastian Ganjali

Aussie crypto fanatic. Filled with coffee, dreams and market analysis.