def parse_order(self, order, market=None):
    id = self.safe_string(order, 'id')
    if (market is None):
        marketId = self.safe_string(order, 'market_id')
        if (marketId in self.markets_by_id):
            market = self.markets_by_id[marketId]
        else:
            marketUuid = self.safe_string(order, 'market_uuid')
            if (marketUuid in self.options['marketsByUuid']):
                market = self.options['marketsByUuid'][marketUuid]
    symbol = None
    if (market is not None):
        symbol = market['symbol']
    timestamp = self.parse8601(self.safe_string(order, 'inserted_at'))
    price = self.safe_float(order, 'price')
    amount = self.safe_float(order, 'amount')
    filled = self.safe_float(order, 'filled_amount')
    remaining = max(0, (amount - filled))
    status = self.parse_order_status(self.safe_string(order, 'state'))
    side = self.safe_string(order, 'side')
    if (side == 'BID'):
        side = 'buy'
    else:
        side = 'sell'
    return {'id': id, 'datetime': self.iso8601(timestamp), 'timestamp': timestamp, 'status': status, 'symbol': symbol, 'type': None, 'side': side, 'price': price, 'cost': None, 'amount': amount, 'filled': filled, 'remaining': remaining, 'trades': None, 'fee': None, 'info': order}
def parse_order(self, order, market=None):
    id = self.safe_string(order, 'id')
    if (market is None):
        marketId = self.safe_string(order, 'market_id')
        if (marketId in self.markets_by_id):
            market = self.markets_by_id[marketId]
        else:
            marketUuid = self.safe_string(order, 'market_uuid')
            if (marketUuid in self.options['marketsByUuid']):
                market = self.options['marketsByUuid'][marketUuid]
    symbol = None
    if (market is not None):
        symbol = market['symbol']
    timestamp = self.parse8601(self.safe_string(order, 'inserted_at'))
    price = self.safe_float(order, 'price')
    amount = self.safe_float(order, 'amount')
    filled = self.safe_float(order, 'filled_amount')
    remaining = max(0, (amount - filled))
    status = self.parse_order_status(self.safe_string(order, 'state'))
    side = self.safe_string(order, 'side')
    if (side == 'BID'):
        side = 'buy'
    else:
        side = 'sell'
    return {'id': id, 'datetime': self.iso8601(timestamp), 'timestamp': timestamp, 'status': status, 'symbol': symbol, 'type': None, 'side': side, 'price': price, 'cost': None, 'amount': amount, 'filled': filled, 'remaining': remaining, 'trades': None, 'fee': None, 'info': order}