diff --git a/proto/reserve/oracle/tx.proto b/proto/reserve/oracle/tx.proto index 206fa0b1..45e06d78 100644 --- a/proto/reserve/oracle/tx.proto +++ b/proto/reserve/oracle/tx.proto @@ -22,6 +22,8 @@ service Msg { rpc UpdateBandParams(MsgUpdateBandParams) returns (MsgUpdateBandParamsResponse); + rpc SetPrice(MsgSetPrice) returns (MsgSetPriceResponse); + rpc UpdateBandOracleRequest(MsgUpdateBandOracleRequestRequest) returns (MsgUpdateBandOracleRequestResponse); rpc DeleteBandOracleRequests(MsgDeleteBandOracleRequests) returns (MsgDeleteBandOracleRequestsResponse); @@ -121,4 +123,20 @@ message MsgUpdateBandOracleRequestParamsRequest { } // MsgUpdateBandOracleRequestParamsResponse define the Msg/UpdateBandOracleRequestParams response type. -message MsgUpdateBandOracleRequestParamsResponse {} \ No newline at end of file +message MsgUpdateBandOracleRequestParamsResponse {} + +message MsgSetPrice{ + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "reserve/x/oracle/MsgSetPrice"; + string denom = 1; + + bytes price = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + string authority = 3; +} + +message MsgSetPriceResponse {} \ No newline at end of file diff --git a/script/proposal-psm.json b/script/proposal-psm.json index 816b6054..1d451bfb 100644 --- a/script/proposal-psm.json +++ b/script/proposal-psm.json @@ -6,7 +6,8 @@ "limit_total": "100000000000000000000000000000", "fee_in": "0.001000000000000000", "fee_out": "0.001000000000000000", - "oracle_script": "44" + "oracle_script": "44", + "symbol": "USD" }, { "@type": "/reserve.psm.v1.MsgAddStableCoin", @@ -15,7 +16,8 @@ "limit_total": "100000000000000000000000000000", "fee_in": "0.001000000000000000", "fee_out": "0.001000000000000000", - "oracle_script": "44" + "oracle_script": "44", + "symbol": "USD" }], "deposit": "100000000stake", "title": "My proposal", diff --git a/x/oracle/client/cli/tx.go b/x/oracle/client/cli/tx.go index fe88f7d0..f0bfd52e 100644 --- a/x/oracle/client/cli/tx.go +++ b/x/oracle/client/cli/tx.go @@ -4,6 +4,7 @@ import ( "fmt" "strconv" + "cosmossdk.io/math" errors "github.com/pkg/errors" "github.com/spf13/cobra" @@ -29,6 +30,7 @@ func GetTxCmd() *cobra.Command { cmd.AddCommand( NewRequestBandRatesTxCmd(), + NewSetPriceCmd(), ) return cmd @@ -73,3 +75,32 @@ func NewRequestBandRatesTxCmd() *cobra.Command { return cmd } + +func NewSetPriceCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "set-price [denom] [price]", + Args: cobra.ExactArgs(2), + Short: "set price for denom ", + Long: `set price for denomn. + + Example: + $ onomyd tx mockoracel set-price usdt 1 + `, + + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + price := math.LegacyMustNewDecFromStr(args[1]) + addr := clientCtx.GetFromAddress() + msg := types.NewSetPrice(args[0], addr.String(), price) + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/oracle/keeper/band_oracle.go b/x/oracle/keeper/band_oracle.go index e950b1a5..558dfdd1 100644 --- a/x/oracle/keeper/band_oracle.go +++ b/x/oracle/keeper/band_oracle.go @@ -621,3 +621,167 @@ func (k Keeper) GetAllPairDecimalsRate(ctx context.Context) []types.PairDecimals return allPair } + +func (k Keeper) SetInitPrice(ctx context.Context) error { + sdkCtx := sdk.UnwrapSDKContext(ctx) + initPrice := []*types.BandPriceState{ + // multiplier = 1000 + { + Symbol: "fxUSD", + Rate: math.NewInt(10000), //1 + ResolveTime: sdkCtx.BlockTime().Unix(), + PriceState: *types.NewPriceState(math.LegacyMustNewDecFromStr("1"), sdkCtx.BlockTime().Unix()), + }, + { + Symbol: "USD", + Rate: math.NewInt(10000), //1 + ResolveTime: (sdkCtx.BlockTime().Unix()), + PriceState: *types.NewPriceState(math.LegacyMustNewDecFromStr("1"), sdkCtx.BlockTime().Unix()), + }, + { + Symbol: "EUR", + Rate: math.NewInt(10910), //1 + ResolveTime: (sdkCtx.BlockTime().Unix()), + PriceState: *types.NewPriceState(math.LegacyMustNewDecFromStr("1"), sdkCtx.BlockTime().Unix()), + }, + { + Symbol: "JPY", + Rate: math.NewInt(66), //1 + ResolveTime: (sdkCtx.BlockTime().Unix()), + PriceState: *types.NewPriceState(math.LegacyMustNewDecFromStr("1"), sdkCtx.BlockTime().Unix()), + }, + { + Symbol: "fxEUR", + Rate: math.NewInt(10910), //1.091 + ResolveTime: (sdkCtx.BlockTime().Unix()), + PriceState: *types.NewPriceState(math.LegacyMustNewDecFromStr("1.091"), sdkCtx.BlockTime().Unix()), + }, + { + Symbol: "fxJPY", + Rate: math.NewInt(66), //0.0066 + ResolveTime: (sdkCtx.BlockTime().Unix()), + PriceState: *types.NewPriceState(math.LegacyMustNewDecFromStr("0.0066"), sdkCtx.BlockTime().Unix()), + }, + { + Symbol: "anom", + Rate: math.NewInt(330), //0.03 + ResolveTime: (sdkCtx.BlockTime().Unix()), + PriceState: *types.NewPriceState(math.LegacyMustNewDecFromStr("0.03"), sdkCtx.BlockTime().Unix()), + }, + { + Symbol: "NOM", + Rate: math.NewInt(330), //0.03 + ResolveTime: (sdkCtx.BlockTime().Unix()), + PriceState: *types.NewPriceState(math.LegacyMustNewDecFromStr("0.03"), sdkCtx.BlockTime().Unix()), + }, + { + Symbol: "usdt", + Rate: math.NewInt(10000), //1 + ResolveTime: (sdkCtx.BlockTime().Unix()), + PriceState: *types.NewPriceState(math.LegacyMustNewDecFromStr("1"), sdkCtx.BlockTime().Unix()), + }, + { + Symbol: "USDT", + Rate: math.NewInt(10000), //1 + ResolveTime: (sdkCtx.BlockTime().Unix()), + PriceState: *types.NewPriceState(math.LegacyMustNewDecFromStr("1"), sdkCtx.BlockTime().Unix()), + }, + { + Symbol: "usdc", + Rate: math.NewInt(10000), //1 + ResolveTime: (sdkCtx.BlockTime().Unix()), + PriceState: *types.NewPriceState(math.LegacyMustNewDecFromStr("1"), sdkCtx.BlockTime().Unix()), + }, + { + Symbol: "eurt", + Rate: math.NewInt(10910), //1.091 + ResolveTime: (sdkCtx.BlockTime().Unix()), + PriceState: *types.NewPriceState(math.LegacyMustNewDecFromStr("1.091"), sdkCtx.BlockTime().Unix()), + }, + { + Symbol: "jpyt", + Rate: math.NewInt(66), //0.0066 + ResolveTime: (sdkCtx.BlockTime().Unix()), + PriceState: *types.NewPriceState(math.LegacyMustNewDecFromStr("0.0066"), sdkCtx.BlockTime().Unix()), + }, + { + Symbol: "uatom", + Rate: math.NewInt(80000), //8 + ResolveTime: (sdkCtx.BlockTime().Unix()), + PriceState: *types.NewPriceState(math.LegacyMustNewDecFromStr("8"), sdkCtx.BlockTime().Unix()), + }, + { + Symbol: "ATOM", + Rate: math.NewInt(80000), //8 + ResolveTime: (sdkCtx.BlockTime().Unix()), + PriceState: *types.NewPriceState(math.LegacyMustNewDecFromStr("8"), sdkCtx.BlockTime().Unix()), + }, + { + Symbol: "uosmo", + Rate: math.NewInt(4500), //0.45 + ResolveTime: (sdkCtx.BlockTime().Unix()), + PriceState: *types.NewPriceState(math.LegacyMustNewDecFromStr("0.45"), sdkCtx.BlockTime().Unix()), + }, + { + Symbol: "uusdt", + Rate: math.NewInt(10000), //0.45 + ResolveTime: (sdkCtx.BlockTime().Unix()), + PriceState: *types.NewPriceState(math.LegacyMustNewDecFromStr("1"), sdkCtx.BlockTime().Unix()), + }, + { + Symbol: "atom", + Rate: math.NewInt(80000), //0.45 + ResolveTime: (sdkCtx.BlockTime().Unix()), + PriceState: *types.NewPriceState(math.LegacyMustNewDecFromStr("8"), sdkCtx.BlockTime().Unix()), + }, + { + Symbol: "ibc/E50A183716AB596378047D9688FE648CD3470C4D196FB4C2C8E61989DB48562E", //transfer/channel-10/transfer/channel-7/transfer/channel-143/erc20/tether/usdt + Rate: math.NewInt(10000), + ResolveTime: (sdkCtx.BlockTime().Unix()), + PriceState: *types.NewPriceState(math.LegacyMustNewDecFromStr("1"), sdkCtx.BlockTime().Unix()), + }, + { + Symbol: "ibc/BE4C72028781730B9DF0542466EB26DEA6DDD42C32316D774F943151F6010320", // transfer/channel-5/usdt + Rate: math.NewInt(10000), + ResolveTime: (sdkCtx.BlockTime().Unix()), + PriceState: *types.NewPriceState(math.LegacyMustNewDecFromStr("1"), sdkCtx.BlockTime().Unix()), + }, + { + Symbol: "ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518", //transfer/channel-0/uosmo + Rate: math.NewInt(4500), //0.45 + ResolveTime: (sdkCtx.BlockTime().Unix()), + PriceState: *types.NewPriceState(math.LegacyMustNewDecFromStr("0.45"), sdkCtx.BlockTime().Unix()), + }, + { + Symbol: "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2", //ibc-atom + Rate: math.NewInt(80000), //0.45 + ResolveTime: (sdkCtx.BlockTime().Unix()), + PriceState: *types.NewPriceState(math.LegacyMustNewDecFromStr("8"), sdkCtx.BlockTime().Unix()), + }, + { + Symbol: "ibc/BC599B88586F8C22E408569D7F6FAD40AEBF808A67D2051B86958CBB5F0A16B0", //usdt + Rate: math.NewInt(10000), + ResolveTime: (sdkCtx.BlockTime().Unix()), + PriceState: *types.NewPriceState(math.LegacyMustNewDecFromStr("1"), sdkCtx.BlockTime().Unix()), + }, + } + + for _, i := range initPrice { + err := k.SetBandPriceState(ctx, i.Symbol, i) + if err != nil { + return err + } + } + return nil +} + +func (k Keeper) SetPrice(goCtx context.Context, msg *types.MsgSetPrice) (*types.MsgSetPriceResponse, error) { + sdkCtx := sdk.UnwrapSDKContext(goCtx) + k.SetBandPriceState(goCtx, msg.Denom, &types.BandPriceState{ + Symbol: msg.Denom, + Rate: math.NewInt(10000).ToLegacyDec().Mul(msg.Price).TruncateInt(), + ResolveTime: (sdkCtx.BlockTime().Unix()), + PriceState: *types.NewPriceState(msg.Price, sdkCtx.BlockTime().Unix()), + }) + return &types.MsgSetPriceResponse{}, nil +} diff --git a/x/oracle/module/genesis.go b/x/oracle/module/genesis.go index 7e9915be..8c796267 100644 --- a/x/oracle/module/genesis.go +++ b/x/oracle/module/genesis.go @@ -23,6 +23,7 @@ func InitGenesis(ctx context.Context, k keeper.Keeper, genState types.GenesisSta sdkCtx.Logger().Info("can not set band price state for symbol %s", bandPriceState.Symbol) } } + k.SetInitPrice(ctx) for _, bandOracleRequest := range genState.BandOracleRequests { err := k.SetBandOracleRequest(ctx, *bandOracleRequest) diff --git a/x/oracle/types/msgs.go b/x/oracle/types/msgs.go index d13237dd..c8c61b97 100644 --- a/x/oracle/types/msgs.go +++ b/x/oracle/types/msgs.go @@ -2,6 +2,7 @@ package types import ( errorsmod "cosmossdk.io/errors" + math "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -90,3 +91,11 @@ func (msg MsgRequestBandRates) GetSignBytes() []byte { bz := ModuleCdc.MustMarshalJSON(&msg) return sdk.MustSortJSON(bz) } + +func NewSetPrice(denom, authority string, price math.LegacyDec) MsgSetPrice { + return MsgSetPrice{ + Denom: denom, + Price: price, + Authority: authority, + } +} diff --git a/x/oracle/types/tx.pb.go b/x/oracle/types/tx.pb.go index c51977ab..bd84dfae 100644 --- a/x/oracle/types/tx.pb.go +++ b/x/oracle/types/tx.pb.go @@ -5,6 +5,7 @@ package types import ( context "context" + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" _ "github.com/cosmos/cosmos-proto" _ "github.com/cosmos/cosmos-sdk/types/msgservice" @@ -516,6 +517,95 @@ func (m *MsgUpdateBandOracleRequestParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateBandOracleRequestParamsResponse proto.InternalMessageInfo +type MsgSetPrice struct { + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + Price cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=price,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"price"` + Authority string `protobuf:"bytes,3,opt,name=authority,proto3" json:"authority,omitempty"` +} + +func (m *MsgSetPrice) Reset() { *m = MsgSetPrice{} } +func (m *MsgSetPrice) String() string { return proto.CompactTextString(m) } +func (*MsgSetPrice) ProtoMessage() {} +func (*MsgSetPrice) Descriptor() ([]byte, []int) { + return fileDescriptor_2ca24ac8eaee815d, []int{12} +} +func (m *MsgSetPrice) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetPrice) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetPrice.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgSetPrice) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetPrice.Merge(m, src) +} +func (m *MsgSetPrice) XXX_Size() int { + return m.Size() +} +func (m *MsgSetPrice) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetPrice.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetPrice proto.InternalMessageInfo + +func (m *MsgSetPrice) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +func (m *MsgSetPrice) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +type MsgSetPriceResponse struct { +} + +func (m *MsgSetPriceResponse) Reset() { *m = MsgSetPriceResponse{} } +func (m *MsgSetPriceResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSetPriceResponse) ProtoMessage() {} +func (*MsgSetPriceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_2ca24ac8eaee815d, []int{13} +} +func (m *MsgSetPriceResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetPriceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetPriceResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgSetPriceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetPriceResponse.Merge(m, src) +} +func (m *MsgSetPriceResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSetPriceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetPriceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetPriceResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgUpdateParams)(nil), "reserve.oracle.MsgUpdateParams") proto.RegisterType((*MsgUpdateParamsResponse)(nil), "reserve.oracle.MsgUpdateParamsResponse") @@ -529,58 +619,68 @@ func init() { proto.RegisterType((*MsgDeleteBandOracleRequestsResponse)(nil), "reserve.oracle.MsgDeleteBandOracleRequestsResponse") proto.RegisterType((*MsgUpdateBandOracleRequestParamsRequest)(nil), "reserve.oracle.MsgUpdateBandOracleRequestParamsRequest") proto.RegisterType((*MsgUpdateBandOracleRequestParamsResponse)(nil), "reserve.oracle.MsgUpdateBandOracleRequestParamsResponse") + proto.RegisterType((*MsgSetPrice)(nil), "reserve.oracle.MsgSetPrice") + proto.RegisterType((*MsgSetPriceResponse)(nil), "reserve.oracle.MsgSetPriceResponse") } func init() { proto.RegisterFile("reserve/oracle/tx.proto", fileDescriptor_2ca24ac8eaee815d) } var fileDescriptor_2ca24ac8eaee815d = []byte{ - // 733 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xbd, 0x6f, 0xd3, 0x4e, - 0x18, 0xce, 0xf5, 0x4b, 0xca, 0xdb, 0x9f, 0x7e, 0x14, 0xb7, 0x34, 0xa9, 0x4b, 0x9c, 0x36, 0x2d, - 0x6a, 0x08, 0x10, 0xab, 0xa9, 0x04, 0x34, 0x0b, 0x6a, 0xc4, 0xd2, 0xa1, 0x02, 0x19, 0x55, 0x42, - 0x2c, 0x91, 0x13, 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x43, 0xa5, 0x65, 0x18, 0x61, 0x9d, - 0xf3, 0x03, 0x33, 0xa8, 0x3c, 0x5a, 0x9b, 0xac, 0x8a, 0x22, 0x54, 0x59, 0xfd, 0x46, 0xf6, 0xf0, - 0x67, 0x31, 0xf3, 0xe9, 0xf4, 0xa0, 0x82, 0x34, 0x9e, 0x50, 0xbf, 0xfb, 0xe6, 0xf4, 0xa0, 0x12, - 0x96, 0x7a, 0x77, 0x7a, 0x50, 0x99, 0xe4, 0x78, 0x23, 0xe8, 0x4a, 0x53, 0x90, 0x8b, 0x98, 0x34, - 0x4c, 0xbb, 0xc4, 0xa6, 0xb8, 0xb4, 0x87, 0x60, 0x7c, 0x8d, 0x9a, 0x1a, 0xde, 0xea, 0x61, 0xea, - 0x36, 0x74, 0xdb, 0xd0, 0x74, 0x17, 0x53, 0x69, 0x12, 0x46, 0x28, 0xb6, 0x0d, 0xec, 0x30, 0x36, - 0x1a, 0x7f, 0x93, 0x0a, 0x00, 0x0e, 0x8b, 0x6d, 0x76, 0x0c, 0x1f, 0xf4, 0x90, 0x96, 0xe5, 0x96, - 0x55, 0xa3, 0x5e, 0x7b, 0xbb, 0x5f, 0xcc, 0xfc, 0xde, 0x2f, 0x66, 0x3c, 0x70, 0x3c, 0xc7, 0x43, - 0x26, 0x87, 0xc8, 0xa2, 0xad, 0x4a, 0x05, 0x98, 0x8e, 0x31, 0x07, 0x08, 0xbf, 0x31, 0x84, 0x0c, - 0xbd, 0xe7, 0xbe, 0xa6, 0xe4, 0x2b, 0x30, 0xda, 0xd2, 0x6d, 0xa3, 0x29, 0xe8, 0x2e, 0x47, 0x75, - 0x0f, 0x1b, 0x35, 0x86, 0x3c, 0xed, 0x35, 0x68, 0x05, 0x16, 0x91, 0xa5, 0xf8, 0x09, 0x72, 0x9c, - 0x68, 0x14, 0x2e, 0x67, 0x19, 0x35, 0x07, 0x2c, 0xff, 0x20, 0x98, 0x15, 0xfc, 0xcf, 0xfc, 0x3a, - 0x5c, 0x15, 0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b1, 0x5d, 0x92, 0xf6, 0x8d, 0xb4, 0x87, 0x20, 0x97, - 0xa0, 0xab, 0xb4, 0x98, 0x5a, 0x28, 0x6e, 0x31, 0xc9, 0xb5, 0xcb, 0xa4, 0x70, 0x08, 0xaf, 0x21, - 0x9f, 0x78, 0xb0, 0xe3, 0xb8, 0x24, 0x05, 0xcb, 0x4b, 0x97, 0x08, 0x0e, 0xba, 0x7f, 0x40, 0x50, - 0x48, 0x1d, 0x2c, 0xe9, 0xd1, 0xc5, 0x39, 0x09, 0x27, 0x54, 0x7e, 0x7c, 0xf9, 0x44, 0x06, 0x4a, - 0x1e, 0xde, 0xf3, 0x7e, 0xe2, 0x1b, 0xab, 0x87, 0xc7, 0x0a, 0x3a, 0x3a, 0x56, 0xd0, 0xaf, 0x63, - 0x05, 0xbd, 0x3f, 0x51, 0x32, 0x47, 0x27, 0x4a, 0xe6, 0xc7, 0x89, 0x92, 0x79, 0xa5, 0x9a, 0x1d, - 0x77, 0xa3, 0xd7, 0xaa, 0xb6, 0x89, 0xa5, 0x12, 0x9b, 0x58, 0xbb, 0xfe, 0x95, 0xa4, 0x4d, 0x36, - 0xd5, 0xfe, 0x95, 0x65, 0x27, 0xb8, 0x57, 0xed, 0x76, 0x31, 0x6d, 0x8d, 0xf8, 0x01, 0x4b, 0x7f, - 0x03, 0x00, 0x00, 0xff, 0xff, 0x1c, 0x57, 0xc4, 0x01, 0x76, 0x09, 0x00, 0x00, + // 854 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xbb, 0x4f, 0xdb, 0x5a, + 0x18, 0x8f, 0x79, 0x44, 0x37, 0x07, 0x74, 0x2f, 0xd7, 0x3c, 0x12, 0x1c, 0x92, 0x40, 0xc2, 0x15, + 0xb9, 0xb9, 0x97, 0x58, 0x04, 0xa9, 0x2d, 0x59, 0x2a, 0x22, 0xa4, 0x0a, 0x89, 0xa8, 0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, 0x14, 0x37, 0xb8, 0x6f, 0x7d, 0x05, + 0xd5, 0x56, 0x8f, 0xcf, 0xb3, 0xcc, 0xc9, 0x79, 0x96, 0xf9, 0x71, 0x9e, 0x65, 0xde, 0x5e, 0x64, + 0x63, 0x27, 0x17, 0xd9, 0xd8, 0xb7, 0x8b, 0x6c, 0xec, 0x39, 0xaf, 0xa8, 0xe6, 0x56, 0xbb, 0x59, + 0x96, 0x90, 0xc6, 0x23, 0x1d, 0x69, 0x1d, 0xfb, 0xab, 0x4d, 0x42, 0xdb, 0x7c, 0xd7, 0x05, 0x34, + 0x3b, 0x2d, 0x88, 0x9b, 0x71, 0x3b, 0x60, 0xf1, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0d, 0x58, + 0xd0, 0x2b, 0x99, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -600,6 +700,7 @@ type MsgClient interface { UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) RequestBandRates(ctx context.Context, in *MsgRequestBandRates, opts ...grpc.CallOption) (*MsgRequestBandRatesResponse, error) UpdateBandParams(ctx context.Context, in *MsgUpdateBandParams, opts ...grpc.CallOption) (*MsgUpdateBandParamsResponse, error) + SetPrice(ctx context.Context, in *MsgSetPrice, opts ...grpc.CallOption) (*MsgSetPriceResponse, error) UpdateBandOracleRequest(ctx context.Context, in *MsgUpdateBandOracleRequestRequest, opts ...grpc.CallOption) (*MsgUpdateBandOracleRequestResponse, error) DeleteBandOracleRequests(ctx context.Context, in *MsgDeleteBandOracleRequests, opts ...grpc.CallOption) (*MsgDeleteBandOracleRequestsResponse, error) UpdateBandOracleRequestParams(ctx context.Context, in *MsgUpdateBandOracleRequestParamsRequest, opts ...grpc.CallOption) (*MsgUpdateBandOracleRequestParamsResponse, error) @@ -640,6 +741,15 @@ func (c *msgClient) UpdateBandParams(ctx context.Context, in *MsgUpdateBandParam return out, nil } +func (c *msgClient) SetPrice(ctx context.Context, in *MsgSetPrice, opts ...grpc.CallOption) (*MsgSetPriceResponse, error) { + out := new(MsgSetPriceResponse) + err := c.cc.Invoke(ctx, "/reserve.oracle.Msg/SetPrice", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *msgClient) UpdateBandOracleRequest(ctx context.Context, in *MsgUpdateBandOracleRequestRequest, opts ...grpc.CallOption) (*MsgUpdateBandOracleRequestResponse, error) { out := new(MsgUpdateBandOracleRequestResponse) err := c.cc.Invoke(ctx, "/reserve.oracle.Msg/UpdateBandOracleRequest", in, out, opts...) @@ -674,6 +784,7 @@ type MsgServer interface { UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) RequestBandRates(context.Context, *MsgRequestBandRates) (*MsgRequestBandRatesResponse, error) UpdateBandParams(context.Context, *MsgUpdateBandParams) (*MsgUpdateBandParamsResponse, error) + SetPrice(context.Context, *MsgSetPrice) (*MsgSetPriceResponse, error) UpdateBandOracleRequest(context.Context, *MsgUpdateBandOracleRequestRequest) (*MsgUpdateBandOracleRequestResponse, error) DeleteBandOracleRequests(context.Context, *MsgDeleteBandOracleRequests) (*MsgDeleteBandOracleRequestsResponse, error) UpdateBandOracleRequestParams(context.Context, *MsgUpdateBandOracleRequestParamsRequest) (*MsgUpdateBandOracleRequestParamsResponse, error) @@ -692,6 +803,9 @@ func (*UnimplementedMsgServer) RequestBandRates(ctx context.Context, req *MsgReq func (*UnimplementedMsgServer) UpdateBandParams(ctx context.Context, req *MsgUpdateBandParams) (*MsgUpdateBandParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateBandParams not implemented") } +func (*UnimplementedMsgServer) SetPrice(ctx context.Context, req *MsgSetPrice) (*MsgSetPriceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetPrice not implemented") +} func (*UnimplementedMsgServer) UpdateBandOracleRequest(ctx context.Context, req *MsgUpdateBandOracleRequestRequest) (*MsgUpdateBandOracleRequestResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateBandOracleRequest not implemented") } @@ -760,6 +874,24 @@ func _Msg_UpdateBandParams_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } +func _Msg_SetPrice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSetPrice) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SetPrice(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/reserve.oracle.Msg/SetPrice", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SetPrice(ctx, req.(*MsgSetPrice)) + } + return interceptor(ctx, in, info, handler) +} + func _Msg_UpdateBandOracleRequest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgUpdateBandOracleRequestRequest) if err := dec(in); err != nil { @@ -830,6 +962,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "UpdateBandParams", Handler: _Msg_UpdateBandParams_Handler, }, + { + MethodName: "SetPrice", + Handler: _Msg_SetPrice_Handler, + }, { MethodName: "UpdateBandOracleRequest", Handler: _Msg_UpdateBandOracleRequest_Handler, @@ -1232,6 +1368,76 @@ func (m *MsgUpdateBandOracleRequestParamsResponse) MarshalToSizedBuffer(dAtA []b return len(dAtA) - i, nil } +func (m *MsgSetPrice) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgSetPrice) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetPrice) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0x1a + } + { + size := m.Price.Size() + i -= size + if _, err := m.Price.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintTx(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSetPriceResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgSetPriceResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetPriceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -1397,6 +1603,34 @@ func (m *MsgUpdateBandOracleRequestParamsResponse) Size() (n int) { return n } +func (m *MsgSetPrice) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Price.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgSetPriceResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2428,6 +2662,203 @@ func (m *MsgUpdateBandOracleRequestParamsResponse) Unmarshal(dAtA []byte) error } return nil } +func (m *MsgSetPrice) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSetPrice: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetPrice: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Price", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Price.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSetPriceResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSetPriceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetPriceResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/psm/keeper/swap.go b/x/psm/keeper/swap.go index 51c5c10a..1fbb1fb9 100644 --- a/x/psm/keeper/swap.go +++ b/x/psm/keeper/swap.go @@ -5,6 +5,7 @@ import ( "fmt" "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/onomyprotocol/reserve/x/psm/types"