Getting Started with ORKID
Get up and running with ORKID's MEV physics engine in under 10 minutes.
Prerequisites
Before you begin, ensure you have:
- ✓A Polygon wallet with MATIC for gas fees
- ✓Basic understanding of MEV and arbitrage
- ✓Development environment (Node.js, Python, or similar)
- ✓ORKID API key (join the waitlist if you don't have one)
Step 1: Get Your API Key
Request early access to get your ORKID API key and choose your plan:
Access: Join the waitlist orteam@orkidlabs.xyz
All new customers receive a 7-day free trial with Pro features.
Step 2: Make Your First API Call
Test your connection with a simple health check:
cURL
curl -H "x-api-key: YOUR_API_KEY" \ https://api.orkidlabs.xyz/health
JavaScript/Node.js
const response = await fetch('https://api.orkidlabs.xyz/health', {
headers: {
'x-api-key': 'YOUR_API_KEY'
}
});
const health = await response.json();
debugLog(health); // { ok: true, timestamp: "..." }Python
import requests
response = requests.get(
'https://api.orkidlabs.xyz/health',
headers={'x-api-key': 'YOUR_API_KEY'}
)
print(response.json()) # {'ok': True, 'timestamp': '...'}Step 3: Fetch MEV Opportunities
Get the latest MEV opportunity detected by ORKID's physics engine:
Latest Opportunity
curl -H "x-api-key: YOUR_API_KEY" \ https://api.orkidlabs.xyz/v1/opportunities/latest
Response Format
{
"signal_id": "550e8400-e29b-41d4-a716-446655440000",
"pair": "WMATIC/USDC",
"venues": {
"buy": "QuickSwap",
"sell": "SushiSwap"
},
"optimalSizeUSDC": 5000,
"expectedNetPnLUSDC": 12.9,
"gasEstimate": {
"gasLimit": 250000,
"gasPriceGwei": 26,
"gasCostUSD": 14.99
},
"routeRecommendation": "standard",
"safety": {
"minOutMarginBps": 30,
"confidenceScore": 0.85
},
"timestamp": 1732584920000,
"schemaVersion": "1.0"
}Step 4: Connect to Real-Time Stream
For real-time opportunities, connect to the WebSocket stream:
JavaScript WebSocket
const ws = new WebSocket('wss://ws.orkidlabs.xyz/v1/stream/opportunities', [], {
headers: {
'x-api-key': 'YOUR_API_KEY'
}
});
ws.onopen = () => {
debugLog('Connected to ORKID stream');
};
ws.onmessage = (event) => {
const message = JSON.parse(event.data);
if (message.type === 'opportunity') {
debugLog('New MEV opportunity:', message.data);
// Process the opportunity
}
};
ws.onerror = (error) => {
console.error('WebSocket error:', error);
};Python WebSocket
import asyncio
import websockets
import json
async def connect_to_orkid():
uri = "wss://ws.orkidlabs.xyz/v1/stream/opportunities"
headers = {"x-api-key": "YOUR_API_KEY"}
async with websockets.connect(uri, extra_headers=headers) as websocket:
print("Connected to ORKID stream")
async for message in websocket:
data = json.loads(message)
if data["type"] == "opportunity":
print(f"New MEV opportunity: {data['data']}")
# Process the opportunity
asyncio.run(connect_to_orkid())Step 5: Implement Your Strategy
Now that you're receiving opportunities, implement your execution logic:
🔍 Opportunity Filtering
- • Check expectedNetPnLUSDC > threshold
- • Validate safety.confidenceScore
- • Consider gas costs and slippage
- • Apply your risk parameters
⚡ Execution Strategy
- • Use routeRecommendation (standard/private)
- • Implement proper slippage protection
- • Monitor transaction inclusion
- • Track P&L and performance
Next Steps
Need Help?
Our team is here to help you succeed with ORKID integration.