The Merger of USWAP.APP and KSWAP.APP: Swap Processes

@theguruasia · 2023-10-03 05:53 · hive
Hi All,
We are planning to merge USWAP.APP & KSWAP.APP swap services under USWAP.APP on 04th of October (Next Wednesday), around 02:00 - 04:00 UTC time. --- ---

Why Merge?

With USWAP.APP, we initially followed the strategy of Static Fees & Rewards. However, this module became challenging when the market showed less fluctuation. As a result of that, we had to frequently adjust swap bridge Fees & Rewards.

This situation could potentially lead to complications, because our services are utilized by different scripts. As a solution, we have decided to implement Dynamic Fees & Rewards for the swap service.

KSWAP.APP has successfully implemented Dynamic Fees & Rewards for the swap bridge. Therefore, we have made the decision to merge both swap services under USWAP.APP & implement Dynamic Fees & Rewards across the board. ---

How To Calculate Fees & Rewards?

Here, we are showing you how to tune up your script to find the Fee & Reward details based on your swap amount.


// You can retrieve the below json data from :- https://fee.uswap.app/fee.json
{
  "BASE_FEE": 0.001,
  "MIN_BASE_FEE": 0.0005,
  "DIFF_COEFFICIENT": 0.005
}


let inputVal = 0.0 //enter the value (Hive or SHive)
let expResult = 0.0 //the receive swap amount
let HIVEPOOL = 0.0 //Hive amount in the pool
let SHIVEPOOL = 0.0 //SHive amount in the pool
if(selectedSymbol == "HIVE")
{
    var diff = ((inputVal * 0.5 + HIVEPOOL) / (SHIVEPOOL + HIVEPOOL)) - 0.5;
    var adjusted_base_fee = Math.max( BASE_FEE * (1 - 2 * Math.abs(diff)), MIN_BASE_FEE );
    var price = 1 - (2 * diff * DIFF_COEFFICIENT);
    expResult = (inputVal * price) * (1 - adjusted_base_fee);
    expResult = Math.floor(expResult * DECIMAL) / DECIMAL;
}
if(selectedSymbol == "SWAP.HIVE")
{
    var diff = ((inputVal * 0.5 + SHIVEPOOL) / (SHIVEPOOL + HIVEPOOL)) - 0.5;
    var adjusted_base_fee = Math.max( BASE_FEE * (1 - 2 * Math.abs(diff)), MIN_BASE_FEE );
    var price = 1 - (2 * diff * DIFF_COEFFICIENT);
    expResult = (inputVal * price) * (1 - adjusted_base_fee);
    expResult = Math.floor(expResult * DECIMAL) / DECIMAL; 
}

---

What Will Happen To KSWAP.APP?

We will process automated and manual refunds if someone accidentally sends swaps there. --- If you experience any errors or issues while using the bridge, please don't hesitate to contact me at any time.

If you are using a script to swap between bridges, please make the necessary changes (define the amount you wish to receive from the swap) to avoid additional fees in case the bridge is unbalanced. --- If any error, please contact us @CORE-VAULT Discord Channel or send a discord message to theguruasia#8947. --- upme.link "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](https://discord.gg/XYMrvyr) Discounted Bridge : [The Lowest Fee (0.09%) Hive | Swap.Hive Bridge](https://www.swaphive.ga/) Burn-To-Vote : [Burn Your UPME / WINEX To Receive Upvotes](https://burn2vote.ga/)
#hive #hive-engine #leofinance #pob #neoxian #swap #uswap #kswap #crypto #merge
Payout: 0.000 HBD
Votes: 85
More interactions (upvote, reblog, reply) coming soon.