⚙️AI API Usage Guide
Base Url
https://apis.xtreamly.io/api/inference/predict/v1
Authentication
The API requires a x-api-token token for authentication, which will be provided separately to testers. It should be included in the request header as follows:x-api-key: <YOUR_TOKEN>. Unless stated, all apis require header authentication
Headers
Name | Value |
---|---|
x-api-key |
|
Important Note:
For all apis, you can either set the block_number parameter or set the start_block and end_block. You can't set them together (e.g. block_number and end_block) nor you can't set them (In next version we would use the latest block as block_number so it would be completely optional)
Gas Fee Prediction
GET
/gas-fee
Predict gas fee (base price) for the next block
Query Parameters
Name | Type | Description |
---|---|---|
block_number | int (Optional) | Block number at which prediction is requested |
start_block | int (Optional) | Block number at which prediction is started |
end_block | int (Optional) | Block number at which prediction is ended |
Eample
Pool volatility prediction
GET
/volatility
Predicts the volatility of the selected Uniswap liquidity pool for next 24 hours
Query Parameters
Name | Type | Description |
---|---|---|
| string | Pool address of Uniswap LP |
block_number | int (Optional) | Block number at which prediction is requested |
start_block | int (Optional) | Block number at which prediction is started |
end_block | int (Optional) | Block number at which prediction is ended |
Here is the list of accepted pool addresses:
0x11b815efB8f581194ae79006d24E0d814B7697F6
0x4e68Ccd3E89f51C3074ca5072bbAC773960dFa36
0xC5aF84701f98Fa483eCe78aF83F11b6C38ACA71D
0xc7bBeC68d12a0d1830360F8Ec58fA599bA1b0e9b
0xE0554a476A092703abdB3Ef35c80e0D76d32939F
0x7BeA39867e4169DBe237d55C8242a8f2fcDcc387
0x8ad599c3A0ff1De082011EFDDc58f1908eb6e6D8
0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640
Eample
Price prediction
GET
/price
Predicts the price of selected symbol pair for next 15 minutes
Query Parameters
Name | Type | Description |
---|---|---|
symbol | string | Trading pair symbol |
block_number | int (Optional) | Block number at which prediction is requested |
start_block | int (Optional) | Block number at which prediction is started |
end_block | int (Optional) | Block number at which prediction is ended |
Here is the list of accepted symbols:
ETH-USDT
ETH-USDC
Example
Slippage Prediction
GET
/slippage
Predicts the slippage percentage associated with a hypotetical swap on UniswapV3
Query Parameters
Name | Type | Description |
---|---|---|
| string | Trading pair symbol |
| string | Pool address of Uniswap LP that swap uses |
| number | Amount of token that is going to be swapped |
quotedprice | number | Quoted price given by Uniswap Quoter contract for the swap in floating point (e.g. 3216.85 for WETH-USDT or 0.00312 for 0.000334 for USDT-WETH) |
priceimpactpercentage | number | The price impact as determined by Uniswap Router for the swap |
gasprice | number | Gas price in Wei at the time of swap initialized |
block_number | int (Optional) | Block number at which prediction is requested |
start_block | int (Optional) | Block number at which prediction is started |
end_block | int (Optional) | Block number at which prediction is ended |
Symbol can be either:
WETH-USDT
WETH-USDC
USDC-WETH
USDT-WETH
Example
Last updated