uniswap-arbitrage-analysis icon indicating copy to clipboard operation
uniswap-arbitrage-analysis copied to clipboard

Hi, wondering how you derive eq6 from eq5 and eq4 ?

Open wellttllew opened this issue 3 years ago • 2 comments

Sorry for my poor math :(
So I tried to use symbolic mathematics to derive it.
But I failed.

import sympy
from sympy.solvers import solve

# symbols
R0,R1,R2,R1_prime,del_a = sympy.symbols('RO R1 R2 R1_prime,del_a')

# equation 4 
del_b = R1 * r * del_a / ( R0 + r * del_a) 

# equation 5 
del_c = R2 * r * del_b / (R1_prime + r * del_b)

# equation 6 
eq_6_num = R0*R1_prime/ (R1_prime + R1 * r) * del_a * r
eq_6_den = (R1*R2*r/(R1*r + R1_prime)) + r * del_a 

eq_6 =  eq_6_num/eq_6_den


# equality check 
# But this is not zero... .. 
sympy.simplify(eq_6 - del_c)

wellttllew avatar May 29 '21 14:05 wellttllew

his eq 6 is mistake, try flipping the e0/e1 part of eq 6, should work

bonny5151 avatar Feb 09 '22 05:02 bonny5151

@bonny5151 what are the correct equations?

JayusJay avatar May 17 '22 14:05 JayusJay