diff --git a/config.yml b/config.yml index dbd473a71..d45b68926 100644 --- a/config.yml +++ b/config.yml @@ -419,6 +419,8 @@ genesis: priceFeeders: - feeder: "elys12tzylat4udvjj56uuhu3vj2n4vgp7cf9fwna9w" is_active: true + - feeder: "elys1v30pe777dj9mgsnlv0j2c5wh05m0ya0nlhuv7t" + is_active: true prices: - asset: USDT price: "1.00" diff --git a/x/amm/client/wasm/query_amm_price_by_denom.go b/x/amm/client/wasm/query_amm_price_by_denom.go index e20c2c206..08bd0c465 100644 --- a/x/amm/client/wasm/query_amm_price_by_denom.go +++ b/x/amm/client/wasm/query_amm_price_by_denom.go @@ -17,6 +17,15 @@ func (oq *Querier) queryAmmPriceByDenom(ctx sdk.Context, query *ammtypes.QueryAM return nil, errorsmod.Wrapf(aptypes.ErrAssetProfileNotFound, "denom: %s", denom) } + // If amount is zero + if query.TokenIn.Amount.IsZero() { + responseBytes, err := json.Marshal(sdk.ZeroDec()) + if err != nil { + return nil, errorsmod.Wrap(err, "failed to serialize in route by denom response") + } + return responseBytes, nil + } + // uses asset profile denom usdcDenom := assetProfile.Denom diff --git a/x/oracle/client/cli/tx_price_feeder.go b/x/oracle/client/cli/tx_price_feeder.go index 4f027b724..8d95e58b5 100644 --- a/x/oracle/client/cli/tx_price_feeder.go +++ b/x/oracle/client/cli/tx_price_feeder.go @@ -21,7 +21,7 @@ func CmdSetPriceFeeder() *cobra.Command { return err } - isActive, err := strconv.ParseBool(args[1]) + isActive, err := strconv.ParseBool(args[0]) if err != nil { return err }