Skip to main content
POST
/
api
/
v1
/
swap
Build swap transaction
curl --request POST \
  --url https://api.argyros.xyz/api/v1/swap \
  --header 'Content-Type: application/json' \
  --data '
{
  "userWallet": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
  "inputMint": "So11111111111111111111111111111111111111112",
  "outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
  "amount": "1000000000",
  "swapMode": "ExactIn",
  "slippageBps": 50,
  "skipSimulation": false
}
'
{
  "success": true,
  "data": {
    "transaction": "<string>",
    "lastValidBlockHeight": 245832190,
    "amountIn": "1000000000",
    "amountOut": "145320000",
    "feeAmount": "0",
    "route": [
      "<string>"
    ],
    "hopCount": 1,
    "pools": [
      "<string>"
    ],
    "minAmountOut": "<string>",
    "maxAmountIn": "<string>",
    "simulation": {
      "success": true,
      "logs": [
        "<string>"
      ],
      "computeUnitsConsumed": 85000,
      "insufficientFunds": true,
      "slippageExceeded": true,
      "error": "<string>"
    },
    "computeUnitsEstimate": 85000,
    "isSplitRoute": false,
    "splitPercents": [
      123
    ]
  }
}

Body

application/json

Parameters for building a swap transaction.

userWallet
string
required

User's wallet address that will sign and execute the transaction.

Example:

"9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM"

inputMint
string
required

Input token mint address.

Example:

"So11111111111111111111111111111111111111112"

outputMint
string
required

Output token mint address.

Example:

"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"

amount
string
required

Amount in smallest token units.

Example:

"1000000000"

swapMode
enum<string>
required

ExactIn: amount is exact input. ExactOut: amount is exact desired output.

Available options:
ExactIn,
ExactOut
Example:

"ExactIn"

slippageBps
integer
default:50

Slippage tolerance in basis points. Default: 50 (0.5%).

Example:

50

skipSimulation
boolean
default:false

Skip transaction simulation. Faster but no pre-flight validation. Default: false.

Example:

false

Response

Swap transaction built successfully.

success
boolean
Example:

true

data
object

Unsigned swap transaction and execution details.