Complete reference for all Phi Protocol API endpoints
Base URL: https://api-live.phiprotocol.ai
Authentication: API Key required in header: X-API-Key
Format: phi_live_[timestamp][random]
Credit Costs:
/bridge/wormhole-quote
Get real-time quotes for cross-chain token transfers via Wormhole.
Parameter | Type | Required | Description |
---|---|---|---|
amount | string | required | Amount to bridge in base units |
fromChain | string | required | Source chain (ethereum, solana, polygon, etc.) |
toChain | string | required | Destination chain |
token | string | required | Token address or symbol |
GET /api/bridge/wormhole-quote?amount=1000000000&fromChain=solana&toChain=ethereum&token=USDC
{
"success": true,
"data": {
"sourceChain": "solana",
"targetChain": "ethereum",
"tokenSymbol": "USDC",
"amountIn": "1000000000",
"amountOut": "999500000000000000000",
"estimatedTime": "15 minutes",
"fees": {
"bridgeFee": "0.1%",
"gasFee": "0.0025 ETH"
}
}
}
/bridge/supported-chains
List all supported blockchain networks for bridging.
{
"success": true,
"data": {
"chains": [
{
"name": "ethereum",
"displayName": "Ethereum",
"chainId": 1,
"nativeToken": "ETH"
},
{
"name": "solana",
"displayName": "Solana",
"chainId": 101,
"nativeToken": "SOL"
},
{
"name": "polygon",
"displayName": "Polygon",
"chainId": 137,
"nativeToken": "MATIC"
}
]
}
}
/market/prices
Get real-time prices for multiple tokens with 24h price changes.
Parameter | Type | Required | Description |
---|---|---|---|
tokens | string | required | Comma-separated token symbols (BTC,ETH,SOL) |
currency | string | optional | Price currency (USD, EUR, default: USD) |
GET /api/market/prices?tokens=BTC,ETH,SOL¤cy=USD
{
"success": true,
"data": {
"prices": {
"BTC": {
"symbol": "BTC",
"price": 67420.50,
"priceChange24h": 2.34,
"priceChangePercent24h": 3.6,
"volume24h": 28492847392.12,
"marketCap": 1329284739201.44,
"lastUpdate": "2024-01-20T10:30:00Z"
},
"ETH": {
"symbol": "ETH",
"price": 3245.82,
"priceChange24h": -45.23,
"priceChangePercent24h": -1.37,
"volume24h": 15847293847.83,
"marketCap": 390284739201.44,
"lastUpdate": "2024-01-20T10:30:00Z"
}
}
}
}
/market/chart
Get historical price data for charting and analysis.
Parameter | Type | Required | Description |
---|---|---|---|
symbol | string | required | Token symbol (BTC, ETH, SOL, etc.) |
interval | string | optional | Time interval (1h, 4h, 1d, 1w, default: 1d) |
limit | number | optional | Number of data points (default: 100, max: 1000) |
GET /api/market/chart?symbol=BTC&interval=1d&limit=30
/advanced-market-data/liquidity
Analyze liquidity depth across multiple chains and DEXs with professional-grade metrics.
Parameter | Type | Description |
---|---|---|
token Required |
string | Token symbol (ETH, SOL, BNB, etc.) |
chains Optional |
string | Comma-separated chains (default: ethereum,bsc,polygon,avalanche,solana) |
depth_levels Optional |
string | Depth levels in millions USD (default: 1,5,10) |
GET /api/advanced-market-data/liquidity?token=ethereum&chains=ethereum,bsc&depth_levels=1,5,10
Headers:
X-API-Key: phi_live_1234567890abcdef
{
"success": true,
"data": {
"token": "ethereum",
"chains": ["ethereum", "bsc"],
"liquidity_analysis": {
"total_liquidity_usd": 2450000000,
"depth_analysis": {
"1m": { "price_impact": 0.12, "available": true },
"5m": { "price_impact": 0.45, "available": true },
"10m": { "price_impact": 0.89, "available": true }
}
}
},
"credits_used": 2
}
/advanced-market-data/arbitrage
Discover profitable arbitrage opportunities across exchanges with real-time price differentials.
Parameter | Type | Description |
---|---|---|
token Required |
string | Token symbol to analyze |
min_profit Optional |
string | Minimum profit percentage (default: 0.5) |
exchanges Optional |
string | Exchanges to analyze (default: all) |
GET /api/advanced-market-data/arbitrage?token=ethereum&min_profit=1.0
Headers:
X-API-Key: phi_live_1234567890abcdef
/advanced-market-data/volatility
Professional volatility metrics including realized, implied, and historical volatility calculations.
Parameter | Type | Description |
---|---|---|
token Required |
string | Token symbol to analyze |
timeframe Optional |
string | Analysis timeframe (default: 24h) |
type Optional |
string | Volatility type: realized, implied, historical (default: realized) |
GET /api/advanced-market-data/volatility?token=ethereum&timeframe=7d&type=realized
Headers:
X-API-Key: phi_live_1234567890abcdef
/advanced-market-data/yield-opportunities
Discover profitable DeFi yield farming and staking opportunities across multiple protocols and chains with risk assessment.
Parameter | Type | Description |
---|---|---|
token Optional |
string | Token symbol (returns all tokens if not specified) |
chains Optional |
string | Comma-separated chains (default: ethereum,bsc,polygon,avalanche,solana) |
min_apy Optional |
string | Minimum APY percentage (default: 1) |
risk_level Optional |
string | Risk level filter: low, medium, high, all (default: all) |
GET /api/advanced-market-data/yield-opportunities?token=ethereum&min_apy=5&risk_level=medium
Headers:
X-API-Key: phi_live_1234567890abcdef
{
"success": true,
"data": {
"total_opportunities": 12,
"highest_apy": "18.45%",
"average_apy": "8.72%",
"opportunities": [
{
"protocol": "Aave",
"chain": "ethereum",
"token": "ETH",
"apy": "12.34%",
"tvl": "$125.4M",
"type": "Lending",
"risk_level": "low",
"lockup_period": "None",
"min_deposit": "$100"
}
],
"risk_distribution": {
"low": 4,
"medium": 6,
"high": 2
}
},
"credits_used": 2
}
/advanced-market-data/correlations
Analyze price correlations between tokens to optimize portfolio diversification and risk management strategies.
Parameter | Type | Description |
---|---|---|
base_token Required |
string | Base token for correlation analysis |
compare_tokens Optional |
string | Comma-separated tokens to compare (default: ethereum,solana,binancecoin) |
timeframe Optional |
string | Analysis timeframe: 1d, 7d, 30d, 90d (default: 30d) |
GET /api/advanced-market-data/correlations?base_token=ethereum&compare_tokens=solana,binancecoin&timeframe=30d
Headers:
X-API-Key: phi_live_1234567890abcdef
{
"success": true,
"data": {
"base_token": "ethereum",
"timeframe": "30d",
"correlations": {
"SOL": {
"correlation": "0.724",
"strength": "Strong",
"direction": "Positive",
"r_squared": "0.524"
},
"BNB": {
"correlation": "0.612",
"strength": "Moderate",
"direction": "Positive",
"r_squared": "0.374"
}
},
"market_insights": {
"highest_correlation": {
"token": "SOL",
"correlation": "0.724"
},
"diversification_score": 73,
"portfolio_risk": "Concentrated"
}
},
"credits_used": 2
}
/advanced-market-data/fear-greed
Access comprehensive Fear & Greed Index data with component breakdown and historical analysis for market sentiment tracking.
Parameter | Type | Description |
---|---|---|
timeframe Optional |
string | Historical timeframe: 1d, 7d, 30d (default: 1d) |
include_breakdown Optional |
boolean | Include component breakdown (default: true) |
GET /api/advanced-market-data/fear-greed?timeframe=7d&include_breakdown=true
Headers:
X-API-Key: phi_live_1234567890abcdef
{
"success": true,
"data": {
"current_index": 72,
"sentiment": "Greed",
"previous_day": 68,
"weekly_average": 65,
"monthly_average": 58,
"component_breakdown": {
"volatility": {
"value": 75,
"weight": "25%",
"description": "Current volatility compared to average"
},
"market_momentum": {
"value": 82,
"weight": "25%",
"description": "Volume and price momentum"
},
"social_media": {
"value": 68,
"weight": "15%",
"description": "Social media sentiment analysis"
}
},
"market_analysis": {
"trend": "Improving",
"volatility": "Normal",
"recommendation": "Monitor market conditions"
}
},
"credits_used": 2
}
/defi/analysis
Get AI-powered market analysis including technical, on-chain, and sentiment data.
Parameter | Type | Required | Description |
---|---|---|---|
tokens | array | required | Array of token symbols to analyze |
analysisType | string | optional | Analysis type (technical, fundamental, sentiment, all) |
timeframe | string | optional | Analysis timeframe (1d, 7d, 30d, default: 7d) |
{
"tokens": ["BTC", "ETH", "SOL"],
"analysisType": "all",
"timeframe": "7d"
}
{
"success": true,
"data": {
"analysis": {
"overview": "Market showing bullish momentum with strong fundamentals...",
"technicalAnalysis": {
"trend": "bullish",
"support": 65000,
"resistance": 72000,
"indicators": {
"rsi": 58.4,
"macd": "bullish_crossover",
"movingAverages": "above_20_50_ma"
}
},
"onChainAnalysis": {
"activeAddresses": 1234567,
"transactionVolume": 45678901234,
"networkActivity": "high",
"whaleActivity": "accumulating"
},
"sentimentAnalysis": {
"overall": "positive",
"socialMediaSentiment": 7.2,
"fearGreedIndex": 68,
"newsImpact": "positive"
},
"riskAssessment": {
"volatilityScore": 6.5,
"liquidityScore": 8.9,
"riskLevel": "medium",
"recommendations": ["Consider position sizing", "Monitor key support levels"]
}
}
}
}
{
"success": false,
"error": "Invalid request parameters",
"details": "Missing required field: tokens"
}
{
"success": false,
"error": "Invalid API key",
"details": "Please check your API key and try again"
}
{
"success": false,
"error": "Internal server error",
"details": "Please try again later or contact support"
}