Introduction
The ANK API is a REST service built with Axum that provides backtesting capabilities for DeFi strategies. It supports Aave lending/borrowing strategies and Uniswap liquidity provision strategies with comprehensive performance analytics.Base URL
The API server runs on:Starting the Server
From theapps/api directory:
Available Endpoints
Health Check
- GET
/- Server health check- Returns:
"ank-api OK"
- Returns:
Backtesting
- POST
/backtest- Run Aave strategy backtest - POST
/backtest/uniswap- Run Uniswap strategy backtest
Price Feeds
- GET
/prices/{symbol}- Get current or historical price for an asset - GET
/prices/{symbol}/historical- Get OHLC historical price data range - GET
/prices/assets- List all available assets
Response Format
All endpoints return JSON responses. Successful responses include the relevant data structure, while errors return appropriate HTTP status codes:400 Bad Request- Invalid input parameters500 Internal Server Error- Server-side errors