Hu-Fi / Mr.Market

Mr. Market is the exchange oracle of HuFi, and a CeFi crypto bot on Mixin Messenger
https://mr-market-one.vercel.app
GNU Affero General Public License v3.0
1 stars 6 forks source link

Enhance supported spot pairs endpoint #164

Open zed-wong opened 2 months ago

zed-wong commented 2 months ago

By following the example here, we will add fields below for supported spot pairs endpoint:

Market:

  1. buyMax, sellMax
  2. buyMin, sellMin
  3. canBuy, canSell
  4. canBuyDelay, canSellDelay

Limit:

  1. limitBuyMax, limitSellMax
  2. limitBuyMin, limitSellMin
  3. limitCanBuy, limitCanSell
  4. limitCanBuyDelay, limitCanSellDelay

Assets:

  1. Asset0
    • asset_id (mixin_asset_id)
    • chain_id (mixin_chain_asset_uuid)
    • symbol (BTC)
    • name (Bitcoin)
    • icon (icon url)
    • decimal (decimal places)
    • protocol (ERC-20/TRC20/...)
    • transferFee (the withdrawal cost in usd, will need to design a way to get accurate value)
  2. Asset1
    • asset_id (mixin_asset_id)
    • chain_id (mixin_chain_asset_uuid)
    • symbol (USDT)
    • name (Tether)
    • icon (icon url)
    • decimal (decimal places)
    • protocol (ERC-20/TRC20/...)
    • transferFee

The min/max amount will be set in per trading pair basis. Each trading pair will have a corresponding record in db.

canBuy/canSell is a boolean state of wether the trading pair is allowed to be traded. Same applies to limitCanBuy/limitCanSell

canBuyDelay/canSellDelay is a boolean state of wether the trading pair is allowed to be traded if the amount is larger than buyMax/sellMax. Same applies to limitCanBuyDelay/limitCanSellDelay

when order amount is lower than buyMax/sellMax, the order will go through by program. Once it's over max value, it should trigger manual intervention, send message to a maintainer group, and we should execute the transaction manually.