duality-labs / duality

Apache License 2.0
10 stars 5 forks source link

Confirm correct truncate usage for other cases #317

Closed jcompagni10 closed 1 year ago

jcompagni10 commented 1 year ago

CalcGreatestMatchingRatio Swap pool, CalcSharesMinted: since shares are calculated, we should always round down when issuing shares to users. Withdraw from the pool - since amounts of tokens for pulling from the pool are calculated, they should always be rounded up.

jcompagni10 commented 1 year ago

Withdraw from the pool - since amounts of tokens for pulling from the pool are calculated, they should always be rounded up.

@teddyknox am I missing something here? If we are removing tokens from the pool we should round down, no? ie. status quo is correct

jcompagni10 commented 1 year ago

All of these cases seem correct