Save 60-99% on transaction costs through intelligent cross-chain routing
A production-ready API that analyzes gas costs across Ethereum, Base, Arbitrum, and Polygon in real-time, then recommends the optimal chain for any transaction using ML-enhanced confidence scoring.
Live API: https://choreograph-metamask-api.fly.dev
Input: Transaction details (amount, current chain, priority)
Output: Best chain recommendation with savings breakdown and ML confidence score
Key Feature: Compares all chains against all chains, not just Ethereum vs L2s. If you're on Polygon and Base is cheaper, we'll recommend Base.
Current: Ethereum transaction costs $0.0321
Recommended: Base transaction costs $0.0016
Savings: $0.03 (95.1%)
ML Confidence: 95%
Our lightweight ML engine adjusts confidence based on learned patterns:
Time-of-Day Patterns:
Volatility Analysis:
Extreme Savings Detection:
Result: Confidence scores range from 65% to 95%, giving you transparency on recommendation certainty.
curl -X POST https://choreograph-metamask-api.fly.dev/api/v1/route \
-H "Content-Type: application/json" \
-d '{
"amount": 100,
"current_chain": "ethereum",
"tx_type": "transfer",
"priority": "cost"
}'
Expected Response:
{
"recommended_chain": "base",
"current_chain": "ethereum",
"current_cost_usd": 0.0321,
"recommended_cost_usd": 0.0016,
"savings_usd": 0.0305,
"savings_percent": 95.1,
"confidence": 0.95,
"costs": {
"ethereum": 0.0321,
"base": 0.0016,
"arbitrum": 0.0019,
"polygon": 4.5916
},
"reasoning": [
"Cost priority: base saves $0.03",
"base is 95.1% cheaper"
],
"eth_price_usd": 4372.92
}
| Parameter | Type | Options | Description |
|---|---|---|---|
| amount | float | 0.001-1000 | Transaction value in USD |
| current_chain | string | ethereum, base, arbitrum, polygon | Current blockchain |
| tx_type | string | transfer, swap, erc20_transfer, nft_mint, contract_interaction | Transaction type |
| priority | string | cost, speed, reliability, balanced | User preference |
1. Small transaction on expensive chain:
curl -X POST https://choreograph-metamask-api.fly.dev/api/v1/route \
-H "Content-Type: application/json" \
-d '{"amount": 10, "current_chain": "ethereum", "tx_type": "transfer", "priority": "cost"}'
2. Large transaction (reliability matters):
curl -X POST https://choreograph-metamask-api.fly.dev/api/v1/route \
-H "Content-Type: application/json" \
-d '{"amount": 50000, "current_chain": "polygon", "tx_type": "swap", "priority": "reliability"}'
3. Speed-critical transaction:
curl -X POST https://choreograph-metamask-api.fly.dev/api/v1/route \
-H "Content-Type: application/json" \
-d '{"amount": 500, "current_chain": "arbitrum", "tx_type": "transfer", "priority": "speed"}'
4. Starting from L2:
curl -X POST https://choreograph-metamask-api.fly.dev/api/v1/route \
-H "Content-Type: application/json" \
-d '{"amount": 100, "current_chain": "base", "tx_type": "transfer", "priority": "cost"}'
import requests
def get_routing_recommendation(amount_usd, current_chain, priority='cost'):
response = requests.post(
'https://choreograph-metamask-api.fly.dev/api/v1/route',
json={
'amount': amount_usd,
'current_chain': current_chain,
'tx_type': 'transfer',
'priority': priority
}
)
return response.json()
# Example usage
recommendation = get_routing_recommendation(100, 'ethereum')
print(f"Recommended chain: {recommendation['recommended_chain']}")
print(f"Save ${recommendation['savings_usd']:.2f} ({recommendation['savings_percent']:.1f}%)")
print(f"ML Confidence: {recommendation['confidence']*100:.0f}%")
async function getRoutingRecommendation(
amountUsd,
currentChain,
priority = 'cost'
) {
const response = await fetch(
'https://choreograph-metamask-api.fly.dev/api/v1/route',
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
amount: amountUsd,
current_chain: currentChain,
tx_type: 'transfer',
priority: priority
})
}
);
return response.json();
}
// Example usage
const rec = await getRoutingRecommendation(100, 'ethereum');
console.log(`Recommended: ${rec.recommended_chain}`);
console.log(`Save $${rec.savings_usd.toFixed(2)} (${rec.savings_percent.toFixed(1)}%)`);
console.log(`ML Confidence: ${(rec.confidence * 100).toFixed(0)}%`);
We built a consumer-facing MetaMask Snap that shows gas recommendations before transaction confirmation.
1. Install MetaMask Flask
2. Get Test ETH (for Sepolia testnet)
3. Install Choreograph Snap
4. Run the Snap Server (Required)
# Contact us for the Snap source code
git clone [snap-repo-url]
cd choreograph-snap
npm install
npm run serve
# Server will start on http://localhost:8081
5. Test a Transaction
Warning: Only test with small amounts you're comfortable losing ($0.50-1.00)
curl https://choreograph-metamask-api.fly.dev/health
Response:
{
"service": "Choreograph MetaMask Routing API",
"status": "healthy",
"version": "1.0.0"
}
AI-powered infrastructure to optimize blockchain transaction costs. Currently validating with launch customers.
Current Status:
Telegram: @boggsss
© 2025 Choreograph. API operational and ready for testing.