Ejemplo n.º 1
0
 def __init__(self,
              api_key=os.getenv("GEMINI_AUDITOR_API_KEY"),
              api_secret=os.getenv("GEMINI_AUDITOR_API_SECRET"),
              sandbox=False):
     self._auditor_api_key = api_key
     self._auditor_api_secret = api_secret
     self.public_client = gemini.PublicClient()
     self.private_client = gemini.PrivateClient(self._auditor_api_key,
                                                self._auditor_api_secret)
Ejemplo n.º 2
0
import binance.client
import coinbasepro
import gemini
from serenity.db.api import connect_serenity_db, InstrumentCache, TypeCodeCache

if __name__ == '__main__':
    conn = connect_serenity_db()
    conn.autocommit = True
    cur = conn.cursor()

    type_code_cache = TypeCodeCache(cur)
    instrument_cache = InstrumentCache(cur, type_code_cache)

    # map all Gemini products to exchange_instrument table
    gemini_client = gemini.PublicClient()
    for symbol in gemini_client.symbols():
        base_ccy = symbol[0:3].upper()
        quote_ccy = symbol[3:].upper()
        currency_pair = instrument_cache.get_or_create_cryptocurrency_pair(base_ccy, quote_ccy)
        instrument_cache.get_or_create_exchange_instrument(symbol, currency_pair.get_instrument(), 'Gemini')

    # map all Coinbase Pro products to exchange_instrument table
    cbp_client = coinbasepro.PublicClient()
    for product in cbp_client.get_products():
        symbol = product['id']
        base_ccy = product['base_currency']
        quote_ccy = product['quote_currency']
        currency_pair = instrument_cache.get_or_create_cryptocurrency_pair(base_ccy, quote_ccy)
        instrument_cache.get_or_create_exchange_instrument(symbol, currency_pair.get_instrument(), 'CoinbasePro')

    # map all Binance products to exchange_instrument table
Ejemplo n.º 3
0
import gemini
import inspect
import numpy as np
import pandas as pd
import datetime
import time

r = gemini.PublicClient()

r.symbols()

r.get_ticker("BTCUSD")

r.get_current_order_book("BTCUSD")

# Will get the latest 500 trades
r.get_trade_history("BTCUSD")
# Alternatively, it can be specified for a specific date
r.get_trade_history("BTCUSD", since="17/06/2017")

# Will get the latest 500 auctions
r.get_auction_history("BTCUSD")
# Alternatively, it can be specified for a specific date
r.get_auction_history("BTCUSD", since="17/06/2017")
Ejemplo n.º 4
0
 def __init__(self):
     self.client = gemini.PublicClient()
     self.custom_client = CustomGeminiPublicClient()