yieldprotocol / ui-monorepo

0 stars 0 forks source link

fix: maxyFYTokenOut implementation #5

Closed marcomariscal closed 2 years ago

marcomariscal commented 2 years ago

fixes the maxFYTokenOut implementation to match the hack md file here

this desmos details what was used to test the implementation (inputs and output). the desmos implementation makes sure to use a mu of 1.05 (not one), to highlight any potential inaccuracies in the implementation (for some reason i used 1 for mu the first time, which made it hard to catch that the implementation was slightly off).

maxBaseIn was also updated (here is the desmos) to look more closely like the maxFYTokenOut implementation for consistency; the outputs remain the same.

these updated functions were tested in app-v2 because i couldn't get the test environment situated here, so would like to test these here.