Blockchain network (e.g., polygon, ethereum, solana)
Token to sell — contract address or mint address
Token to buy — contract address or mint address
Amount of sellToken to swap (human-readable string)
Private key of the sender wallet for signing the transaction
Recipient address for the bought tokens (required for Solana)
Maximum acceptable slippage in basis points (default: 50 = 0.5%)
curl -X POST https://secureapi.gridlog.io/api/v1/crypto/swaps/execute \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"chain": "polygon",
"sellToken": "0x0000000000000000000000000000000000001010",
"buyToken": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
"amount": "10.0",
"privateKey": "0xPRIVATE_KEY...",
"slippageBps": 50
}'
{
"txHash": "0xabcdef...",
"success": true
}
On-chain transaction hash for the swap
Whether the swap transaction was successfully broadcast
Swaps are executed immediately at market price. Use slippageBps to protect against unfavorable price movement.