Skip to main content
Glama

SWAP

Execute token swaps on decentralized exchanges by building transactions with specified tokens, amounts, and slippage tolerance across blockchain networks.

Instructions

Building swap transaction

Input Schema

NameRequiredDescriptionDefault
chainNoThe blockchain network to execute the transaction on. uses fraxtal as defaultfraxtal
inTokenAddressYesThe token to swap from (address).
outTokenAddressYesThe token to swap to (address).
amountYesToken amount with decimals. For example, if 1 USDT is input, use 1000000 (1 USDT * 10^6).
slippageNoDefine the acceptable slippage level by inputting a percentage value within the range of 0.05 to 50. 1% slippage set as 1.1
accountYesuser's wallet address.

Input Schema (JSON Schema)

{ "properties": { "account": { "description": "user's wallet address.", "type": "string" }, "amount": { "description": "Token amount with decimals. For example, if 1 USDT is input, use 1000000 (1 USDT * 10^6). ", "pattern": "^\\d+$", "type": "string" }, "chain": { "default": "fraxtal", "description": "The blockchain network to execute the transaction on. uses fraxtal as default", "type": "string" }, "inTokenAddress": { "description": "The token to swap from (address).", "type": "string" }, "outTokenAddress": { "description": "The token to swap to (address).", "type": "string" }, "slippage": { "default": "1", "description": "Define the acceptable slippage level by inputting a percentage value within the range of 0.05 to 50. 1% slippage set as 1.", "type": "string" } }, "required": [ "inTokenAddress", "outTokenAddress", "amount", "account" ], "type": "object" }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/openocean-finance/openocean-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server