gryphon.lib.exchange package

Submodules

gryphon.lib.exchange.base module

gryphon.lib.exchange.bitfinex_btc_usd module

gryphon.lib.exchange.bitme module

gryphon.lib.exchange.bitstamp_bch_btc module

gryphon.lib.exchange.bitstamp_bch_eur module

gryphon.lib.exchange.bitstamp_bch_usd module

gryphon.lib.exchange.bitstamp_btc_eur module

gryphon.lib.exchange.bitstamp_btc_usd module

gryphon.lib.exchange.bitstamp_eth_btc module

gryphon.lib.exchange.bitstamp_eth_eur module

gryphon.lib.exchange.bitstamp_eth_usd module

gryphon.lib.exchange.bitstamp_staging module

gryphon.lib.exchange.buttercoin module

gryphon.lib.exchange.cavirtex module

gryphon.lib.exchange.coinbase_btc_cad module

gryphon.lib.exchange.coinbase_btc_usd module

gryphon.lib.exchange.coinsetter module

gryphon.lib.exchange.consts module

gryphon.lib.exchange.exceptions module

A collection of exceptions to handle regular failures from exchange APIs.

exception gryphon.lib.exchange.exceptions.CachedOrderbookFailure(exchange, message)[source]

Bases: gryphon.lib.exchange.exceptions.ExchangeException

exception gryphon.lib.exchange.exceptions.CancelOrderNotFoundError[source]

Bases: gryphon.lib.exchange.exceptions.ExchangeException

exception gryphon.lib.exchange.exceptions.ExchangeAPIErrorException(exchange, message)[source]

Bases: gryphon.lib.exchange.exceptions.ExchangeException

exception gryphon.lib.exchange.exceptions.ExchangeAPIFailureException(exchange, response=None, message='')[source]

Bases: gryphon.lib.exchange.exceptions.ExchangeException

exception gryphon.lib.exchange.exceptions.ExchangeException[source]

Bases: exceptions.Exception

exception gryphon.lib.exchange.exceptions.ExchangeNotIntegratedError(exchange_name)[source]

Bases: gryphon.lib.exchange.exceptions.ExchangeException

This exception is used to indicate that the user is trying to trade on an exchange that Gryphon doesn’t know about or hasn’t been integrated.

exception gryphon.lib.exchange.exceptions.InsufficientFundsError[source]

Bases: gryphon.lib.exchange.exceptions.ExchangeException

exception gryphon.lib.exchange.exceptions.MinimumOrderSizeError[source]

Bases: gryphon.lib.exchange.exceptions.ExchangeException

exception gryphon.lib.exchange.exceptions.NoEffectOrderCancelledError[source]

Bases: gryphon.lib.exchange.exceptions.ExchangeException

exception gryphon.lib.exchange.exceptions.NonceError[source]

Bases: gryphon.lib.exchange.exceptions.ExchangeException

gryphon.lib.exchange.exchange_api_wrapper module

gryphon.lib.exchange.exchange_factory module

gryphon.lib.exchange.exchange_factory.all_bank_accounts(db)[source]
gryphon.lib.exchange.exchange_factory.all_current_and_historical_exchanges()[source]
gryphon.lib.exchange.exchange_factory.all_exchange_datas(db)[source]
gryphon.lib.exchange.exchange_factory.all_exchanges()[source]
gryphon.lib.exchange.exchange_factory.canonical_key(key)[source]
gryphon.lib.exchange.exchange_factory.get_all_initialized_exchange_wrappers(db)[source]
gryphon.lib.exchange.exchange_factory.get_api_wrapper_class_by_name(exchange_name)[source]
gryphon.lib.exchange.exchange_factory.historical_exchange_datas(db)[source]
gryphon.lib.exchange.exchange_factory.historical_exchanges()[source]
gryphon.lib.exchange.exchange_factory.initialized_ledgers(db)[source]

Give us the names of the exchanges that have initialized ledgers in our trading database.

gryphon.lib.exchange.exchange_factory.make_exchange_data_from_key(key, db)[source]
gryphon.lib.exchange.exchange_factory.make_exchange_datas_from_keys(pair_names, db)[source]
gryphon.lib.exchange.exchange_factory.make_exchange_from_key(key)[source]
gryphon.lib.exchange.exchange_factory.map_pair_name_to_exchange_name(pair_name)[source]

We’re preparing to add the notion that exchanges can have multiple trading pairs into our system. Each exchange is going to have a single ExchangeData db object but have one wrapper for each pair. Order.exchange_name is going to refer to the pair, but most accounting functions take place on the ExchangeData object. Thus, we need a mapping of ExchangeWrapper -> ExchangeData. This function will serve that purpose for now.

To add a master-slave relationship to a pair, add a line like this:
if pair_name == ‘GEMINI_ETH_USD’: # [slave pair]
return ‘GEMINI_BTC_USD’ # [master pair]

gryphon.lib.exchange.exchange_order module

gryphon.lib.exchange.exchange_trade module

gryphon.lib.exchange.gemini_btc_usd module

gryphon.lib.exchange.gemini_eth_btc module

gryphon.lib.exchange.gemini_eth_usd module

gryphon.lib.exchange.gemini_ltc_usd module

gryphon.lib.exchange.gemini_zec_usd module

gryphon.lib.exchange.itbit_btc_usd module

gryphon.lib.exchange.kraken_btc_cad module

gryphon.lib.exchange.kraken_btc_eur module

gryphon.lib.exchange.kraken_btc_usd module

gryphon.lib.exchange.okcoin_btc_usd module

gryphon.lib.exchange.order_types module

A simple enumeration we use to define order types like market, limit, IOC. This is forward looking as we expect this list to only grow.

gryphon.lib.exchange.poloniex_eth_btc module

gryphon.lib.exchange.quadriga_btc_cad module

gryphon.lib.exchange.retry module

gryphon.lib.exchange.sim_exchange module

gryphon.lib.exchange.vault_of_satoshi module

Module contents