def fetch_positions(self, symbols=None, since=None, limit=None, params={}):
    self.load_markets()
    method = None
    defaultType = self.safe_string_2(self.options, 'fetchPositions', 'defaultType')
    type = self.safe_string(params, 'type', defaultType)
    if ((type == 'futures') or (type == 'swap')):
        method = (type + 'GetPosition')
    elif (type == 'option'):
        underlying = self.safe_string(params, 'underlying')
        if (underlying is None):
            raise ArgumentsRequired((((self.id + ' fetchPositions() requires an underlying parameter for ') + type) + ' markets'))
        method = (type + 'GetUnderlyingPosition')
    else:
        raise NotSupported((((self.id + ' fetchPositions() does not support ') + type) + ' markets, supported market types are futures, swap or option'))
    params = self.omit(params, 'type')
    response = getattr(self, method)(params)
    return response
def fetch_positions(self, symbols=None, since=None, limit=None, params={}):
    self.load_markets()
    method = None
    defaultType = self.safe_string_2(self.options, 'fetchPositions', 'defaultType')
    type = self.safe_string(params, 'type', defaultType)
    if ((type == 'futures') or (type == 'swap')):
        method = (type + 'GetPosition')
    elif (type == 'option'):
        underlying = self.safe_string(params, 'underlying')
        if (underlying is None):
            raise ArgumentsRequired((((self.id + ' fetchPositions() requires an underlying parameter for ') + type) + ' markets'))
        method = (type + 'GetUnderlyingPosition')
    else:
        raise NotSupported((((self.id + ' fetchPositions() does not support ') + type) + ' markets, supported market types are futures, swap or option'))
    params = self.omit(params, 'type')
    response = getattr(self, method)(params)
    return response