NEAR Intents: Swap Types
Every quote request includes a swapType that sets how the amount field is read and how your deposit is handled. Open the option that fits your use case below, each one has a full example request, with the highlighted lines showing what makes it different.
[!NOTE]
slippageToleranceis in basis points (100= 1%) across every swap type below.
EXACT_INPUT — fix the amount you send
You commit to sending an exact
amountoforiginAsset; the quote returns the output you'll receive.{ "dry": false, "swapType": "EXACT_INPUT", "slippageTolerance": 100, "originAsset": "nep141:wrap.near", "depositType": "INTENTS", "destinationAsset": "nep141:usdt.tether-token.near", "amount": "1000000000000000000000000", "recipient": "user.near", "recipientType": "INTENTS", "refundTo": "user.near", "refundType": "INTENTS", "deadline": "2025-01-01T00:00:00.000Z" }
amountis the 1 NEAR you intend to send (in yoctoNEAR).{ "amountIn": "1000000000000000000000000", "amountOut": "10000000" }
amountOutis the output you'll receive for sending exactlyamount.Deposit handling
Deposit below
amountIn→ refunded by thedeadline.Deposit above
amountIn→ swap proceeds; the excess is refunded torefundTo.[!NOTE]
The example routes through depositType
INTENTS;ORIGIN_CHAINandDESTINATION_CHAINalso work (see the Quickstart).CONFIDENTIAL_INTENTSis also supported.
EXACT_OUTPUT — fix the amount you receive
You commit to receiving an exact
amountofdestinationAsset; the quote returns the input required. Slippage applies to the input side.{ "dry": false, "swapType": "EXACT_OUTPUT", "slippageTolerance": 100, "originAsset": "nep141:wrap.near", "depositType": "INTENTS", "destinationAsset": "nep141:usdt.tether-token.near", "amount": "10000000", "recipient": "user.near", "recipientType": "INTENTS", "refundTo": "user.near", "refundType": "INTENTS", "deadline": "2025-01-01T00:00:00.000Z" }
amountis the 10 USDT you want to end up with. The response returnsamountIn(the input to send, with slippage baked in) andminAmountIn(the minimum actually needed).Deposit handling
Deposit below
minAmountIn→ refunded by thedeadline.Deposit above
amountIn→ swap proceeds; the excess is refunded torefundTo.[!TIP]
amountInlooks higher thanminAmountInby roughly your slippage. That gap is a buffer to guarantee execution, not a worse price — anything unused is refunded.[!NOTE]
The example routes through depositType
INTENTS;ORIGIN_CHAINandDESTINATION_CHAINalso work (see the Quickstart).CONFIDENTIAL_INTENTSis also supported.
FLEX_INPUT — one token, variable amount
Still one known
originAssetthrough one deposit address, but the deposit amount can vary within a band. Use it when you don't know the exact amount at quote time — for example, sweeping a wallet whose balance is still settling.{ "dry": false, "swapType": "FLEX_INPUT", "slippageTolerance": 100, "originAsset": "nep141:wrap.near", "depositType": "INTENTS", "destinationAsset": "nep141:usdt.tether-token.near", "amount": "1000000000000000000000000", "recipient": "user.near", "recipientType": "INTENTS", "refundTo": "user.near", "refundType": "INTENTS", "deadline": "2025-01-01T00:00:00.000Z" }
slippageToleranceapplies to both sides, so the quote comes back as a band:{ "amountIn": "1000000000000000000000000", "minAmountIn": "990000000000000000000000", "amountOut": "10000000", "minAmountOut": "9900000" }Deposit handling (for the 1 NEAR → ~10 USDT quote above, at 1% slippage)
Deposit 0.99 NEAR or more → swapped; you receive at least 9.9 USDT.
Deposit above the quoted 1 NEAR → still swapped (the quote is not a cap).
Deposit below 0.99 NEAR → refunded after the
deadline, as long as the total received stays underminAmountIn.[!NOTE]
The example routes through depositType
INTENTS;ORIGIN_CHAINandDESTINATION_CHAINalso work (see the Quickstart).CONFIDENTIAL_INTENTSis not supported forFLEX_INPUT.
ANY_INPUT — collect many tokens into one
Fixes only
destinationAssetandrecipient— there's no fixed origin asset, chain, amount, or up-front rate. It's a standing deposit-and-sweep account: setoriginAssetto1cs_v1:anyandamountto"0".{ "dry": false, "swapType": "ANY_INPUT", "slippageTolerance": 100, "originAsset": "1cs_v1:any", "depositType": "INTENTS", "destinationAsset": "nep141:usdt.tether-token.near", "amount": "0", "recipient": "user.near", "recipientType": "INTENTS", "refundTo": "user.near", "refundType": "INTENTS", "deadline": "2025-01-01T00:00:00.000Z" }Deposit handling
Deposits arrive in any supported token into an Intents account and accumulate.
depositTypemust beINTENTSorCONFIDENTIAL_INTENTS.They're periodically converted into
destinationAssetand withdrawn torecipientonce the pool clears a $1,000 USD threshold.Each conversion is quoted at sweep time, so there's no fixed rate when you create the quote.
The
deadlineis checked only at creation — the collector then runs indefinitely, so one quote keeps aggregating without being refreshed.There are no refunds: a failed swap retries every 5 minutes rather than returning funds, so set
refundToto an address you control.[!WARNING]
ANY_INPUTis available to authorized partners only — requests without a valid partner are rejected. Get access via the Partner Dashboard. PublicANY_INPUTquote requests cannot containappFees.[!TIP]
The most common use of
ANY_INPUTis fee aggregation. For the end-to-end setup steps such as getting a collection address, wiring it intoappFees.recipient, and tracking withdrawals, see Fee Configuration → Fee Aggregation.