Ejemplo n.º 1
0
def books(Symbol='tBTCUSD', Precision='P0', **params):
    """ The Order Books channel allow you to keep track of the state of the Bitfinex order book. 
    It is provided on a price aggregated basis, with customizable precision.
    Docs: https://bitfinex.readme.io/v2/reference#rest-public-books
    """
    endpoint = f'book/{Symbol}/{Precision}'
    return request(authenticate=False, version=2, endpoint=endpoint, method='GET', query_params=params)
Ejemplo n.º 2
0
def ticker(Symbol='tBTCUSD', **params):
    """ The ticker is a high level overview of the state of the market. 
    It shows you the current best bid and ask, as well as the last trade price. 
    It also includes information such as daily volume and how much the price has moved over the last day.
    Docs: https://bitfinex.readme.io/v2/reference#rest-public-ticker
    """
    endpoint = f'ticker/{Symbol}'
    return request(authenticate=False, version=2, endpoint=endpoint, method='GET', query_params=params)
Ejemplo n.º 3
0
def platform_status(**params):
    """ Get the current status of the platform. 
    Maintenance periods last for just few minutes and might be necessary 
    from time to time during upgrades of core components of our infrastructure.
    Docs: https://bitfinex.readme.io/v2/reference#rest-public-platform-status
    """
    endpoint = 'platform/status'
    return request(authenticate=False, version=2, endpoint=endpoint, method='GET', query_params=params)
Ejemplo n.º 4
0
def lends(currency='USD', **params):
    """ Get a list of the most recent funding data for the given currency: total amount lent and Flash Return Rate (in % by 365 days) over time.
    Docs: https://bitfinex.readme.io/v1/reference#rest-public-lends
    """
    endpoint = f'lends/{currency}'
    return request(authenticate=False,
                   version=1,
                   endpoint=endpoint,
                   method='GET',
                   query_params=params)
Ejemplo n.º 5
0
def trades(symbol='BTCUSD', **params):
    """ Get a list of the most recent trades for the given symbol.
    Docs: https://bitfinex.readme.io/v1/reference#rest-public-trades
    """
    endpoint = f'trades/{symbol}'
    return request(authenticate=False,
                   version=1,
                   endpoint=endpoint,
                   method='GET',
                   query_params=params)
Ejemplo n.º 6
0
def order_book(symbol='BTCUSD', **params):
    """ Get the full order book.
    Docs: https://bitfinex.readme.io/v1/reference#rest-public-orderbook
    """
    endpoint = f'book/{symbol}'
    return request(authenticate=False,
                   version=1,
                   endpoint=endpoint,
                   method='GET',
                   query_params=params)
Ejemplo n.º 7
0
def ticker(symbol='BTCUSD', **params):
    """ Gives innermost bid and asks and information on the most recent trade, as well as high, low and volume of the last 24 hours.
    Docs: https://bitfinex.readme.io/v1/reference#rest-public-ticker
    """
    endpoint = f'pubticker/{symbol}'
    return request(authenticate=False,
                   version=1,
                   endpoint=endpoint,
                   method='GET',
                   query_params=params)
Ejemplo n.º 8
0
def funding_book(currency='USD', **params):
    """ Get the full margin funding book.
    Docs: https://bitfinex.readme.io/v1/reference#rest-public-fundingbook
    """
    endpoint = f'lendbook/{currency}'
    return request(authenticate=False,
                   version=1,
                   endpoint=endpoint,
                   method='GET',
                   query_params=params)
Ejemplo n.º 9
0
def stats(symbol='BTCUSD', **params):
    """ Various statistics about the requested pair.
    Docs: https://bitfinex.readme.io/v1/reference#rest-public-stats
    """
    endpoint = f'stats/{symbol}'
    return request(authenticate=False,
                   version=1,
                   endpoint=endpoint,
                   method='GET',
                   query_params=params)
Ejemplo n.º 10
0
def symbols_details(**params):
    """ Get a list of valid symbol IDs and the pair details.
    Docs: https://bitfinex.readme.io/v1/reference#rest-public-symbol-details
    """
    endpoint = f'symbols_details'
    return request(authenticate=False,
                   version=1,
                   endpoint=endpoint,
                   method='GET',
                   query_params=params)
