swap
Exchange tokens using Typus Perp's liquidity pool on Sui.
Instructions
Swap tokens using Typus Perp liquidity pool. Requires PRIVATE_KEY in .env.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"fromToken": "<fromToken>",
"toToken": "<toToken>",
"amount": "<amount>",
"perpIndex": "<perpIndex>"
},
"name": "swap"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | Amount to swap (raw integer with fromToken decimals) | |
| toToken | Yes | Token to swap to, e.g. 'SUI' | |
| fromToken | Yes | Token to swap from, e.g. 'USDC' | |
| perpIndex | Yes | Perp market index. 0 = main market (SUI, BTC, ETH, etc.), 1 = TYPUS market. |