πŸ‘“Use Cases

Alice has 1200 USDT, and she wants to buy 1ETH. Currently, the market price of ETH on Uniswap is 1250 USDT. Alice can’t wait, as she needs 1ETH now. But if she swaps the token now, she will get less than 1ETH. So she needs to open the limit order, where she sets the desired price. Once market conditions reach desired parameters, the order will be executed.

So Alice creates the order: she selects the ETH/USDT pair and enters the amount at 1ETH and the price of 1200 USDT. Then she confirms the transaction. Next Alice has to wait until the market price goes down and the order can be executed. Once it’s done, she sees 1ETH on her wallet balance and the executed order details on TheTrade platform.

πŸ” When a user wants to open an order (buy or sell), they enter the order parameters (order type, token they want to buy and the one he want to sell, desired token price, and amount) and submits the transaction by signing it in the wallet (MetaMask and Wallet Connect are supported). After the transaction is executed, TheTrade smart-contract system manages the provided assets and creates a position.

The position consists of Uniswap v3 concentrated liquidity in the smallest price range. Once the market price goes up or down to the desired price, assets in the liquidity position are swapped and are available for execution of the order. Now, any Ethereum account can get the reward by calling the execute() function and finalizing the order. The smart contract gets liquidity back from Uniswap and places the desired asset, obtained at the preset price, in the user's wallet.

Cancel of limit order

Creation of limit order If a user wants to cancel the created order, but his liquidity is already being converted from 0 to 1 asset, he must be aware of the following. When canceling this order on TheTrade, he will get back both assets in equal parts in correspondence with the transferred amount of assets. Gas fee will be charged to a user, and execution fee will also be returned.

Last updated