Check it out here: HBD.USWAP.APP
// You can retrieve the below json data from :- https://fee.uswap.app/hbd.json
{
"BASE_FEE": 0.003,
"MIN_BASE_FEE": 0.001,
"DIFF_COEFFICIENT": 0.005,
"BASE_PRICE_HBD_TO_SHBD": 1.00
}
let inputVal = 0.0 //enter the value (HBD or SHBD)
let expResult = 0.0 //the receive swap amount
let HBDPOOL = 0.0 //HBD amount in the pool
let SHBDPOOL = 0.0 //SHBD amount in the pool
let DECIMAL = 1000;
if(insymbol == "HBD") {
let diff = ((inputVal * 0.5 + HBDPOOL) / (SHBDPOOL + HBDPOOL)) - 0.5;
let adjusted_base_fee = Math.max( BASE_FEE * (1 - 2 * Math.abs(diff)), MIN_BASE_FEE );
let price = BASE_PRICE_HBD_TO_SHBD - (2 * diff * DIFF_COEFFICIENT);
expResult = (inputVal * price) * (1 - adjusted_base_fee);
expResult = Math.floor(expResult * DECIMAL) / DECIMAL;
}
if(insymbol == "SWAP.HBD") {
let diff = ((inputVal * 0.5 + SHBDPOOL) / (SHBDPOOL + HBDPOOL)) - 0.5;
let adjusted_base_fee = Math.max( BASE_FEE * (1 - 2 * Math.abs(diff)), MIN_BASE_FEE );
let price = 1 / BASE_PRICE_HBD_TO_SHBD - (2 * diff * DIFF_COEFFICIENT);
expResult = (inputVal * price) * (1 - adjusted_base_fee);
expResult = Math.floor(expResult * DECIMAL) / DECIMAL;
}
"Delegate @hiveupme Curation Project To Earn 95% Delegation Rewards, 15% APR Worth UPME Tokens, Mentor Votes & WINEX Token Rewards"
Contact Us : CORE / VAULT Token Discord Channel
Discounted Bridge : The Lowest Fee (0.09%) Hive | Swap.Hive Bridge
Burn-To-Vote : Burn Your UPME / WINEX To Receive Upvotes
This post has been manually curated by @steemflow from Indiaunited community. Join us on our Discord Server.
Do you know that you can earn a passive income by delegating to @indiaunited. We share more than 100 % of the curation rewards with the delegators in the form of IUC tokens. HP delegators and IUC token holders also get upto 20% additional vote weight.
Here are some handy links for delegations: 100HP, 250HP, 500HP, 1000HP.
100% of the rewards from this comment goes to the curator for their manual curation efforts. Please encourage the curator @steemflow by upvoting this comment and support the community by voting the posts made by @indiaunited.
Congratulations @theguruasia! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)
Your next target is to reach 33000 upvotes.
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: