With the launch on Uniswap v3, the DEFI community got a lot of opportunities that Uniswap v2 was not able to provide mainly because of how the liquidity was managed.
Uniswap v3 brings a new feature on the table, namely the possibility for the users to:
- Select different fees when providing liquidity to the pools (0.05 %, 0.3% and 1%).
- Select a price range where they want to provide their liquidity for, known as concentrated liquidity.
We will mainly focus on the second feature here and the ability to provide concentrated liquidity for pairs in a pool.
Every Uniswap v3 pool is identified by the 2 tokens in the pool (known as pairs) and the fee selected for the pool (0.05 %, 0.3% or 1%).
Every Uniswap v3 pool has a current / market price, defining the price between the 2 tokens in the pool.
When adding liquidity to the Uniswap v3 pool, user can (in the given order):
- select the pairs (pool) and the fees. This is the Uniswap v3 pool identifier.
- select the target price range (min-max) for providing the liquidity. The users can usually select a price range left (lower) or right(higher) than the current price.
- deposit the amounts of the 2 tokens in the pool according to the price range selected.
Please note that target price range consist of min — max target prices.
Lets discuss about the target price range selection and the rules for it:
- If the target price range is including the current price, the user needs to deposits amounts for the both tokens. This deposit will be immediately used (during swaps), since its price range is within the current price.
- If the target price range is higher than the current price, the user can only deposit one of the tokens i.e. the first token of the pool. This deposit will only be used when the current price moves within this price range.
- If the target price range is lower than the current price, the user can only deposit one of the tokens, i.e. the second token of the pool. This deposit will only be used when the current price moves within this price range.
The second and the third point are known as range orders in Uniswap V3.
Limit orders are used in the crypto world whenever users:
- want to SELL a token at a target price, usually when the price is higher than the current/market price, for example sell 1 ETH for USDC whenever the price reaches 4000 USDC/ETH.
- want to BUY a token at the given price, usually when its price is lower than the current/market price, for examples buy 1 ETH with USDC whenever the price reaches 3000 USDC/ETH.
This is a well known investment strategy: buy low, sell high.
Those 2 mentioned cases of buy and sell limit orders are exactly what can be implemented using Uniswap v3 range orders by selecting a thin target price range.
HOW IT WORKS ?
Uniswap v3 automatically process your limit orders whenever the current / market price reaches and surpasses your selected THIN target price range.
Once the current /market price moves on the other side of your THIN target price range, your tokens are considered sold (in case of a sell limit order) or bough (in case of a buy limit order).
Sell Limit Order
User places sell limit orders for a given token pair on Uniswap v3 if they select a THIN price range higher than the current price of the pool.
Sell 1 ETH for USDC whenever the price reaches 4000 USDC/ETH. Note the min and max price are close to each other, this is what is referred as THIN price range.
Once the current price moves ABOVE the max price of 4048 USD per ETH, your ETH tokens will be sold (automatically by Uniswap v3) for USDC.
You will get the 4048 USDC amount from selling the ETH, as WELL as any additional fees earned from Uniswap v3 for providing the liquidity. That means you are getting slightly more USDC than what you placed the sell order for, which is better than if you were to swap ETH to USDC directly.
Buy Limit Order
User places buy limit orders for a given token pair on Uniswap v3 if they select a THIN price range lower than the current / market price of the pool.
Buy ETH with 3000 USDC whenever the price reaches 3000 USDC/ETH. Note the min and max price are close to each other, this is what is referred as a THIN price range.
ETH/USDC buy limit order on Uniswap v3
Once the current price moves BELOW the min price of 2981 USD per ETH, your USDC tokens will be sold (automatically by Uniswap v3) for ETH.
You will get the 1 ETH amount from selling the 3000 USDC, as WELL as any additional fees earned from Uniswap v3 for providing the liquidity. That means you are getting slightly more ETH than what you placed the buy order for, which is better than if you were to swap USDC to ETH directly.
THE PROBLEM ?
This feature is perfect, however there are 2 problems with it:
- The user needs to MANUALLY collect and withdraw the amounts obtained on Uniswap v3 using the limit order.
- Most important, the user needs to do this RIGHT AFTER the current / market price surpasses your target price range.
Of course the user can sit, monitor, wait 24/7 and do it on their own. But why do that, when all of this can be automated.
This is where Chainlink keepers comes into place.
Next chapter would be related to how to configure Chainlink keeper to automatically monitor the limit orders and how to cover its upkeep cost from the fees charged to the end users.
HOW IT WORKS
KROMatika consists of:
- Audited smart contracts for creating trades and processing them, all powered by Uniswap.
- UI for interacting with KROMatika smart contracts .
- Off-chain decentralized processing services, responsible for active processing of the trades, powered by Chainlink Keepers.
- KROM token — utility ERC20 token used for paying the service fee. This fee is paid by the users and is used to cover the cost of the processing services (Chainlink Keepers).
# PLACING TRADE
Placing a DEX trade on Kromatika is pretty simple:
- Go to [app.kromatika.finance] (make sure you select the Kovan Test Network from your metamask wallet, other networks to follow).
- Select the token and the amount you want to sell (example 1 ETH)
- Select the token you want to receive. (Example USDC)
- Select the target price and place the trade. (Example target price: 1ETH = 5300 USDC).
- As a result of placing the trade, you will receive a unique Non-Fungable Kromatika trade position token.
Trading ETH for DAI
Congratulations. First step done. Now what is remaining is funding your account with KROM tokens and waiting for the trade(s) to be processed.
- Go on [app.kromatika.finance]to list all your active trades
- Check the minimum KROM token balance needed for processing the trades. If your current KROM balance is lower than the minimum KROM balance, you’ll need to fund your account with KROM tokens.
- [KROM token] is a non-mintable ERC20 token, deployed on Ethereum, secured by OpenZepellin and audited by MythX, having a 100 millions of total supply EVER.
- 60 millions KROM tokens are already available for trading on Uniswap V3 MAINNET. Get your KROM tokens
- Starting token price is: 1 KROM = 1 000 gwei = 0.000001 ETH.
- For better security and prevention from rug pulls hacks, the proof of liquidity (position) has been burned.
- The majority of the token is in the community hands forever.
- 20 millions KROM tokens will be available for trading on Layer2 Uniswap (Arbitrum and Optimism) in the first month of the launch.
- The rest of the tokens: 20 millions KROM tokens will be held in a multisignature Gnosis Safe wallet and used solely for project funding.
# PROCESS TRADE
During the processing, the service fee is deducted from your KROM balance. The service fee is used to automatikally replenish the service ( Chainlink Keepers ), so that it can continue managing the trades.
After the trade has been processed, the user can collect the amount from it.
If the trade hasn’t been processed for a while, the user can cancel it.
This concludes the user interaction with the platform:
1. Placing Trade(s).
2. Funding your account with KROM tokens.
3. Claiming the amounts from your processed trades.
4. Cancelling non-processed trades.
# WHY KROMatika
- When doing swaps on Uniswap V3, the user pays what is called a swap fee that is: 0.05%, 0.3% or 1%. When placing trades on KROMatika, the user does not pay swap fee, but pays service fee instead.
- The swap fee depends on the amount being swapped, whereas the service fee is FIXED.
- The actual service fee is paid in ETH, since this is the real cost of the processing services (gas fee), however the users always pay with KROM tokens.
- KROM token allows for huge savings on the service fee, close to having a ZERO service fees.
- Early KROM token holders would have HUGE savings on service fees, because they would be buying the token cheap and pay the service fee (which is fixed ETH) when its token price has increased.
Hidden gem: Within the DAPP, the user can choose a lower target gas price for the automatik processing of their trades, even further lowering the service fee, sacrificing some processing speed for lower service fees.
ZERO SERVICE FEE
KROMatika will be deployed on Layer2 (Arbitrum and Optimism) because of the lower gas cost.
The service fee on Layer 2 would be around 0.00002 ETH, expressed in KROM tokens. That’s 1 dollar cent for a service fee.
It could not get any cheaper. Well, it can…. go into earning instead of paying service fees…. and that’s to be discussed later on.