Impermanent Gains Part 2: What is a "cross-swap"?

in Synergy Builders3 days ago (edited)

For a primer on "Impermanent Gains" - See part 1.

Words mean things, to the chagrin of linguists everywhere, and sometimes they even mean different things - to different people, in different contexts, and within different cultures.

But maybe the important part is not the words, but the "things" that the words are referring to. If we focus on the things, we might say that there is just one reality, and a whole bunch of different words, and "word groups" called languages, just running around and trying to talk about this one set of things that exist.

Because often, especially with "new things", there are enough problems around understanding the things themselves without even getting into the words that describe them.

image.png

I have written on this philosophical topic before, but now Wikipedia claims the very idea is too technical for you to understand

I certainly don't want to claim to be an expert, the fact that I ask questions that other's don't doesn't make me an expert - it makes me an autist.

But late last night, in my time zone, @dm312 asked a question, and it really got me thinking about one hundred other questions. Thinking in a good way, like "what do these words even mean", about a topic I am very interested in and "work" in on a daily basis. I will try to avoid all autistic rants and rabbit holes along the way, and just speak about the different "things" that "are", from my perspective.

Here is his original question which inspired me:


image.png

As @txracer states, all tokens can be sold for swap.hive on the orderbooks, and any other token can be purchased on its orderbooks for such swap.hive. This is the exact automation strategy of @dswap - which for reasons I will not get into here, no one should ever use, ever.

So back to the topic; in my free time I have been playing with triangles, sets of 3 Liquidity pools; I will give you an example:

Example 1 - Pizza : Swap.HIVE : Oneup

This triangle is made of 3 pools; PIZZA:Swap.HIVE, ONEUP:Swap.HIVE and PIZZA:ONEUP.

What happens when we "push" on one corner of the triangle? How does the price change in one token affect the ratios between the three tokens? This is what I have been playing with, the questions I have been answering for myself.

What would happen, for example, if PIZZA token pumped?

image.png

Everyone may (or may not) know, that there are "bots" which take advantage of "arbitrage opportunities". That means, when prices are linked through liquidity pools, any movements in price/ratios can affect multiple markets/pools/orderbooks.

This is expected behavior. I have come to consider these bots as "friends", mostly. They move money around based on opportunities often unseen by us mere humans, as we are not looking everywhere at once, or even might not know where to all be looking.

But still the question remains: If PIZZA token rises in Swap.HIVE terms, will these "arbitrage bots" raise the price of ONEUP to keep the PIZZA:ONEUP ratio, or will they change the PIZZA:ONEUP ratio with respect to the "new" price of each in Swap.HIVE terms?

And the answer I have found is - it depends. Depends on what? What it depends on, also depends - depends on the bot!

A note about bots: "Bots are people too!"

A lot could be said about "bots", heck, a lot has been said about them by many people. It's normal to look at a bot do something "better" or faster than a human (the only types of tasks that bots are generally made for) and think - hey! That's not fair!

And, beyond the discussion of whether its "fair" that someone can write python scripts and another cannot, it's important to note this - behind every bot is someone writing the scripts that make the bot, bot. There are a lot of weaknesses to automation, not least of which is the "no thinking required" nature of automated actions.

If a bot's ability to move faster than me is considered unfair, then its probably just as unfair when I use my powers of thinking, which the bot doesn't have, to trick the bot into doing something silly, and giving me money. So it goes both ways when it comes to "bots".


Back to the triangle.

If PIZZA price goes up, either ONEUP price will go up, or the ratio between the two will require more ONEUP per PIZZA, or some combination of the two. The environmental conditions to consider are A. the relative depth of the Liquidity Pools in question, and B. the orders living and live on the market order books for the ONEUP token.

Perhaps another important thing to mention is - it doesn't matter "why" PIZZA token price went up. These bots are agnostic to the emotions of token hype and price, they are just looking around for free money by balancing things out.

Swap Fees

When people (or bots) interact with the market order books, there is no fee, but when they do these types of "cross swaps" between pools, they pay a 0.25% fee to do so. This also means there is some friction to getting an "arbitrage action" going, and there is some money left behind for someone (the liquidity providers) after the arbitrage - money that the bot "paid" in order to make its arbitrage.

So not only is the "bot" adjusting the prices all around to make sure they "make sense" and all balance out, but it often pays other people (liquidity providers) for the privilege of doing so.

