Introducing the Hive Swap Calculator!

in Programming & Dev8 months ago

Hey all, long time no see.

Today I introduce to you the Hive Swap Calculator!

Screenshot from 2023-08-29 23-48-01.png

What does it do?

If you're looking to buy or sell some Hive, but you're not sure what the best route is. Should you go through Hive? Hive-Engine? Which coin? That's where the Hive Swap Calculator comes in. It's designed to show you the most profitable way to buy or sell Hive, based on real-time market prices.

The interface is designed to be straightforward and is not dissimilar to the interface you might see on Uniswap. You've got an input for the amount, a toggle for buying or selling, and a field to set Hive-Engine fees (since there are multiple routes to deposit/withdraw hive).

Smarter Decisions

This was intended to be a one day project, however, after realising the logic necessary to factor in the ever-changing network fees, it took a little longer - but it does mean it accurately factors in the withdrawal fees for any networks which charge it (including BSC, ETH .etc) with the live fee from hive-engine.

Code

If you're interested in the setup - it's a Go backend for the basic calculations and merging of the data and javascript for the final calculations based on the data you enter in the page. You can check out the code here if you want to learn more about it.

I'm always open to feedback. So go ahead, give it a spin, and let me know what you think! Of course, markets change rapidly and so I'd only recommend using this if there's a good margin to be had - however I had fun and it was a good way to mess around with some hive and hive engine APIs I haven't touched in a while.

Don't forget to check it out here Hive Swap Calculator.

Thanks for stopping by as always,
~ CA

Sort:  

What routes are there? I tested it and it basically just says 0 fees for HIVE or 0.7% for Hive Engine which is what everyone already knows

In this case that means there's no better offers right now, that's often the case but you can see in the screenshot included how it works when there is a better offer via some other route.

And routes wise - it can do any of the tokens listed to the side of the app (major coins with SWAP. Equivalents)

Got it, I think I understood. Will check the code if I happen to have the time.

Wow! Thanks for sharing this post, it really educative i guess hive has more features that most of us are yet to discover but by the time we spendore time on hive we gain something new.

No worries, I hope you find it useful!

Yes it very useful and understandable.

Super idea! I will check this out!

Thanks :)

WOW! this amazing, putting up something this huge must have been really tasking, I will check it out and drop a feedback afterward.

Good job!

It wasn't too bad actually, just getting the logic right was the hard part as it'd be rather useless without that haha

That’s so nice

Good job again!😃

Interesting and useful tool
Bookmarked!
!discovery 30
@tipu curate


This post was shared and voted inside the discord by the curators team of discovery-it
Join our Community and follow our Curation Trail
Discovery-it is also a Witness, vote for us here
Delegate to us for passive income. Check our 80% fee-back Program

This is pretty good
Good job!

Thank you :)

Congratulations @cadawg! Your post has been a top performer on the Hive blockchain and you have been rewarded with this rare badge

Post with the highest payout of the day.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Check out our last posts:

Be ready for the September edition of the Hive Power Up Month!
Hive Power Up Day - September 1st 2023
HiveBuzz Women's World Cup Contest - Prizes from our sponsors

Thank you, this is useful. :>

Ohh usefull and user friendly tool I think. How long did it take you to create it?

Yo! Cadawg how are you man? How's the calculator going?

Hi it's pretty useful tool, but I wish you might think of adding Swap services like
Hiveswap, Bswap, Kswap, Uswap here. So based on each swap service the end user can find the best route to do the swap.

Nice to see you back!
$WINE

Cheers~

Yeah, that's a very good point - there's so many swap services nowadays. I've been lurking this whole time tinkering on stuff in the background but certainly glad to have posted my first blog post in a while.