Wednesday, September 13, 2023

2023-09-13 ETHBTC-THANG! Day 108

Let's do the ETHBTC-THANG!

I record the $ETH and $BTC prices from @osmosiszone, where errors are resurfacing for the $wBTC price.



I record these prices into my SPREADSHEETSZORXEN! 

SPREADSHEETSZORXEN! says 'swap 0.00812 $BTC' (I'll come to that eventually), so I withdraw that amount from @TeamKujira Ghost lend.



But where to swap?

Aye: there's the rub.

Let's look at 4 (non-)options, then a fifth OG geophf-option.

For DEXen, worst (least $ETH from $BTC) to best (most). 

For 0.00812 $BTC I get _ from: _

  1. 0.1299 $ETH: @THORSwap (ignoring gas fees)


  1. 0.1309 $ETH: @Manta_DAO


  1. 0.1315 $ETH: @osmosiszone


  1. 0.1317 $ETH: @NolusProtocol (lease then payoff)



Folks: learn leasing.

"...butbutbut HOWDOILEARNLEASING, o, el geophf?"


All on my blog, folks, with other juicy α. All free. For you. 

"So, el geophf, ya gonna lease-then-payoff, then, for the BTC-ETH 'swap'?"

Maybe. The above four give you the (kinda-)DEX-approach.

Let's take a deeper dive.

These are the viable paths for the @TeamKujira order books, diagrammed by ./graphista.



These data are graphed in @neo4j cloud db Aura, uploaded with queries.cyp:

https://github.com/logicalgraphs/crypto-n-rust/blob/main/src/ch08/graphista/queries.cyp

Okay, fine. What are the directed and acyclic paths from $wBTC to $wETH?

Easy. That's the Cypher query:

match p=(c {name: "wBTC"})-[*1..4]->(c1{name: "wETH"}) 
return p



This, however, is inhuman AND inhumane in the amount of pathing one must do to trade from $wBTC to $wETH on @TeamKujira FIN.

That's why I have ./vern, my main man, ./vern.



There's a problem, however, when I output the viable paths as CSV.

Dear @neo4j,

Seriously? Again?




You've had this problem FOR YEARS!
I have pointed this problem out on MULTIPLE occasions!

Please fix CSV output to be NO QUOTES, not 300,000 quotes.

ffs 🙄

love, geophf

Dear @neo4j,

A reference how CSV output, that is: sane CSV output, SHOULD look like and how your CSV output USED TO look like.




You pay bounties for people who find bugs in your system?

wallet addy: kujira1h525rx052gx2qt9qc9jqj6f7thv5h3lylja47q

So, I'm a programmer.

Let's pretend problems don't distract me from just writing the d-mn solution.

They do, but let's pretend.

Behold. 



all-isomorphic-paths.csv (up to 3-deep) on @TeamKujira FIN, ... NOW INCLUDING $MNTA ORDER BOOKS!! 💥💥💥 

That, along with the latest market data and my (non-)list of synthetic order books allows me to run ./vern, my main man, ./vern!

What does ./vern say?


Huh! If that isn't disappointing!

But am I disappointed? No.

Sometimes, ./vern fails me, be it the verra smol amount traded or inactive-order-book hell.

This does not stop me. No weapon formed against me shall stop me.

I'll just find another way! Let's look at the order books




The key here is to look at the HIGHEST price to SELL $wBTC and the LOWEST price to BUY $wETH.

SELL HIGH; BUY LOW

Then create a path between those two, which entail mixing in:

USK,axlUSDC,ATOM,KUJI,MNTA,






not in any particular order. 

So, the trick is to stitch the order books together in a pretty-durn-good transactional chain.

How do you know that your path is a winner?

Enter: ./emily 

I run my three best guesses through ./emily, and ./emily tells me what the result of the trade is.



Now, ./emily runs the trade AT MARKET PRICE, ONLY! But that's what @Manta_DAO is supposed to do, automatically.

So why does ./emily easily beat @Manta_DAO? 🤔



@NolusProtocol lease-then-payoff just beats my best trade, without the hassle of going through five order books.



But, even still: it's not as easy as all that.

@NolusProtocol beats market price trades.

I NEVER trade at market price. Why would I?

So, with ./emily I can get the trade to be around 0.1355, just above or below market price, on order books with $1k+ 24-hour volumes.

So, I place the first order in the 

> $wBTC > $USK > $axlUSDC > $ATOM > $KUJI > $wETH

trade-path, and call it a night.



G'night, fam. I have a video-conference at midnight, then a meeting at 1:15 am ET. 😴

Pivoted: $wBTC > $MNTA > $KUJI > $wETH

I'm at the $KUJI > $wETH part of the trade. I took a wee bit o' profit in $KUJI, and still I beat all DEX trades.






Next time I need to long the objective ($wETH) during these trades so the objective doesn't escape me on a moonshot.

No comments:

Post a Comment