Ejemplo n.º 11
0
def total_taken_funds(key, secret_key, **params):
    """ View the total of your active-funding used in your position(s).
    Docs: https://bitfinex.readme.io/v1/reference#rest-auth-total-taken-funds
    """
    endpoint = 'total_taken_funds'
    return request(authenticate=True,
                   key=key,
                   secret_key=secret_key,
                   version=1,
                   endpoint=endpoint,
                   method='POST',
                   body_params=params)
Ejemplo n.º 12
0
def close_margin_funding(key, secret_key, **params):
    """ Allow you to close an unused or used taken fund
    Docs: https://bitfinex.readme.io/v1/reference#rest-auth-close-margin-funding
    """
    endpoint = 'funding/close'
    return request(authenticate=True,
                   key=key,
                   secret_key=secret_key,
                   version=1,
                   endpoint=endpoint,
                   method='POST',
                   body_params=params)
Ejemplo n.º 13
0
def delete(key, secret_key, **params):
    """ Delete user settings.
    Docs: https://bitfinex.readme.io/v2/reference#user-settings-delete
    """
    endpoint = 'auth/w/settings/del'
    return request(authenticate=True,
                   key=key,
                   secret_key=secret_key,
                   version=2,
                   endpoint=endpoint,
                   method='POST',
                   body_params=params)
Ejemplo n.º 14
0
def available_balances(key, secret_key, **params):
    """ Calculate available balance for order/offer
    Docs: https://bitfinex.readme.io/v2/reference#rest-auth-calc-bal-avail
    """
    endpoint = 'auth/calc/order/avail'
    return request(authenticate=True,
                   key=key,
                   secret_key=secret_key,
                   version=2,
                   endpoint=endpoint,
                   method='POST',
                   body_params=params)
Ejemplo n.º 15
0
def wallets(key, secret_key, **params):
    """ Get account wallets
    Docs: https://bitfinex.readme.io/v2/reference#rest-auth-wallets
    """
    endpoint = 'auth/r/wallets'
    return request(authenticate=True,
                   key=key,
                   secret_key=secret_key,
                   version=2,
                   endpoint=endpoint,
                   method='POST',
                   body_params=params)
Ejemplo n.º 16
0
def active_credits(key, secret_key, **params):
    """ View your funds currently taken (active credits).
    Docs: https://bitfinex.readme.io/v1/reference#rest-auth-active-credits
    """
    endpoint = 'credits'
    return request(authenticate=True,
                   key=key,
                   secret_key=secret_key,
                   version=1,
                   endpoint=endpoint,
                   method='POST',
                   body_params=params)
Ejemplo n.º 17
0
def offers_active(key, secret_key, **params):
    """ View your active offers.
    Docs: https://bitfinex.readme.io/v1/reference#rest-auth-offers
    """
    endpoint = 'offers'
    return request(authenticate=True,
                   key=key,
                   secret_key=secret_key,
                   version=1,
                   endpoint=endpoint,
                   method='POST',
                   body_params=params)
Ejemplo n.º 18
0
def offer_new(key, secret_key, **params):
    """ Submit a new offer.
    Docs: https://bitfinex.readme.io/v1/reference#rest-auth-new-offer
    """
    endpoint = 'offer/new'
    return request(authenticate=True,
                   key=key,
                   secret_key=secret_key,
                   version=1,
                   endpoint=endpoint,
                   method='POST',
                   body_params=params)
Ejemplo n.º 19
0
def offer_cancel(key, secret_key, **params):
    """ Cancel an offer.
    Docs: https://bitfinex.readme.io/v1/reference#rest-auth-cancel-offer
    """
    endpoint = 'offer/cancel'
    return request(authenticate=True,
                   key=key,
                   secret_key=secret_key,
                   version=1,
                   endpoint=endpoint,
                   method='POST',
                   body_params=params)
Ejemplo n.º 20
0
def balance(key, secret_key, **params):
    """ View all of your balance ledger entries.
    Docs: https://bitfinex.readme.io/v1/reference#rest-auth-balance-history
    """
    endpoint = 'history'
    return request(authenticate=True,
                   key=key,
                   secret_key=secret_key,
                   version=1,
                   endpoint=endpoint,
                   method='POST',
                   body_params=params)
Ejemplo n.º 21
0
def offer_status(key, secret_key, **params):
    """ Get the status of an offer. Is it active? Was it cancelled? To what extent has it been executed? etc.
    Docs: https://bitfinex.readme.io/v1/reference#rest-auth-offer-status
    """
    endpoint = 'offer/status'
    return request(authenticate=True,
                   key=key,
                   secret_key=secret_key,
                   version=1,
                   endpoint=endpoint,
                   method='POST',
                   body_params=params)
