ExchangeUnion / xud

Exchange Union Daemon 🔁 ⚡️
https://exchangeunion.com
GNU Affero General Public License v3.0
115 stars 49 forks source link

incorrect message for `not sufficient balance for order placing` case #2003

Closed raladev closed 3 years ago

raladev commented 3 years ago

Sell Case:

Trading Limits:
┌──────────┬─────────┬───────────┬──────────────┬───────────────┐
│ Currency │ Max Buy │ Max Sell  │ Reserved Buy │ Reserved Sell │
├──────────┼─────────┼───────────┼──────────────┼───────────────┤
│ BTC      │ 0.196   │ 0.1959095 │ 0            │ 0             │
├──────────┼─────────┼───────────┼──────────────┼───────────────┤
│ LTC      │ 0.98    │ 0.979638  │ 0            │ 0             │
└──────────┴─────────┴───────────┴──────────────┴───────────────┘
simnet > sell 0.53 LTC/BTC 0.5 2
9 FAILED_PRECONDITION: LTC inbound capacity of 97963800 is not sufficient for order amount of 53000000

Expected result: It should be BTC error instead of LTC, because i have enough LTC to place sell order. 9 FAILED_PRECONDITION: BTC inbound capacity of 0.196 (satoshi) is not sufficient for order amount of 0.265

Buy Case:

Trading Limits:
┌──────────┬─────────┬───────────┬──────────────┬───────────────┐
│ Currency │ Max Buy │ Max Sell  │ Reserved Buy │ Reserved Sell │
├──────────┼─────────┼───────────┼──────────────┼───────────────┤
│ BTC      │ 0.196   │ 0.0495095 │ 0            │ 0.1464        │
├──────────┼─────────┼───────────┼──────────────┼───────────────┤
│ LTC      │ 0.004   │ 0.979638  │ 0.976        │ 0             │
└──────────┴─────────┴───────────┴──────────────┴───────────────┘
simnet > buy 0.986 LTC/BTC 0.15 -r 1
9 FAILED_PRECONDITION: BTC inbound capacity of 4950950 is not sufficient for order amount of 150000

Expected result: It should be LTC error instead of BTC, because i have enough BTC to place buy order. but have no enough LTC. 9 FAILED_PRECONDITION: LTC inbound capacity of 0.986 (satoshi) is not sufficient for order amount of 0.98