amm-arbitrageur icon indicating copy to clipboard operation
amm-arbitrageur copied to clipboard

any chance writing the math for the max borrow amount on balancer and curve?

Open stefangabos opened this issue 3 years ago • 6 comments

i am willing to pay for it

stefangabos avatar Feb 02 '22 22:02 stefangabos

Me too

yoongyy avatar Feb 03 '22 10:02 yoongyy

For Balancer or Curve, it's quite complicated to solve for the best solution. Suggest to trying calculate it off-chain by using tools such as scipy or you can use an off-chain binary searching for an optimized borrow amount.

For Uniswap V3, I only suggest using binary searching for an optimized borrow amount.

paco0x avatar Feb 05 '22 05:02 paco0x

@stefangabos @yoongyy how much? I have a formulation that I'm using in my bots, that I'm willing to sell, depending on price and use case. Also have optimal amounts for triangular arbitrages.

samlaf avatar Feb 21 '22 02:02 samlaf

@stefangabos @yoongyy how much? I have a formulation that I'm using in my bots, that I'm willing to sell, depending on price and use case. Also have optimal amounts for triangular arbitrages.

The important part is not the formula, but Balancer/Curve is Vault, so it is not like normal pool like WBNB/BUSD in PancakeSwap. I need the script to calculate the borrow amount from Vault and selling amount on Dex or from Dex to Vault, off chain and on chain (if possible).

yoongyy avatar Feb 21 '22 03:02 yoongyy

@paco0x Would you mind explaining a bit further the way you would implement the binary search for the optimized borrow amount? I'm trying to code my flashswap contract from scratch bit I'm struggling with this part

edochigini avatar Mar 18 '22 23:03 edochigini

@mtyou pm me on twitter @samlafer

samlaf avatar May 17 '22 04:05 samlaf