@hiveupme is a HIVE <-> SWAP.HIVE instant swapping service developed by @theguruasia that has a 0.1% normal fee. Its official website is at https://swaphive.github.io/swap/.

This post focuses on a potential problem I encountered with @hiveupme, particularly with its 0.075% reward system for its users adding liquidity to it. 🤔

Note that this post has lots of Math! 🤯😅

*On this post, I call both HIVE and SWAP.HIVE as "tokens" for simplicity.*

🤔 Details 🤔

**There is a 0.1% base fee for converting HIVE to SWAP.HIVE, or SWAP.HIVE to HIVE.**That means for every 1 token you swap with the other, you receive 0.999 of the other, where 0.001 is the deducted fee. However, the fee is*rounded down*(but the minimum fee is 0.001 token), so you can swap 1.999 of one token and receive 1.998 of the other token, making the fee become practically reduced to 0.05%.**Whenever the balance of one token is low enough, the fee is waived and you get 0.075% of the amount you converted as reward.**That means for every 10 of a token you swap, you get 10.075 of the other where 0.075 is the reward. To maximize the reward, you should swap`1.333 * n + 0.001`

of a token to the other to get`1.334 * n + 0.001`

where`n`

is any positive integer, such that 1.334 of a token gives 1.335 of the other, 2.667 gives 2.669, 4.000 gives 4.003, and so on.

🤯 More details 🤯

With the given details above, we can deduce that whenever the balance of one token is low enough, every time you convert 1.334 of a token to the other, you get 1.335 of the other, and *whenever* you have at least 1.999 of the other token, swap it back. Repeating this cycle until the balance of either token is no longer low enough earns you lots of the token with the low balance (sadly at the expense of @hiveupme and/or its supporters). 🤫

For example, if the balance of HIVE on @hiveupme is low enough such that there is bonus 0.075% HIVE for converting SWAP.HIVE to HIVE and you have 10 SWAP.HIVE, convert 9.332 (equivalent to 1.333 * 7 + 0.001) SWAP.HIVE to get 9.339 (equivalent to 1.334 * 7 + 0.001) SWAP.HIVE, then convert 1.999 SWAP.HIVE to HIVE 4 times to get 7.992 (equivalent to 1.998 * 4) HIVE. See here that the bonus of converting 9.332 SWAP.HIVE to HIVE here gives a profit of 0.007 HIVE, while converting back 7.998 (equivalent to 1.999 * 4) SWAP.HIVE (which is less than the 9.332 SWAP.HIVE we used earlier) back to HIVE only has 0.004 HIVE fee. This "cycle" gave us a net profit of 0.003 HIVE, and can be repeated endlessly as long as the balance of HIVE on @hiveupme is low enough. 🔄

As another example, I actually traded two 1.999 SWAP.HIVE (the one with the much higher balance in @hiveupme when I initiated the trades) here and here for which I received two 1.998 HIVE here and here. I then swapped 4 HIVE here for which I received 4 SWAP.HIVE here with the reward of 0.003 SWAP.HIVE here. That's a net profit of 0.001 HIVE from 4 SWAP.HIVE. That's small indeed, but if you have a bot which can automate the process again and again - that's 1 HIVE/SWAP.HIVE profit swapped for every 4,000 of the other token swapped repeatedly with minimal effort. 🤖

😊 Final words 😊

@hiveupme is a great instant swapping service between HIVE and SWAP.HIVE, as its normal fee is only 0.1% (much less than #HiveEngine and #TribalDex which have 0.75% fee, and #LeoDex and #BeeSwap which have 0.25% fee).

I have published this post for the following people:

- The developer of @hiveupme who is @theguruasia to add updates to prevent people from abusing this issue I found, probably with something as simple as the fee getting rounded up (or even just rounded off) instead of getting rounded down.
- Hive users who like @hiveupme to provide liquidity to it (and get rewarded in the process, without doing the "cycles" as I described above), because this issue is only a problem if the balance either HIVE or SWAP.HIVE is low in the @hiveupme Hive account (
*unless*@theguruasia has already implemented the update I suggested above).

🥳 Thank you for reading! 😎

Posted with STEMGeeks