fluidex/dingir-exchange

DESIGN: eth_watcher update balance workflow

Opened this issue · 3 comments

DESIGN: eth_watcher update balance workflow

We need to upgrade the db schema.

  • TODO: do we need to add tx_hash for update_balance related records?
  • we need to add token_address to asset table, and probably also define symbol & name in a more clear way. (#132)
  • we also need to tell whether the asset is used as a "commonly quoted" one. (for #137)

We also need to:

  1. update the updatebalance API.
    • TODO: should associated with a tx_hash? how to deal with replay? where is the tx_hash stored (mem, mq, db)? we are not supposed to stored in mem forever, but how to deal with expire/retry?
      • same problem for withdraw
  2. add a new API named add_token
    • should associated with a tx_hash
    • should contain symbol, name, decimals (TODO: we have 2 different prec? prec_show and prec_save?)
  3. upgrade the AssetList API (#131)

ETH/USDT/USDC/TUSD/DAI are pre-setup.

we need to upgrade the exhange(trade) API as well: #137
also need to deal with the resolving for our "commonly quoted".
be careful to avoid self pair (a pre-setup asset against its token_address)
BTW the usdt in BASE_URL/usdt/0xtokenaddr is a commonly quoted one? it looks like a "BASE" in terms of its position in the URL. and also need to be careful about the trade_pair display.

add_token should also "reload_market" automatically? Or think about another way to handle "markets"