Skip to content
This repository has been archived by the owner on Jun 15, 2021. It is now read-only.

Normalization

i-petko edited this page Feb 19, 2018 · 12 revisions

get_deposit_address()

type: dict

dict['address'] = address

{'address': 'M9gEKyoXLywuVaqtjEVaGzKXcsZVq8YaWT'}

get_markets()

type: list

['bcheur', 'bchusd', 'bchxbt']

get_market_ticker()

type: dict

dict keys: 'ask', 'bit', 'last'

{'ask': Decimal, 'bid': Decimal, 'last': Decimal}

cancel_order()

type bool

True

cancel_all_orders()

type bool

True

get_market_spread()

type: Decimal

buy_limit()

type bool

True

sell_limit()

type bool

True

withdraw()

type bool

True

get_balances()

type list

get_deposit_history()

type list

get_market_depth()

type dict

dict keys: 'bids', 'asks'

{'bids': Decimal('315.3114365700000043708783879'), 'asks': Decimal('896.0000205000000229119128109')}

get_market_orders()

type dict

dict keys: 'bids', 'asks'

get_market_trade_history()

type list

Each trade in the list should be normalized to:

type dict

With fields:

dict = {
         'timestamp': datetime.datetime,
         'is_sale': bool,
         'rate': Decimal,
         'amount': Decimal,
         'trade_id': any
}

Example for Bittrex:

data = Bittrex().get_trade_history('btc-etc')[0]
 
{
    'timestamp': normalize_time(data['TimeStamp']), # datetime object
    'is_sale': normalize_sale(data['OrderType']), # bool
    'rate': Decimal(data['Price']), #  Decimal
    'amount': Decimal(data['Quantity']), # Decimal
    'trade_id': data['Id']  # any
}

get_market_volume()

type float

get_open_orders()

type list

get_order()

type dict

dict = {
         'order_id': any,
         'timestamp': datetime.datetime,
         'pair': string,
         'type': buy/sell,
         'rate': Decimal,
         'amount': Decimal,
         'trade_id': any
}

get_withdraw_history()

type list