Last updated: 26 July 2022 04:48 PM
Currently to set a limit order on UniswapV3 , user must provide one token that he want to swap for and must keep an eye on the spot price to reach his desired price. Once the spot price passes his desired price, he must remove the liquidity before the spot price moves back in the range.
Our app automates the complete process starting from placing the limit order and removing the liquidity after processing it.
Token0 and Token1 are the tokens added by the user in the liquidity pool. The box below it shows the fee tier of the pool. The current price tab shows the current market price of the tokens.
The user enters the price at which he wants to provide his liquidity. Next, he has to enter the amount of tokens which he desires to be removed from the liquidity pool when the price reaches his desired price. He selects his order type in the dropdown menu below. The final step is Placing the limit order. It triggers our dApp to automatically check and execute the limit order processing.
After the place limit order is confirmed, the dApp confirms the metamask transaction. The inputs are passed to smart contracts which then places the limit order and sets the values. The sequencer starts to run. It fetches and checks for the values continuously. Once the condition set by the user is met, it processes the limit order and the user’s task is done.
We faced difficulty while testing the contracts on testnets since we didn't found any ERC20 token pair pool on testnet. As of now we tested the contract by forking mainnet through hardhat.