Complete API reference for integrating with Yield Delta's AI-powered yield optimization platform on SEI Network.
https://api.yielddelta.io/apiDevelopment: http://localhost:3000/api
Some endpoints require API key authentication. Include your API key in the request headers:
headers: {
'X-API-Key': 'your-api-key-here',
'Content-Type': 'application/json'
Public endpoints (no authentication required): /health, /market/data, /vaults
X-RateLimit-Limit - Total request limitX-RateLimit-Remaining - Remaining requestsX-RateLimit-Reset - Reset timestampCheck API and service health status.
{
"status": "healthy",
"timestamp": "2024-01-23T15:30:00Z",
"version": "1.0.0",
"chain": "SEI",
"chainId": 1328,
"services": {
"api": "operational",
"ai_engine": "operational",
"blockchain": "operational"
}
List all vaults with optional filtering.
| Parameter | Type | Description |
|---|---|---|
strategy | string | Filter by strategy type |
active | boolean | Filter by active status |
page | number | Page number (default: 1) |
limit | number | Items per page (default: 50, max: 1000) |
{
"success": true,
"data": [
{
"address": "0xf6A791e4773A60083AA29aaCCDc3bA5E900974fE",
"name": "SEI-USDC Concentrated LP",
"strategy": "concentrated_liquidity",
"tokenA": "SEI",
"tokenB": "USDC",
"fee": 0.003,
"tickSpacing": 60,
"tvl": 1250000,
"apy": 0.125,
"chainId": 1328,
"active": true,
"performance": {
"totalReturn": 0.087,
"sharpeRatio": 1.45,
"maxDrawdown": 0.023,
"winRate": 0.68
}
}
],
"count": 1,
"chainId": 1328
Create a new vault.
{
"name": "SEI-USDC Concentrated LP",
"strategy": "concentrated_liquidity",
"tokenA": "SEI",
"tokenB": "USDC",
"fee": 0.003,
"tickSpacing": 60,
"chainId": 1328
concentrated_liquidity - Concentrated liquidity positionsyield_farming - Yield farming strategiesarbitrage - Cross-DEX arbitragehedge - Hedging strategiesstable_max - Stablecoin maximizersei_hypergrowth - High-risk SEI growth strategyblue_chip - Blue-chip token strategydelta_neutral - Delta neutral market making{
"success": true,
"data": {
"address": "0x1234567890123456789012345678901234567890",
"name": "SEI-USDC Concentrated LP",
"strategy": "concentrated_liquidity",
"tokenA": "SEI",
"tokenB": "USDC",
"fee": 0.003,
"tickSpacing": 60,
"tvl": 0,
"apy": 0,
"chainId": 1328,
"active": true
},
"message": "Vault created successfully",
"chainId": 1328
Get detailed vault information.
address - SEI vault address (required){
"success": true,
"data": {
"address": "0xf6A791e4773A60083AA29aaCCDc3bA5E900974fE",
"name": "SEI-USDC Concentrated LP",
"strategy": "concentrated_liquidity",
"tokenA": "SEI",
"tokenB": "USDC",
"fee": 0.003,
"tvl": 1250000,
"apy": 0.125,
"position": {
"lowerTick": -887220,
"upperTick": 887220,
"liquidity": "1000000000000000000",
"tokensOwed0": "50000000",
"tokensOwed1": "125000000"
},
"risk": {
"impermanentLoss": 0.023,
"volatility": 0.18
}
},
"chainId": 1328
Generate AI-powered liquidity range predictions.
{
"vaultAddress": "0xf6A791e4773A60083AA29aaCCDc3bA5E900974fE",
"marketData": {
"currentPrice": 0.485,
"volume24h": 15678234,
"volatility": 0.25,
"liquidity": 125000000
},
"timeframe": "1d",
"chainId": 1328
1h - 1 hour prediction4h - 4 hour prediction1d - 1 day prediction (default)7d - 7 day prediction30d - 30 day prediction{
"success": true,
"data": {
"vaultAddress": "0xf6A791e4773A60083AA29aaCCDc3bA5E900974fE",
"prediction": {
"optimalRange": {
"lowerPrice": 0.425,
"upperPrice": 0.545,
"lowerTick": -12000,
"upperTick": 12000,
"currentTick": 0,
"tickSpacing": 60
},
"confidence": 0.87,
"expectedReturn": {
"daily": 0.0012,
"weekly": 0.0084,
"monthly": 0.036
},
"riskMetrics": {
"impermanentLossRisk": 0.18,
"rebalanceFrequency": "medium",
"maxDrawdown": 0.12,
"sharpeRatio": 1.45
},
"seiOptimizations": {
"gasOptimized": true,
"fastFinality": true,
"parallelExecution": true,
"estimatedGasCost": 0.001,
"blockConfirmations": 1
},
"signals": {
"action": "balanced",
"urgency": "medium",
"nextRebalanceTime": "2024-01-24T03:30:00Z",
"marketSentiment": "bullish"
}
},
"metadata": {
"modelVersion": "2.1.0",
"features": [
"price_momentum",
"volatility_clustering",
"liquidity_depth",
"sei_specific_metrics"
],
"processingTime": "~500ms",
"chainOptimized": "SEI"
}
},
"timestamp": "2024-01-23T15:30:00Z",
"chainId": 1328
Trigger or schedule vault rebalancing.
{
"vaultAddress": "0xf6A791e4773A60083AA29aaCCDc3bA5E900974fE",
"strategy": "threshold_based",
"parameters": {
"newLowerTick": -15000,
"newUpperTick": 15000,
"slippageTolerance": 0.005,
"maxGasPrice": 0.001,
"deadline": 1706023800
},
"chainId": 1328
immediate - Execute rebalance immediatelyscheduled - Schedule for future executionthreshold_based - Execute when thresholds are met (default){
"success": true,
"data": {
"transactionHash": "0xabc123...",
"status": "pending",
"gasUsed": "0.001",
"executionTime": "450ms",
"newPosition": {
"lowerTick": -15000,
"upperTick": 15000,
"liquidity": "1050000000000000000"
}
},
"timestamp": "2024-01-23T15:30:00Z",
"chainId": 1328
Get current market data for SEI ecosystem tokens.
| Parameter | Type | Description |
|---|---|---|
symbols | string | Comma-separated symbols (e.g., "SEI-USDC,ATOM-SEI") |
timeframe | string | Data timeframe (1m, 5m, 15m, 1h, 4h, 1d) |
{
"success": true,
"data": [
{
"symbol": "SEI-USDC",
"price": 0.485,
"change24h": 0.023,
"changePercent24h": 4.98,
"volume24h": "14.2M",
"volumeUSD24h": 14200000,
"high24h": 0.492,
"low24h": 0.467,
"liquidity": {
"totalLocked": 125000000,
"sei": 257732474,
"usdc": 125000000
},
"seiMetrics": {
"blockTime": 0.4,
"tps": 5000,
"gasPrice": 0.000001,
"validators": 100
},
"timestamp": "2024-01-23T15:30:00Z",
"source": "SEI_DEX_AGGREGATOR"
}
],
"timestamp": "2024-01-23T15:30:00Z",
"chainId": 1328
Get historical market data.
{
"symbols": ["SEI-USDC", "ATOM-SEI"],
"timeframe": "1h",
"limit": 100,
"chainId": 1328
{
"success": true,
"data": [
{
"symbol": "SEI-USDC",
"timeframe": "1h",
"data": [
{
"timestamp": "2024-01-23T14:00:00Z",
"open": 0.483,
"high": 0.489,
"low": 0.481,
"close": 0.485,
"volume": 7800000,
"volumeUSD": 3783000,
"trades": 453
}
]
}
],
"metadata": {
"timeframe": "1h",
"limit": 100,
"symbols": ["SEI-USDC", "ATOM-SEI"]
},
"timestamp": "2024-01-23T15:30:00Z",
"chainId": 1328
Scan for arbitrage opportunities across SEI DEXes.
| Parameter | Type | Description |
|---|---|---|
tokens | string | Comma-separated token symbols |
minProfit | number | Minimum profit threshold (default: 0.005) |
{
"success": true,
"data": [
{
"path": ["SEI", "USDC", "SEI"],
"exchanges": ["DragonSwap", "SeiSwap"],
"profit": 0.0125,
"profitUSD": 156.25,
"confidence": 0.92,
"gasEstimate": 0.002,
"netProfit": 0.0105,
"execution": {
"optimal": true,
"urgency": "medium",
"estimatedTime": "800ms"
}
}
],
"scan": {
"totalOpportunities": 1,
"avgProfit": 0.0125,
"timestamp": "2024-01-23T15:30:00Z"
},
"chainId": 1328
| Contract | Description | Interface |
|---|---|---|
StrategyVault | AI-driven dynamic liquidity vault | IStrategyVault |
VaultFactory | Factory for creating vaults | - |
AIOracle | Oracle for AI rebalancing decisions | - |
// Deposit tokens and mint vault shares
function deposit(
uint256 amount0,
uint256 amount1,
address recipient
) external returns (uint256 shares)
// Withdraw tokens and burn shares
function withdraw(
uint256 shares,
address recipient
) external returns (uint256 amount0, uint256 amount1)
// Execute AI-powered rebalance
function rebalance(
int24 newTickLower,
int24 newTickUpper,
bytes calldata signature
) external// Create a new strategy vault
function createVault(
VaultCreationParams calldata params
) external payable returns (address vault)
// Get vault by creation salt
function getVault(bytes32 salt) external view returns (address)
// Get total number of vaults
function allVaultsLength() external view returns (uint256)// Register AI model
function registerAIModel(
string calldata model,
address signer
) external
// Submit rebalance request
function submitRebalanceRequest(
address vault,
int24 newTickLower,
int24 newTickUpper,
uint256 confidence,
uint256 deadline
) external returns (bytes32 requestId)| Code | Description |
|---|---|
400 | Bad Request - Invalid request data |
401 | Unauthorized - Invalid or missing API key |
404 | Not Found - Resource not found |
429 | Too Many Requests - Rate limit exceeded |
500 | Internal Server Error - Server error |
| Operation | Estimated Cost |
|---|---|
| Swap | 0.001 SEI |
| Add Liquidity | 0.002 SEI |
| Remove Liquidity | 0.002 SEI |
| Rebalance | 0.003 SEI |
| Vault Creation | 0.005 SEI |
SEI - Native SEI tokenUSDC - USD CoinUSDT - Tether USDATOM - Cosmos HubETH - Wrapped EthereumBTC - Wrapped Bitcoinconst response = await fetch('https://api.yielddelta.io/api/vaults', {
method: 'GET',
headers: {
'Content-Type': 'application/json',
},
});
const { data } = await response.json();
console.log('Vaults:', data);const response = await fetch('https://api.yielddelta.io/api/vaults', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'your-api-key',
},
body: JSON.stringify({
name: 'My SEI Vault',
strategy: 'concentrated_liquidity',
tokenA: 'SEI',
tokenB: 'USDC',
fee: 0.003,
tickSpacing: 60,
chainId: 1328,
}),
});
const { data } = await response.json();
console.log('Created vault:', data.address);const response = await fetch('https://api.yielddelta.io/api/ai/predict', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'your-api-key',
},
body: JSON.stringify({
vaultAddress: '0xf6A791e4773A60083AA29aaCCDc3bA5E900974fE',
marketData: {
currentPrice: 0.485,
volume24h: 15678234,
volatility: 0.25,
liquidity: 125000000,
},
timeframe: '1d',
chainId: 1328,
}),
});
const { data } = await response.json();
console.log('AI Prediction:', data.prediction);import { ethers } from 'ethers';
const provider = new ethers.JsonRpcProvider('https://evm-rpc-arctic-1.sei-apis.com');
const signer = new ethers.Wallet(privateKey, provider);
const vaultABI = [...]; // Your vault ABI
const vaultAddress = '0xf6A791e4773A60083AA29aaCCDc3bA5E900974fE';
const vault = new ethers.Contract(vaultAddress, vaultABI, signer);
// Deposit into vault
const amount0 = ethers.parseEther('10'); // 10 SEI
const amount1 = ethers.parseUnits('5', 6); // 5 USDC
const tx = await vault.deposit(amount0, amount1, signer.address);
await tx.wait();
console.log('Deposited successfully!');Need help? Join our Discord or check the documentation.