<center></center> So, you fancy dabbling with liquidity pools but don’t want to leave your cozy Python cocoon? Well, you're in luck! I've whipped up a small Python script — because why not add more joy to your life, right? — that fetches token pairs for any account you specify. It’s like Pokémon, but instead of Pikachu, you're catching SWAP.ETH. Here’s how you can use it: `python fetch_liquidity_pools.py`, or use attributes like this: `python fetch_liquidity_pools.py accountname TOKEN(:OTHERTOKEN)` <div class="pull-right"> <center></center> </div> By default, this script keeps it cool with hive-engine and BTC. You can try ALL if you're feeling adventurous, but be warned — Hive Engine has more pairs than a shoe store, and the script might just throw a tantrum (hence why BTC is the default). ## Example of the Magic in Action: Run it like this: `python fetch_liquidity_pools.py hive-engine ETH` And voila, you'll see something like this: ``` Liquidity Pool Positions with ETH token: Token Pair: SWAP.HIVE:SWAP.ETH | Base Balance: 31206.634533 SWAP.HIVE | Quote Balance: 2.242819 SWAP.ETH Token Pair: BEE:SWAP.ETH | Base Balance: 42215.817136 BEE | Quote Balance: 1.422489 SWAP.ETH Token Pair: SWAP.BTC:SWAP.ETH | Base Balance: 0.007309 SWAP.BTC | Quote Balance: 0.169925 SWAP.ETH Token Pair: SWAP.ETH:SWAP.USDT | Base Balance: 0.151195 SWAP.ETH | Quote Balance: 351.954867 SWAP.USDT Token Pair: SWAP.ETH:SPS | Base Balance: 0.033753 SWAP.ETH | Quote Balance: 11164.970135 SPS ``` ## Using the Script Like a Pro: If you’re the type who loves to DIY, you can also use the script as a function in your own scripts. Just do a: ``` from fetch_liquidity_pools import get_filtered_pools ``` And Bob’s your uncle! ## The Secret Sauce — AKA the Script Itself: Now, I know you’re itching to see the magic behind the curtain, so here it is — all 99 lines of it. (Yes, I counted. Twice.) Don’t worry if it looks like hieroglyphics; I've sprinkled some comments to help you along the way. ``` # fetch_liquidity_pools.py import argparse import requests from time import sleep # Hive-Engine API Node HIVE_ENGINE_NODE = 'https://api2.hive-engine.com/rpc/contracts' retry_delay = 5 # seconds to wait between retries max_retries = 3 # Maximum number of retries # Default values DEFAULT_ACCOUNT_NAME = 'hive-engine' # Replace with your actual Hive account name DEFAULT_FILTER_TOKEN = 'BTC' # Replace with the desired token to filter, or use 'ALL' to list all tokens def fetch_liquidity_positions(account_name): # Fetch liquidity positions for the given account url = HIVE_ENGINE_NODE payload = { "jsonrpc": "2.0", "id": 1, "method": "find", "params": { "contract": "marketpools", "table": "liquidityPositions", "query": {"account": account_name}, "limit": 1000 } } response = requests.post(url, json=payload) if response.status_code != 200: print(f"Error: Failed to fetch data. Status Code: {response.status_code}") return [] try: data = response.json() except ValueError: print("Error: Failed to parse JSON response.") return [] return data.get('result', []) def fetch_pool_details(token_pair): # Fetch details of the specified liquidity pool for attempt in range(max_retries): url = HIVE_ENGINE_NODE payload = { "jsonrpc": "2.0", "id": 1, "method": "find", "params": { "contract": "marketpools", "table": "pools", "query": {"tokenPair": token_pair}, "limit": 1 } } response = requests.post(url, json=payload) if response.status_code == 200: try: data = response.json() except ValueError: print("Error: Failed to parse JSON response.") return {} if 'result' in data and data['result']: return data['result'][0] print(f"Error: Failed to fetch pool details for {token_pair}. Status Code: {response.status_code}") if attempt < max_retries - 1: sleep(retry_delay) else: print(f"Max retries exceeded for {token_pair}. Skipping.") return {} def get_filtered_pools(account_name, filter_token): # Get and filter pools by the specified token positions = fetch_liquidity_positions(account_name) filtered_pools = [] for position in positions: token_pair = position.get('tokenPair', 'Unknown') # If filter_token is 'ALL', skip filtering; otherwise, check for the token in the pair if filter_token.upper() != 'ALL' and filter_token.upper() not in token_pair.upper(): continue shares = float(position.get('shares', '0')) pool_details = fetch_pool_details(token_pair) if not pool_details: continue total_shares = float(pool_details.get('totalShares', '0')) base_quantity = float(pool_details.get('baseQuantity', '0')) quote_quantity = float(pool_details.get('quoteQuantity', '0')) if total_shares == 0: continue user_base_balance = (shares / total_shares) * base_quantity user_quote_balance = (shares / total_shares) * quote_quantity if ':' in token_pair: base_symbol, quote_symbol = token_pair.split(':') else: base_symbol, quote_symbol = "Unknown", "Unknown" filtered_pools.append({ "token_pair": token_pair, "base_symbol": base_symbol, "quote_symbol": quote_symbol, "base_balance": user_base_balance, "quote_balance": user_quote_balance }) return filtered_pools def main(account_name, filter_token): # Main function to fetch and print filtered pools pools = get_filtered_pools(account_name, filter_token) print(f"\nLiquidity Pool Positions with {filter_token.upper()} token:") for pool in pools: print(f"Token Pair: {pool['token_pair']} | Base Balance: {pool['base_balance']:.6f} {pool['base_symbol']} | " f"Quote Balance: {pool['quote_balance']:.6f} {pool['quote_symbol']}") if __name__ == "__main__": parser = argparse.ArgumentParser(description='Fetch Hive-Engine liquidity pools.') parser.add_argument('account_name', nargs='?', default=DEFAULT_ACCOUNT_NAME, help='Hive account name to fetch liquidity pools for.') parser.add_argument('filter_token', nargs='?', default=DEFAULT_FILTER_TOKEN, help="Token to filter by, or 'ALL' to list all tokens.") args = parser.parse_args() main(args.account_name, args.filter_token) ``` Give it a spin and let me know if it brings you joy or just mild frustration. Either way, I’m here for the feedback!
author | gamer00 |
---|---|
permlink | python-wizardry-fetching-liquidity-pools |
category | hive-164872 |
json_metadata | "{"app":"ecency/3.2.0-vision","description":"So, you fancy dabbling with liquidity pools but don’t want to leave your cozy Python cocoon? Well, you're in luck! I've whipped up a small Python script — because why not add more joy to your life, right?","format":"markdown+html","image":["https://images.ecency.com/DQmQgHBWpBzayETP1EvtwLQgiQZYiGaHAQbrvpX8uPPj6NG/kiemis_mg_5396.jpg","https://images.ecency.com/DQmRDDRQQ4AMMZb5Btj6iPKwA7ra6qXiQZMTDFRDmpeBLtr/image.png"],"image_ratios":["1.5023","1.3333"],"tags":["hive-164872","hive","coding","python","script","hive-engine","liquidity","liquidity-pairs","justforfun","programming","ecency"],"thumbnails":["https://images.ecency.com/DQmQgHBWpBzayETP1EvtwLQgiQZYiGaHAQbrvpX8uPPj6NG/kiemis_mg_5396.jpg","https://images.ecency.com/DQmRDDRQQ4AMMZb5Btj6iPKwA7ra6qXiQZMTDFRDmpeBLtr/image.png"]}" |
created | 2024-09-10 19:24:45 |
last_update | 2024-09-10 21:18:57 |
depth | 0 |
children | 5 |
last_payout | 2024-09-17 19:24:45 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 4.226 HBD |
curator_payout_value | 4.188 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 7,104 |
author_reputation | 168,798,415,632,608 |
root_title | "Python Wizardry: Fetching Liquidity Pools from Hive Engine with a Simple Script" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 136,968,425 |
net_rshares | 31,728,000,817,704 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
kevinwong | 0 | 1,221,738,520 | 0.6% | ||
eric-boucher | 0 | 3,315,663,617 | 0.6% | ||
roelandp | 0 | 46,442,198,983 | 5% | ||
cloh76 | 0 | 823,383,258 | 0.6% | ||
lemouth | 0 | 287,547,092,587 | 10% | ||
netaterra | 0 | 6,523,387,278 | 0.6% | ||
tfeldman | 0 | 1,121,117,123 | 0.6% | ||
petrvl | 0 | 485,183,200,229 | 42% | ||
metabs | 0 | 1,121,258,786 | 10% | ||
mcsvi | 0 | 97,246,577,759 | 50% | ||
cnfund | 0 | 2,605,599,193 | 1.2% | ||
boxcarblue | 0 | 3,115,048,598 | 0.6% | ||
justyy | 0 | 8,751,484,213 | 1.2% | ||
disregardfiat | 0 | 84,538,736,280 | 3.24% | ||
michelle.gent | 0 | 714,729,303 | 0.24% | ||
curie | 0 | 69,762,047,270 | 1.2% | ||
modernzorker | 0 | 494,672,373 | 0.84% | ||
techslut | 0 | 26,576,346,806 | 4% | ||
steemstem | 0 | 184,956,865,948 | 10% | ||
yadamaniart | 0 | 923,762,961 | 0.6% | ||
valth | 0 | 1,513,029,961 | 5% | ||
metroair | 0 | 5,507,920,484 | 1.2% | ||
darth-azrael | 0 | 74,090,039,439 | 25% | ||
dna-replication | 0 | 343,742,256 | 10% | ||
darth-cryptic | 0 | 13,216,265,028 | 25% | ||
tarazkp | 0 | 2,794,911,899,142 | 40% | ||
privex | 0 | 780,215,381 | 1.2% | ||
dhimmel | 0 | 54,880,149,712 | 2.5% | ||
freebornsociety | 0 | 2,664,952,542 | 5.22% | ||
detlev | 0 | 6,552,978,381 | 0.36% | ||
federacion45 | 0 | 1,761,148,590 | 0.6% | ||
gamersclassified | 0 | 1,138,356,811 | 0.6% | ||
adriansky | 0 | 8,799,200,380 | 100% | ||
forykw | 0 | 4,087,535,112 | 0.6% | ||
xplosive | 0 | 30,626,036,665 | 100% | ||
mobbs | 0 | 30,053,698,431 | 10% | ||
jerrybanfield | 0 | 3,907,344,952 | 1.2% | ||
rt395 | 0 | 2,277,732,965 | 1.5% | ||
bitrocker2020 | 0 | 2,398,857,209 | 0.24% | ||
ninahaskin | 0 | 429,607,776,796 | 100% | ||
sustainablyyours | 0 | 2,963,820,029 | 5% | ||
cryptoknight12 | 0 | 14,396,514,935 | 49.76% | ||
helo | 0 | 521,113,727 | 5% | ||
arunava | 0 | 3,439,825,651 | 0.48% | ||
juancar347 | 0 | 3,767,054,637 | 0.6% | ||
samminator | 0 | 5,651,706,933 | 5% | ||
belahejna | 0 | 84,080,767,046 | 42% | ||
turpsy | 0 | 6,070,394,277 | 80% | ||
enjar | 0 | 10,979,991,697 | 1.08% | ||
lorenzor | 0 | 1,281,166,868 | 50% | ||
sam99 | 0 | 12,561,639,335 | 21% | ||
jackmiller | 0 | 561,930,896 | 70% | ||
alexander.alexis | 0 | 6,018,399,855 | 10% | ||
dandesign86 | 0 | 17,183,904,052 | 8% | ||
jayna | 0 | 1,631,486,238 | 0.24% | ||
princessmewmew | 0 | 1,568,640,004 | 0.6% | ||
joeyarnoldvn | 0 | 462,538,800 | 1.47% | ||
grocko | 0 | 46,512,082,756 | 50% | ||
gunthertopp | 0 | 14,967,932,994 | 0.3% | ||
pipiczech | 0 | 515,462,166 | 1.2% | ||
godfish | 0 | 633,032,837,828 | 50% | ||
empath | 0 | 1,011,255,237 | 0.6% | ||
tattoodjay | 0 | 488,914,359,090 | 15% | ||
kaminchan | 0 | 15,992,155,400 | 72% | ||
minnowbooster | 0 | 824,102,029,315 | 20% | ||
felt.buzz | 0 | 1,755,080,240 | 0.3% | ||
howo | 0 | 110,512,925,739 | 10% | ||
tsoldovieri | 0 | 1,014,881,645 | 5% | ||
nikdo | 0 | 10,936,474,738 | 50% | ||
neumannsalva | 0 | 1,042,458,728 | 0.6% | ||
stayoutoftherz | 0 | 33,940,533,192 | 0.3% | ||
abigail-dantes | 0 | 3,793,690,368 | 10% | ||
coindevil | 0 | 594,193,959 | 0.96% | ||
bambukah | 0 | 17,395,732,094 | 20% | ||
zonguin | 0 | 495,021,525 | 2.5% | ||
investingpennies | 0 | 3,530,869,868 | 1.2% | ||
ahlawat | 0 | 4,601,546,712 | 8.6% | ||
iamphysical | 0 | 4,720,383,841 | 90% | ||
zyx066 | 0 | 626,168,739 | 0.36% | ||
pearlumie | 0 | 2,211,277,346 | 70% | ||
revo | 0 | 2,478,330,338 | 1.2% | ||
azulear | 0 | 898,595,598 | 100% | ||
psicoluigi | 0 | 763,678,519 | 50% | ||
aidefr | 0 | 1,010,509,091 | 5% | ||
inthenow | 0 | 22,449,874,151 | 20% | ||
splash-of-angs63 | 0 | 12,293,782,811 | 50% | ||
espoem | 0 | 15,827,673,771 | 5% | ||
meno | 0 | 7,579,858,599 | 0.6% | ||
buttcoins | 0 | 517,877,594 | 0.24% | ||
enzor | 0 | 530,042,900 | 10% | ||
bartosz546 | 0 | 1,628,690,748 | 0.6% | ||
minnowspower | 0 | 526,389,895 | 70% | ||
sunsea | 0 | 1,371,434,089 | 0.6% | ||
bluefinstudios | 0 | 881,830,978 | 0.36% | ||
steveconnor | 0 | 1,065,495,994 | 0.6% | ||
aboutcoolscience | 0 | 2,642,608,317 | 10% | ||
mytechtrail | 0 | 41,728,750,814 | 35% | ||
kenadis | 0 | 2,590,952,598 | 10% | ||
madridbg | 0 | 3,712,206,983 | 10% | ||
sneakyninja | 0 | 16,099,755,854 | 24.88% | ||
drunksamurai | 0 | 527,661,754 | 30% | ||
steembasicincome | 0 | 4,056,040,280,669 | 100% | ||
adelepazani | 0 | 502,317,179 | 0.24% | ||
r00sj3 | 0 | 4,394,352,696 | 5% | ||
sco | 0 | 2,971,134,363 | 10% | ||
ennyta | 0 | 943,576,079 | 50% | ||
juecoree | 0 | 603,034,295 | 7% | ||
gabrielatravels | 0 | 675,123,130 | 0.42% | ||
bartheek | 0 | 920,391,518 | 1.2% | ||
hetty-rowan | 0 | 1,188,289,065 | 0.6% | ||
ydavgonzalez | 0 | 1,900,635,329 | 10% | ||
intrepidphotos | 0 | 2,473,831,862 | 7.5% | ||
fineartnow | 0 | 842,915,856 | 0.6% | ||
oscarina | 0 | 754,946,657 | 10% | ||
aiziqi | 0 | 1,093,097,082 | 5% | ||
steemvault | 0 | 472,662,093 | 1.2% | ||
communitybank | 0 | 806,575,385 | 1.2% | ||
fragmentarion | 0 | 2,305,509,321 | 10% | ||
utube | 0 | 822,308,778 | 1.2% | ||
m1alsan | 0 | 1,066,481,865 | 1.2% | ||
neneandy | 0 | 1,348,568,552 | 1.2% | ||
sportscontest | 0 | 1,149,443,347 | 1.2% | ||
pandasquad | 0 | 3,335,357,850 | 1.2% | ||
fieryfootprints | 0 | 59,117,532,719 | 20% | ||
tobias-g | 0 | 9,411,256,590 | 5% | ||
lanzjoseg | 0 | 54,764,224,896 | 100% | ||
jazzhero | 0 | 32,770,040,617 | 37.5% | ||
miguelangel2801 | 0 | 751,350,324 | 50% | ||
mproxima | 0 | 488,698,940 | 0.6% | ||
fantasycrypto | 0 | 805,948,207 | 1.2% | ||
mastergerund | 0 | 13,495,997,700 | 49.76% | ||
emiliomoron | 0 | 879,943,718 | 5% | ||
fireguardian | 0 | 625,456,798 | 20% | ||
photohunt | 0 | 669,574,652 | 1.2% | ||
geopolis | 0 | 617,122,623 | 10% | ||
robertbira | 0 | 1,037,119,621 | 2.5% | ||
anikys3reasure | 0 | 2,163,497,878 | 50% | ||
alexdory | 0 | 1,363,319,722 | 10% | ||
takowi | 0 | 23,950,770,228 | 1.2% | ||
irgendwo | 0 | 5,046,418,064 | 1.2% | ||
melvin7 | 0 | 16,552,380,828 | 5% | ||
francostem | 0 | 1,331,620,171 | 10% | ||
russellstockley | 0 | 41,869,829,573 | 35% | ||
videoaddiction | 0 | 33,478,345,638 | 25% | ||
endopediatria | 0 | 690,162,200 | 20% | ||
croctopus | 0 | 1,394,041,215 | 100% | ||
jjerryhan | 0 | 1,448,957,033 | 0.6% | ||
putu300 | 0 | 887,008,145 | 5% | ||
michelmake | 0 | 45,698,608,228 | 20% | ||
jglake | 0 | 6,298,208,393 | 20% | ||
zipporah | 0 | 582,313,576 | 0.24% | ||
dumnebari | 0 | 876,091,530 | 50% | ||
superlotto | 0 | 892,138,096 | 1.2% | ||
satren | 0 | 13,940,852,088 | 10% | ||
bscrypto | 0 | 3,396,580,740 | 0.6% | ||
asimo | 0 | 6,342,044,870 | 70% | ||
movingman | 0 | 586,696,738 | 20% | ||
tomastonyperez | 0 | 16,195,538,083 | 50% | ||
bil.prag | 0 | 548,020,051 | 0.06% | ||
vcclothing | 0 | 565,877,730 | 0.36% | ||
elvigia | 0 | 10,176,920,180 | 50% | ||
ravenmus1c | 0 | 107,140,128,462 | 5% | ||
sanderjansenart | 0 | 1,190,625,706 | 0.6% | ||
adamada | 0 | 72,749,766,201 | 50% | ||
laxam | 0 | 5,785,139,394 | 100% | ||
qberry | 0 | 865,165,464 | 0.6% | ||
sbi2 | 0 | 3,132,701,354,664 | 100% | ||
greddyforce | 0 | 994,622,283 | 0.44% | ||
gadrian | 0 | 77,901,077,789 | 6% | ||
saidaplc | 0 | 1,380,182,047 | 100% | ||
therising | 0 | 21,755,927,064 | 1.2% | ||
de-stem | 0 | 5,406,356,490 | 9.9% | ||
choco11oreo11 | 0 | 2,843,480,581 | 90% | ||
gogreenbuddy | 0 | 2,769,787,380,176 | 40% | ||
josedelacruz | 0 | 4,730,510,430 | 50% | ||
achimmertens | 0 | 1,937,267,538 | 0.6% | ||
kgakakillerg | 0 | 20,794,789,939 | 10% | ||
softa | 0 | 789,382,187 | 0.24% | ||
kendallron | 0 | 997,462,152 | 50% | ||
erickyoussif | 0 | 598,324,863 | 100% | ||
sbi3 | 0 | 1,382,413,879,011 | 100% | ||
primersion | 0 | 448,785,654,262 | 20% | ||
deholt | 0 | 533,535,291 | 8.5% | ||
robmolecule | 0 | 23,807,210,142 | 10% | ||
sbi4 | 0 | 1,094,645,438,768 | 100% | ||
celinavisaez | 0 | 10,891,743,978 | 30% | ||
pladozero | 0 | 31,459,024,794 | 10% | ||
minerthreat | 0 | 829,317,632 | 0.6% | ||
nateaguila | 0 | 70,741,641,150 | 5% | ||
temitayo-pelumi | 0 | 885,126,074 | 10% | ||
andrick | 0 | 817,110,065 | 50% | ||
doctor-cog-diss | 0 | 9,157,545,359 | 10% | ||
pinas | 0 | 618,069,581 | 50% | ||
uche-nna | 0 | 1,469,593,941 | 0.96% | ||
sgbonus | 0 | 11,562,217,330 | 16% | ||
sbi5 | 0 | 687,467,841,814 | 100% | ||
cheese4ead | 0 | 864,311,242 | 0.6% | ||
apshamilton | 0 | 3,031,006,888 | 0.15% | ||
sbi6 | 0 | 527,933,064,576 | 100% | ||
nattybongo | 0 | 3,588,546,390 | 10% | ||
talentclub | 0 | 678,965,174 | 0.6% | ||
ambiguity | 0 | 21,153,524,381 | 46% | ||
thedailysneak | 0 | 21,908,613,791 | 24.88% | ||
bflanagin | 0 | 627,252,785 | 0.6% | ||
armandosodano | 0 | 1,673,569,333 | 0.6% | ||
bestofph | 0 | 4,445,476,458 | 50% | ||
hamismsf | 0 | 995,138,188 | 0.15% | ||
thehive | 0 | 71,863,323,323 | 92% | ||
velazquezboy | 0 | 6,290,865,495 | 100% | ||
goblinknackers | 0 | 80,548,361,130 | 7% | ||
luciannagy | 0 | 519,741,299 | 50% | ||
anttn | 0 | 1,083,926,536 | 0.6% | ||
kylealex | 0 | 5,048,758,409 | 10% | ||
sbi7 | 0 | 390,388,006,736 | 100% | ||
orlandogonzalez | 0 | 3,142,379,897 | 25% | ||
fran.frey | 0 | 3,985,257,343 | 50% | ||
emaillisahere | 0 | 1,121,854,542 | 75% | ||
jokinmenipieleen | 0 | 3,532,190,683 | 100% | ||
buzzbee | 0 | 481,464,166 | 36.8% | ||
thelittlebank | 0 | 9,028,480,555 | 0.6% | ||
pboulet | 0 | 23,802,825,612 | 8% | ||
stem-espanol | 0 | 2,118,075,728 | 100% | ||
ravensavage | 0 | 4,672,659,183 | 49.76% | ||
marshalmugi | 0 | 5,348,013,930 | 100% | ||
cliffagreen | 0 | 5,187,482,644 | 10% | ||
aleestra | 0 | 13,769,058,937 | 80% | ||
podg3 | 0 | 5,083,941,586 | 90% | ||
palasatenea | 0 | 708,229,074 | 0.6% | ||
ebot2020 | 0 | 0 | 70% | ||
the.success.club | 0 | 557,562,238 | 0.6% | ||
sbi8 | 0 | 310,512,567,363 | 100% | ||
piestrikesback | 0 | 642,037,338 | 100% | ||
sbi9 | 0 | 225,017,204,209 | 100% | ||
brianoflondon | 0 | 23,895,809,036 | 0.3% | ||
giulyfarci52 | 0 | 1,627,675,908 | 50% | ||
esthersanchez | 0 | 4,385,053,342 | 60% | ||
kristall97 | 0 | 782,118,696 | 100% | ||
steemcryptosicko | 0 | 2,086,681,326 | 0.24% | ||
buildingpies | 0 | 48,154,348,570 | 100% | ||
multifacetas | 0 | 474,237,739 | 0.6% | ||
cakemonster | 0 | 601,589,343 | 1.2% | ||
sbi10 | 0 | 174,284,098,043 | 100% | ||
stem.witness | 0 | 560,475,445 | 10% | ||
gudnius.comics | 0 | 7,818,161,400 | 100% | ||
maajaanaa | 0 | 2,420,400,269 | 42% | ||
chipdip | 0 | 819,230,083 | 10% | ||
theskmeister | 0 | 520,127,664 | 100% | ||
jpbliberty | 0 | 1,735,387,188 | 0.3% | ||
retrodroid | 0 | 7,638,197,204 | 25% | ||
double-negative | 0 | 529,247,289 | 20% | ||
samsemilia7 | 0 | 884,192,809 | 39% | ||
vaultec | 0 | 268,425,485,202 | 12% | ||
steemstorage | 0 | 1,464,686,323 | 1.2% | ||
aqua.nano | 0 | 471,542,315 | 100% | ||
hairgistix | 0 | 684,624,940 | 0.6% | ||
photoparadise | 0 | 5,293,092,859 | 25% | ||
instagram-models | 0 | 3,042,272,997 | 0.6% | ||
steemean | 0 | 10,091,394,767 | 5% | ||
littlesorceress | 0 | 498,370,562 | 0.6% | ||
aaronkroeblinger | 0 | 96,128,840,246 | 50% | ||
cryptofiloz | 0 | 1,927,228,597 | 1.2% | ||
dawnoner | 0 | 1,923,549,550 | 0.6% | ||
robibasa | 0 | 13,632,271,251 | 10% | ||
nooblogger | 0 | 4,705,247,116 | 50% | ||
qwerrie | 0 | 1,083,720,477 | 0.09% | ||
michelmake.util | 0 | 1,558,973,147 | 100% | ||
walterprofe | 0 | 5,376,212,785 | 5% | ||
zeruxanime | 0 | 3,484,038,468 | 50% | ||
reggaesteem | 0 | 485,557,402 | 5% | ||
ali-h | 0 | 1,135,556,956 | 70% | ||
babytarazkp | 0 | 2,433,187,919 | 50% | ||
trendovoter | 0 | 3,451,329,466 | 70% | ||
tokensink | 0 | 704,557,106 | 1.2% | ||
maddogmike | 0 | 55,016,280,830 | 35% | ||
beta500 | 0 | 817,142,636 | 1.2% | ||
sbi-tokens | 0 | 30,081,077,808 | 49.76% | ||
the-table | 0 | 8,324,977,593 | 92% | ||
cardtrader | 0 | 11,661,232,474 | 100% | ||
thehouse | 0 | 2,210,252,578 | 90% | ||
trendobounty | 0 | 4,516,480 | 70% | ||
steemstem-trig | 0 | 163,385,832 | 10% | ||
baltai | 0 | 1,394,283,358 | 0.6% | ||
silverquest | 0 | 3,800,694,550 | 50% | ||
qwertm | 0 | 3,700,185,527 | 50% | ||
honeychip | 0 | 9,883,410,523 | 100% | ||
ibt-survival | 0 | 37,513,164,885 | 10% | ||
jennyferandtony | 0 | 1,415,918,672 | 100% | ||
veryanprime | 0 | 5,769,741,593 | 100% | ||
gloriaolar | 0 | 9,333,724,275 | 12% | ||
vault.tokens | 0 | 1,022,946,931 | 50% | ||
tommys.shop | 0 | 33,714,278,676 | 100% | ||
dpend.active | 0 | 1,853,435,131 | 4.97% | ||
hive-199963 | 0 | 718,414,252 | 1.2% | ||
hivetrending | 0 | 152,800,878,504 | 100% | ||
thepeakstudio | 0 | 907,366,780 | 35% | ||
stemsocial | 0 | 81,429,237,389 | 10% | ||
mrf83 | 0 | 0 | 100% | ||
behiver | 0 | 1,263,488,300,840 | 100% | ||
holoferncro | 0 | 5,855,107,362 | 5% | ||
sketching | 0 | 2,976,081,633 | 24.88% | ||
hivelist | 0 | 1,158,009,323 | 0.36% | ||
kiemurainen | 0 | 469,275,627 | 0.5% | ||
cybercity | 0 | 1,033,248,896,772 | 100% | ||
kingneptune | 0 | 1,279,170,268 | 50% | ||
hiveupme | 0 | 775,506,446,479 | 70% | ||
hivecurator | 0 | 1,594,009,210 | 70% | ||
hivehustlers | 0 | 14,108,898,801 | 70% | ||
noelyss | 0 | 2,863,410,827 | 5% | ||
improbableliason | 0 | 1,402,354,141 | 35% | ||
miguelpeliculas | 0 | 2,853,133,613 | 40% | ||
jelly13 | 0 | 3,209,889,287 | 34% | ||
quinnertronics | 0 | 11,176,529,342 | 7% | ||
coretoken | 0 | 303,715,819 | 70% | ||
vaulttoken | 0 | 1,476,941,414 | 70% | ||
swap.vault | 0 | 0 | 70% | ||
vokus | 0 | 4,369,467,183 | 50% | ||
sylmarill | 0 | 0 | 100% | ||
goliathus | 0 | 2,091,236,269 | 25% | ||
altleft | 0 | 5,102,211,195 | 0.01% | ||
finris | 0 | 1,635,593,997 | 50% | ||
omarrojas | 0 | 486,061,473 | 0.6% | ||
tan.dev | 0 | 0 | 70% | ||
wine-token | 0 | 1,590,616,869 | 70% | ||
birdbeaksd | 0 | 610,476,051 | 100% | ||
tan.reg | 0 | 0 | 70% | ||
meritocracy | 0 | 13,329,038,165 | 0.12% | ||
thesimguru | 0 | 0 | 70% | ||
tan.stake | 0 | 551,081,378 | 70% | ||
wine.bot | 0 | 6,296,855,650 | 70% | ||
dcrops | 0 | 7,812,586,843 | 0.6% | ||
rondonshneezy | 0 | 10,681,756,657 | 50% | ||
dadspardan | 0 | 9,762,249,719 | 50% | ||
tan.extra | 0 | 0 | 70% | ||
vihan | 0 | 0 | 70% | ||
winebank | 0 | 0 | 70% | ||
eldritchspig | 0 | 628,500,726 | 50% | ||
yozen | 0 | 486,747,156 | 0.6% | ||
esmeesmith | 0 | 497,959,200 | 0.6% | ||
simbank | 0 | 0 | 70% | ||
altor | 0 | 18,528,977,326 | 35% | ||
tawadak24 | 0 | 876,717,581 | 0.6% | ||
huzzah | 0 | 35,944,320,793 | 100% | ||
cooperclub | 0 | 3,360,878,551 | 50% | ||
wine-ico | 0 | 222,221,222 | 70% | ||
failingforwards | 0 | 735,700,682 | 0.6% | ||
creodas | 0 | 2,704,284,688 | 75% | ||
core.voter | 0 | 135,434,983 | 70% | ||
drricksanchez | 0 | 3,362,451,455 | 0.6% | ||
wizzitywillican | 0 | 6,729,867,008 | 50% | ||
hive.pizza | 0 | 2,516,684,976,387 | 100% | ||
nfttunz | 0 | 1,990,802,108 | 0.12% | ||
jim-crypto | 0 | 521,739,013 | 12.5% | ||
pizzabot | 0 | 636,039,909 | 100% | ||
dajokawild | 0 | 74,303,504,770 | 50% | ||
okluvmee | 0 | 1,033,948,828 | 0.6% | ||
merit.ahama | 0 | 1,221,481,141 | 0.36% | ||
holovision.cash | 0 | 4,021,372,066 | 100% | ||
egistar | 0 | 3,513,010,524 | 14% | ||
podping | 0 | 2,047,730,467 | 0.3% | ||
vault.burn | 0 | 4,723,214,230 | 70% | ||
t-nil | 0 | 534,714,186 | 10% | ||
pinkfloyd878 | 0 | 5,780,005,175 | 100% | ||
john9inch | 0 | 1,776,563,074 | 50% | ||
theguru.photos | 0 | 117,903,245 | 70% | ||
szmobacsi | 0 | 1,427,328,189 | 90% | ||
onthemountain | 0 | 1,055,172,438 | 50% | ||
rayius | 0 | 480,663,157 | 100% | ||
slunicko | 0 | 741,102,110 | 21% | ||
andriko | 0 | 769,438,320 | 100% | ||
olympicdragon | 0 | 0 | 100% | ||
jam728 | 0 | 4,293,047,976 | 100% | ||
avidez | 0 | 816,509,371 | 50% | ||
aries90 | 0 | 10,224,376,120 | 1.2% | ||
onewolfe | 0 | 554,237,972 | 50% | ||
banzafahra | 0 | 8,425,130,202 | 50% | ||
migka | 0 | 5,255,431,148 | 90% | ||
mxm0unite | 0 | 523,168,405 | 24.88% | ||
eustace-kidd | 0 | 603,827,205 | 0.6% | ||
mcgilli | 0 | 771,474,788 | 100% | ||
blingit | 0 | 772,965,094 | 0.6% | ||
arc7icwolf | 0 | 182,047,556,242 | 100% | ||
cogie88 | 0 | 2,549,969,008 | 50% | ||
beffeater | 0 | 5,046,324,307 | 50% | ||
thercek | 0 | 613,730,445 | 50% | ||
zirkonov | 0 | 1,221,206,296 | 30% | ||
almightygrim | 0 | 12,635,199,488 | 45% | ||
nikita200 | 0 | 516,105,046 | 50% | ||
epicur0 | 0 | 6,303,490,042 | 100% | ||
anonymous02 | 0 | 19,749,720,859 | 40% | ||
h3m4n7 | 0 | 19,253,169,785 | 90% | ||
kavii | 0 | 94,461,147 | 70% | ||
spiritverve | 0 | 14,947,964,532 | 100% | ||
thedoc07 | 0 | 5,838,430,636 | 50% | ||
krakatice | 0 | 5,000,836,635 | 100% | ||
kqaosphreak | 0 | 7,408,770,550 | 100% | ||
dnrxgwp2021 | 0 | 1,229,962,454 | 18.4% | ||
cherute | 0 | 2,800,034,740 | 50% | ||
newilluminati | 0 | 3,582,161,791 | 0.6% | ||
lothbrox | 0 | 3,192,431,657 | 100% | ||
huckleberrie | 0 | 184,589,661,207 | 100% | ||
zeclipse | 0 | 3,124,920,142 | 100% | ||
checkyzk | 0 | 89,683,821,934 | 98% | ||
highfist | 0 | 3,924,040,009 | 50% | ||
hucksbucks | 0 | 18,213,605,393 | 100% | ||
blocktunes | 0 | 1,780,373,807 | 10% | ||
lichtkunstfoto | 0 | 1,641,995,925 | 1.2% | ||
vindiesel1980 | 0 | 1,774,584,400 | 0.6% | ||
zihadlo | 0 | 801,326,252 | 50% | ||
studio3141 | 0 | 504,340,218 | 50% | ||
lukasbachofner | 0 | 956,607,330 | 0.6% | ||
benwickenton | 0 | 560,281,659 | 1.2% | ||
duja | 0 | 23,058,431,821 | 100% | ||
azj26 | 0 | 4,717,874,341 | 16% | ||
dalekma | 0 | 1,691,850,099 | 100% | ||
elkingplayer | 0 | 619,768,616 | 100% | ||
incantia | 0 | 657,417,585 | 70% | ||
archangel21 | 0 | 2,905,958,021 | 1.2% | ||
plicc8 | 0 | 1,093,053,415 | 100% | ||
titly | 0 | 477,301,211 | 50% | ||
belug | 0 | 1,421,544,782 | 0.36% | ||
ertytux | 0 | 3,722,027,166 | 100% | ||
mugueto2022 | 0 | 559,813,085 | 20% | ||
hmvf | 0 | 31,859,066,838 | 5% | ||
abouttodie | 0 | 1,773,386,526 | 40% | ||
fefe99 | 0 | 552,449,826 | 100% | ||
bummblebee | 0 | 3,125,349,687 | 100% | ||
kryptofire | 0 | 1,577,739,598 | 20% | ||
soyjoselopez | 0 | 471,997,799 | 20% | ||
tspaula | 0 | 5,581,035,530 | 100% | ||
hive-186141 | 0 | 139,534,676,951 | 100% | ||
hk-curation | 0 | 1,270,154,401 | 0.84% | ||
yanetzi1 | 0 | 0 | 100% | ||
rocco-maloney | 0 | 847,218,428 | 100% | ||
lyamalfonzo23 | 0 | 2,328,666,086 | 100% | ||
taimen | 0 | 858,014 | 100% | ||
abbiek | 0 | 3,132,955,976 | 85% | ||
daje10 | 0 | 5,435,615,616 | 50% | ||
bgmoha | 0 | 3,959,752,909 | 55% | ||
thoth442 | 0 | 13,812,710,859 | 50% | ||
yopeks | 0 | 470,499,083 | 50% | ||
fun.miner | 0 | 19,168,860,864 | 100% | ||
jijisaurart | 0 | 490,698,149 | 0.6% | ||
daudmuhammad2022 | 0 | 0 | 100% | ||
smariam | 0 | 2,856,357,798 | 25% | ||
clpacksperiment | 0 | 516,748,959 | 0.6% | ||
oladayo1 | 0 | 481,931,642 | 100% | ||
masterfarmer | 0 | 1,329,479,792 | 100% | ||
ambicrypto | 0 | 23,627,492,237 | 1.2% | ||
humbe | 0 | 7,378,904,214 | 2% | ||
magic.fun | 0 | 363,239,917 | 100% | ||
callum77 | 0 | 1,587,341,123 | 95% | ||
slothbuzz | 0 | 19,190,831,378 | 50% | ||
opticus | 0 | 7,208,801,250 | 1.2% | ||
caspermoeller89 | 0 | 0 | 40% | ||
rhemagames | 0 | 1,108,168,953 | 0.6% | ||
kryptof | 0 | 14,185,787,859 | 15% | ||
calendulacraft | 0 | 41,808,372,020 | 100% | ||
hivesl | 0 | 11,132,163,339 | 70% | ||
tslu | 0 | 4,699,317,374 | 100% | ||
tsjen | 0 | 3,846,817,077 | 100% | ||
thewobs94 | 0 | 1,696,095,765 | 100% | ||
maickto | 0 | 6,806,459,864 | 99% | ||
actifit-godfish | 0 | 3,363,714,902 | 100% | ||
stewiekobe | 0 | 5,751,136,242 | 75% | ||
learn2code | 0 | 1,117,154,912 | 50% | ||
coltdelegation | 0 | 7,702,004,918 | 90% | ||
rostik924 | 0 | 13,673,535,117 | 17.64% | ||
profwhitetower | 0 | 1,196,726,048 | 5% | ||
glideglobe | 0 | 0 | 10% | ||
soyernesto | 0 | 0 | 100% | ||
tsmaria | 0 | 2,422,580,793 | 75% | ||
tsliverpool | 0 | 785,882,208 | 75% | ||
cocinator | 0 | 1,399,556,774 | 100% | ||
tslaura | 0 | 977,780,603 | 50% | ||
tinamccabe | 0 | 1,888,508,402 | 72% | ||
tsjudy | 0 | 1,413,436,352 | 75% | ||
chan-ra | 0 | 0 | 20% |
I tried the code and it worked perfectly!  Love it! I also read it a few times and now I get how it works: now I have to check how the library "argparse" works because I may also use it in my code, so I'd like to better understand it :) it looks very straightforward, but I'd like to check what "nargs='?" exactly does. EDIT: found it!
author | arc7icwolf |
---|---|
permlink | re-gamer00-sk0psx |
category | hive-164872 |
json_metadata | {"tags":["hive-164872"],"app":"ecency/3.2.0-vision","format":"markdown+html"} |
created | 2024-09-18 16:58:12 |
last_update | 2024-09-18 17:25:06 |
depth | 1 |
children | 1 |
last_payout | 2024-09-25 16:58:12 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.012 HBD |
curator_payout_value | 0.012 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 477 |
author_reputation | 508,055,258,566,757 |
root_title | "Python Wizardry: Fetching Liquidity Pools from Hive Engine with a Simple Script" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 137,184,702 |
net_rshares | 85,705,540,180 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
gamer00 | 0 | 85,705,540,180 | 20% |
Thanks for the encouragement! Glad you liked it! It's one of my first Hive-related scripts, so I was kind of anxious letting it out of the gates. (I'm kind of slow releasing these, lol, but I might get faster in time.) I'm currently rewriting parts of the script, because after testing it for a while I noticed it needs better error handling, especially in situations where the servers act up. But from the command line it usually works best, because in case of error, one can always run it again. About that `nargs='?'`, it just lets the script continue with no arguments, basically it falls back to using the default variable set for `account_name`.
author | gamer00 |
---|---|
permlink | re-arc7icwolf-2024919t02812261z |
category | hive-164872 |
json_metadata | {"tags":["hive-164872"],"app":"ecency/3.2.0-vision","format":"markdown+html"} |
created | 2024-09-18 21:28:18 |
last_update | 2024-09-18 21:28:18 |
depth | 2 |
children | 0 |
last_payout | 2024-09-25 21:28:18 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 653 |
author_reputation | 168,798,415,632,608 |
root_title | "Python Wizardry: Fetching Liquidity Pools from Hive Engine with a Simple Script" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 137,189,434 |
net_rshares | 0 |
Anotated 👍👏
author | ertytux |
---|---|
permlink | re-gamer00-2024916t174855207z |
category | hive-164872 |
json_metadata | {"content_type":"general","type":"comment","tags":["hive-164872","hive","coding","python","script","hive-engine","liquidity","liquidity-pairs","justforfun","programming","ecency"],"app":"ecency/3.1.6-mobile","format":"markdown+html"} |
created | 2024-09-16 21:48:57 |
last_update | 2024-09-16 21:48:57 |
depth | 1 |
children | 0 |
last_payout | 2024-09-23 21:48:57 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 12 |
author_reputation | 32,350,492,372,378 |
root_title | "Python Wizardry: Fetching Liquidity Pools from Hive Engine with a Simple Script" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 137,132,975 |
net_rshares | 0 |
author | kaminchan |
---|---|
permlink | re-gamer00-2024915t2025407z |
category | hive-164872 |
json_metadata | {"content_type":"general","type":"comment","tags":["hive-164872","hive","coding","python","script","hive-engine","liquidity","liquidity-pairs","justforfun","programming","ecency"],"app":"ecency/3.1.5-mobile","format":"markdown+html"} |
created | 2024-09-15 13:25:39 |
last_update | 2024-09-15 13:25:39 |
depth | 1 |
children | 0 |
last_payout | 2024-09-22 13:25:39 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.012 HBD |
curator_payout_value | 0.013 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 56 |
author_reputation | 551,433,449,481,874 |
root_title | "Python Wizardry: Fetching Liquidity Pools from Hive Engine with a Simple Script" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 137,092,854 |
net_rshares | 93,794,615,608 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
gamer00 | 0 | 84,655,417,846 | 20% | ||
dustbunny | 0 | 9,139,197,762 | 2.9% |
<div class='text-justify'> <div class='pull-left'> <img src='https://stem.openhive.network/images/stemsocialsupport7.png'> </div> Thanks for your contribution to the <a href='/trending/hive-196387'>STEMsocial community</a>. Feel free to join us on <a href='https://discord.gg/9c7pKVD'>discord</a> to get to know the rest of us! Please consider delegating to the @stemsocial account (85% of the curation rewards are returned). You may also include @stemsocial as a beneficiary of the rewards of this post to get a stronger support. <br /> <br /> </div>
author | stemsocial |
---|---|
permlink | re-gamer00-python-wizardry-fetching-liquidity-pools-20240911t032211209z |
category | hive-164872 |
json_metadata | {"app":"STEMsocial"} |
created | 2024-09-11 03:22:12 |
last_update | 2024-09-11 03:22:12 |
depth | 1 |
children | 0 |
last_payout | 2024-09-18 03:22:12 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.012 HBD |
curator_payout_value | 0.012 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 565 |
author_reputation | 22,920,436,264,631 |
root_title | "Python Wizardry: Fetching Liquidity Pools from Hive Engine with a Simple Script" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 136,974,671 |
net_rshares | 97,848,969,640 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
gamer00 | 0 | 40,986,133,758 | 10% | ||
dustbunny | 0 | 56,862,835,882 | 18.03% |