메인 콘텐츠로 건너뛰기
GET
/
v1
/
swap
/
quote
Swap Quote
curl --request GET \
  --url https://payments.magicblock.app/v1/swap/quote
{
  "inputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
  "inAmount": "1000000",
  "outputMint": "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",
  "outAmount": "999519",
  "otherAmountThreshold": "994522",
  "swapMode": "ExactIn",
  "slippageBps": 50,
  "priceImpactPct": "0",
  "routePlan": [
    {
      "swapInfo": {
        "ammKey": "DB3sUCP2H4icbeKmK6yb6nUxU5ogbcRHtGuq7W2RoRwW",
        "label": "HumidiFi",
        "inputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
        "outputMint": "So11111111111111111111111111111111111111112",
        "inAmount": "1000000",
        "outAmount": "11687625"
      },
      "percent": 100,
      "bps": null
    },
    {
      "swapInfo": {
        "ammKey": "4rJggoVMajEUtipev1XhSMjESYk8Zibz6CDHPtUe1mem",
        "label": "GoonFi V2",
        "inputMint": "So11111111111111111111111111111111111111112",
        "outputMint": "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",
        "inAmount": "11687625",
        "outAmount": "999519"
      },
      "percent": 100,
      "bps": null
    }
  ],
  "contextSlot": 414697033,
  "timeTaken": 0.001218
}

쿼리 매개변수

inputMint
string
필수

Input token mint address.

예시:

"So11111111111111111111111111111111111111112"

outputMint
string
필수

Output token mint address.

예시:

"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"

amount
string
필수

Raw amount to swap before decimals are applied, as an unsigned integer string.

Pattern: ^\d+$
예시:

"1000000"

slippageBps
integer

Slippage threshold in basis points.

필수 범위: x >= 0
예시:

50

swapMode
enum<string>

Use ExactIn for fixed input amount or ExactOut for fixed output amount.

사용 가능한 옵션:
ExactIn,
ExactOut
예시:

"ExactIn"

dexes
string

Optional comma-separated list of DEX labels to include.

예시:

"Raydium,Orca+V2"

excludeDexes
string

Optional comma-separated list of DEX labels to exclude.

예시:

"Meteora+DLMM"

restrictIntermediateTokens
boolean

Restrict intermediate tokens to a more stable set.

예시:

true

onlyDirectRoutes
boolean

Limit routing to a single hop.

예시:

false

asLegacyTransaction
boolean

Request a legacy transaction-compatible route.

예시:

false

platformFeeBps
integer

Optional platform fee in basis points.

필수 범위: x >= 0
예시:

20

maxAccounts
integer

Approximate maximum account budget for the route.

필수 범위: x >= 0
예시:

64

instructionVersion
enum<string>

Instruction format to target.

사용 가능한 옵션:
V1,
V2
예시:

"V1"

dynamicSlippage
boolean

Keep for compatibility with upstream quote parameters.

예시:

false

forJitoBundle
boolean

Exclude routes that are incompatible with Jito bundles.

예시:

false

supportDynamicIntermediateTokens
boolean

Allow dynamic selection of intermediate tokens.

예시:

false

응답

Swap quote

inputMint
string
필수
inAmount
string
필수
outputMint
string
필수
outAmount
string
필수
otherAmountThreshold
string
필수
swapMode
enum<string>
필수
사용 가능한 옵션:
ExactIn,
ExactOut
slippageBps
integer
필수
필수 범위: x >= 0
priceImpactPct
string
필수
routePlan
object[]
필수
instructionVersion
enum<string> | null
사용 가능한 옵션:
V1,
V2,
null
platformFee
object
contextSlot
integer
필수 범위: x >= 0
timeTaken
number