The first two technical blogs addressed the primary components of LQDEX Bridge.
LQDEX Bridge can be used for all Ethereum decentralized exchanges (DEX), not just EtherDelta, as Bridge’s sole purpose is to tokenize non-ERC20 assets. As an example and demonstrable feature, we built direct integration to EtherDelta’s smart contract.
In this blog, we will explain the trading components of LQDEX Bridge, where traders can place orders directly into EtherDelta and fill orders that originated on Bridge. Although users can directly trade the ERC20 LQ-Assets from EtherDelta without using the Bridge’s trading UI, we wanted to offer potential Bridge users the ability to trade them directly from the Bridge. This part of the trade flow requires MetaMask for signing the following transactions:
Placing An Order Into EtherDelta Through Bridge:
The following screen displays how traders can add an order directly to EtherDelta’s order books. The one condition is that users should have a balance in LQ tokens (e.g. LQ-BTC, LQ-LTC etc.) This is so traders can actually place an order against any ERC20 tokens listed on EtherDelta. Bridge will maintain an internal database of orders that originates from the Bridge itself in order to provide options to fill the existing orders.
ERC20 token contracts have the two following functions that EtherDelta’s smart contract utilizes:
- Approve X tokens to EtherDelta’s contract address by the owner of the tokens.
- Deposit X (or anything less than approval amount) to EtherDelta’s contract address.
The above steps must be in order because the deposit function of EtherDelta’s contract requires the tokens to be approved before it is transferred to its own address.
Bridge provides the following functionalities to directly accomplish, approve, and deposit to EtherDelta’s contract before placing an order:
- Approve: As seen below it has two inputs (i.e your specific Ethereum address holding LQ-BTC) and the amount you are willing to approve using MetaMask.
2) Deposit: Bridge makes it easy for users to deposit their tokens directly to EtherDelta’s contract before placing or filling an order.
To avoid any confusion, Bridge provides the ability to fill orders that have originated only from LQDEX Bridge. Pictured below is the fill screen for an existing order:
Fill flow, which ends up calling EtherDelta’s trade function will also need to have the filling token be approved and deposited. Therefore, the fill flow will also involve the approval and deposit screens for the filling token, similar to the order flow. Then from the Bridge you can post the trade to EtherDelta through the following screen:
As we near the launch of Bridge version 1.0, the LQDEX development team is focused on testing and adding user-friendly features to the flows of Bridge to eliminate any distraction or unnecessary UI components.
We aspire to have a complete, functioning version of Bridge that includes the following:
- Minting ERC20 version of Bitcoin, LiteCoin, ZCash, BCash, etc.
- Withdrawing ERC20 version of the above
- Placing Order on EtherDelta for ERC20 vs Non-ERC20 versions
- Filling Orders on Bridge/EtherDelta Order Book