Request a swap quote
Generates a swap quote based on input parameters such as the assets, amount, slippage tolerance, and recipient/refund information.
Returns pricing details, estimated time, and a unique deposit address to which tokens must be transferred to initiate the swap.
You can set the dry parameter to true to simulate the quote request without generating a deposit address or initiating the swap process. This is useful for previewing swap parameters or validating input data without committing to an actual swap.
This endpoint is the first required step in the swap process.
Documentation Index
Fetch the complete documentation index at: https://docs.near-intents.org/llms.txt
Use this file to discover all available pages before exploring further.
Authorizations
API key for partner authentication (recommended)
Body
Flag indicating whether this is a dry run request.
If true, the response will NOT contain the following fields:
depositAddresstimeWhenInactivedeadline
true
How to interpret amount (and refunds) when performing the swap:
-
EXACT_INPUT— requests the output amount for an exact input.- If deposit is less than
amountIn, the deposit is refunded by deadline. - If deposit is above than
amountIn, the swap is processed and the excess is refunded torefundToaddress after swap is complete.
- If deposit is less than
-
EXACT_OUTPUT— requests the input amount for an exact output.- The output amount (
amountOut) is fixed; slippage is applied to the input side. - The quote response includes
amountIn(the proposed input with slippage tolerance baked in) andminAmountIn(the minimum input required). - Important:
amountInwill appear higher thanminAmountInby approximately yourslippageTolerance. This is not price degradation—it is a buffer to ensure successful execution. Any input amount above what is actually needed for the swap is refunded to yourrefundToaddress after the swap completes. - If the deposit is above
amountIn, the swap is processed and the excess is refunded torefundToaddress after swap is complete. - If the deposit is less than
minAmountIn, the deposit is refunded by deadline.
- The output amount (
-
FLEX_INPUT— a flexible input amount that allows for partial deposits and variable amounts.slippageapplies both toamountOutandamountInand defines an acceptable range (minAmountInandminAmountOut).- Any amount higher than
minAmountInis accepted and converted to the output asset as long asminAmountOutis met. - The deposit must be at least
minAmountIn, after applying the slippage constraint to the quoted amount. Deposits belowminAmountInare refunded if the total received by the deadline is below this amount. - If deposits exceed the upper bound, the swap is still processed
EXACT_INPUT, EXACT_OUTPUT, FLEX_INPUT, ANY_INPUT Slippage tolerance for the swap. This value is in basis points (1/100th of a percent), e.g. 100 for 1% slippage.
100
ID of the origin asset.
"nep141:arb-0xaf88d065e77c8cc2239327c5edb3a432268e5831.omft.near"
Type of deposit address:
ORIGIN_CHAIN- deposit address on the origin chain.INTENTS- the account ID within NEAR Intents to which you should transfer assets.
ORIGIN_CHAIN, INTENTS, CONFIDENTIAL_INTENTS ID of the destination asset.
"nep141:sol-5ce3bf3a31af18be40ba30f721101b4341690186.omft.near"
Amount to swap as the base amount. It is interpreted as the input or output amount based on the swapType flag and is specified in the smallest unit of the currency (e.g., wei for ETH). Must be an integer string; decimal values like "0.01" are invalid—use base units (e.g. "10000000000000000" for 0.01 with 18 decimals).
"1000"
Address used for refunds.
"0x2527D02599Ba641c19FEa793cD0F167589a0f10D"
Type of refund address:
ORIGIN_CHAIN- assets are refunded to therefundToaddress on the origin chain.INTENTS- assets are refunded to therefundToIntents account.
ORIGIN_CHAIN, INTENTS, CONFIDENTIAL_INTENTS Recipient address. The format must match recipientType. Destination routing metadata, when required, must be encoded according to the destination chain address format.
"13QkxhNMrTPxoCkRdYdJ65tFuwXPhL5gLS2Z5Nr6gjRK"
Type of recipient address:
DESTINATION_CHAIN- assets are transferred to the chain ofdestinationAsset.INTENTS- assets are transferred to an account inside Intents
DESTINATION_CHAIN, INTENTS, CONFIDENTIAL_INTENTS Timestamp in ISO format that identifies when the user refund begins if the swap isn't completed by then. It must exceed the time required for the deposit transaction to be mined. For example, Bitcoin may require around one hour depending on the fees paid.
"2019-08-24T14:15:22Z"
What deposit address mode you will get in the response, most chain supports only SIMPLE and some(for example stellar) only MEMO:
SIMPLE- usual deposit with only deposit address.MEMO- some chains will REQUIRE thememotogether withdepositAddressfor swap to work.
depositMode applies only to deposit transaction metadata.
SIMPLE, MEMO "SIMPLE"
Addresses of connected wallets.
["0x123...", "0x456..."]Unique client session identifier for 1Click.
"session_abc123"
EVM address of a transfer recipient in a virtual chain
"0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C"
EVM address of a refund recipient in a virtual chain
"0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C"
HIGHLY EXPERIMENTAL Message to pass to ft_transfer_call when withdrawing assets to NEAR.
Otherwise, ft_transfer will be used.
WARNING: Funds will be lost if used with non NEP-141 tokens, in case of insufficient storage_deposit or if the recipient does not implement ft_on_transfer method.
"smart-contract-recipient.near"
Confidentiality mode for this quote. Invite-only for now: if set, API may return an invite-only message until rollout is enabled for your integration.
public, basic, advanced "basic"
Distribution channel / venue identifier (for example: ledger, trustwallet). Keep lowercase for consistency.
"ledger"
Rebate distribution for this quote. Provide up to 3 confidential Intents recipients (for example, rebate-recipient.near on confidential Intents); each item defines a recipient and its percent share, and all shares must add up to 100.
[
{
"recipient": "rebate-recipient.near",
"share": 20
},
{
"recipient": "partner-2.near",
"share": 80
}
]Time in milliseconds the user is willing to wait for a quote from the relay. **Defaults to 0ms delay if not specified, if you want to receive the fastest quote.
3000
List of recipients and their fees
Response
Unique identifier for request tracing and debugging
"550e8400-e29b-41d4-a716-446655440000"
Timestamp in ISO format that was used to derive the deposit address
"2019-08-24T14:15:22Z"
Signature of the 1Click service confirming the quote for the specific deposit address. Must be saved on the client side (along with the whole quote) in order to resolve any disputes or mistakes.
User request
Response containing the deposit address for sending the amount of originAsset and the expected output amount.