Skip to content

deal maker cli #3

@techland

Description

@techland

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

  1. Able to listen for new orders
  2. Able to cache the orders and update them when necessary in a data store.
  3. Able to package the order cells as a transaction to achieve swap actions in a batch.
  4. 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
  1. 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

  • Implemented the features outlined above.
  • Unit tests covering various use cases for making the deals for the orders.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions