Friday, October 7, 2022

Solution to the Stable routing bonus quiz

Partial solution to the Stable routing bonus quiz:

I've mapped stable-to-stable across DEXen. Here're those mappings: 


You see from the raw data (below), there are 66 edges to this graph. SOME of which have a gain-multiplier (marked in green)! 

Partial solution, part II:





  • Sample Stable Coin graph


  • Dijkstra shortest path $DAI.e -> $USDT.e


But there's a problem...

The problem here is Dijkstra solves for SHORTEST path, but the LOWER the multiplier, the MORE disadvantageous the trade.

I must rework my data set that has an inverted multiplier, but some multipliers, as you saw, are ABOVE 1.0, i.e.: an ADVANTAGEOUS swap.

Some thought required.

Okay, redesigned with an efficacy-score. DONE! ✅ 



NOT DONE! 😤

The problem with pathing algorithms for this particular domain is that the multipliers are not path-lengths, but, as their name denotes: multipliers.

I think I may have to tune an algorithm then patten(tm)(r)(c) it.

BUT IN THE INTERIM! 

I CAN query the graph and ask:

"Are there paths that pay ME to swap?" or, in cypher:

match p =(c)-[r]->(c1)
where r.efficacy < 1 
return p
And there are:


How about we go one step further?

"Is there a multiple hope currency-swap that is efficacious?" or, in cypher:

match p =(c)-[r]->(c1)-[r1]->()
where r.efficacy < 1 and r1.efficacy < 1
return p


Answer: NUPE! 

Oh, well.

No comments:

Post a Comment