How to get order info on filled order

On CEX exchanges full order info usually available for canceled / filled orders. On BitShares such info is not available, because such info is stored in memory of bitshares-core node, and keeping non-actual orders info would take astonishing amounts of RAM.

Thus, such order info could be obtained in two ways:

  • By querying account history from the node:
from bitshares.account import Account

a = Account('dexbot')
ops = a.history(only_ops=['fill_order'], limit=1)
for op in ops:

Note: this way has limitation: public nodes doesn’t store full account history, only limited number of entries

How to detect partially filled order

An Order have the following fields:

  • order['base']['amount']: stores initial amount to sell
  • order['for_sale']['amount']: stores remaining amount to sell

So, if your order initially sells 100 BTS, and 50 BTS was sold, the order['for_sale']['amount'] will contain remaining 50 BTS.