Skip to content

Commit

Permalink
Return nil for no profit opportunity
Browse files Browse the repository at this point in the history
  • Loading branch information
NotJeremyLiu committed Feb 15, 2023
1 parent af4c0c8 commit ad5ea73
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions x/protorev/keeper/rebalance.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package keeper

import (
"fmt"

sdk "github.com/cosmos/cosmos-sdk/types"

poolmanagertypes "github.com/osmosis-labs/osmosis/v14/x/poolmanager/types"
Expand Down Expand Up @@ -123,7 +121,7 @@ func (k Keeper) FindMaxProfitForRoute(ctx sdk.Context, route RouteMetaData, rema
if err != nil {
return sdk.Coin{}, sdk.ZeroInt(), err
} else if minInProfit.LTE(sdk.ZeroInt()) {
return sdk.Coin{}, sdk.ZeroInt(), fmt.Errorf("no profit for route %d", route.Route.PoolIds())
return sdk.Coin{}, sdk.ZeroInt(), nil
}

// Increment the number of pool points consumed since we know this route will be profitable
Expand Down

0 comments on commit ad5ea73

Please sign in to comment.