def parse_my_trade(self, pair, market=None):
    userTrade = self.safe_value(pair, 1)
    otherTrade = self.safe_value(pair, 0)
    firstMarketId = self.safe_string(otherTrade, 'instrument_id')
    secondMarketId = self.safe_string(userTrade, 'instrument_id')
    if (firstMarketId != secondMarketId):
        raise NotSupported((self.id + ' parseMyTrade() received unrecognized response format, differing instrument_ids in one fill, the exchange API might have changed, paste your verbose output: https://github.com/ccxt/ccxt/wiki/FAQ#what-is-required-to-get-help'))
    marketId = firstMarketId
    market = self.safe_market(marketId, market)
    symbol = market['symbol']
    quoteId = market['quoteId']
    side = None
    amount = None
    cost = None
    receivedCurrencyId = self.safe_string(userTrade, 'currency')
    feeCurrencyId = None
    if (receivedCurrencyId == quoteId):
        side = self.safe_string(otherTrade, 'side')
        amount = self.safe_float(otherTrade, 'size')
        cost = self.safe_float(userTrade, 'size')
        feeCurrencyId = self.safe_string(otherTrade, 'currency')
    else:
        side = self.safe_string(userTrade, 'side')
        amount = self.safe_float(userTrade, 'size')
        cost = self.safe_float(otherTrade, 'size')
        feeCurrencyId = self.safe_string(userTrade, 'currency')
    id = self.safe_string(userTrade, 'trade_id')
    price = self.safe_float(userTrade, 'price')
    feeCostFirst = self.safe_float(otherTrade, 'fee')
    feeCostSecond = self.safe_float(userTrade, 'fee')
    feeCurrencyCodeFirst = self.safe_currency_code(self.safe_string(otherTrade, 'currency'))
    feeCurrencyCodeSecond = self.safe_currency_code(self.safe_string(userTrade, 'currency'))
    fee = None
    fees = None
    if ((feeCostFirst is not None) and (feeCostFirst != 0)):
        if ((feeCostSecond is not None) and (feeCostSecond != 0)):
            fees = [{'cost': (- feeCostFirst), 'currency': feeCurrencyCodeFirst}, {'cost': (- feeCostSecond), 'currency': feeCurrencyCodeSecond}]
        else:
            fee = {'cost': (- feeCostFirst), 'currency': feeCurrencyCodeFirst}
    elif ((feeCostSecond is not None) and (feeCostSecond != 0)):
        fee = {'cost': (- feeCostSecond), 'currency': feeCurrencyCodeSecond}
    else:
        fee = {'cost': 0, 'currency': self.safe_currency_code(feeCurrencyId)}
    timestamp = self.parse8601(self.safe_string_2(userTrade, 'timestamp', 'created_at'))
    takerOrMaker = self.safe_string_2(userTrade, 'exec_type', 'liquidity')
    if (takerOrMaker == 'M'):
        takerOrMaker = 'maker'
    elif (takerOrMaker == 'T'):
        takerOrMaker = 'taker'
    orderId = self.safe_string(userTrade, 'order_id')
    result = {'info': pair, 'timestamp': timestamp, 'datetime': self.iso8601(timestamp), 'symbol': symbol, 'id': id, 'order': orderId, 'type': None, 'takerOrMaker': takerOrMaker, 'side': side, 'price': price, 'amount': amount, 'cost': cost, 'fee': fee}
    if (fees is not None):
        result['fees'] = fees
    return result
def parse_my_trade(self, pair, market=None):
    userTrade = self.safe_value(pair, 1)
    otherTrade = self.safe_value(pair, 0)
    firstMarketId = self.safe_string(otherTrade, 'instrument_id')
    secondMarketId = self.safe_string(userTrade, 'instrument_id')
    if (firstMarketId != secondMarketId):
        raise NotSupported((self.id + ' parseMyTrade() received unrecognized response format, differing instrument_ids in one fill, the exchange API might have changed, paste your verbose output: https://github.com/ccxt/ccxt/wiki/FAQ#what-is-required-to-get-help'))
    marketId = firstMarketId
    market = self.safe_market(marketId, market)
    symbol = market['symbol']
    quoteId = market['quoteId']
    side = None
    amount = None
    cost = None
    receivedCurrencyId = self.safe_string(userTrade, 'currency')
    feeCurrencyId = None
    if (receivedCurrencyId == quoteId):
        side = self.safe_string(otherTrade, 'side')
        amount = self.safe_float(otherTrade, 'size')
        cost = self.safe_float(userTrade, 'size')
        feeCurrencyId = self.safe_string(otherTrade, 'currency')
    else:
        side = self.safe_string(userTrade, 'side')
        amount = self.safe_float(userTrade, 'size')
        cost = self.safe_float(otherTrade, 'size')
        feeCurrencyId = self.safe_string(userTrade, 'currency')
    id = self.safe_string(userTrade, 'trade_id')
    price = self.safe_float(userTrade, 'price')
    feeCostFirst = self.safe_float(otherTrade, 'fee')
    feeCostSecond = self.safe_float(userTrade, 'fee')
    feeCurrencyCodeFirst = self.safe_currency_code(self.safe_string(otherTrade, 'currency'))
    feeCurrencyCodeSecond = self.safe_currency_code(self.safe_string(userTrade, 'currency'))
    fee = None
    fees = None
    if ((feeCostFirst is not None) and (feeCostFirst != 0)):
        if ((feeCostSecond is not None) and (feeCostSecond != 0)):
            fees = [{'cost': (- feeCostFirst), 'currency': feeCurrencyCodeFirst}, {'cost': (- feeCostSecond), 'currency': feeCurrencyCodeSecond}]
        else:
            fee = {'cost': (- feeCostFirst), 'currency': feeCurrencyCodeFirst}
    elif ((feeCostSecond is not None) and (feeCostSecond != 0)):
        fee = {'cost': (- feeCostSecond), 'currency': feeCurrencyCodeSecond}
    else:
        fee = {'cost': 0, 'currency': self.safe_currency_code(feeCurrencyId)}
    timestamp = self.parse8601(self.safe_string_2(userTrade, 'timestamp', 'created_at'))
    takerOrMaker = self.safe_string_2(userTrade, 'exec_type', 'liquidity')
    if (takerOrMaker == 'M'):
        takerOrMaker = 'maker'
    elif (takerOrMaker == 'T'):
        takerOrMaker = 'taker'
    orderId = self.safe_string(userTrade, 'order_id')
    result = {'info': pair, 'timestamp': timestamp, 'datetime': self.iso8601(timestamp), 'symbol': symbol, 'id': id, 'order': orderId, 'type': None, 'takerOrMaker': takerOrMaker, 'side': side, 'price': price, 'amount': amount, 'cost': cost, 'fee': fee}
    if (fees is not None):
        result['fees'] = fees
    return result