IonPanda¶
Imports and Params¶
[1]:
from Ionomy import IonPanda
from decouple import config
MARKET = 'btc-hive'
CURRENCY = 'hive'
BASE = 'btc'
TIME = 'day'
AMOUNT = 1
PRICE = 0.0000001
Instantiation¶
[2]:
ionpd = IonPanda(config('IONOMY_KEY'), config('IONOMY_SECRET'))
Public Endpoint Methods¶
Markets¶
[3]:
markets_pd = ionpd.markets()
markets_pd.head()
[3]:
market | title | currencyBase | currencyMarket | orderMinSize | buyFee | sellFee | inMaintenance | |
---|---|---|---|---|---|---|---|---|
0 | btc-eth | Bitcoin:Ethereum | btc | eth | 0.00001 | 0.2 | 0.2 | False |
1 | btc-ion | Bitcoin:Ion | btc | ion | 0.00001 | 0.2 | 0.2 | False |
2 | btc-dash | Bitcoin:Dash | btc | dash | 0.00001 | 0.2 | 0.2 | False |
3 | btc-pivx | Bitcoin:Pivx | btc | pivx | 0.00001 | 0.2 | 0.2 | False |
4 | btc-atoms | Bitcoin:Atoms | btc | atoms | 0.00001 | 0.0 | 0.4 | False |
Currencies¶
[4]:
currencies_pd = ionpd.currencies()
currencies_pd.head()
[4]:
currency | title | withdrawMinSize | withdrawFee | inMaintenance | canDeposit | canWithdraw | |
---|---|---|---|---|---|---|---|
0 | dash | Dash | 0.001 | 0.0020 | False | True | True |
1 | pivx | Pivx | 0.001 | 0.1000 | False | True | True |
2 | ion | Ion | 0.250 | 0.5000 | False | True | True |
3 | btc | Bitcoin | 0.001 | 0.0005 | False | True | True |
4 | eth | Ethereum | 0.001 | 0.0060 | False | True | True |
Order Book¶
[6]:
order_book_pd = ionpd.order_book(MARKET)
order_book_pd.head()
[6]:
size | price | type | |
---|---|---|---|
0 | 207.0 | 0.000033 | bid |
1 | 3.2 | 0.000033 | bid |
2 | 160.0 | 0.000032 | bid |
3 | 143.0 | 0.000032 | bid |
4 | 100.0 | 0.000032 | bid |
Market Summaries¶
[7]:
market_summaries_pd = ionpd.market_summaries()
market_summaries_pd.head()
[7]:
market | high | low | volume | price | change | baseVolume | bidsOpenOrders | bidsLastPrice | highestBid | asksOpenOrders | asksLastPrice | lowestAsk | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | btc-ion | 0.000003 | 0.000003 | 3488.067194 | 0.000003 | -17.05 | 0.008825 | 9 | 0.000003 | 0.000003 | 163 | 0.000003 | 0.000003 |
1 | btc-eth | 0.021500 | 0.019000 | 0.314676 | 0.019000 | -11.63 | 0.005979 | 10 | 0.019000 | 0.019000 | 14 | 0.022500 | 0.022500 |
2 | btc-ltc | 0.004750 | 0.000560 | 11.346268 | 0.000560 | -13.85 | 0.006354 | 10 | 0.004500 | 0.004500 | 43 | 0.005300 | 0.005300 |
3 | btc-dash | 0.007992 | 0.007949 | 0.130268 | 0.007949 | -0.54 | 0.001035 | 10 | 0.008000 | 0.007464 | 42 | 0.007949 | 0.007949 |
4 | btc-pivx | 0.000043 | 0.000028 | 345.795984 | 0.000028 | -21.96 | 0.009644 | 7 | 0.000029 | 0.000028 | 19 | 0.000036 | 0.000043 |
Market Summary¶
[8]:
market_summary = ionpd.market_summary(MARKET)
market_summary
[8]:
{'market': 'btc-hive',
'high': '0.00003538',
'low': '0.00003300',
'volume': '3856.61483680',
'price': '0.00003370',
'change': '2.06',
'baseVolume': '0.12996792',
'bidsOpenOrders': '39',
'bidsLastPrice': '0.00003301',
'highestBid': '0.00003301',
'asksOpenOrders': '47',
'asksLastPrice': '0.00003447',
'lowestAsk': '0.00003370'}
Market History¶
[9]:
market_history = ionpd.market_history(MARKET)
market_history.head()
[9]:
type | amount | price | total | createdAt | |
---|---|---|---|---|---|
0 | MARKET_BUY | 140.930038 | 0.000034 | 0.004749 | 2020-05-16 09:28:58 |
1 | MARKET_BUY | 71.402354 | 0.000034 | 0.002463 | 2020-05-16 06:14:42 |
2 | MARKET_BUY | 88.000000 | 0.000034 | 0.002979 | 2020-05-16 06:14:42 |
3 | LIMIT_BUY | 50.000000 | 0.000034 | 0.001692 | 2020-05-16 06:01:16 |
4 | MARKET_BUY | 74.982622 | 0.000034 | 0.002579 | 2020-05-16 03:27:41 |
Market Endpoint Methods¶
Limit Buy/Sell Orders¶
[ ]:
order = ionpd.limit_buy(AMOUNT, PRICE, MARKET)
order = ionpd.limit_sell(AMOUNT, PRICE, MARKET)
Success¶
[ ]:
success = ionpd.cancel_order(ORDERID)
Order Status¶
[ ]:
order_status = ionpd.order_status(ORDERID)
Account Endpoint Methods¶
Open Orders¶
[10]:
open_orders_pd = ionpd.open_orders(MARKET)
open_orders_pd
[10]:
orderId | market | type | amount | price | filled | createdAt |
---|
Balances¶
[11]:
balances_pd = ionpd.balances()
balances_pd.head()
[11]:
currency | available | reserved | |
---|---|---|---|
0 | btc | 0.115747 | 1.000000e-08 |
1 | ion | 0.000000 | 0.000000e+00 |
2 | steem | 0.560000 | 0.000000e+00 |
3 | hive | 0.548145 | 0.000000e+00 |
4 | gravity-live | 0.000000 | 0.000000e+00 |
Balance¶
[12]:
balance = ionpd.balance(CURRENCY)
balance
[12]:
{'currency': 'hive', 'available': '0.54814539', 'reserved': '0.00000000'}
Deposit Address¶
[13]:
deposit_address = ionpd.deposit_address(CURRENCY)
deposit_address
[13]:
{'currency': 'hive', 'address': '5e8f6cd1a2a3e2080524eb42'}
Deposit History¶
[14]:
deposit_history_pd = ionpd.deposit_history(CURRENCY)
deposit_history_pd.head()
[14]:
currency | deposits |
---|
Withdrawal History¶
[15]:
withdrawal_history_pd = ionpd.withdrawal_history(CURRENCY)
withdrawal_history_pd.head()
[15]:
transactionId | state | currency | amount | feeAmount | createdAt | |
---|---|---|---|---|---|---|
0 | 5e8f726da2a3e220e6566b72 | PROCESSED | hive | 7186.010000 | 0.01 | 2020-04-09 19:07:25 |
1 | 5e8f9934a2a3e24bda6b9962 | PROCESSED | hive | 579.563903 | 0.01 | 2020-04-09 21:52:52 |
2 | 5e9a6fe4a2a3e2016530b782 | PROCESSED | hive | 6194.010000 | 0.01 | 2020-04-18 03:11:32 |
3 | 5ea24752a2a3e2245f19e352 | PROCESSED | hive | 4308.010000 | 0.01 | 2020-04-24 01:56:34 |
4 | 5eacd1792249e5764b7323d2 | PROCESSED | hive | 124.050000 | 0.05 | 2020-05-02 01:48:41 |
[ ]: