#API
Currently, the API does not implement authentication. For production or public-facing deployments, we strongly recommend integrating a secure method (e.g., API keys, JWT tokens) to control access.
#Base URL & Environment Variables
http://164.90.156.209/api/testing
#Delta Calculation
Delta is a volatility measure used to model price uncertainty over time. It represents the average absolute percentage change in price over a given window.
#Step-by-step:
Step 1: For each pair of consecutive average prices P[t] and P[t+1], compute the absolute percentage change:
delta_t = abs((P[t+1] - P[t]) / P[t])
Mathematically:
deltaₜ = |P[t+1] - P[t]| / P[t]
Step 2: Take a rolling average of delta_t over a window (default: averaging_range = steps / 2). This smooths out short-term noise:
rolling_delta = delta_series.rolling(window=averaging_range).mean()
#Endpoints
#POST /calculate-single-probability
#Description
Calculates the probability that a given asset's price will remain within a specified range (± threshold) for a certain number of time steps, using manually provided inputs.
Request
- Methods: POST
- URL :
/calculate-single-probability
#Request Body (JSON)
#Response
#Success (HTTP 200)
- Probability_within_range: Predicted chance (in fraction) that the future price will be within the target range.
- Lower_bound / upper_bound: The target range based on the current price and the given threshold.
- Confidence_interval_80: 80% confidence interval computed from the underlying normal distribution.
#POST /calculate-current-market-probability
#Description
Computes the probability using live market data. This endpoint retrieves the latest price data, calculates the volatility measure, and then invokes the prediction algorithm.
#Request
- Method: POST
- URL:
/calculate-current-market-probability
#Request Body (JSON)
#Response
The response format is identical to/calculate-single-probability.
Note: This endpoint automatically fetches live data in Uniswap ETH/USDC pool to determine the current price and volatility.
#POST /test-historical
#Description
This endpoint runs the prediction model across an entire historical dataset. In addition to returning overall metrics (e.g., average probability, accuracy, interval scores), it includes a debug section with detailed prediction data for selected timestamps.
#Request
- Method: POST
- URL:
/test-historical
#Request Body (JSON)
#Response
#Explanation
- Overall: Aggregated metrics for the entire dataset (naive predictions, high‑confidence predictions, etc.).
- Static / non_static: Breakdowns based on the actual behavior:
- Static: Timeframes where the future price remained within the target range.
- Non-static: Timeframes where the future price fell outside the target range.
- Debug: Optional. Contains detailed prediction data (e.g., for timestamps “2023-12-28T09:55:00”, “2024-03-25T20:27:00”, etc.) for advanced debugging and analysis. Debug cells setup manually in the code by request.
#Datasets
The following historical datasets are available for testing and evaluating the prediction model. Each file contains minute-level price data for the ETH/USDC pair on Uniswap.
#1.uniswap_eth_usdc_minute_2023-08-01_2024-07-31.csv
Period: August 1, 2023 → July 31, 2024
Chain: Ethereum
Download: 📥 Google Drive Link
#2. uniswap_eth_usdc_minute_2024-12-31_2025-04-14.csv
Period: December 31, 2024 → April 14, 2025
Chain: Ethereum
Download: 📥 Google Drive Link
#Error Handling
If an error occurs, the API returns an HTTP 500 status with an error message in JSON format:
Check the server logs for more details if you encounter issues.
#Examples:
Test 1: Request
Response
Test 2:
Request
Response