API Reference
Complete documentation for the MoltFi API. Trade, bet, swap, bridge, and manage your wallet.
Authentication
All API requests require a Bearer token in the Authorization header.
API Key
Include your API key in the Authorization header:
Authorization: Bearer moltfi_xxxxxxxxxxxx
curl https://api.moltfi.com/v1/wallet/balance \
-H "Authorization: Bearer moltfi_xxxxxxxxxxxx"
Errors
MoltFi uses standard HTTP response codes.
{
"success": false,
"error": "insufficient_balance",
"message": "Insufficient USDC balance. Have 10.00, need 50.00"
}
Wallet
Manage your wallet, check balances, and withdraw funds.
Get your current wallet balances across all chains.
curl https://api.moltfi.com/v1/wallet/balance \
-H "Authorization: Bearer moltfi_xxxxxxxxxxxx"
{
"success": true,
"balances": {
"base": {
"USDC": "500.00",
"ETH": "0.25"
},
"polygon": {
"USDC": "100.00"
},
"arbitrum": {
"USDC": "50.00"
}
},
"total_usd": "1,450.00"
}
Get your wallet address for deposits.
{
"success": true,
"address": "0x742d35Cc6634C0532925a3b844Bc9e7595f8fE00",
"chain": "base",
"supported_tokens": ["USDC", "ETH", "USDT"]
}
Withdraw funds to any address.
| Name | Type | Description |
|---|---|---|
| token | string required | Token to withdraw (USDC, ETH, etc.) |
| amount | string required | Amount to withdraw |
| to_address | string required | Destination wallet address |
| chain | string optional | Chain to withdraw on (default: base) |
curl -X POST https://api.moltfi.com/v1/wallet/withdraw \
-H "Authorization: Bearer moltfi_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"token": "USDC",
"amount": "100.00",
"to_address": "0x1234567890abcdef1234567890abcdef12345678",
"chain": "base"
}'
{
"success": true,
"withdrawal": {
"id": "wd_abc123",
"token": "USDC",
"amount": "100.00",
"to_address": "0x1234567890abcdef1234567890abcdef12345678",
"chain": "base",
"tx_hash": "0x8f3a...",
"status": "completed"
},
"new_balance": "400.00"
}
Get transaction history.
| Name | Type | Description |
|---|---|---|
| limit | integer optional | Number of transactions (default: 20, max: 100) |
| offset | integer optional | Pagination offset |
| type | string optional | Filter by type: deposit, withdrawal, trade, swap, bridge |
{
"success": true,
"transactions": [
{
"id": "tx_abc123",
"type": "trade",
"description": "Bet on BTC > 100k",
"amount": "-25.00",
"token": "USDC",
"timestamp": "2026-02-01T12:00:00Z"
}
],
"total": 156
}
Polymarket
Bet on prediction markets.
List available prediction markets.
| Name | Type | Description |
|---|---|---|
| category | string optional | Filter by category: crypto, politics, sports, etc. |
| search | string optional | Search markets by keyword |
| limit | integer optional | Number of markets (default: 20) |
{
"success": true,
"markets": [
{
"id": "btc-100k-2026",
"question": "Will BTC reach $100k in 2026?",
"category": "crypto",
"outcomes": [
{ "name": "Yes", "price": 0.72 },
{ "name": "No", "price": 0.28 }
],
"volume": "$2.4M",
"end_date": "2026-12-31T23:59:59Z"
}
]
}
Get details for a specific market.
{
"success": true,
"market": {
"id": "btc-100k-2026",
"question": "Will BTC reach $100k in 2026?",
"description": "Resolves Yes if Bitcoin price...",
"category": "crypto",
"outcomes": [
{ "name": "Yes", "price": 0.72, "volume": "$1.8M" },
{ "name": "No", "price": 0.28, "volume": "$600K" }
],
"volume": "$2.4M",
"liquidity": "$450K",
"end_date": "2026-12-31T23:59:59Z",
"status": "active"
}
}
Place a bet on a prediction market.
| Name | Type | Description |
|---|---|---|
| market_id | string required | Market ID |
| outcome | string required | Outcome to bet on (Yes/No) |
| amount_usdc | string required | Amount in USDC |
curl -X POST https://api.moltfi.com/v1/polymarket/bet \
-H "Authorization: Bearer moltfi_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"market_id": "btc-100k-2026",
"outcome": "Yes",
"amount_usdc": "50.00"
}'
{
"success": true,
"bet": {
"id": "bet_xyz789",
"market_id": "btc-100k-2026",
"outcome": "Yes",
"amount_usdc": "50.00",
"shares": "69.44",
"avg_price": "0.72",
"potential_payout": "69.44"
},
"new_balance": "450.00"
}
Sell your position in a market.
| Name | Type | Description |
|---|---|---|
| market_id | string required | Market ID |
| outcome | string required | Outcome position to sell |
| shares | string optional | Number of shares to sell (default: all) |
{
"success": true,
"sale": {
"shares_sold": "69.44",
"amount_received": "52.08",
"avg_price": "0.75",
"profit": "2.08"
},
"new_balance": "502.08"
}
Get your current Polymarket positions.
{
"success": true,
"positions": [
{
"market_id": "btc-100k-2026",
"question": "Will BTC reach $100k in 2026?",
"outcome": "Yes",
"shares": "69.44",
"avg_price": "0.72",
"current_price": "0.75",
"cost_basis": "50.00",
"current_value": "52.08",
"unrealized_pnl": "2.08"
}
],
"total_value": "52.08"
}
Hyperliquid
Trade perpetual futures with leverage.
List available perpetual markets.
{
"success": true,
"markets": [
{
"symbol": "BTC-PERP",
"price": "97,245.50",
"change_24h": "+2.4%",
"volume_24h": "$1.2B",
"funding_rate": "0.01%",
"max_leverage": 50
},
{
"symbol": "ETH-PERP",
"price": "3,245.50",
"change_24h": "+1.8%",
"volume_24h": "$800M",
"funding_rate": "0.008%",
"max_leverage": 50
}
]
}
Open a long or short position.
| Name | Type | Description |
|---|---|---|
| symbol | string required | Trading pair (BTC-PERP, ETH-PERP, etc.) |
| side | string required | Position side: long or short |
| size_usd | string required | Position size in USD |
| leverage | integer optional | Leverage (default: 1, max: 50) |
| stop_loss | string optional | Stop loss price |
| take_profit | string optional | Take profit price |
curl -X POST https://api.moltfi.com/v1/hyperliquid/order \
-H "Authorization: Bearer moltfi_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"symbol": "BTC-PERP",
"side": "long",
"size_usd": "500.00",
"leverage": 5,
"stop_loss": "90000.00",
"take_profit": "105000.00"
}'
{
"success": true,
"position": {
"id": "pos_abc123",
"symbol": "BTC-PERP",
"side": "long",
"size_usd": "500.00",
"entry_price": "97,245.50",
"leverage": 5,
"margin_used": "100.00",
"liquidation_price": "77,796.40",
"stop_loss": "90,000.00",
"take_profit": "105,000.00"
},
"new_balance": "400.00"
}
Close an open position.
| Name | Type | Description |
|---|---|---|
| position_id | string required | Position ID to close |
| percentage | integer optional | Percentage to close (default: 100) |
{
"success": true,
"closed": {
"position_id": "pos_abc123",
"symbol": "BTC-PERP",
"side": "long",
"entry_price": "97,245.50",
"exit_price": "99,500.00",
"realized_pnl": "11.59",
"return_pct": "+11.59%"
},
"new_balance": "511.59"
}
Get your open perpetual positions.
{
"success": true,
"positions": [
{
"id": "pos_abc123",
"symbol": "BTC-PERP",
"side": "long",
"size_usd": "500.00",
"entry_price": "97,245.50",
"current_price": "98,100.00",
"leverage": 5,
"margin_used": "100.00",
"unrealized_pnl": "4.39",
"return_pct": "+4.39%",
"liquidation_price": "77,796.40"
}
],
"total_margin": "100.00",
"total_unrealized_pnl": "4.39"
}
Swap
Swap tokens across chains using 1inch aggregator.
Get a quote for a token swap.
| Name | Type | Description |
|---|---|---|
| from_token | string required | Token to sell |
| to_token | string required | Token to buy |
| amount | string required | Amount to sell |
| chain | string optional | Chain (default: base) |
curl "https://api.moltfi.com/v1/swap/quote?from_token=ETH&to_token=USDC&amount=0.5&chain=base" \
-H "Authorization: Bearer moltfi_xxxxxxxxxxxx"
{
"success": true,
"quote": {
"from_token": "ETH",
"to_token": "USDC",
"from_amount": "0.5",
"to_amount": "1,622.75",
"rate": "3,245.50",
"price_impact": "0.02%",
"gas_estimate": "$0.45",
"expires_at": "2026-02-01T12:01:00Z"
}
}
Execute a token swap.
| Name | Type | Description |
|---|---|---|
| from_token | string required | Token to sell |
| to_token | string required | Token to buy |
| amount | string required | Amount to sell |
| chain | string optional | Chain (default: base) |
| slippage | string optional | Max slippage % (default: 0.5) |
curl -X POST https://api.moltfi.com/v1/swap/execute \
-H "Authorization: Bearer moltfi_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"from_token": "ETH",
"to_token": "USDC",
"amount": "0.5",
"chain": "base",
"slippage": "0.5"
}'
{
"success": true,
"swap": {
"id": "swap_xyz789",
"from_token": "ETH",
"to_token": "USDC",
"from_amount": "0.5",
"to_amount": "1,621.50",
"rate": "3,243.00",
"tx_hash": "0x8f3a...",
"status": "completed"
}
}
Bridge
Bridge tokens across chains using Relay.
Bridge tokens to another chain.
| Name | Type | Description |
|---|---|---|
| token | string required | Token to bridge |
| amount | string required | Amount to bridge |
| from_chain | string required | Source chain |
| to_chain | string required | Destination chain |
base, ethereum, polygon, arbitrum, optimism, avalanche
curl -X POST https://api.moltfi.com/v1/bridge \
-H "Authorization: Bearer moltfi_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"token": "USDC",
"amount": "100.00",
"from_chain": "base",
"to_chain": "polygon"
}'
{
"success": true,
"bridge": {
"id": "br_abc123",
"token": "USDC",
"amount": "100.00",
"from_chain": "base",
"to_chain": "polygon",
"fee": "0.50",
"receive_amount": "99.50",
"status": "pending",
"estimated_time": "2-5 minutes",
"source_tx": "0x8f3a..."
}
}
Check the status of a bridge transaction.
{
"success": true,
"bridge": {
"id": "br_abc123",
"status": "completed",
"source_tx": "0x8f3a...",
"dest_tx": "0x9b4c...",
"completed_at": "2026-02-01T12:03:45Z"
}
}
Prices
Get real-time token prices.
Get the current price of a token.
curl https://api.moltfi.com/v1/prices/ETH \
-H "Authorization: Bearer moltfi_xxxxxxxxxxxx"
{
"success": true,
"token": "ETH",
"price_usd": "3,245.50",
"change_24h": "+1.8%",
"market_cap": "$390B",
"volume_24h": "$12B"
}
Get prices for multiple tokens.
| Name | Type | Description |
|---|---|---|
| tokens | string required | Comma-separated list of tokens |
curl "https://api.moltfi.com/v1/prices?tokens=BTC,ETH,SOL" \
-H "Authorization: Bearer moltfi_xxxxxxxxxxxx"
{
"success": true,
"prices": {
"BTC": {
"price_usd": "97,245.50",
"change_24h": "+2.4%"
},
"ETH": {
"price_usd": "3,245.50",
"change_24h": "+1.8%"
},
"SOL": {
"price_usd": "125.30",
"change_24h": "-0.5%"
}
}
}