List Protocols
List all available protocol adapters.
curl -H "x-api-key: dev-api-key" \
http://localhost:3000/api/v1/protocols
Response
{
"status": "success",
"data": {
"protocols": [
{
"protocol": "system-program",
"version": "1.0.0",
"capabilities": ["transfer_sol", "create_account"],
"programIds": ["11111111111111111111111111111111"]
},
{
"protocol": "jupiter",
"version": "1.0.0",
"capabilities": ["swap", "quote"],
"programIds": ["JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4"]
}
]
}
}
Get Protocol Capabilities
Retrieve capabilities for a specific protocol.
curl -H "x-api-key: dev-api-key" \
http://localhost:3000/api/v1/protocols/jupiter/capabilities
Path Parameters
Protocol name: system-program, spl-token, jupiter, marinade, solend, metaplex, orca, raydium, escrow
Response
Array of supported operations
Array of on-chain program IDs
Get Protocol Version
Get protocol adapter version.
curl -H "x-api-key: dev-api-key" \
http://localhost:3000/api/v1/protocols/jupiter/version
Protocol Health
Check health of all protocol adapters.
curl -H "x-api-key: dev-api-key" \
http://localhost:3000/api/v1/protocols/health
Get Specific Protocol Health
curl -H "x-api-key: dev-api-key" \
http://localhost:3000/api/v1/protocols/escrow/health
Response
{
"status": "success",
"data": {
"protocol": "escrow",
"ok": true,
"configured": true,
"deployed": true,
"programId": "EscrowProgramId1111111111111111111111111111"
}
}
Compatibility Check
Check if a protocol supports a specific intent.
curl -X POST \
-H "x-api-key: dev-api-key" \
-H "Content-Type: application/json" \
-d '{
"type": "swap",
"intent": {
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
}
}' \
http://localhost:3000/api/v1/protocols/jupiter/compatibility-check
Migrate Intent
Migrate an intent from one protocol version to another.
curl -X POST \
-H "x-api-key: dev-api-key" \
-H "Content-Type: application/json" \
-d '{
"intent": {...},
"targetVersion": "2.0.0"
}' \
http://localhost:3000/api/v1/protocols/jupiter/migrate-intent
DeFi Operations
Get Quote
Get a swap quote from a DEX protocol.
curl -X POST \
-H "x-api-key: dev-api-key" \
-H "Content-Type: application/json" \
-d '{
"protocol": "jupiter",
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amount": "1000000",
"wallet": "7xKLvUhXW9XqHZzN3Jw8wVHGK6R4tN2gqV9mP3kL5eXy",
"slippageBps": 50
}' \
http://localhost:3000/api/v1/defi/quote
Request Body
DEX protocol: jupiter, orca, raydium
Output token mint address
Input amount (in token base units)
Slippage tolerance in basis points (default: 50)
Swap
Execute a token swap.
curl -X POST \
-H "x-api-key: dev-api-key" \
-H "Content-Type: application/json" \
-d '{
"protocol": "jupiter",
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amount": "1000000",
"wallet": "7xKLvUhXW9XqHZzN3Jw8wVHGK6R4tN2gqV9mP3kL5eXy",
"slippageBps": 50
}' \
http://localhost:3000/api/v1/defi/swap
This is a convenience endpoint. For full transaction control, use POST /api/v1/transactions with type: "swap".
Stake
Stake SOL with a staking protocol.
curl -X POST \
-H "x-api-key: dev-api-key" \
-H "Content-Type: application/json" \
-d '{
"protocol": "marinade",
"wallet": "7xKLvUhXW9XqHZzN3Jw8wVHGK6R4tN2gqV9mP3kL5eXy",
"amount": "1000000000",
"validator": "optional-validator-address"
}' \
http://localhost:3000/api/v1/defi/stake
Request Body
Staking protocol: marinade, solend
Amount to stake in lamports
Specific validator address (optional)
Unstake
Unstake SOL from a staking protocol.
curl -X POST \
-H "x-api-key: dev-api-key" \
-H "Content-Type: application/json" \
-d '{
"protocol": "marinade",
"wallet": "7xKLvUhXW9XqHZzN3Jw8wVHGK6R4tN2gqV9mP3kL5eXy",
"amount": "1000000000"
}' \
http://localhost:3000/api/v1/defi/unstake
Lend - Supply
Supply tokens to a lending protocol.
curl -X POST \
-H "x-api-key: dev-api-key" \
-H "Content-Type: application/json" \
-d '{
"protocol": "solend",
"wallet": "7xKLvUhXW9XqHZzN3Jw8wVHGK6R4tN2gqV9mP3kL5eXy",
"mint": "So11111111111111111111111111111111111111112",
"amount": "1000000000"
}' \
http://localhost:3000/api/v1/defi/lend/supply
Request Body
Token mint address to supply
Amount to supply (in token base units)
Lend - Borrow
Borrow tokens from a lending protocol.
curl -X POST \
-H "x-api-key: dev-api-key" \
-H "Content-Type: application/json" \
-d '{
"protocol": "solend",
"wallet": "7xKLvUhXW9XqHZzN3Jw8wVHGK6R4tN2gqV9mP3kL5eXy",
"mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amount": "1000000"
}' \
http://localhost:3000/api/v1/defi/lend/borrow
Escrow Operations
Create Escrow
Create a new escrow account.
curl -X POST \
-H "x-api-key: dev-api-key" \
-H "Content-Type: application/json" \
-d '{
"escrowNumericId": "900001",
"counterparty": "7xKLvUhXW9XqHZzN3Jw8wVHGK6R4tN2gqV9mP3kL5eXy",
"creator": "8yMLvVhYW0YrHZaN4Kx9xWIHK7S5tO3hqW0nQ4mM6fYz",
"arbiter": "9zNMvWhZW1ZsIZbO5Ly0yXJHL8T6tP4irX1oR5nN7gZa",
"feeRecipient": "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVv",
"amount": "10000000",
"deadlineUnixSec": 4102444800,
"terms": "Payment for services rendered"
}' \
http://localhost:3000/api/v1/escrow/create
Request Body
Unique numeric escrow identifier
Arbiter wallet address for dispute resolution
Fee recipient wallet address
Escrow amount in lamports
Escrow deadline (Unix timestamp)
Accept Escrow
Accept an existing escrow.
curl -X POST \
-H "x-api-key: dev-api-key" \
-H "Content-Type: application/json" \
-d '{
"escrowNumericId": "900001",
"creator": "8yMLvVhYW0YrHZaN4Kx9xWIHK7S5tO3hqW0nQ4mM6fYz"
}' \
http://localhost:3000/api/v1/escrow/900001/accept
Path Parameters
Release Escrow
Release funds to counterparty.
curl -X POST \
-H "x-api-key: dev-api-key" \
-H "Content-Type: application/json" \
-d '{
"escrowNumericId": "900001",
"creator": "8yMLvVhYW0YrHZaN4Kx9xWIHK7S5tO3hqW0nQ4mM6fYz",
"counterparty": "7xKLvUhXW9XqHZzN3Jw8wVHGK6R4tN2gqV9mP3kL5eXy",
"feeRecipient": "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVv"
}' \
http://localhost:3000/api/v1/escrow/900001/release
Refund Escrow
Refund funds to creator.
curl -X POST \
-H "x-api-key: dev-api-key" \
-H "Content-Type: application/json" \
-d '{
"escrowNumericId": "900001",
"creator": "8yMLvVhYW0YrHZaN4Kx9xWIHK7S5tO3hqW0nQ4mM6fYz"
}' \
http://localhost:3000/api/v1/escrow/900001/refund
Dispute Escrow
Raise a dispute.
curl -X POST \
-H "x-api-key: dev-api-key" \
-H "Content-Type: application/json" \
-d '{
"escrowNumericId": "900001",
"creator": "8yMLvVhYW0YrHZaN4Kx9xWIHK7S5tO3hqW0nQ4mM6fYz"
}' \
http://localhost:3000/api/v1/escrow/900001/dispute
Resolve Dispute
Arbiter resolves a dispute.
curl -X POST \
-H "x-api-key: dev-api-key" \
-H "Content-Type: application/json" \
-d '{
"escrowNumericId": "900001",
"creator": "8yMLvVhYW0YrHZaN4Kx9xWIHK7S5tO3hqW0nQ4mM6fYz",
"winnerIsCreator": false
}' \
http://localhost:3000/api/v1/escrow/900001/resolve
Supported Protocols
System Program
SPL Token
Jupiter
Marinade
Solend
Escrow
Protocol: system-programCapabilities:
transfer_sol - Transfer SOL between accounts
create_account - Create new accounts
Program ID: 11111111111111111111111111111111 Protocol: spl-tokenCapabilities:
transfer_spl - Transfer SPL tokens
create_mint - Create new token mint
mint_token - Mint tokens to account
Program ID: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA Protocol: jupiterCapabilities:
swap - Token swaps with best price routing
quote - Get swap quotes
Program ID: JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4 Protocol: marinadeCapabilities:
stake - Stake SOL for mSOL
unstake - Unstake mSOL for SOL
Program ID: MarBmsSgKXdrN1egZf5sqe1TMai9K1rChYNDJgjq7aD Protocol: solendCapabilities:
lend_supply - Supply tokens to earn interest
lend_borrow - Borrow tokens against collateral
Program ID: So1endDq2YkqhipRh3WViPa8hdiSpxWy6z3Z6tMCpAo Protocol: escrowCapabilities:
create_escrow - Create escrow account
accept_escrow - Accept escrow terms
release_escrow - Release funds
refund_escrow - Refund to creator
dispute_escrow - Raise dispute
resolve_dispute - Arbiter resolution
Program ID: Configured via ESCROW_PROGRAM_ID