BitPanda

Imports and Params

[1]:
from Ionomy import BitPanda
from decouple import config

MARKET = 'btc-hive'
CURRENCY = 'hive'
BASE = 'btc'
TIME = 'day'

Instantiation

[3]:
bp = BitPanda(config('TREX_KEY'), config('TREX_SECRET'))

Public Endpoint Methods

Markets

[5]:
markets_pd = bp.markets()
markets_pd.head()
[5]:
MarketCurrency BaseCurrency MarketCurrencyLong BaseCurrencyLong MinTradeSize MarketName IsActive IsRestricted Created Notice IsSponsored LogoUrl
0 LTC BTC Litecoin Bitcoin 0.032972 BTC-LTC True False 2014-02-13 None None https://bittrexblobstorage.blob.core.windows.n...
1 DOGE BTC Dogecoin Bitcoin 1000.000000 BTC-DOGE True False 2014-02-13 None None https://bittrexblobstorage.blob.core.windows.n...
2 VTC BTC Vertcoin Bitcoin 8.830802 BTC-VTC True False 2014-02-13 None None https://bittrexblobstorage.blob.core.windows.n...
3 PPC BTC Peercoin Bitcoin 6.025548 BTC-PPC True False 2014-02-13 None None https://bittrexblobstorage.blob.core.windows.n...
4 FTC BTC Feathercoin Bitcoin 213.675214 BTC-FTC True False 2014-02-13 None None https://bittrexblobstorage.blob.core.windows.n...

Currencies

[6]:
currencies_pd = bp.currencies()
currencies_pd.head()
[6]:
Currency CurrencyLong MinConfirmation TxFee IsActive IsRestricted CoinType BaseAddress Notice
0 BTC Bitcoin 2 0.0005 True False BITCOIN 1N52wHoVR79PMDishab2XmRHsbekCdGquK None
1 LTC Litecoin 6 0.0100 True False BITCOIN16 LhyLNfBkoKshT7R8Pce6vkB9T2cP2o84hx None
2 DOGE Dogecoin 6 2.0000 True False BITCOIN D9GqmkGCpgtnXP7xMD78v9xfqeDkqBZBMT None
3 VTC Vertcoin 600 0.0200 True False BITCOIN16 VfukW89WKT9h3YjHZdSAAuGNVGELY31wyj None
4 PPC Peercoin 12 0.0200 True False BITCOIN16 None None

Ticker

[7]:
bp.ticker(MARKET)
[7]:
{'Bid': 3.381e-05, 'Ask': 3.409e-05, 'Last': 3.38e-05}

Market Summaries

[9]:
market_summaries_pd = bp.market_summaries()
market_summaries_pd.head()
[9]:
MarketName High Low Volume Last BaseVolume TimeStamp Bid Ask OpenBuyOrders OpenSellOrders PrevDay Created
0 BTC-STPT 1.090000e-06 1.060000e-06 8.975255e+04 1.090000e-06 0.096687 2020-05-15 18:58:54.720 1.070000e-06 1.100000e-06 40.0 271.0 1.060000e-06 2019-06-11 18:34:44.627
1 ETH-WAXP 1.639700e-04 1.523000e-04 8.819855e+04 1.550100e-04 13.731805 2020-05-15 18:58:54.720 1.540300e-04 1.597800e-04 109.0 109.0 1.569600e-04 2018-02-15 01:09:15.167
2 ETH-FX 2.740000e-04 2.519900e-04 4.506822e+04 2.630000e-04 11.563228 2020-05-15 18:58:54.720 2.610000e-04 2.680000e-04 72.0 135.0 2.590000e-04 2019-04-23 17:00:38.527
3 BTC-PLA 5.000000e-08 4.000000e-08 1.844084e+06 4.000000e-08 0.074589 2020-05-15 18:58:54.720 3.000000e-08 4.000000e-08 45.0 137.0 5.000000e-08 2019-03-28 17:12:11.213
4 EUR-USDT 9.330000e-01 9.230000e-01 2.398502e+04 9.270000e-01 22295.859801 2020-05-15 18:58:54.720 9.230000e-01 9.290000e-01 73.0 72.0 9.300000e-01 2020-03-30 06:19:27.620

Market Summary

[12]:
bp.market_summary(MARKET)
[12]:
{'MarketName': 'BTC-HIVE',
 'High': 3.453e-05,
 'Low': 3.28e-05,
 'Volume': 275969.44525378,
 'Last': 3.365e-05,
 'BaseVolume': 9.35729375,
 'TimeStamp': '2020-05-15T18:59:34.75',
 'Bid': 3.37e-05,
 'Ask': 3.406e-05,
 'OpenBuyOrders': 389,
 'OpenSellOrders': 858,
 'PrevDay': 3.4e-05,
 'Created': '2020-03-21T20:13:46.243'}

Order Book

[13]:
order_book_pd = bt.order_book(MARKET)
order_book_pd.head()
[13]:
Quantity Rate type
0 833.815866 0.000034 bid
1 1700.000000 0.000034 bid
2 59.127338 0.000034 bid
3 1589.495316 0.000034 bid
4 557.397472 0.000034 bid

Market History

