Skip to content

Commit

Permalink
fix: uncomment previous logic
Browse files Browse the repository at this point in the history
  • Loading branch information
hallazzang committed Jun 13, 2022
1 parent fd08796 commit 44cdb0e
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions x/liquidity/amm/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,9 @@ func PoolBuyOrders(pool Pool, lowestPrice, highestPrice sdk.Dec, tickPrec int) [
ry = ry.Add(amt)
tmpPool = NewBasicPool(rx, ry, sdk.Int{})
}
// TODO: handle this case
//if pool.Price().GT(highestPrice) {
// placeOrder(highestPrice, tmpPool.BuyAmountTo(highestPrice))
//}
if pool.Price().GT(highestPrice) {
placeOrder(highestPrice, tmpPool.BuyAmountTo(highestPrice))
}
tick := PriceToDownTick(tmpPool.Price(), tickPrec)
for tick.GTE(lowestPrice) {
amt := tmpPool.BuyAmount(tick)
Expand Down Expand Up @@ -244,10 +243,9 @@ func PoolSellOrders(pool Pool, lowestPrice, highestPrice sdk.Dec, tickPrec int)
ry = ry.Sub(amt)
tmpPool = NewBasicPool(rx, ry, sdk.Int{})
}
// TODO: handle this case
//if pool.Price().LT(lowestPrice) {
// placeOrder(lowestPrice, tmpPool.SellAmountTo(lowestPrice))
//}
if pool.Price().LT(lowestPrice) {
placeOrder(lowestPrice, tmpPool.SellAmountTo(lowestPrice))
}
tick := PriceToUpTick(tmpPool.Price(), tickPrec)
for tick.LTE(highestPrice) {
amt := tmpPool.SellAmount(tick)
Expand Down

0 comments on commit 44cdb0e

Please sign in to comment.