DA3N API Documentation
Base URL
https://api.da3n.defi/v1
Authentication
Authorization: Bearer <your_api_key>
Query Processing
Submit Natural Language Query
Request:
{
"query": "Show ETH-USDC pool depth on Uniswap V3",
"context": {
"chain": "ethereum",
"timeRange": "24h"
}
}
Response:
{
"queryId": "q_01h2m9z...",
"sql": "SELECT...",
"result": {
"poolDepth": 45000000,
"timestamp": 1674125600,
"price": 1820.45
},
"proof": "0x..."
}
Market Analysis
Get Trading Patterns
GET /market/patterns/{pair}
Response:
{
"pair": "ETH-USDC",
"patterns": [
{
"type": "whale_move",
"data": {
"volume": 2500000,
"priceImpact": 0.015,
"duration": 1800,
"addresses": ["0x..."]
},
"confidence": 0.95
}
],
"timestamp": 1674125600
}
Monitor Liquidity
GET /market/liquidity/{pair}
Response:
{
"pair": "ETH-USDC",
"totalDepth": 89450000,
"changes": {
"1h": -0.02,
"24h": 0.05
},
"sources": [
{
"protocol": "uniswap_v3",
"depth": 45000000,
"share": 0.5
}
]
}
Get Arbitrage Opportunities
GET /market/opportunities/arbitrage
Response:
{
"opportunities": [
{
"pair": "ETH-USDC",
"spread": 0.025,
"source": {
"protocol": "uniswap_v3",
"price": 1820.45
},
"target": {
"protocol": "curve",
"price": 1865.96
},
"volume": 500000,
"confidence": 0.92
}
]
}
Cross-Chain Operations
Verify Cross-Chain Transaction
POST /verify/transaction
Request:
{
"txHash": "0x...",
"sourceChain": "ethereum",
"targetChain": "polygon"
}
Response:
{
"verified": true,
"proof": "0x...",
"sourceState": {
"block": 17580000,
"timestamp": 1674125600
},
"targetState": {
"block": 45780000,
"timestamp": 1674125660
}
}
Get Protocol Status
GET /protocol/status/{protocol}
Response:
{
"protocol": "uniswap_v3",
"status": "active",
"metrics": {
"tvl": 2450000000,
"24hVolume": 156780000,
"activeTokenPairs": 548
},
"health": {
"contractStatus": "normal",
"liquidityScore": 0.95,
"riskLevel": "low"
}
}
Error Responses
{
"error": {
"code": "INVALID_QUERY",
"message": "Unable to parse natural language query",
"details": "..."
}
}
Status Codes:
500: Internal Server Error
Rate Limits
Free tier: 100 requests/minute
Pro tier: 1000 requests/minute
Enterprise: Custom limits