cowprotocol / cow-amm

An automated market maker running on top of CoW Protocol
17 stars 5 forks source link

fix: use inverse price order in legacy as well #89

Closed fedgiac closed 4 months ago

fedgiac commented 4 months ago

Unfortunately #87 isn't enough to fix the issue mentioned in the description: this is because getTradeableOrder is also used in the legacy math, where it wasn't updated.

Here the code is adjusted in the legacy path as well.

How to test

Notice that getTradeableOrder is only used twice, and in both cases we changed the order of the price vector.