tdex-network / tdex-daemon-alpha

💰 Alpha Daemon implementation to run automated market making strategies on top of TDEX
MIT License
0 stars 2 forks source link

Markets endpoint returns empty markets #41

Closed sekulicd closed 4 years ago

sekulicd commented 4 years ago

Trade - Markets endpoint is showing an empty market.

Steps to reproduce:

1. yarn start --regtest
2. take address from logs and send faucet and mint to address ert1q9sl7tl9c554d2c3xkpz222kftuvk3cjfmwcc6n
3. tdex-cli network regtest
4. tdex-cli operator connect localhost:9000
5. tdex-cli operator deposit --fee
6. tdex-cli operator deposit ert1qaj6gcewc4fzqkavc0mx752aqx0uucgnh54qnxy
7. tdex-cli operator deposit ert1q5x45j3ggw5zetzckgz9733qu53gevgcvzql4d3
8. send faucet and mint to ert1q5x45j3ggw5zetzckgz9733qu53gevgcvzql4d3

Trade.Markets endpoint returns:

{
  "markets": [
    {
      "market": {
        "base_asset": "",
        "quote_asset": ""
      },
      "fee": 0
    },
    {
      "market": {
        "base_asset": "5ac9f65c0efcc4775e0baec4ec03abdde22473cd3cf33c0419ca290e0751b225",
        "quote_asset": "c6188b0d2d72a85e1c2256da78f37a5a8aa691e6703373d84d55ce018ec909c1"
      },
      "fee": 0.25
    }
  ]
}

Please find db dump in the attachments.

unspents.txt markets.txt

altafan commented 4 years ago

I couldn't be able to replicate this by my self with these steps:

  1. Start daemon
  2. Fund fee account with LBTC from faucet and asset from mint
  3. Get market list with markets rpc

At this point, the rpc returns an empty list as expected.

Only after adding the step:

  1. Get deposit address

Now markets returns a list with an empty market as you pointed.

Did not fully investigate on this, but I think the bug resides in crawler, when a watcher for a deposit address is instantiated, or in app, where we watch for crawler's deposit events. It should be definetly releted to this event.