This serves as a service backbone for the DEX proposal to help package the orders that are matched. The protocol is designed to incentivize the deal makers who are looking for arbitrage profit among the live orders while aiming to bring in competition among them to achieve better efficiency in completing deals.
Original Requirement
https://nervos.quip.com/vh8zAVnCOmbp/-ckb-DEX#NdGACAJvrNN
Diagram
https://nervos.quip.com/vh8zAVnCOmbp/-ckb-DEX#NdGACAaT4yY
Features
- Able to listen for new orders
- Able to cache the orders and update them when necessary in a data store.
- Able to package the order cells as a transaction to achieve swap actions in a batch.
- Able to console log the key metrics in real-time:
- total attempts (total number of attempts in submitting transactions)
- successful deals
- failure deals (could be due to front-running or contract rejections in verifying calculations for the swaps)
- total profit
- Able to configure the wallet account for the deal maker, such as the private key
For simplicity, this CLI client can only have one command dex-miner start at the beginning, which should start itself as a process to listen to and handle for the orders until ctrl-c is triggered.
Tech Stack
These are just some suggestions, please feel free to choose the stack that you are comfortable with.
Definition of done
This serves as a service backbone for the DEX proposal to help package the orders that are matched. The protocol is designed to incentivize the
deal makerswho are looking for arbitrage profit among the live orders while aiming to bring in competition among them to achieve better efficiency in completing deals.Original Requirement
https://nervos.quip.com/vh8zAVnCOmbp/-ckb-DEX#NdGACAJvrNN
Diagram
https://nervos.quip.com/vh8zAVnCOmbp/-ckb-DEX#NdGACAaT4yY
Features
For simplicity, this CLI client can only have one command
dex-miner startat the beginning, which should start itself as a process to listen to and handle for the orders untilctrl-cis triggered.Tech Stack
EventEmitter, https://github.com/nervosnetwork/lumos/tree/develop/packages/indexer#eventemitterThese are just some suggestions, please feel free to choose the stack that you are comfortable with.
Definition of done