PriceAuthority doesn't allow AMM to modify amountIn when submitting prices #2789
Labels
bug
Something isn't working
Core Economy
OBSOLETE in favor of INTER-protocol
enhancement
New feature or request
Zoe Contract
Contracts within Zoe
Describe the bug
The PriceAuthority presumes that prices provided by
calcAmountIn
andcalcAmountOut
will only provide one amount. Autoswap'sgetOutputForGivenInput()
will sometimes update the amountIn as well as providing the amountOut, and conversely forgetInputForGivenOutput()
.Expected behavior
The PriceAuthority should transmit the best price information available.
Additional context
In
priceAuthority.js
, trigger expects that calcAmountOut will only produce amountOut. This forces the priceAuthority in the AMM to discard its amountIn before responding. The current version ofgetOutputForGivenInput()
in autoswap returns theamountOut
along with a possibly updatedamountIn
.quoteGiven
andquoteAtTime
should take both values fromcalcAmountOut
, andquoteWanted
should take both values fromcalcAmountIn
.The text was updated successfully, but these errors were encountered: