Learn how Relay handles surpluses or shortages.
Relay allows for users to instantly bridge or swap funds cross-chain while saving on gas. There are swaps or bridges where a surplus or shortage can happen. To understand how we handle either, we first need to understand how an origin operation can produce a surplus or shortage.
When starting a bridge or swap, Relay labels then as origin operations. After submission, origin operations send their output to the solver to complete the bridge or swap. There are three possible outcomes for an origin operation:
An origin operation can produce three possible outcomes. Depending on the outcome will determine how Relay handles the bridge or swap.
Consider the following quote to a user:
However, during the origin operation, this happens:
In this case, the new output amount (0.011 ETH) is passed to the destination swap. The operation continues as long as the solver can swap 0.011 ETH at a rate of at least 0.01 ETH per 100 DAI, resulting in the user receiving a little extra.
Consider the following quote to a user:
However, during the origin operation, this happens:
In this case, the new output amount (0.009 ETH) is passed to the destination swap. The operation continues as long as the solver can swap 0.009 ETH at a rate of at least 0.01 ETH per 100 DAI, resulting in the user receiving a little less.
Learn how Relay handles surpluses or shortages.
Relay allows for users to instantly bridge or swap funds cross-chain while saving on gas. There are swaps or bridges where a surplus or shortage can happen. To understand how we handle either, we first need to understand how an origin operation can produce a surplus or shortage.
When starting a bridge or swap, Relay labels then as origin operations. After submission, origin operations send their output to the solver to complete the bridge or swap. There are three possible outcomes for an origin operation:
An origin operation can produce three possible outcomes. Depending on the outcome will determine how Relay handles the bridge or swap.
Consider the following quote to a user:
However, during the origin operation, this happens:
In this case, the new output amount (0.011 ETH) is passed to the destination swap. The operation continues as long as the solver can swap 0.011 ETH at a rate of at least 0.01 ETH per 100 DAI, resulting in the user receiving a little extra.
Consider the following quote to a user:
However, during the origin operation, this happens:
In this case, the new output amount (0.009 ETH) is passed to the destination swap. The operation continues as long as the solver can swap 0.009 ETH at a rate of at least 0.01 ETH per 100 DAI, resulting in the user receiving a little less.