Skip to main content

Swapping Tokens

1EX offers exactInput and exactOutput swaps, providing flexibility and convenience for various trading strategies.

Simple Swap

A simple swap allows users to directly exchange one token for another in a single transaction. Users can choose between exact input or exact output swaps, depending on their preference for specifying the input or output token amount.

Multi-Hop Swap

A multi-hop swap involves trading through multiple token pairs to reach the desired output token, potentially providing better rates or increased liquidity. The 1EX routing algorithm automatically determines the most efficient route for a multi-hop swap, considering available liquidity and potential price impact.

Trade Execution and Confirmation

Before executing a swap, users can review the trade details, including the expected price, slippage tolerance, and estimated gas fees. Once the user confirms the transaction, it is submitted to the supported blockchain for processing. The trade will either be completed within the specified transaction deadline or canceled if the deadline is not met.

Trade History

Users can access their trade history on the 1EX platform, providing a record of all executed swaps, including details such as the date, time, token pairs, and amounts traded. This information can be useful for tracking trading activity and performance over time.

ExactInput Swap

In an exactInput swap, users specify the exact input value of a token they want to swap. The system then calculates the corresponding output value based on current market conditions and available liquidity.

ExactOutput Swap

With exactOutput swaps, users input the desired output value of the token they wish to receive. The system calculates the required input value needed to achieve this output, considering the prevailing exchange rate and liquidity.

This section covers key terms and concepts related to token swaps on the 1EX platform, helping users understand the various aspects involved in executing trades.

Slippage

The potential difference between the expected price of a trade and the executed price, resulting from market fluctuations. Users can set a tolerance level for slippage to minimize the risk of unfavorable price movements.

Transaction Deadline

The maximum time a transaction can take before it becomes ineligible for execution. This helps users manage their trades more effectively by ensuring that a swap will only be executed within a specified time frame. If a transaction is not executed within the deadline, it will not be removed from the network. However, when it is eventually processed by miners, the smart contract will detect that the deadline has passed and prevent the swap from being completed. This way, users can avoid unwanted trades due to unexpected market fluctuations or network congestion.

Gas

The fee required to perform a transaction on a blockchain network. Gas fees compensate miners or validators for processing and validating transactions.

Gas Price

The cost of executing a transaction, typically measured in Gwei. Users can adjust gas prices to prioritize transaction speed or cost-efficiency.

Token Approve

The process of granting permission for a smart contract to interact with your tokens. This step is necessary before executing certain actions, such as trading or providing liquidity.

Wrapping/Unwrapping

Converting a native coin into a tokenized version (wrapped) or vice versa (unwrapped) to facilitate trading on the decentralized exchange. Wrapped tokens maintain a 1:1 value peg to their native counterparts.

Exact Input

A type of swap where users specify the exact amount of a token they want to trade, and the system calculates the corresponding output amount based on the current market conditions.

Exact Output

A type of swap where users specify the exact amount of a token they want to receive, and the system calculates the required input amount based on the current market conditions.

Price Impact

The change in the price of an asset resulting from the execution of a trade. Large trades can have a significant impact on the market price, which may affect the trader's expected outcome.

Slippage Tolerance

The maximum allowable difference between the expected price of a trade and the actual price at which it is executed. Users can set their slippage tolerance to minimize the risk of unfavorable price movements during a trade.

Route

The sequence of token pairs through which a trade is executed in a multi-hop swap. A route is determined by the 1EX routing algorithm, which finds the most efficient path for a trade, taking into account available liquidity and potential price impact.

Swap Fee

A small percentage of each trade, paid by the trader, which is distributed to the liquidity providers who facilitate the swap. The fee varies based on the pool fee tier (0.01%, 0.05%, 0.3%, or 1%).

Understanding these swap-related terms and concepts allows users to make more informed decisions when trading on the 1EX platform, optimizing their trading strategies and managing their assets effectively.