Limit Orders on Lykke
By Mihail Nikulin, Lykke co-founder and CTO
What is a limit order?
A limit order enables you to state the price that you are willing to pay for a particular asset. The order waits until someone comes along who is willing to sell or buy the asset at this price, and then the trade takes effect.
Once you send a limit order, it becomes available to trigger trades with other market participants. The order can be triggered by multiple traders to cover the volume that you wish to buy or sell.
You can cancel the limit order if you become unhappy with the price or if you do not wish to wait any longer.
Keep in mind that opening a limit order decreases your available trading balance.
Why limit orders took so long to implement
Our trading architecture combines a superfast centralized matching engine on the Lykke Exchange with the Lykke Wallet’s decentralized settlement capability to secure customer funds.
Every transaction must be signed on the client side, so that no one can withdraw the client’s money without this person’s signature, even if Lykke is compromised. This approach provides traders with ample security, but it poses interesting problems for implementing limit orders, since the execution of these orders requires settlement even when the client’s smartphone is offline.
Until the end of May of this year, every Lykke transaction was settled on the bitcoin blockchain as an atomic swap transaction, exchanging two assets between counterparties. The results of this were mixed. We experienced many settlement issues caused by the throughput limit on the bitcoin blockchain, not to mention the skyrocketing miners commission.
To mitigate these issues, we launched offchain settlement at the end of May. Offchain improves settlement speed and enables us to introduce collateral flow for the settlement of limit orders.
Collateral flow for limit orders
The collateral flow for limit orders proceeds like this:
When a client sends a buy limit order (such as to buy 1 BTC for 3000 USD; see Figure 1 below), this person also sends money to the exchange for the execution of the order as collateral. Because of offchain settlement, this transfer is confirmed within a second or two, after which the limit order is accepted by the matching engine.
If another client satisfies the limit order with a corresponding sell order, the settlement of the trade is triggered. To settle assets bought with limit orders, the client’s signature is requested with a push notification to this person’s smartphone. If the client is offline, settlement is pending until this person comes back online.
Canceling the order triggers the return of the remaining collateral to the client.
ETH sell limit orders
Ethers limit orders are currently not available. While Ethereum transactions are settled on the blockchain, this process requires a different collateral flow implementation. We are working on that.
Lykke requires trust
When you place a limit order, you send money from your trading wallet to Lykke to cover 100 percent of the volume of the order, which means that you entrust Lykke to hold these funds as collateral. Until the limit order is executed or canceled, the amount of money to cover the order remains in the custody of the Lykke Exchange.
Why limit orders are not trustless
Potentially trustless limit orders based on smart contracts might be trustless for Ethereum-to-Ethereum trades (for example, ETH to ERC20 trades), but the same does not work for crosschain trades.
If you are selling ETH with a limit order for buying BTC, you would need to freeze Ethers in a smart contract. But the smart contract requires a proof of BTC settlement as the second leg of the trade on the Bitcoin blockchain to unlock the funds for your counterparty. There is a way to do so using BTCRelay, even though there are some restrictions. But in the opposite case when you are selling BTC for ETH with a limit order, you need to freeze BTC in a similar trustless way on Bitcoin blockchain. This is not doable with the Bitcoin blockchain currently.
At the end of the day the trustless limit order is what decentralized exchanges usually provide, but it works very slowly because of the settlement of each individual limit order on the blockchain.
Is it possible to have high-frequency trading with limit orders?
Placing or canceling a limit order triggers the settlement procedure, which leads to some latency, even though the order is executed without hitting the blockchain. We are planning to provide an API for high-frequency trading that assumes trusted deposits on the Lykke side. The trader should delegate the management of his or her funds to Lykke to have high-frequency trading enabled by the low latency API.
What is the priority execution for limit orders
Currently it’s a price-time priority. We are planning to implement a price-spread-time algorithm in the future. See more details here.
User interface for limit orders
The basic form for limit orders is coming to the Lykke Wallet with the August 25 release. In the near future, we also plan to enable trading directly from charts.
FOMO In Trading: How to Beat It & Avoid Major Losses
Simply put, FOMO refers to buying or selling or longing or shorting assets without much thinking. People instinctively make decisions whenever the market movement, upward or downward, is almost impossible to ignore.
Crypto Event of the Year: The Merge
Aaand, it’s happening! The much-awaited Ethereum merge is finally on! During the past couple of months, crypto investors have been religiously following the “buy the rumor, sell the news” adage and stacking ether.
Positioning Your Crypto Portfolio After Summer Holidays
Zug, Switzerland. - August 29th, 2022. Unlike traditional financial and stock markets that take a breather during weekends and holidays, crypto markets never sleep.
Bitcoin Testing Key Trendlines – Where Are We Heading?
Zug, Switzerland. - August 23rd, 2022. At the time of writing, Bitcoin is sitting at $23,465. It was just a couple of days ago when the most popular cryptocurrency out there was touching the $25,000 level.
5 Beginner-Friendly Crypto Trading Tips
Zug, Switzerland. - July 14th, 2022. Considering the current market conditions, investing in cryptocurrencies could be a wise move to make before the trend reversal. Yet, when doing crypto, you should be well aware of the fact that there is a thin line between your investments soaring up to thousands of dollars and going to waste.