[15]:
market_history_pd = bp.market_history(MARKET)
market_history_pd.head()
[15]:
Id TimeStamp Quantity Price Total FillType OrderType Uuid
0 65288419 2020-05-15 18:59:18.930 28737.484222 0.000034 0.967016 FILL SELL 5bb886f8-7f19-478c-97cf-9f1127f3a698
1 65288418 2020-05-15 18:59:18.930 84.785096 0.000034 0.002854 FILL SELL 17bf5e26-8aa6-4eab-aca0-a87a84e601e0
2 65288417 2020-05-15 18:59:18.930 464.468900 0.000034 0.015639 FILL SELL 4fd0d932-0f83-46f3-b34c-f55864c19199
3 65288416 2020-05-15 18:59:18.930 1700.000000 0.000034 0.057375 FILL SELL 6d30c744-537a-4b71-a93a-7194c004f932
4 65288415 2020-05-15 18:59:18.930 35.000000 0.000034 0.001181 FILL SELL a9a528d8-4d5d-4488-9314-4343a0dca7f8

Market Endpoint Methods

Limit Buy/Sell Order

[ ]:
order_uuid = bp.buy_limit(MARKET, QUANTITY, RATE, TIMEINFORCE)
order_uuid = bp.sell_limit(MARKET, QUANTITY, RATE, TIMEINFORCE)

Cancel Order

[ ]:
order_uuid = bp.cancel(UUID)

Order Status

[ ]:
order = bp.get_order(UUID)

Account Endpoint Methods

Balances

[16]:
balances_pd = bp.balances()
balances_pd.head()
[16]:
Currency Balance Available Pending CryptoAddress
0 BTC 1.000000e-08 1.000000e-08 0.0 None
1 BTXCRD 8.489922e+00 8.489922e+00 0.0 None
2 HIVE 1.372603e+04 1.372603e+04 0.0 30c05de7684c4bf1817
3 STEEM 0.000000e+00 0.000000e+00 0.0 acc190939a9248d981f

Balance

[17]:
bp.balance(CURRENCY)
[17]:
{'Currency': 'HIVE',
 'Balance': 13726.03479181,
 'Available': 13726.03479181,
 'Pending': 0.0,
 'CryptoAddress': '30c05de7684c4bf1817'}

Order History

[18]:
order_history_pd = bp.order_history()
order_history_pd.head()
[18]:
OrderUuid Exchange TimeStamp OrderType Limit Quantity QuantityRemaining Commission Price PricePerUnit IsConditional Condition ConditionTarget ImmediateOrCancel Closed
0 74b7ccde-f6f5-4083-8d0e-e56c080015a1 BTC-HIVE 2020-05-14 21:11:14.440 LIMIT_BUY 0.000034 1128.493453 0.000000 0.000077 0.038482 0.000034 False 0.0 False 2020-05-14 21:11:14.440
1 b1be09e1-c0b5-40fd-bae1-9ef061521483 BTC-HIVE 2020-05-14 21:09:07.890 LIMIT_BUY 0.000034 2828.824311 1128.824311 0.000116 0.057953 0.000034 False 0.0 False 2020-05-14 21:09:34.990
2 aef02e01-641f-4a0a-9223-05a846e47e4c BTC-STEEM 2020-05-14 21:06:01.770 MARKET_SELL NaN 5439.624000 0.000000 0.000193 0.096666 0.000018 False 0.0 True 2020-05-14 21:06:01.770
3 aba84609-e842-4681-90b1-42fb24501174 BTC-HIVE 2020-05-13 14:27:35.190 LIMIT_BUY 0.000035 485.000000 0.000000 0.000034 0.016975 0.000035 False 0.0 False 2020-05-13 21:59:27.830
4 bf5b235d-ea76-4bd7-bf37-eebaaaea05dd BTC-STEEM 2020-05-13 12:55:44.540 MARKET_SELL NaN 912.726000 0.000000 0.000034 0.016958 0.000019 False 0.0 True 2020-05-13 12:55:44.540

Deposit History

[19]:
deposit_history_pd = bp.deposit_history(CURRENCY)
deposit_history_pd.head()
[19]:
Id Amount Currency Confirmations LastUpdated TxId CryptoAddress
0 102691733 7194.41 HIVE 59 2020-05-14 21:06:48.500 da01a679e0c7d7afd6de6e3753ca2beb7dea0caf 30c05de7684c4bf1817

Deposit History

[20]:
bp.deposit_address(CURRENCY)
[20]:
{'Currency': 'HIVE', 'Address': '30c05de7684c4bf1817'}

Withdrawal History

[21]:
withdrawal_history_pd = bp.withdrawal_history(CURRENCY)
withdrawal_history_pd.head()
[21]:
PaymentUuid Currency Amount Address Opened Authorized PendingPayment TxCost TxId Canceled InvalidAddress
0 cee4a123-5656-4938-a777-66a05df1b500 HIVE 0.990000 memehub 2020-05-15 18:18:00.133 True False 0.01 bd6a480971ab8fdf28bf46375551df9149b241dd False False
1 35aca318-89b1-4aa5-9b1a-2ca702b8268f HIVE 0.990000 memehub 2020-05-15 18:17:31.920 True False 0.01 182ce6ce3c7e3b615c2558d046838dd904a85b7e False False
2 78943ce0-b6d4-4fcb-991a-7516e4323e82 HIVE 13728.024792 memehub 2020-05-15 18:13:44.513 False False 0.01 None True False

Withdraw

[ ]:
uuid = bt.withdraw(CURRENCY, QUANTITY, ADDRESS, PAYMENTID_OPTIONAL)