This content was muted by moderators for not following community guidelines.

Access the Steem Dex With Python

Words
51
Reading
1 min
Listen
Play
8y


The internal Dex of Steem can be accessed via steem python see the read the docs. Here is a very basic example below:
https://steem.readthedocs.io/en/latest/tools.html#dex

#!/usr/bin/env python3
#-*- coding: utf-8 -*-
import os
from steem import Steem
#from steem.account import Account
#from steem.post import Post
from steem.dex import Dex




STEEM_KEY = os.getenv('STEEM_KEY') # You can use a
s = Steem(keys = [STEEM_KEY])

#dex = Dex(BOT_ACCOUNT, steemd_instance=s)
dex_t = Dex(steemd_instance=s)

buy_sell_dex_exchange_history = dex_t.market_history(bucket_seconds=300,start_age=3600,end_age=0)
print(buy_sell_dex_exchange_history)

This looks much better in VSCode:

Run the below example:

venv) $ export STEEM_KEY="INSERT WIF KEY HERE"

venv) $ python3 -Wd dex.py

Here are two articles on the Steem Dex that might interest you:
https://steemit.com/steemit/@rvanstel/two-weeks-of-trading-on-the-steemit-internal-market-let-s-see-how-i-ve-done
https://steemit.com/steemit/@rvanstel/why-you-should-trade-on-the-steemit-internal-market

Ending Credits:

Pic from here:
https://www.reddit.com/r/binance/comments/6zrprt/binance_a_decentralised_exchange/

Access the Steem Dex With Python | Ecency