Showing posts with label vern. Show all posts
Showing posts with label vern. Show all posts

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.

Friday, March 31, 2023

10 ATOM-arb, 2023-03-31

Let's do an $ATOM arb!

./vern, my main man, ./vern sez:



  • ATOM,USK,LOCAL,KUJI,axlUSDC,ATOM


will get me 2.17%.

Let's do that!

I place the order, 


...and we're OFT! to the races!

Wednesday, March 29, 2023

Rust pop-quiz answer: unique arbitration paths

./vern! my main man, ./vern just got another upgrade: unique arb-paths.

./vern. The ./vern abides. 

This pop-quiz answer is in response to the same pop-quiz [question].

Tuesday, March 28, 2023

Whither arb'd KUJI?

Okay, so I've arbed $KUJI twice, for a total gain of 74 $KUJI on 1,500 $KUJI arb'd.

Not bad.

BUT HAVE I ARBED (yes) ... $KUJI??? (yes?)

Yes, I have.

But $KUJI is money, and money is a means of exchange, so that means I can buy anything that's for sale, ...

including $USK.

"What's the best way to get $USK from $KUJI?" you may ask.

Let's ask ./vern, my main man, ./vern: 


./vern, my main man, ./vern sez


  • KUJI,axlUSDC,ATOM,KUJI,USK

To translate: "Arb the $KUJI first, then swap."

Okay, a bit convoluted, I grant you, but it's the most efficacious route.

«En y va!» as the French (don't) say.

We're OFT! to the races. I place my first order in this 'buy $USK from $KUJI'-adventure.

  • 2023-03-28 placed: 74 KUJI -> _ axlUSDC, SELL at 0.424


What does this illustrate?

./vern can be used for ANY (FIN) trade, because all-isomorphic-paths (or all arbs) include all possible trade-paths as a subset, and ./vern finds efficacy there.

Why buy anything for anything other than the best price? ./vern helps with that.

Thank you, ./vern, my main man, ./vern!

./vern ... constructed from first principals by simply following the quizzes.  

Friday, March 17, 2023

KUJI arb, 2023-03-18

Shall we arb some $KUJI?

./vern, my main man, ./vern says that there's a 4% arb on 100 $KUJI right now.


Shall we give it a go?


(spoiler: yes) 

Saturday, February 25, 2023

"Synthetic" order books

The @TeamKujira FIN order books have a problem. There are too many order books with hardly any volume. How do solve this problem?

I am introducing the concept of 'synthetic order books.' 


Synthetic order books: aren't.

They are usually LPs on, e.g.: Osmosis, Comdex, or Terra.

To this end, I am modifying ./vern, my main man, ./vern in two significant ways.

  1. ./vern will now use synthetic order books as well.
  2. ./vern will now consider the order books' volume to compute the best arbitration paths.

The aim: to make more arb-paths successful trades.

Infrastructure:

  1. ./vern now incorporates ./top_order_books to compute order book volumes to minimize trade-risk. 
  2. The synthetic order books are here. You see mostly @osmosiszone and @ComdexOfficial swap-pairs. 



Tuesday, January 10, 2023

Rust pop-quiz: teach ./vern uniqueness

Rust pop-quiz, feature enhancement:

./vern, my main man, ./vern, if you look closely, reports paths redundantly.


It's not that the (full) paths are the same, it's that two different paths have the same tails, and ./vern doesn't know that.

Teach ./vern to report unique paths.

Monday, December 26, 2022

2022-12-26 KUJI arbitrage-vern

Prélude

Now for ./vern, my main man, ./vern.

./vern sez: "I LUV ⭐⭐⭐! GIMME MOAR ⭐⭐⭐!!!"
  • KUJI,axlUSDC,STARS,USK,ATOM,KUJI

And, just as Fate would have it ...
[🎵 "ended up with Sunset Sam!" 🎶]

... both sell-orders hit at the same time! 

We check ./vern with the current market-conditions.


./vern is now singing a very different tune.

so we adjust with both ./vern and ./emily paths being the same.

  • KUJI,axlUSDC,USK,STARS,axlUSDC,KUJI
    • 2022-12-26 placed: 227.50 axlUSDC -> _ USK, SELL at 0.9704 fulfilled

So, I place one ... 'sell' (?) order for $USK (axlUSDC/USK order book IS SO WEIRD! 😤) for both ./vern and ./emily, and we'll diverge again after this order fills, if necessary. 

Friday, December 23, 2022

2022-12-24 wBNB arbitration

For $wBNB, ./vern, my main man, ./vern 


recommends the following path:
  • wBNB,USK,ATOM,axlUSDC,wBNB

So I kick off my $wBNB-arb with

The first order for the $wBNB came through, so I claim that.


Now. Let's consult ./vern, my main man, ./vern.


./vern sez: USK,DOT,axlUSDC, to get 0.055 wBNB

But can I do better, just swapping back?


The swap-back gets me 0.054, so let's continue the arb.

Actually, I take that back.

The DOT/USK board has fallen asleep.


SO!

I'm going for the swap-back at $5 below 24h low to get the same result.


Here's hoping! 


  • 2022-12-25 placed 13.0695 USK -> 0.0556 wBNB, BUY at 235.233 closed 

2022-12-14 0.05 wBNB -> 0.0556 wBNB, 11.2% ROI, 3 days