Skip to main content
Glama

jupiter_swap

Destructive

Execute a token swap via Jupiter (non-custodial).

submit_mode (optional): your execution preference. Omitted/"public" = public-RPC broadcast (default, unchanged). "mev_protected" = the tx is built with a Jito tip you pay (jito_tip_lamports, default 10,000) and relayed to the Jito block engine as a bundle. Use the same mode on build and broadcast. A failed protected submit returns an error and is NOT sent publicly unless you set mev_fallback_public=true. The response execution block names the mode and tip. Mainnet only. Never selected for you.

Without signed_transaction: returns an UNSIGNED base64 transaction for your wallet to sign + broadcast. With signed_transaction: broadcasts the caller-signed tx and returns tx_signature. amount is in base units of input_token. Includes the Crank technology service fee when a referral fee account is configured -- collected ON-CHAIN via Jupiter's platformFeeBps, deducted from swap output. Swaps are NOT additionally gated by x402 (that would double-charge the same fee), so payment_header stays a no-op here (jupiter_swap is not in x402 PAID_TOOLS). pay_in_crank is NO LONGER a no-op: the on-chain rate is now derived from this wallet's volume tier and $CRANK staker / pay-in-$CRANK / Crank Score discounts, so a discounted wallet is quoted a lower platformFeeBps -- the same schedule x402 applies to perps/lend/stake.

slippage_bps omitted (None) resolves to the published platform default of 50 bps -- unchanged from before; the returned envelope's slippage.applied_source honestly reports "platform_default" in that case rather than falsely claiming "caller".

SECURITY: the output_token is run through multi-layer authenticity verification before any tx is built; an unverified/suspicious/fake token is blocked (UNVERIFIED_TOKEN). Set allow_unverified=true to trade an unverified token at your own risk (hard scam signals are never overridable).

venue_hint is ADVISORY, never required -- spot routes via Jupiter aggregation (the only spot venue today); an unknown hint raises, omitting it is unchanged from before.

Workflow: EXECUTE step -- deploy the directional/allocation leg after the risk phase capped the size. Non-custodial. Get a price first with get_quotes. See get_trading_workflow.

idempotency_key (optional): a client-generated UUID. Retrying the SAME call (build or broadcast) with the same key + same args replays the original result instead of re-executing -- guards against a timeout-then-retry double-swap. Reuse the SAME key across the build call and its signed_transaction broadcast retry (they dedupe independently); a NEW key means a genuinely new swap.

verify (default True): when broadcasting (signed_transaction supplied), await on-chain confirmation and re-read the output_token balance -- the response gains a verification block ({confirmed, slot, post_state, expected_vs_actual}). Gate follow-on decisions on verification.confirmed, never on tx_signature alone. Set False to skip for latency-sensitive callers. Verify any prior signature later with the standalone verify_transaction tool.

GEO GATE: when either leg is a tokenized security this call is geo-gated (Reg S = no US persons) and OFAC-screened, same control trade_equity enforces -- jurisdiction declares the caller's jurisdiction once (persisted for next time), ip is the caller's origin IP for the additional Reg-S IP layer. Non-security swaps are unaffected.

simulate (optional): true = rehearse this call. The full gate stack (capability, kill switch, session signer, wallet policy, permission mode, soft launch, venue / compliance / token checks, fee quote) is evaluated read-only and returned as verdicts + would_execute, with a paper fill where one applies. Nothing is built, signed, broadcast or charged. Omitted = your wallet's default_simulate setting; false = execute.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ipNo
amountYes
verifyNo
simulateNo
caller_idNo
venue_hintNo
input_tokenYes
submit_modeNo
jurisdictionNo
output_tokenYes
pay_in_crankNo
slippage_bpsNo
payment_headerNo
wallet_addressYes
idempotency_keyNo
allow_unverifiedNo
jito_tip_lamportsNo
signed_transactionNo
mev_fallback_publicNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / simulate
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "boolean"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
  2. Changed3 schema fields changed
    • addedInput schema / properties / jito_tip_lamports
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
    • addedInput schema / properties / mev_fallback_public
      Added value: +{
      +  "default": false,
      +  "type": "boolean"
      +}
    • addedInput schema / properties / submit_mode
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
  3. Changed3 schema fields changed
    • addedInput schema / properties / slippage_bps / anyOf
      Added value: +[
      +  {
      +    "type": "integer"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / slippage_bps / default
      Previous value: -50New value: +null
    • removedInput schema / properties / slippage_bps / type
      Removed value: -"integer"
  4. Changed2 schema fields changed
    • addedInput schema / properties / ip
      Added value: +{
      +  "default": "",
      +  "type": "string"
      +}
    • addedInput schema / properties / jurisdiction
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
  5. Changed1 schema field changed
    • addedInput schema / properties / verify
      Added value: +{
      +  "default": true,
      +  "type": "boolean"
      +}
  6. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources