Skip to main content

/quickalerts/rest/v1/notifications/backtest REST Method

Backtests a QuickAlerts expression.

Updated on
Oct 3, 2023

/quickalerts/rest/v1/notifications/backtest REST Method

Body Parameters

expression
string<base64>
REQUIRED
Base64 encoded expression.
network
string
REQUIRED
The network for this notification. ENUM: "arbitrum-mainnet", "arbitrum-sepolia", "avalanchec-mainnet", "avalanchec-fuji", "b3-mainnet", "b3-sepolia", "base-mainnet", "base-sepolia", "bera-bartio", "blast-mainnet", "blast-sepolia", "bnbchain-mainnet", "bnbchain-testnet", "bitcoin-mainnet", "camp-sepolia", "celo-mainnet", "cyber-mainnet", "cyber-sepolia", "doge-mainnet", "ethereum-holesky", "ethereum-mainnet", "ethereum-sepolia", "fantom-mainnet", "fraxtal-mainnet", "gnosis-mainnet", "hedera-mainnet", "hedera-testnet", "imx-mainnet", "imx-testnet", "kaia-kairos", "kaia-mainnet", "linea-mainnet", "mantle-mainnet", "mantle-sepolia", "mode-mainnet", "morph-holesky", "nova-mainnet", "optimism-mainnet", "optimism-sepolia", "polygon-mainnet", "polygon-amoy", "race-mainnet", "race-sepolia", "redstone-mainnet", "scroll-mainnet", "scroll-testnet", "sei-atlantic", "sei-pacific", "story-testnet", "tron-mainnet", "xai-mainnet", "xai-testnet", "zkevm-cardona", "zkevm-mainnet", "zksync-mainnet", "zksync-sepolia", "zora-mainnet"
block_number
number
REQUIRED
The block number to backtest.
backtest_count
number
REQUIRED
The number of blocks to backtest. <=20

Returns

expression_result
object
The results of the backtest. Each result is an array with the following properties:
block_number
number
The block number of the result.
evaluation
boolean
Whether the expression is true or false for the block_number.
network
string
The network this notification was backtested on
matched_hashes
object
An object containing a comma-separated list of transaction hashes that matched the expression for the block_number.
Request
1
curl -X POST \
2
"https://api.quicknode.com/quickalerts/rest/v1/notifications/backtest" \
3
-H "accept: application/json" \
4
-H "Content-Type: application/json" \
5
-H "x-api-key: YOUR_API_KEY" \
6
-d $'{
7
"expression": "dHhfdG8gPT0gJzB4ZDhkQTZCRjI2OTY0YUY5RDdlRWQ5ZTAzRTUzNDE1RDM3YUE5NjA0NSc=",
8
"network": "ethereum-mainnet",
9
"block_number": 12345678,
10
"backtest_count": 10
11
}'
12
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free