Ejemplo n.º 22
0
def past_fundings(key, secret_key, **params):
    """ View your past fundings trades.
    Docs: https://bitfinex.readme.io/v1/reference#rest-auth-mytrades-funding
    """
    endpoint = 'mytrades_funding'
    return request(authenticate=True,
                   key=key,
                   secret_key=secret_key,
                   version=1,
                   endpoint=endpoint,
                   method='POST',
                   body_params=params)
Ejemplo n.º 23
0
def offers_hist(key, secret_key, **params):
    """ View your latest inactive offers. Limited to last 3 days and 1 request per minute.
    Docs: https://bitfinex.readme.io/v1/reference#rest-auth-offers-hist
    """
    endpoint = 'offers/hist'
    return request(authenticate=True,
                   key=key,
                   secret_key=secret_key,
                   version=1,
                   endpoint=endpoint,
                   method='POST',
                   body_params=params)
Ejemplo n.º 24
0
def deposit_withdrawal_movements(key, secret_key, Currency='BTC', **params):
    """ View your past deposits/withdrawals.
    Docs: https://bitfinex.readme.io/v2/reference#movements
    """
    endpoint = f'auth/r/movements/{Currency}/hist'
    return request(authenticate=True,
                   key=key,
                   secret_key=secret_key,
                   version=2,
                   endpoint=endpoint,
                   method='POST',
                   body_params=params)
Ejemplo n.º 25
0
def active_funding_used_in_a_margin_position(key, secret_key, **params):
    """ View your funding currently borrowed and used in a margin position.
    Docs: https://bitfinex.readme.io/v1/reference#rest-auth-active-funding-used-in-a-margin-position
    """
    endpoint = 'taken_funds'
    return request(authenticate=True,
                   key=key,
                   secret_key=secret_key,
                   version=1,
                   endpoint=endpoint,
                   method='POST',
                   body_params=params)
Ejemplo n.º 26
0
def past_trades(key, secret_key, Symbol='tBTCUSD', **params):
    """ Get Trades generated by an Order
    Docs: https://bitfinex.readme.io/v2/reference#rest-auth-trades-hist
    """
    endpoint = f'auth/r/trades/{Symbol}/hist'
    return request(authenticate=True,
                   key=key,
                   secret_key=secret_key,
                   version=2,
                   endpoint=endpoint,
                   method='POST',
                   body_params=params)
Ejemplo n.º 27
0
def funding_info(key, secret_key, Symbol='fUSD', **params):
    """ Get account funding info
    Docs: https://bitfinex.readme.io/v2/reference#rest-auth-info-funding
    """
    endpoint = f'auth/r/info/funding/{Symbol}'
    return request(authenticate=True,
                   key=key,
                   secret_key=secret_key,
                   version=2,
                   endpoint=endpoint,
                   method='POST',
                   body_params=params)
Ejemplo n.º 28
0
def past_fundings(key, secret_key, Symbol='fUSD', **params):
    """ Get funding trades
    Docs: https://bitfinex.readme.io/v2/reference#rest-auth-funding-trades-hist
    """
    endpoint = f'auth/r/funding/trades/{Symbol}/hist'
    return request(authenticate=True,
                   key=key,
                   secret_key=secret_key,
                   version=2,
                   endpoint=endpoint,
                   method='POST',
                   body_params=params)
Ejemplo n.º 29
0
def ledgers(key, secret_key, Currency='fUSD', **params):
    """ View your past ledger entries.
    Docs: https://bitfinex.readme.io/v2/reference#ledgers
    """
    endpoint = f'auth/r/ledgers/{Currency}/hist'  #if Currency else 'auth/r/ledgers/hist'
    return request(authenticate=True,
                   key=key,
                   secret_key=secret_key,
                   version=2,
                   endpoint=endpoint,
                   method='POST',
                   body_params=params)
Ejemplo n.º 30
0
def read(key, secret_key, **params):
    """ Read user settings
    Docs: https://bitfinex.readme.io/v2/reference#user-settings-read
    """
    endpoint = 'auth/r/settings'
    return request(authenticate=True,
                   key=key,
                   secret_key=secret_key,
                   version=2,
                   endpoint=endpoint,
                   method='POST',
                   body_params=params)