Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

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

Open
stefangabos opened this issue Feb 2, 2022 · 6 comments

Comments

@stefangabos
Copy link

i am willing to pay for it

@yoongyy
Copy link

yoongyy commented Feb 3, 2022

Me too

@paco0x
Copy link
Owner

paco0x commented Feb 5, 2022

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.

@samlaf
Copy link

samlaf commented Feb 21, 2022

@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.

@yoongyy
Copy link

yoongyy commented Feb 21, 2022

@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).

@edochigini
Copy link

edochigini commented Mar 18, 2022

@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

@samlaf
Copy link

samlaf commented May 17, 2022

@mtyou pm me on twitter @Samlafer

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants