Skip to Content
API ReferenceSwap Quotes

Swap Quotes

getUniswapV2Quote

Gets a swap quote from the Uniswap V2 Router02 contract using getAmountsOut (constant-product x*y=k AMM). On-chain read - no transaction needed. Router02 only deployed on Ethereum.

curl -X POST https://your-endpoint.simplystaking.xyz/v1 \
  -H "Content-Type: application/json" \
{
  "jsonrpc": "2.0",
  "method": "getUniswapV2Quote",
  "params": {
    "chain": "ethereum",
    "tokenIn": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
    "tokenOut": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "amount": "1.0"
  },
  "id": 1
}

Parameters

NameRequiredDescription
chainyesNetwork slug
tokenInyesInput token contract address
e.g. 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
tokenOutyesOutput token contract address
e.g. 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
amountyesInput amount (human-readable, e.g. "1.0")
e.g. 1.0

Response Fields

FieldType
dataobject
chainstring
tokenInstring
tokenOutstring
amountInstring
amountOutstring

Supported Networks

Ethereum
Try It
{
  "jsonrpc": "2.0",
  "method": "getUniswapV2Quote",
  "params": {
    "chain": "ethereum",
    "tokenIn": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
    "tokenOut": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "amount": "1.0"
  },
  "id": 1
}

getUniswapV3Quote

Gets an exact-input swap quote from the Uniswap V3 QuoterV2 contract. On-chain read - no transaction needed.

curl -X POST https://your-endpoint.simplystaking.xyz/v1 \
  -H "Content-Type: application/json" \
{
  "jsonrpc": "2.0",
  "method": "getUniswapV3Quote",
  "params": {
    "chain": "ethereum",
    "tokenIn": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
    "tokenOut": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "amount": "1.0",
    "fee": 3000,
    "blockHeight": 19834521
  },
  "id": 1
}

Parameters

NameRequiredDescription
chainyesNetwork slug
tokenInyesInput token contract address
e.g. 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
tokenOutyesOutput token contract address
e.g. 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
amountyesInput amount (human-readable, e.g. "1.0")
e.g. 1.0
feenoPool fee tier in bps
Options: 500, 3000, 10000
blockHeightnoHistorical EVM block number (archive nodes only)
e.g. 19834521

Response Fields

FieldType
dataobject
chainstring
tokenInstring
tokenOutstring
amountInstring
amountOutstring
feeinteger
blockHeightinteger
gasEstimatestring

Supported Networks

EthereumPolygonArbitrumOptimismBaseBNB ChainAvalanche
Try It
{
  "jsonrpc": "2.0",
  "method": "getUniswapV3Quote",
  "params": {
    "chain": "ethereum",
    "tokenIn": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
    "tokenOut": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "amount": "1.0",
    "fee": 3000,
    "blockHeight": 19834521
  },
  "id": 1
}

getUniswapV4Quote

Gets a swap quote from the Uniswap V4 Quoter contract (singleton PoolManager architecture with hooks). On-chain read via staticCall.

curl -X POST https://your-endpoint.simplystaking.xyz/v1 \
  -H "Content-Type: application/json" \
{
  "jsonrpc": "2.0",
  "method": "getUniswapV4Quote",
  "params": {
    "chain": "ethereum",
    "tokenIn": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
    "tokenOut": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "amount": "1.0",
    "fee": 3000,
    "tickSpacing": 60,
    "blockHeight": 19834521
  },
  "id": 1
}

Parameters

NameRequiredDescription
chainyesNetwork slug
tokenInyesInput token contract address
e.g. 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
tokenOutyesOutput token contract address
e.g. 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
amountyesInput amount (human-readable, e.g. "1.0")
e.g. 1.0
feenoPool fee in bps (default 3000)
e.g. 3000
tickSpacingnoTick spacing (default 60)
e.g. 60
blockHeightnoHistorical EVM block number (archive nodes only)
e.g. 19834521

Response Fields

FieldType
dataobject
chainstring
tokenInstring
tokenOutstring
amountInstring
amountOutstring
feeinteger
tickSpacinginteger
blockHeightinteger
gasEstimatestring

Supported Networks

EthereumOptimismBaseArbitrumPolygonBNB ChainAvalanche
Try It
{
  "jsonrpc": "2.0",
  "method": "getUniswapV4Quote",
  "params": {
    "chain": "ethereum",
    "tokenIn": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
    "tokenOut": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "amount": "1.0",
    "fee": 3000,
    "tickSpacing": 60,
    "blockHeight": 19834521
  },
  "id": 1
}

Endpoint "defi-uniswap-v3-token" not found

getJupiterQuote

Gets a swap quote from the Jupiter aggregator for Solana SPL tokens. Returns route plan, price impact, and output amount. Chain is fixed to Solana.

curl -X POST https://your-endpoint.simplystaking.xyz/v1 \
  -H "Content-Type: application/json" \
{
  "jsonrpc": "2.0",
  "method": "getJupiterQuote",
  "params": {
    "inputMint": "So11111111111111111111111111111111111111112",
    "outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
    "amount": "1000000000",
    "slippageBps": 50
  },
  "id": 1
}

Parameters

NameRequiredDescription
inputMintyesInput SPL token mint address
e.g. So11111111111111111111111111111111111111112
outputMintyesOutput SPL token mint address
e.g. EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
amountyesInput amount in raw units (lamports)
e.g. 1000000000
slippageBpsnoSlippage tolerance in bps (default 50)
e.g. 50

Response Fields

FieldType
dataobject
inputMintstring
outputMintstring
amountInstring
amountOutstring
priceImpactPctstring
routePlanobject[]
swapInfoobject
ammKeystring
labelstring
inputMintstring
outputMintstring
percentinteger

Supported Networks

Solana
Try It
{
  "jsonrpc": "2.0",
  "method": "getJupiterQuote",
  "params": {
    "inputMint": "So11111111111111111111111111111111111111112",
    "outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
    "amount": "1000000000",
    "slippageBps": 50
  },
  "id": 1
}

getJupiterPrice

Gets the current price of a Solana token by quoting 1 unit against a reference token (e.g. USDC). Derived from Jupiter quote API. Chain is fixed to Solana.

curl -X POST https://your-endpoint.simplystaking.xyz/v1 \
  -H "Content-Type: application/json" \
{
  "jsonrpc": "2.0",
  "method": "getJupiterPrice",
  "params": {
    "inputMint": "So11111111111111111111111111111111111111112",
    "outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
  },
  "id": 1
}

Parameters

NameRequiredDescription
inputMintyesToken mint to price
e.g. So11111111111111111111111111111111111111112
outputMintyesReference token mint (e.g. USDC)
e.g. EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v

Response Fields

FieldType
dataobject
pricenumber

Supported Networks

Solana
Try It
{
  "jsonrpc": "2.0",
  "method": "getJupiterPrice",
  "params": {
    "inputMint": "So11111111111111111111111111111111111111112",
    "outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
  },
  "id": 1
}