Now if the PIZZA token pumps in Swap.HIVE terms - which pool will the bot want to move? The ONEUP:Swap.HIVE pool or the PIZZA:ONEUP pool?

A. You might believe the answer is that the pool with less liquidity, will adjust more easily - since there is less friction.

B. Alternatively, you might think - the deeper of the two pools will have more arbitrage available by trading from it, before the arb closes due to slippage.

And either way you think - you would be right. That's because the complete arbitrage moves through all three pools in the triangle, including and perhaps especially the PIZZA:Swap.HIVE pool itself.

Is this how the "bots" see it? Again, this is going to depend on the bot; a bot programmed to "play the spread" on the orderbooks is just as blind to all this as any human not looking.

These are some of my thoughts, my notes about triangle "cross-swaps"; now what if it was in a different shape than a triangle?

That's going to have to wait until Part 3. But,

Back to the words that inspired:

Screenshot_20250517_070307.jpg

SIM and (swap)HBD form a triangle with Swap.HIVE, they have pools, so using the orderbooks isn't even necessary.

The path from SIM to swap.HBD is called a "route", and anyone -whether human or bot - trying to find this path is engaging in "routing", or "trying to find the best route".

Is it possible to build an interface that allows a user to allow a bot to route their trades? Yes I believe so, it has been done before on other platforms, heck @dswap is a type of routing bot right here on Hive-Engine.

Would it be smart to use such a thing? I am quite doubtful, I've used my powers of thinking to trick too many "bots" too many times into giving me money to assume otherwise.

Freedom and Friendship

Sort:  

Love seeing your though process on this, I have been thinking about this subject on and off for years. The best thing I can come up with is delayed swaps like Hive-HBD so the algorithms that govern the bots can average the swap price with others that want the opposite swap. Unfortunately this is the opposite of why people pick lp swaps on the 3 second block time for almost instant settlement or rejection of their offer. The other option is a forum where people can request swaps and others can just accept the offer, but again this is a slow process and can be exploited. Maybe my ramblings will give you some other inspiration to come up with a solution I have yet to see.

I have only seen one person try the non pool swap on Tribal Dex and he was not happy about the 2 day wait for the swap to process.

Edit: The biggest hurdle to overcome on this is a basic computer science problem of with working with n log n calculations.

Often "fast" and "good results" are the trade off. I understand that trade off, I try to position myself to never "need" to be so fast that I sacrifice good results.

This requires more clicking and more thinking. But the alternative, trusting some non-thinking lines of code to make these tradeoffs for you - I think might be a step in the wrong direction.

Is it possible that we should encourage all users to learn more and think longer? Or is the future of these technologies to be such that easy interfaces encourage people to think less?

I dont know!!!

I am a firm believer that knowledge is power. So I would love to see more people just start playing with dust payouts and see how stuff works.

my vote power sucks so enjoy some !PIZZA


Your reply is upvoted by @topcomment; a manual curation service that rewards meaningful and engaging comments.

More Info - Support us! - Reports - Discord Channel

image.png
Curated by incublus

I've been going deep into diesel/liquidity pools over the last year (I've always been in them, but now I'm going way deeper), so this information, and these questions, are fascinating to me. I watch and observe various pools a lot now, as I test them out to see where their differing reward and/or fee thresholds are. This idea of a pool triangle is super interesting, and it gives me things to which I should pay closer attention, and to test and with which to experiment. Very, very interesting, my friend! 😁 🙏 💚 ✨ 🤙

Happy Happy Birthday!

PIZZA!

$PIZZA slices delivered:
@txracer(2/15) tipped @ecoinstant

Come get MOONed!

Hmmmm Interesting, This gets me thinking if there are multiple bots as such wont that affect the pool and prìze ?

Hi @ecoinstant, I read your two articles and I find both of them very interesting.
I once used the LPS, and they really helped me a lot, then I abandoned them, because in one of the pairs where I had bet, I failed, because of a problem with a game.
But now that I'm reading you, I think I'll try again, but I'll choose the tokens I'm going to invest in well.
Anyway, I will try to learn and study more about tos regarding the process.
Thank you very much for the information of both post.


Este post fue votado desde Ecency.
Vota la propuesta de Ecency

!HUESO

Uses: 3/12
!PIZZA