Skip to main content

Swaps

Introduction

The most prevalent method of engaging with Intrinsic is through swaps. Swapping is a simple process for end-users - a user chooses an ERC-20 token they possess and the token they wish to exchange it for. By executing a swap, the tokens they currently hold are sold in exchange for the other token in the pool at the given exchange rate, with a swap fee deducted. This fee is then rewarded to liquidity providers. Importantly, the process of swapping with the Intrinsic protocol is permissionless, allowing users to participate freely.

Swaps performed through the Intrinsic protocol diverge from traditional order book trades in their execution process. Instead of being matched against specific orders in a sequential manner, swaps are executed against a passive liquidity pool. Liquidity providers who contribute capital to the pool earn fees that are proportionate to their committed funds.


Price Dynamics

In a conventional order-book market, a significant market-buy order has the potential to exhaust the existing liquidity from a previous limit-sell order and proceed to execute against a subsequent limit-sell order at a higher price. As a result, the final execution price of the order falls within the range of the two limit-sell prices against which the order was fulfilled.

Price impact influences the execution price of a swap in a similar manner, albeit through a distinct mechanism. When employing an automated market maker, the relative value of one asset in relation to the other undergoes continuous change throughout the swap execution. This dynamic results in the final execution price landing somewhere between the initial and final relative price.

As an integral element of AMM design, this dynamic impacts every swap conducted through the Intrinsic protocol.

Due to the variability of liquidity at different price points, the price impact for a particular swap size is influenced by the amount of liquidity accessible at each price level. When greater liquidity is present at a specific price, the price impact for a given swap size diminishes. Conversely, if there is lower liquidity available, the price impact for the same swap size increases.

The Intrinsic user interface provides real-time estimates of an approximate price impact, allowing users to anticipate and evaluate the potential impact on prices during a swap. In case of an unusually high price impact expected during a swap, the interface will display a warning. Thus, individuals executing a swap retain the capability to assess the price impact situation as necessary.

Price Slippage

When conducting swaps using Intrinsic, another important aspect to consider is slippage. Slippage refers to potential changes in a specific price that may transpire while a transaction is pending.

Upon submitting transactions to the RSK network, their execution order is determined by the gas fee provided for each transaction. A higher fee leads to faster execution, while transactions with lower gas fees remain pending for an uncertain duration. Throughout this pending period, the price environment in which the transaction will ultimately be executed undergoes changes due to the occurrences of other swaps.

Slippage tolerances define a permissible range of change beyond the price impact that a user finds acceptable. As long as the execution price falls within the designated slippage range, for example 2% unfavorably, the transaction will be successfully executed. However, if the execution price ends up outside the accepted slippage range, the transaction will fail, and the swap will not take place.

A similar scenario in a traditional market would involve a market-buy order executed with a delay. While the expected price of the market-buy order is known upon submission, significant changes can occur during the period between submission and execution.