Getting Started
Welcome to the Hoops Finance API Documentation! 🚀
The Hoops Finance API is the most comprehensive AMM data provider for the Stellar/Soroban DeFi ecosystem. Our goal is to empower developers to build innovative applications and integrate Hoops Finance data seamlessly.
What You Can Do
- Explore Liquidity Pools: Get detailed insights into active AMM pools
- Access Pricing and Volume Data: Retrieve real-time and historical pricing and trading volumes for tokens and pairs
- Evaluate Risk and Ranking Metrics: Understand the health and performance of various liquidity pools
- Gather Insights into DeFi Market Conditions: Analyze trends and make informed decisions
- Interact with AI-driven Endpoints: Access advanced data for sophisticated analysis
API Base URLs
- Production:
https://api.hoops.finance
- Local Development:
http://localhost:9999
Authentication
The Hoops Finance Public AMM API does not require an API key for most public endpoints, allowing for easy access to market data.
info
Specific endpoints or future features may require authentication. Please refer to individual endpoint details.
Rate Limiting
- Requests per minute: 120
- Burst limit: 30 requests
- Headers:
X-RateLimit-*
- Error Code:
429 Too Many Requests
Quick Start Example
Try this simple request to get started:
# Get all protocols
curl https://api.hoops.finance/protocols
# Get specific pair details
curl https://api.hoops.finance/pairs/CAB6MICC2WKRT372U3FRPKGGVB5R3FDJSMWSLPF2UJNJPYMBZ76RQVYE
# Get platform metrics
curl https://api.hoops.finance/getmetrics?period=24h
Python Example
import requests
BASE_URL = "https://api.hoops.finance"
def get_all_protocols():
"""Fetches all supported DeFi protocols."""
response = requests.get(f"{BASE_URL}/protocols")
response.raise_for_status()
return response.json()
def get_pair_details(pair_contract_address):
"""Fetches details for a specific liquidity pair."""
response = requests.get(f"{BASE_URL}/pairs/{pair_contract_address}")
response.raise_for_status()
return response.json()
if __name__ == "__main__":
print("Fetching all protocols...")
protocols = get_all_protocols()
print(f"Found {len(protocols['protocols'])} protocols:")
for protocol in protocols['protocols']:
print(f"- {protocol['name']} (ID: {protocol['protocol_id']})")
print("\nFetching details for sample pair...")
sample_pair = "CAB6MICC2WKRT372U3FRPKGGVB5R3FDJSMWSLPF2UJNJPYMBZ76RQVYE"
details = get_pair_details(sample_pair)
print(f"Pair: {details['token0Details']['symbol']}/"
f"{details['token1Details']['symbol']}")
print(f"TVL: ${details['tvl']}")
print(f"Fee: {details['fee']}")
What's Next?
- 📚 API Reference - Explore all available endpoints
- 🤖 AI Endpoints - Learn about our advanced AI-powered features
- 📊 Examples - See more detailed integration examples
- 💬 Support - Get help from our team
API Structure
The Hoops Finance API is organized into several logical categories:
Core AMM Data
- Protocols: Supported AMM protocols
- Pairs: Liquidity pairs (pools)
- Tokens: Individual token information
- Markets: Aggregated token markets
- Events: Historical contract events
- Metrics: Platform-wide metrics
- Statistics: Per-pair statistics
- Swaps: User swap event data
AI-Powered Endpoints
- AI Tokens: Columnar format for AI
- AI Pairs: Pairs in AI-friendly format
- AI Insights Multi: Multi-period data
- AI Hot Multi: "Hot" pairs analysis
- AI Whales: Top liquidity providers
Stellar Classic
- Accounts: Account information
- Assets: Asset details
- Transactions: Transaction data
- Operations: Operation details
Get started by exploring our interactive API reference!