Degen Code

Degen Code

Share this post

Degen Code
Degen Code
Smart Contract Arbitrage — Optimizing the Input
Copy link
Facebook
Email
Notes
More

Smart Contract Arbitrage — Optimizing the Input

Mad Maxing

Mar 16, 2022
∙ Paid
21

Share this post

Degen Code
Degen Code
Smart Contract Arbitrage — Optimizing the Input
Copy link
Facebook
Email
Notes
More
4
Share

The trickiest part of a two-pool arbitrage is determining the optimal borrow amount.

To understand how the problem is solved, consider the the hypothetical equation:

P(x) = y_b(x) - y_a(x)

where y_b(x) is the output of token x swapped for token y through Pool B, y_a(x) is the repayment required in token y for a flash borrow of token x through Pool A, and …

This post is for paid subscribers

Already a paid subscriber? Sign in
© 2025 BowTiedDevil
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share

Copy link
Facebook
Email
Notes
More