Showing posts with label pretty printer. Show all posts
Showing posts with label pretty printer. Show all posts

Wednesday, October 26, 2022

Rust pop-answer: order books, pretty-printed

The solution to the Rust pop-quiz of pretty-printing order books is straightforward.


That's not the interesting part.

The interesting part is this: look at ATOM / USK and ATOM / axlUSDC. 


ATOM's prices are different in each order book.

Hm. Arbitrage opportunity? 

Tuesday, October 25, 2022

Rust pop-quiz: order books, printed prettily, I pray thee

Rust pop-quiz

We see the USD-type has a pretty-printer.


(line number is annotated)

SO: write a pretty-printer for order book, such that it outputs as, e.g.:

KUJI / axlUSDC 1.027 ($1.03)

instead of the debugging nightmare we saw in the last quiz answer.