From 2dc23b9f94a8d1c2d7829ccd12891648cc2e20f7 Mon Sep 17 00:00:00 2001 From: Hieu Vu Date: Mon, 11 Nov 2024 12:01:49 +0700 Subject: [PATCH 1/5] update proto --- proto/reserve/vaults/params.proto | 16 +- x/vaults/types/params.pb.go | 280 ++++++++++++++++++++---------- 2 files changed, 201 insertions(+), 95 deletions(-) diff --git a/proto/reserve/vaults/params.proto b/proto/reserve/vaults/params.proto index aae3ec3..86f0caa 100644 --- a/proto/reserve/vaults/params.proto +++ b/proto/reserve/vaults/params.proto @@ -34,43 +34,44 @@ message Params { // VaultParams defines the parameters for each collateral vault type. message VaultMamagerParams { string mint_denom = 1; + string mint_symbol = 2; - string min_collateral_ratio = 2 [ + string min_collateral_ratio = 3 [ (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (amino.dont_omitempty) = true, (gogoproto.nullable) = false ]; - string liquidation_ratio = 3 [ + string liquidation_ratio = 4 [ (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (amino.dont_omitempty) = true, (gogoproto.nullable) = false ]; - string max_debt = 4 [ + string max_debt = 5 [ (cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "cosmossdk.io/math.Int", (amino.dont_omitempty) = true, (gogoproto.nullable) = false ]; - string stability_fee = 5 [ + string stability_fee = 6 [ (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (amino.dont_omitempty) = true, (gogoproto.nullable) = false ]; - string liquidation_penalty = 6 [ + string liquidation_penalty = 7 [ (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (amino.dont_omitempty) = true, (gogoproto.nullable) = false ]; - string minting_fee = 7 [ + string minting_fee = 8 [ (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (amino.dont_omitempty) = true, @@ -84,8 +85,9 @@ message VaultMamager { [ (amino.dont_omitempty) = true, (gogoproto.nullable) = false ]; string denom = 2; + string symbol = 3; - string mint_available = 3 [ + string mint_available = 4 [ (cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "cosmossdk.io/math.Int", (amino.dont_omitempty) = true, diff --git a/x/vaults/types/params.pb.go b/x/vaults/types/params.pb.go index 2600ff0..832cdea 100644 --- a/x/vaults/types/params.pb.go +++ b/x/vaults/types/params.pb.go @@ -133,12 +133,13 @@ func (m *Params) GetChargingPeriod() time.Duration { // VaultParams defines the parameters for each collateral vault type. type VaultMamagerParams struct { MintDenom string `protobuf:"bytes,1,opt,name=mint_denom,json=mintDenom,proto3" json:"mint_denom,omitempty"` - MinCollateralRatio cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=min_collateral_ratio,json=minCollateralRatio,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"min_collateral_ratio"` - LiquidationRatio cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=liquidation_ratio,json=liquidationRatio,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"liquidation_ratio"` - MaxDebt cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=max_debt,json=maxDebt,proto3,customtype=cosmossdk.io/math.Int" json:"max_debt"` - StabilityFee cosmossdk_io_math.LegacyDec `protobuf:"bytes,5,opt,name=stability_fee,json=stabilityFee,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"stability_fee"` - LiquidationPenalty cosmossdk_io_math.LegacyDec `protobuf:"bytes,6,opt,name=liquidation_penalty,json=liquidationPenalty,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"liquidation_penalty"` - MintingFee cosmossdk_io_math.LegacyDec `protobuf:"bytes,7,opt,name=minting_fee,json=mintingFee,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"minting_fee"` + MintSymbol string `protobuf:"bytes,2,opt,name=mint_symbol,json=mintSymbol,proto3" json:"mint_symbol,omitempty"` + MinCollateralRatio cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=min_collateral_ratio,json=minCollateralRatio,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"min_collateral_ratio"` + LiquidationRatio cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=liquidation_ratio,json=liquidationRatio,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"liquidation_ratio"` + MaxDebt cosmossdk_io_math.Int `protobuf:"bytes,5,opt,name=max_debt,json=maxDebt,proto3,customtype=cosmossdk.io/math.Int" json:"max_debt"` + StabilityFee cosmossdk_io_math.LegacyDec `protobuf:"bytes,6,opt,name=stability_fee,json=stabilityFee,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"stability_fee"` + LiquidationPenalty cosmossdk_io_math.LegacyDec `protobuf:"bytes,7,opt,name=liquidation_penalty,json=liquidationPenalty,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"liquidation_penalty"` + MintingFee cosmossdk_io_math.LegacyDec `protobuf:"bytes,8,opt,name=minting_fee,json=mintingFee,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"minting_fee"` } func (m *VaultMamagerParams) Reset() { *m = VaultMamagerParams{} } @@ -181,11 +182,19 @@ func (m *VaultMamagerParams) GetMintDenom() string { return "" } +func (m *VaultMamagerParams) GetMintSymbol() string { + if m != nil { + return m.MintSymbol + } + return "" +} + // VaultMamager defines the manager of each collateral vault type. type VaultMamager struct { Params VaultMamagerParams `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` - MintAvailable cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=mint_available,json=mintAvailable,proto3,customtype=cosmossdk.io/math.Int" json:"mint_available"` + Symbol string `protobuf:"bytes,3,opt,name=symbol,proto3" json:"symbol,omitempty"` + MintAvailable cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=mint_available,json=mintAvailable,proto3,customtype=cosmossdk.io/math.Int" json:"mint_available"` } func (m *VaultMamager) Reset() { *m = VaultMamager{} } @@ -235,6 +244,13 @@ func (m *VaultMamager) GetDenom() string { return "" } +func (m *VaultMamager) GetSymbol() string { + if m != nil { + return m.Symbol + } + return "" +} + type Vault struct { Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"` @@ -499,75 +515,77 @@ func init() { func init() { proto.RegisterFile("reserve/vaults/params.proto", fileDescriptor_1f12ab0d072f9f7c) } var fileDescriptor_1f12ab0d072f9f7c = []byte{ - // 1088 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xbb, 0x6f, 0xdb, 0x46, - 0x18, 0x17, 0x25, 0x59, 0x89, 0x3f, 0x25, 0x8a, 0x7c, 0x75, 0x5c, 0x45, 0x46, 0x65, 0x41, 0x43, - 0x61, 0x18, 0x0d, 0xd9, 0x28, 0x40, 0x1b, 0x04, 0xed, 0x60, 0x5b, 0x72, 0x21, 0x44, 0x49, 0x6d, - 0xda, 0x49, 0x80, 0x74, 0x10, 0x4e, 0xe4, 0x85, 0x3e, 0x98, 0xe4, 0xc9, 0xe4, 0x49, 0xb1, 0xfe, - 0x82, 0x16, 0x9e, 0x32, 0x76, 0x31, 0xd0, 0x07, 0x0a, 0x74, 0xcc, 0x90, 0x3f, 0xa1, 0x43, 0xc6, - 0x20, 0x53, 0xd1, 0x21, 0x2d, 0xec, 0x21, 0x9d, 0xba, 0x76, 0x2d, 0xee, 0x41, 0x9b, 0x7e, 0xb4, - 0x48, 0xea, 0x45, 0xd0, 0x7d, 0x8f, 0xdf, 0x7d, 0xdf, 0xef, 0x7b, 0xf0, 0x60, 0x36, 0x22, 0x31, - 0x89, 0x46, 0xc4, 0x1a, 0xe1, 0xa1, 0xcf, 0x63, 0x6b, 0x80, 0x23, 0x1c, 0xc4, 0xe6, 0x20, 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, 0x50, 0xcb, 0xbc, 0x3c, 0xa8, 0x65, - 0x7e, 0x3d, 0xa8, 0x65, 0x1e, 0x59, 0x1e, 0xe5, 0x9b, 0xc3, 0xbe, 0xe9, 0xb0, 0xc0, 0x62, 0x21, - 0x0b, 0xc6, 0x32, 0x6d, 0x87, 0xf9, 0xd6, 0xa9, 0xb7, 0x03, 0x1f, 0x0f, 0x48, 0xdc, 0x2f, 0x48, - 0x83, 0x9b, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0xc5, 0x27, 0x38, 0xb9, 0x1f, 0x0a, 0x00, 0x00, + // 1112 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xcb, 0x6f, 0x1b, 0x45, + 0x18, 0xf7, 0xfa, 0xd5, 0xe6, 0x73, 0xe2, 0x3a, 0x43, 0x1a, 0x5c, 0x47, 0xd8, 0x96, 0x0f, 0x28, + 0x8a, 0xe8, 0x2e, 0x75, 0x25, 0xa8, 0x2a, 0x38, 0xc4, 0xb1, 0x83, 0xac, 0xba, 0x25, 0xd9, 0xa4, + 0xad, 0x54, 0x0e, 0xd6, 0x78, 0x77, 0xba, 0x19, 0x65, 0x77, 0xc7, 0xd9, 0x1d, 0xbb, 0xf1, 0x5f, + 0x00, 0xca, 0x85, 0x1e, 0xb9, 0x44, 0xe2, 0x21, 0x24, 0x8e, 0x3d, 0xf4, 0x8f, 0xe8, 0xb1, 0xea, + 0x09, 0x21, 0x54, 0x50, 0x72, 0x28, 0xff, 0x01, 0x57, 0xb4, 0x33, 0xb3, 0xc9, 0xe6, 0x01, 0x6a, + 0xc9, 0xc5, 0xf2, 0x7c, 0x8f, 0xdf, 0x7c, 0xdf, 0xef, 0x7b, 0xec, 0xc0, 0x42, 0x40, 0x42, 0x12, + 0x8c, 0x89, 0x31, 0xc6, 0x23, 0x97, 0x87, 0xc6, 0x10, 0x07, 0xd8, 0x0b, 0xf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 0x2a, 0xd9, 0x6f, + 0x7e, 0xaa, 0xa6, 0x5a, 0xdd, 0x17, 0x07, 0x55, 0xed, 0xe5, 0x41, 0x55, 0xfb, 0xf3, 0xa0, 0xaa, + 0x3d, 0x3d, 0xac, 0xa6, 0x5e, 0x1e, 0x56, 0x53, 0xbf, 0x1e, 0x56, 0x53, 0x8f, 0x0c, 0x87, 0xf2, + 0xad, 0xd1, 0x40, 0xb7, 0x98, 0x67, 0x30, 0x9f, 0x79, 0x13, 0x91, 0xb6, 0xc5, 0x5c, 0xe3, 0xcc, + 0xa3, 0x83, 0x4f, 0x86, 0x24, 0x1c, 0xe4, 0x85, 0xc1, 0xcd, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, + 0x28, 0x85, 0xd5, 0xc6, 0x58, 0x0a, 0x00, 0x00, } func (this *Params) Equal(that interface{}) bool { @@ -684,7 +702,7 @@ func (m *VaultMamagerParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintParams(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x3a + dAtA[i] = 0x42 { size := m.LiquidationPenalty.Size() i -= size @@ -694,7 +712,7 @@ func (m *VaultMamagerParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintParams(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x32 + dAtA[i] = 0x3a { size := m.StabilityFee.Size() i -= size @@ -704,7 +722,7 @@ func (m *VaultMamagerParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintParams(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x2a + dAtA[i] = 0x32 { size := m.MaxDebt.Size() i -= size @@ -714,7 +732,7 @@ func (m *VaultMamagerParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintParams(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 + dAtA[i] = 0x2a { size := m.LiquidationRatio.Size() i -= size @@ -724,7 +742,7 @@ func (m *VaultMamagerParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintParams(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x22 { size := m.MinCollateralRatio.Size() i -= size @@ -734,7 +752,14 @@ func (m *VaultMamagerParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintParams(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a + if len(m.MintSymbol) > 0 { + i -= len(m.MintSymbol) + copy(dAtA[i:], m.MintSymbol) + i = encodeVarintParams(dAtA, i, uint64(len(m.MintSymbol))) + i-- + dAtA[i] = 0x12 + } if len(m.MintDenom) > 0 { i -= len(m.MintDenom) copy(dAtA[i:], m.MintDenom) @@ -774,7 +799,14 @@ func (m *VaultMamager) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintParams(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x22 + if len(m.Symbol) > 0 { + i -= len(m.Symbol) + copy(dAtA[i:], m.Symbol) + i = encodeVarintParams(dAtA, i, uint64(len(m.Symbol))) + i-- + dAtA[i] = 0x1a + } if len(m.Denom) > 0 { i -= len(m.Denom) copy(dAtA[i:], m.Denom) @@ -1061,6 +1093,10 @@ func (m *VaultMamagerParams) Size() (n int) { if l > 0 { n += 1 + l + sovParams(uint64(l)) } + l = len(m.MintSymbol) + if l > 0 { + n += 1 + l + sovParams(uint64(l)) + } l = m.MinCollateralRatio.Size() n += 1 + l + sovParams(uint64(l)) l = m.LiquidationRatio.Size() @@ -1088,6 +1124,10 @@ func (m *VaultMamager) Size() (n int) { if l > 0 { n += 1 + l + sovParams(uint64(l)) } + l = len(m.Symbol) + if l > 0 { + n += 1 + l + sovParams(uint64(l)) + } l = m.MintAvailable.Size() n += 1 + l + sovParams(uint64(l)) return n @@ -1399,6 +1439,38 @@ func (m *VaultMamagerParams) Unmarshal(dAtA []byte) error { m.MintDenom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MintSymbol", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MintSymbol = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field MinCollateralRatio", wireType) } @@ -1432,7 +1504,7 @@ func (m *VaultMamagerParams) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 3: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field LiquidationRatio", wireType) } @@ -1466,7 +1538,7 @@ func (m *VaultMamagerParams) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 4: + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field MaxDebt", wireType) } @@ -1500,7 +1572,7 @@ func (m *VaultMamagerParams) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 5: + case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field StabilityFee", wireType) } @@ -1534,7 +1606,7 @@ func (m *VaultMamagerParams) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 6: + case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field LiquidationPenalty", wireType) } @@ -1568,7 +1640,7 @@ func (m *VaultMamagerParams) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 7: + case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field MintingFee", wireType) } @@ -1718,6 +1790,38 @@ func (m *VaultMamager) Unmarshal(dAtA []byte) error { m.Denom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Symbol = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field MintAvailable", wireType) } From 8c00f7391b19ff7de0e884f16d9f7b9b79c2cfb4 Mon Sep 17 00:00:00 2001 From: Hieu Vu Date: Mon, 11 Nov 2024 12:02:10 +0700 Subject: [PATCH 2/5] get price using symbol --- x/vaults/keeper/vault.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/x/vaults/keeper/vault.go b/x/vaults/keeper/vault.go index 990791a..a14f6c8 100644 --- a/x/vaults/keeper/vault.go +++ b/x/vaults/keeper/vault.go @@ -27,6 +27,8 @@ func (k *Keeper) CreateNewVault( if err != nil { return fmt.Errorf("%s was not actived", denom) } + collateralSymbol := vm.Symbol + mintSymbol := vm.Params.MintSymbol allowedMintDenoms := k.GetAllowedMintDenoms(ctx) // TODO: Check if mint denom is allowed @@ -43,7 +45,7 @@ func (k *Keeper) CreateNewVault( } // Calculate collateral ratio - price := k.OracleKeeper.GetPrice(ctx, denom, mint.Denom) + price := k.OracleKeeper.GetPrice(ctx, collateralSymbol, mintSymbol) if price == nil || price.IsNil() { return errors.Wrapf(oracletypes.ErrInvalidOracle, "CreateNewVault: can not get price with base %s quote %s", denom, types.DefaultMintDenoms) } @@ -180,7 +182,9 @@ func (k *Keeper) MintCoin( } lockedCoin := vault.CollateralLocked - price := k.OracleKeeper.GetPrice(ctx, lockedCoin.Denom, mint.Denom) + collateralSymbol := vm.Symbol + mintSymbol := vm.Params.MintSymbol + price := k.OracleKeeper.GetPrice(ctx, collateralSymbol, mintSymbol) if price == nil || price.IsNil() { return errors.Wrapf(oracletypes.ErrInvalidOracle, "MintCoin: can not get price with base %s quote %s", lockedCoin.Denom, types.DefaultMintDenoms) } @@ -381,7 +385,9 @@ func (k *Keeper) WithdrawFromVault( } newLock := vault.CollateralLocked.Sub(collateral) - price := k.OracleKeeper.GetPrice(ctx, collateral.Denom, vault.Debt.Denom) + collateralSymbol := vm.Symbol + mintSymbol := vm.Params.MintSymbol + price := k.OracleKeeper.GetPrice(ctx, collateralSymbol, mintSymbol) // defensive programming: should never happen since when withdraw should always have a valid oracle price if price == nil || price.IsNil() { return errors.Wrapf(oracletypes.ErrInvalidOracle, "WithdrawFromVault: can not get price with base %s quote %s", collateral.Denom, types.DefaultMintDenoms) @@ -489,7 +495,9 @@ func (k *Keeper) GetLiquidations( liquidations := make(map[string]*types.Liquidation) err := k.VaultsManager.Walk(ctx, nil, func(key string, vm types.VaultMamager) (bool, error) { - price := k.OracleKeeper.GetPrice(ctx, vm.Denom, mintDenom) + collateralSymbol := vm.Symbol + mintSymbol := vm.Params.MintSymbol + price := k.OracleKeeper.GetPrice(ctx, collateralSymbol, mintSymbol) if price == nil || price.IsNil() { return true, errors.Wrapf(oracletypes.ErrInvalidOracle, "GetLiquidations: can not get price with base %s quote %s", vm.Denom, types.DefaultMintDenoms) } From 836b0cb10e5a495be285c2ea0e91332804c4d0aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CDongLieu=E2=80=9D?= Date: Mon, 11 Nov 2024 12:40:33 +0700 Subject: [PATCH 3/5] add field MsgActiveCollateral, MsgUpdatesCollateral --- proto/reserve/vaults/tx.proto | 4 + script/proposal-vault-1.json | 14 +- script/proposal-vault-2.json | 13 -- script/vaults-gov-test.sh | 7 +- x/vaults/keeper/abci_test.go | 4 +- x/vaults/keeper/keeper.go | 7 +- x/vaults/keeper/msg_server.go | 4 +- x/vaults/keeper/vault.go | 5 +- x/vaults/keeper/vaults_test.go | 16 +- x/vaults/types/msgs.go | 55 +++--- x/vaults/types/tx.pb.go | 310 ++++++++++++++++++++++++++------- 11 files changed, 305 insertions(+), 134 deletions(-) delete mode 100644 script/proposal-vault-2.json diff --git a/proto/reserve/vaults/tx.proto b/proto/reserve/vaults/tx.proto index fa8a759..10c2b99 100644 --- a/proto/reserve/vaults/tx.proto +++ b/proto/reserve/vaults/tx.proto @@ -117,6 +117,8 @@ message MsgActiveCollateral { uint64 oracl_script = 8; string authority = 9 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string sym_bol = 10; + string mint_denom = 11; } // MsgActiveCollateralResponse defines the Msg/ActiveCollateral response type. @@ -175,6 +177,8 @@ message MsgUpdatesCollateral { uint64 oracl_script = 8; string authority = 9 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string sym_bol = 10; + string mint_denom = 11; } // MsgActiveCollateralResponse defines the Msg/ActiveCollateral response type. diff --git a/script/proposal-vault-1.json b/script/proposal-vault-1.json index ce67d45..6135235 100644 --- a/script/proposal-vault-1.json +++ b/script/proposal-vault-1.json @@ -5,7 +5,19 @@ "authority":"onomy10d07y265gmmuvt4z0w9aw880jnsr700jqr8n8k", "min_collateral_ratio": "0.5", "liquidation_ratio":"0.5", - "max_debt":"1000000000000000000000000000" + "max_debt":"1000000000000000000000000000", + "sym_bol": "usdt", + "mint_denom": "nomUSD" + }, + { + "@type": "/reserve.vaults.MsgActiveCollateral", + "denom": "atom", + "authority":"onomy10d07y265gmmuvt4z0w9aw880jnsr700jqr8n8k", + "min_collateral_ratio": "0.5", + "liquidation_ratio":"0.5", + "max_debt":"1000000000000000000000000000", + "sym_bol": "atom", + "mint_denom": "nomUSD" }], "deposit": "100000000stake", "title": "My proposal", diff --git a/script/proposal-vault-2.json b/script/proposal-vault-2.json deleted file mode 100644 index 11a199c..0000000 --- a/script/proposal-vault-2.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "messages": [{ - "@type": "/reserve.vaults.MsgActiveCollateral", - "denom": "atom", - "authority":"onomy10d07y265gmmuvt4z0w9aw880jnsr700jqr8n8k", - "min_collateral_ratio": "0.5", - "liquidation_ratio":"0.5", - "max_debt":"1000000000000000000000000000" - }], - "deposit": "100000000stake", - "title": "My proposal", - "summary": "A short summary of my proposal" - } \ No newline at end of file diff --git a/script/vaults-gov-test.sh b/script/vaults-gov-test.sh index 56ec754..42999d8 100755 --- a/script/vaults-gov-test.sh +++ b/script/vaults-gov-test.sh @@ -122,21 +122,16 @@ reserved q gov proposals # reserved tx gov submit-legacy-proposal active-collateral "title" "description" "atom" "10" "0.1" "10000" 10000000000000000000stake --keyring-backend=test --home=$HOME/.reserved/validator1 --from validator1 -y --chain-id testing-1 --fees 20stake reserved tx gov submit-proposal ./script/proposal-vault-1.json --home=$HOME/.reserved/validator1 --from validator1 --keyring-backend test --fees 20stake --chain-id testing-1 -y -reserved tx gov submit-proposal ./script/proposal-vault-2.json --home=$HOME/.reserved/validator2 --from validator2 --keyring-backend test --fees 20stake --chain-id testing-1 -y # # vote sleep 7 reserved tx gov vote 1 yes --from validator1 --keyring-backend test --home ~/.reserved/validator1 --chain-id testing-1 -y --fees 20stake reserved tx gov vote 1 yes --from validator2 --keyring-backend test --home ~/.reserved/validator2 --chain-id testing-1 -y --fees 20stake reserved tx gov vote 1 yes --from validator3 --keyring-backend test --home ~/.reserved/validator3 --chain-id testing-1 -y --fees 20stake -sleep 7 -reserved tx gov vote 2 yes --from validator1 --keyring-backend test --home ~/.reserved/validator1 --chain-id testing-1 -y --fees 20stake -reserved tx gov vote 2 yes --from validator2 --keyring-backend test --home ~/.reserved/validator2 --chain-id testing-1 -y --fees 20stake -reserved tx gov vote 2 yes --from validator3 --keyring-backend test --home ~/.reserved/validator3 --chain-id testing-1 -y --fees 20stake # wait voting_perio=15s echo "========sleep==========" -sleep 8 +sleep 15 reserved q gov proposals reserved tx oracle set-price usdt 1 --home=$HOME/.reserved/validator1 --from validator1 --keyring-backend test --fees 20stake --chain-id testing-1 -y reserved tx oracle set-price atom 8 --home=$HOME/.reserved/validator2 --from validator2 --keyring-backend test --fees 20stake --chain-id testing-1 -y diff --git a/x/vaults/keeper/abci_test.go b/x/vaults/keeper/abci_test.go index 37b251e..82dfefc 100644 --- a/x/vaults/keeper/abci_test.go +++ b/x/vaults/keeper/abci_test.go @@ -31,7 +31,7 @@ func (s *KeeperTestSuite) TestBeginBlock() { name: "success: one vault", setup: func() { // 100000000000atom debt 210000000nomUSD(get 200000000nomUSD + 10000000nomUSD MintingFee) err := s.k.ActiveCollateralAsset(s.Ctx, - denom, math.LegacyMustNewDecFromStr("1.6"), + denom, denom, "nomUSD", math.LegacyMustNewDecFromStr("1.6"), math.LegacyMustNewDecFromStr("1.5"), maxDebt, stabilityFee, types.DefaultMintingFee, @@ -62,7 +62,7 @@ func (s *KeeperTestSuite) TestBeginBlock() { name: "success: no vault, LastUpdateTime updates", setup: func() { // 100000000000atom debt 210000000nomUSD(get 200000000nomUSD + 10000000nomUSD MintingFee) err := s.k.ActiveCollateralAsset(s.Ctx, - denom, math.LegacyMustNewDecFromStr("1.6"), + denom, denom, "nomUSD", math.LegacyMustNewDecFromStr("1.6"), math.LegacyMustNewDecFromStr("1.5"), maxDebt, stabilityFee, types.DefaultMintingFee, diff --git a/x/vaults/keeper/keeper.go b/x/vaults/keeper/keeper.go index 28ece8f..412a7dd 100644 --- a/x/vaults/keeper/keeper.go +++ b/x/vaults/keeper/keeper.go @@ -76,6 +76,8 @@ func (k Keeper) GetAuthority() string { func (k *Keeper) ActiveCollateralAsset( ctx context.Context, denom string, + symbol string, + mintDenom string, minCollateralRatio math.LegacyDec, liquidationRatio math.LegacyDec, maxDebt math.Int, @@ -90,8 +92,11 @@ func (k *Keeper) ActiveCollateralAsset( return fmt.Errorf("denom %s already be actived", denom) } vm := types.VaultMamager{ - Denom: denom, + Denom: denom, + Symbol: symbol, Params: types.VaultMamagerParams{ + MintDenom: mintDenom, + MintSymbol: symbol, MinCollateralRatio: minCollateralRatio, LiquidationRatio: liquidationRatio, MaxDebt: maxDebt, diff --git a/x/vaults/keeper/msg_server.go b/x/vaults/keeper/msg_server.go index e6f5f3d..99cc260 100644 --- a/x/vaults/keeper/msg_server.go +++ b/x/vaults/keeper/msg_server.go @@ -45,7 +45,7 @@ func (k msgServer) ActiveCollateral(ctx context.Context, msg *types.MsgActiveCol return nil, errorsmod.Wrapf(types.ErrInvalidSigner, "invalid authority; expected %s, got %s", k.authority, msg.Authority) } - err = k.ActiveCollateralAsset(ctx, msg.Denom, msg.MinCollateralRatio, msg.LiquidationRatio, msg.MaxDebt, msg.StabilityFee, msg.MintingFee, msg.LiquidationPenalty, int64(msg.OraclScript)) + err = k.ActiveCollateralAsset(ctx, msg.Denom, msg.SymBol, msg.MintDenom, msg.MinCollateralRatio, msg.LiquidationRatio, msg.MaxDebt, msg.StabilityFee, msg.MintingFee, msg.LiquidationPenalty, int64(msg.OraclScript)) if err != nil { return nil, err } @@ -173,7 +173,7 @@ func (k msgServer) Close(ctx context.Context, msg *types.MsgClose) (*types.MsgCl if err != nil { return nil, fmt.Errorf("vault %d was not found", msg.VaultId) } - + err = k.CloseVault(ctx, msg.Sender, vault) if err != nil { return nil, err diff --git a/x/vaults/keeper/vault.go b/x/vaults/keeper/vault.go index a14f6c8..3ba8966 100644 --- a/x/vaults/keeper/vault.go +++ b/x/vaults/keeper/vault.go @@ -28,7 +28,7 @@ func (k *Keeper) CreateNewVault( return fmt.Errorf("%s was not actived", denom) } collateralSymbol := vm.Symbol - mintSymbol := vm.Params.MintSymbol + mintDenom := vm.Params.MintDenom allowedMintDenoms := k.GetAllowedMintDenoms(ctx) // TODO: Check if mint denom is allowed @@ -45,7 +45,8 @@ func (k *Keeper) CreateNewVault( } // Calculate collateral ratio - price := k.OracleKeeper.GetPrice(ctx, collateralSymbol, mintSymbol) + price := k.OracleKeeper.GetPrice(ctx, collateralSymbol, mintDenom) + fmt.Println(price, collateralSymbol, mintDenom) if price == nil || price.IsNil() { return errors.Wrapf(oracletypes.ErrInvalidOracle, "CreateNewVault: can not get price with base %s quote %s", denom, types.DefaultMintDenoms) } diff --git a/x/vaults/keeper/vaults_test.go b/x/vaults/keeper/vaults_test.go index b7b1074..01a3484 100644 --- a/x/vaults/keeper/vaults_test.go +++ b/x/vaults/keeper/vaults_test.go @@ -33,7 +33,7 @@ func (s *KeeperTestSuite) TestCreateNewVault() { collateral = sdk.NewCoin(denom, math.NewInt(10_000_000)) // 10 atom = 80$ maxDebt = math.NewInt(100_000_000) ) - err := s.k.ActiveCollateralAsset(s.Ctx, denom, math.LegacyMustNewDecFromStr("1.6"), math.LegacyMustNewDecFromStr("1.5"), maxDebt, types.DefaultStabilityFee, types.DefaultMintingFee, types.DefaultLiquidationPenalty, 1) + err := s.k.ActiveCollateralAsset(s.Ctx, denom, denom, "nomUSD", math.LegacyMustNewDecFromStr("1.6"), math.LegacyMustNewDecFromStr("1.5"), maxDebt, types.DefaultStabilityFee, types.DefaultMintingFee, types.DefaultLiquidationPenalty, 1) s.Require().NoError(err) tests := []struct { @@ -166,7 +166,7 @@ func (s *KeeperTestSuite) TestRepayDebt() { maxDebt = math.NewInt(2000000000) mintedCoin = sdk.NewCoin(types.DefaultMintDenoms[0], math.NewInt(300000000)) ) - err := s.k.ActiveCollateralAsset(s.Ctx, denom, math.LegacyMustNewDecFromStr("0.1"), math.LegacyMustNewDecFromStr("0.1"), maxDebt, types.DefaultStabilityFee, types.DefaultMintingFee, types.DefaultLiquidationPenalty, 1) + err := s.k.ActiveCollateralAsset(s.Ctx, denom, denom, "nomUSD", math.LegacyMustNewDecFromStr("0.1"), math.LegacyMustNewDecFromStr("0.1"), maxDebt, types.DefaultStabilityFee, types.DefaultMintingFee, types.DefaultLiquidationPenalty, 1) s.Require().NoError(err) tests := []struct { @@ -284,7 +284,7 @@ func (s *KeeperTestSuite) TestDepositToVault() { maxDebt = math.NewInt(2000000000) mintedCoin = sdk.NewCoin(types.DefaultMintDenoms[0], math.NewInt(200000000)) ) - err := s.k.ActiveCollateralAsset(s.Ctx, denom, math.LegacyMustNewDecFromStr("0.1"), math.LegacyMustNewDecFromStr("0.1"), maxDebt, types.DefaultStabilityFee, types.DefaultMintingFee, types.DefaultLiquidationPenalty, 1) + err := s.k.ActiveCollateralAsset(s.Ctx, denom, denom, "nomUSD", math.LegacyMustNewDecFromStr("0.1"), math.LegacyMustNewDecFromStr("0.1"), maxDebt, types.DefaultStabilityFee, types.DefaultMintingFee, types.DefaultLiquidationPenalty, 1) s.Require().NoError(err) tests := []struct { @@ -407,7 +407,7 @@ func (s *KeeperTestSuite) TestWithdrawFromVault() { setup: func() { s.FundAccount(s.TestAccs[0], types.ModuleName, sdk.NewCoins(fund)) - err := s.k.ActiveCollateralAsset(s.Ctx, denom, math.LegacyMustNewDecFromStr("0.1"), math.LegacyMustNewDecFromStr("0.1"), maxDebt, types.DefaultStabilityFee, types.DefaultMintingFee, types.DefaultLiquidationPenalty, 1) + err := s.k.ActiveCollateralAsset(s.Ctx, denom, denom, "nomUSD", math.LegacyMustNewDecFromStr("0.1"), math.LegacyMustNewDecFromStr("0.1"), maxDebt, types.DefaultStabilityFee, types.DefaultMintingFee, types.DefaultLiquidationPenalty, 1) s.Require().NoError(err) err = s.k.CreateNewVault(s.Ctx, s.TestAccs[0], coinMintToAcc, mintedCoin) @@ -443,7 +443,7 @@ func (s *KeeperTestSuite) TestWithdrawFromVault() { setup: func() { s.FundAccount(s.TestAccs[0], types.ModuleName, sdk.NewCoins(fund)) - err := s.k.ActiveCollateralAsset(s.Ctx, denom, math.LegacyMustNewDecFromStr("0.1"), math.LegacyMustNewDecFromStr("0.1"), maxDebt, types.DefaultStabilityFee, types.DefaultMintingFee, types.DefaultLiquidationPenalty, 1) + err := s.k.ActiveCollateralAsset(s.Ctx, denom, denom, "nomUSD", math.LegacyMustNewDecFromStr("0.1"), math.LegacyMustNewDecFromStr("0.1"), maxDebt, types.DefaultStabilityFee, types.DefaultMintingFee, types.DefaultLiquidationPenalty, 1) s.Require().NoError(err) err = s.k.CreateNewVault(s.Ctx, s.TestAccs[0], coinMintToAcc, mintedCoin) @@ -460,7 +460,7 @@ func (s *KeeperTestSuite) TestWithdrawFromVault() { setup: func() { s.FundAccount(s.TestAccs[0], types.ModuleName, sdk.NewCoins(fund)) - err := s.k.ActiveCollateralAsset(s.Ctx, denom, math.LegacyMustNewDecFromStr("0.1"), math.LegacyMustNewDecFromStr("0.1"), maxDebt, types.DefaultStabilityFee, types.DefaultMintingFee, types.DefaultLiquidationPenalty, 1) + err := s.k.ActiveCollateralAsset(s.Ctx, denom, denom, "nomUSD", math.LegacyMustNewDecFromStr("0.1"), math.LegacyMustNewDecFromStr("0.1"), maxDebt, types.DefaultStabilityFee, types.DefaultMintingFee, types.DefaultLiquidationPenalty, 1) s.Require().NoError(err) err = s.k.CreateNewVault(s.Ctx, s.TestAccs[0], coinMintToAcc, mintedCoin) @@ -477,7 +477,7 @@ func (s *KeeperTestSuite) TestWithdrawFromVault() { setup: func() { s.FundAccount(s.TestAccs[0], types.ModuleName, sdk.NewCoins(fund)) - err := s.k.ActiveCollateralAsset(s.Ctx, denom, math.LegacyMustNewDecFromStr("0.1"), math.LegacyMustNewDecFromStr("0.1"), maxDebt, types.DefaultStabilityFee, types.DefaultMintingFee, types.DefaultLiquidationPenalty, 1) + err := s.k.ActiveCollateralAsset(s.Ctx, denom, denom, "nomUSD", math.LegacyMustNewDecFromStr("0.1"), math.LegacyMustNewDecFromStr("0.1"), maxDebt, types.DefaultStabilityFee, types.DefaultMintingFee, types.DefaultLiquidationPenalty, 1) s.Require().NoError(err) err = s.k.CreateNewVault(s.Ctx, s.TestAccs[0], coinMintToAcc, mintedCoin) @@ -709,7 +709,7 @@ func (s *KeeperTestSuite) TestLiquidate() { for _, t := range tests { s.Run(t.name, func() { s.SetupTest() - err := s.k.ActiveCollateralAsset(s.Ctx, "atom", math.LegacyMustNewDecFromStr("0.1"), math.LegacyMustNewDecFromStr("0.1"), math.NewInt(1000_000_000), types.DefaultStabilityFee, types.DefaultMintingFee, types.DefaultLiquidationPenalty, 1) + err := s.k.ActiveCollateralAsset(s.Ctx, "atom", "atom", "nomUSD", math.LegacyMustNewDecFromStr("0.1"), math.LegacyMustNewDecFromStr("0.1"), math.NewInt(1000_000_000), types.DefaultStabilityFee, types.DefaultMintingFee, types.DefaultLiquidationPenalty, 1) s.Require().NoError(err) for _, vault := range t.liquidation.LiquidatingVaults { diff --git a/x/vaults/types/msgs.go b/x/vaults/types/msgs.go index 0dc5b77..1d84379 100644 --- a/x/vaults/types/msgs.go +++ b/x/vaults/types/msgs.go @@ -3,7 +3,6 @@ package types import ( "fmt" - sdkerrors "cosmossdk.io/errors" "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" @@ -123,6 +122,14 @@ func (msg *MsgActiveCollateral) ValidateBasic() error { return fmt.Errorf("denom is empty") } + if msg.SymBol == "" { + return fmt.Errorf("symbol is empty") + } + + if msg.MintDenom == "" { + return fmt.Errorf("mintDenom is empty") + } + if msg.Authority == "" { return fmt.Errorf("authority is empty") } @@ -162,6 +169,14 @@ func (msg *MsgUpdatesCollateral) ValidateBasic() error { return fmt.Errorf("denom is empty") } + if msg.SymBol == "" { + return fmt.Errorf("symbol is empty") + } + + if msg.MintDenom == "" { + return fmt.Errorf("mintDenom is empty") + } + if msg.Authority == "" { return fmt.Errorf("authority is empty") } @@ -210,6 +225,8 @@ func NewMsgActiveCollateral(a *ActiveCollateralProposal) *MsgActiveCollateral { MintingFee: a.ActiveCollateral.MintingFee, OraclScript: a.ActiveCollateral.OraclScript, Authority: a.ActiveCollateral.Authority, + SymBol: a.ActiveCollateral.SymBol, + MintDenom: a.ActiveCollateral.MintDenom, } } @@ -224,6 +241,8 @@ func NewMsgUpdatesCollateral(u *UpdatesCollateralProposal) *MsgUpdatesCollateral MintingFee: u.UpdatesCollateral.MintingFee, OraclScript: u.UpdatesCollateral.OraclScript, Authority: u.UpdatesCollateral.Authority, + SymBol: u.UpdatesCollateral.SymBol, + MintDenom: u.UpdatesCollateral.MintDenom, } } @@ -245,23 +264,8 @@ func (m *ActiveCollateralProposal) ProposalType() string { func (m *ActiveCollateralProposal) ValidateBasic() error { a := m.ActiveCollateral - if a.Denom == "" { - return sdkerrors.Wrap(ErrInvalidActiveCollateralProposal, "empty denom") - } - - if a.MinCollateralRatio.LT(math.LegacyZeroDec()) { - return sdkerrors.Wrap(ErrInvalidActiveCollateralProposal, "less than zero") - } - - if a.LiquidationRatio.LT(math.LegacyZeroDec()) { - return sdkerrors.Wrap(ErrInvalidActiveCollateralProposal, "less than zero") - } - - if a.MaxDebt.LT(math.ZeroInt()) { - return sdkerrors.Wrap(ErrInvalidActiveCollateralProposal, "less than zero") - } - return nil + return a.ValidateBasic() } func (m *UpdatesCollateralProposal) GetDescription() string { @@ -282,21 +286,6 @@ func (m *UpdatesCollateralProposal) ProposalType() string { func (m *UpdatesCollateralProposal) ValidateBasic() error { a := m.UpdatesCollateral - if a.Denom == "" { - return sdkerrors.Wrap(ErrInvalidUpdatesCollateralProposal, "empty denom") - } - - if a.MinCollateralRatio.LT(math.LegacyZeroDec()) { - return sdkerrors.Wrap(ErrInvalidUpdatesCollateralProposal, "less than zero") - } - - if a.LiquidationRatio.LT(math.LegacyZeroDec()) { - return sdkerrors.Wrap(ErrInvalidUpdatesCollateralProposal, "less than zero") - } - if a.MaxDebt.LT(math.ZeroInt()) { - return sdkerrors.Wrap(ErrInvalidUpdatesCollateralProposal, "less than zero") - } - - return nil + return a.ValidateBasic() } diff --git a/x/vaults/types/tx.pb.go b/x/vaults/types/tx.pb.go index 590eb58..c075494 100644 --- a/x/vaults/types/tx.pb.go +++ b/x/vaults/types/tx.pb.go @@ -139,6 +139,8 @@ type MsgActiveCollateral struct { MintingFee cosmossdk_io_math.LegacyDec `protobuf:"bytes,7,opt,name=minting_fee,json=mintingFee,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"minting_fee"` OraclScript uint64 `protobuf:"varint,8,opt,name=oracl_script,json=oraclScript,proto3" json:"oracl_script,omitempty"` Authority string `protobuf:"bytes,9,opt,name=authority,proto3" json:"authority,omitempty"` + SymBol string `protobuf:"bytes,10,opt,name=sym_bol,json=symBol,proto3" json:"sym_bol,omitempty"` + MintDenom string `protobuf:"bytes,11,opt,name=mint_denom,json=mintDenom,proto3" json:"mint_denom,omitempty"` } func (m *MsgActiveCollateral) Reset() { *m = MsgActiveCollateral{} } @@ -222,6 +224,8 @@ type MsgUpdatesCollateral struct { MintingFee cosmossdk_io_math.LegacyDec `protobuf:"bytes,7,opt,name=minting_fee,json=mintingFee,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"minting_fee"` OraclScript uint64 `protobuf:"varint,8,opt,name=oracl_script,json=oraclScript,proto3" json:"oracl_script,omitempty"` Authority string `protobuf:"bytes,9,opt,name=authority,proto3" json:"authority,omitempty"` + SymBol string `protobuf:"bytes,10,opt,name=sym_bol,json=symBol,proto3" json:"sym_bol,omitempty"` + MintDenom string `protobuf:"bytes,11,opt,name=mint_denom,json=mintDenom,proto3" json:"mint_denom,omitempty"` } func (m *MsgUpdatesCollateral) Reset() { *m = MsgUpdatesCollateral{} } @@ -781,72 +785,74 @@ func init() { func init() { proto.RegisterFile("reserve/vaults/tx.proto", fileDescriptor_bbce2367024dc47b) } var fileDescriptor_bbce2367024dc47b = []byte{ - // 1026 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x57, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xf6, 0xd2, 0x38, 0x3f, 0x5e, 0x4a, 0x49, 0x26, 0x6e, 0xe2, 0x6c, 0xc0, 0x0e, 0x2e, 0x82, - 0x28, 0xd0, 0xdd, 0xa6, 0x95, 0x2a, 0x11, 0x71, 0xa0, 0x89, 0x85, 0x64, 0x51, 0x4b, 0x95, 0xab, - 0x52, 0x04, 0x07, 0x6b, 0xbc, 0x3b, 0xac, 0x47, 0xec, 0xee, 0x98, 0x9d, 0xb1, 0x1b, 0xdf, 0x10, - 0x27, 0xc4, 0x89, 0x3f, 0xa1, 0x47, 0x40, 0x20, 0xe5, 0xd0, 0x0b, 0xff, 0x41, 0x8f, 0x55, 0x4f, - 0xa5, 0x87, 0x0a, 0x25, 0x87, 0x70, 0xe5, 0x3f, 0x40, 0x3b, 0x33, 0x5e, 0xaf, 0x9d, 0x75, 0x1a, - 0x14, 0x0e, 0x11, 0xea, 0x25, 0xc9, 0xec, 0xf7, 0xde, 0xf7, 0xbe, 0x6f, 0xf2, 0xde, 0xce, 0x2c, - 0xac, 0x44, 0x84, 0x93, 0xa8, 0x47, 0xec, 0x1e, 0xee, 0xfa, 0x82, 0xdb, 0x62, 0xcf, 0xea, 0x44, - 0x4c, 0x30, 0x74, 0x49, 0x03, 0x96, 0x02, 0xcc, 0x82, 0xc7, 0x3c, 0x26, 0x21, 0x3b, 0xfe, 0x4b, - 0x45, 0x99, 0x6b, 0x63, 0xe9, 0x1d, 0x1c, 0xe1, 0x80, 0x6b, 0x70, 0x11, 0x07, 0x34, 0x64, 0xb6, - 0xfc, 0xa9, 0x1f, 0xad, 0x3a, 0x8c, 0x07, 0x8c, 0x37, 0x15, 0x91, 0x5a, 0x68, 0x68, 0x45, 0xad, - 0xec, 0x80, 0x7b, 0x76, 0x6f, 0x2b, 0xfe, 0xa5, 0x81, 0x92, 0x06, 0x5a, 0x98, 0x13, 0xbb, 0xb7, - 0xd5, 0x22, 0x02, 0x6f, 0xd9, 0x0e, 0xa3, 0xa1, 0xc2, 0x2b, 0xbf, 0x1b, 0xf0, 0x46, 0x9d, 0x7b, - 0xf7, 0x3a, 0x2e, 0x16, 0xe4, 0x8e, 0x14, 0x80, 0x6e,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0, 0xfc, 0xff, 0x23, 0x16, 0xe5, 0xd5, 0x2f, 0x96, - 0x9a, 0xc8, 0xff, 0xc5, 0x80, 0xd9, 0x3a, 0xf7, 0x1a, 0xa4, 0x83, 0xfb, 0xe7, 0x5e, 0x3f, 0x82, - 0x85, 0x81, 0xd6, 0xc4, 0x80, 0x2f, 0xf5, 0xef, 0xfa, 0x8c, 0x93, 0xff, 0x54, 0xff, 0x49, 0x0a, - 0x64, 0xb5, 0x81, 0x82, 0xeb, 0x7f, 0xe7, 0xe1, 0x42, 0x9d, 0x7b, 0xe8, 0x73, 0xb8, 0x38, 0x72, - 0xab, 0x2e, 0x8f, 0xdf, 0x86, 0xc7, 0xee, 0xae, 0xe6, 0x7b, 0x2f, 0x09, 0x18, 0x54, 0x40, 0x2e, - 0x2c, 0x1c, 0xbb, 0xd8, 0x5e, 0xc9, 0x48, 0x1e, 0x0f, 0x32, 0xdf, 0x3f, 0x45, 0x50, 0x52, 0xc5, - 0x83, 0xc5, 0xe3, 0x77, 0x88, 0x77, 0x26, 0x6a, 0x4c, 0x45, 0x99, 0x1f, 0x9c, 0x26, 0x2a, 0x29, - 0x74, 0x0f, 0xe6, 0xd3, 0xef, 0xeb, 0x52, 0x46, 0x72, 0x0a, 0x37, 0xdf, 0x3d, 0x19, 0x4f, 0x68, - 0x6b, 0x30, 0x33, 0x78, 0x23, 0x9a, 0x19, 0x29, 0x1a, 0x33, 0x2b, 0x93, 0xb1, 0x84, 0xea, 0x36, - 0xcc, 0x26, 0xef, 0xa5, 0xb5, 0x8c, 0xf8, 0x01, 0x68, 0x5e, 0x39, 0x01, 0x4c, 0xd8, 0x3e, 0x86, - 0x29, 0xf9, 0x7a, 0x58, 0xc9, 0x08, 0x8e, 0x01, 0xb3, 0x3c, 0x01, 0x48, 0x18, 0x76, 0x21, 0xaf, - 0x26, 0xb4, 0x98, 0x11, 0x29, 0x11, 0x73, 0x7d, 0x12, 0x92, 0x26, 0x51, 0x63, 0x92, 0x45, 0x22, - 0x91, 0x4c, 0x92, 0x91, 0x66, 0x37, 0xf3, 0xdf, 0xc6, 0x63, 0xba, 0x53, 0x7b, 0x7c, 0x50, 0x32, - 0x9e, 0x1c, 0x94, 0x8c, 0x3f, 0x0f, 0x4a, 0xc6, 0x8f, 0x87, 0xa5, 0xdc, 0x93, 0xc3, 0x52, 0xee, - 0xd9, 0x61, 0x29, 0xf7, 0x85, 0xed, 0x51, 0xd1, 0xee, 0xb6, 0x2c, 0x87, 0x05, 0x36, 0x0b, 0x59, - 0xd0, 0x97, 0x9f, 0x9d, 0x0e, 0xf3, 0xed, 0xe1, 0xe7, 0xdd, 0xe0, 0xeb, 0xb9, 0xdf, 0x21, 0xbc, - 0x35, 0x2d, 0x03, 0x6e, 0xfc, 0x13, 0x00, 0x00, 0xff, 0xff, 0xbe, 0x2c, 0xe8, 0xfa, 0x5c, 0x0f, - 0x00, 0x00, + // 1057 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x57, 0x41, 0x6f, 0x1b, 0x45, + 0x14, 0xf6, 0xd2, 0xd8, 0x8e, 0x9f, 0x43, 0x49, 0x26, 0x6e, 0xe2, 0x6c, 0xa8, 0x1d, 0x5c, 0x04, + 0x51, 0xa0, 0xbb, 0x4d, 0x2b, 0x55, 0x22, 0xe2, 0x40, 0x13, 0x0b, 0x29, 0xa2, 0x96, 0x2a, 0x57, + 0xa5, 0x08, 0x0e, 0xd6, 0x78, 0x77, 0xd8, 0x8c, 0xd8, 0xdd, 0x31, 0x3b, 0x93, 0x34, 0xbe, 0x21, + 0x4e, 0x88, 0x13, 0xf0, 0x0b, 0x7a, 0x04, 0x04, 0x52, 0x0e, 0xbd, 0xf0, 0x0f, 0x7a, 0xac, 0x7a, + 0xaa, 0x38, 0x54, 0x28, 0x39, 0x84, 0x2b, 0xff, 0x00, 0xed, 0xcc, 0x78, 0xbd, 0x76, 0x36, 0x69, + 0x50, 0x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b, 0xbd, 0x38, + 0xa8, 0xe5, 0x3e, 0xb7, 0x3d, 0x2a, 0xb6, 0xb6, 0xbb, 0x96, 0xc3, 0x02, 0x9b, 0x85, 0x2c, 0xe8, + 0xcb, 0xcf, 0x5c, 0x87, 0xf9, 0xf6, 0xf0, 0x73, 0x72, 0xf0, 0xb5, 0xde, 0xef, 0x11, 0xde, 0x2d, + 0xc8, 0x80, 0x5b, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x1c, 0x17, 0x54, 0xb3, 0xcc, 0x0f, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1322,6 +1328,20 @@ func (m *MsgActiveCollateral) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.MintDenom) > 0 { + i -= len(m.MintDenom) + copy(dAtA[i:], m.MintDenom) + i = encodeVarintTx(dAtA, i, uint64(len(m.MintDenom))) + i-- + dAtA[i] = 0x5a + } + if len(m.SymBol) > 0 { + i -= len(m.SymBol) + copy(dAtA[i:], m.SymBol) + i = encodeVarintTx(dAtA, i, uint64(len(m.SymBol))) + i-- + dAtA[i] = 0x52 + } if len(m.Authority) > 0 { i -= len(m.Authority) copy(dAtA[i:], m.Authority) @@ -1447,6 +1467,20 @@ func (m *MsgUpdatesCollateral) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.MintDenom) > 0 { + i -= len(m.MintDenom) + copy(dAtA[i:], m.MintDenom) + i = encodeVarintTx(dAtA, i, uint64(len(m.MintDenom))) + i-- + dAtA[i] = 0x5a + } + if len(m.SymBol) > 0 { + i -= len(m.SymBol) + copy(dAtA[i:], m.SymBol) + i = encodeVarintTx(dAtA, i, uint64(len(m.SymBol))) + i-- + dAtA[i] = 0x52 + } if len(m.Authority) > 0 { i -= len(m.Authority) copy(dAtA[i:], m.Authority) @@ -2019,6 +2053,14 @@ func (m *MsgActiveCollateral) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } + l = len(m.SymBol) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.MintDenom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -2060,6 +2102,14 @@ func (m *MsgUpdatesCollateral) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } + l = len(m.SymBol) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.MintDenom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -2718,6 +2768,70 @@ func (m *MsgActiveCollateral) Unmarshal(dAtA []byte) error { } m.Authority = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SymBol", 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.SymBol = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MintDenom", 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.MintDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -3105,6 +3219,70 @@ func (m *MsgUpdatesCollateral) Unmarshal(dAtA []byte) error { } m.Authority = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SymBol", 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.SymBol = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MintDenom", 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.MintDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) From a68dccc0bc038f9c3b4ac396492617167e7291c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CDongLieu=E2=80=9D?= Date: Mon, 11 Nov 2024 12:44:08 +0700 Subject: [PATCH 4/5] updates proposal.json for vaults --- script/proposal-vault-1.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/script/proposal-vault-1.json b/script/proposal-vault-1.json index 6135235..321517a 100644 --- a/script/proposal-vault-1.json +++ b/script/proposal-vault-1.json @@ -7,7 +7,9 @@ "liquidation_ratio":"0.5", "max_debt":"1000000000000000000000000000", "sym_bol": "usdt", - "mint_denom": "nomUSD" + "oracl_script": "44", + "mint_denom": "nomUSD", + "stability_fee": "0.1" }, { "@type": "/reserve.vaults.MsgActiveCollateral", @@ -17,7 +19,9 @@ "liquidation_ratio":"0.5", "max_debt":"1000000000000000000000000000", "sym_bol": "atom", - "mint_denom": "nomUSD" + "oracl_script": "44", + "mint_denom": "nomUSD", + "stability_fee": "0.1" }], "deposit": "100000000stake", "title": "My proposal", From 66f4899e7dfe326d34e6cc505234325837ce6def Mon Sep 17 00:00:00 2001 From: vuong177 Date: Mon, 11 Nov 2024 13:07:37 +0700 Subject: [PATCH 5/5] remove oracle keeper import in vault keeper --- app/keepers/keepers.go | 1 - x/auction/keeper/keeper.go | 9 +++------ x/auction/module/module.go | 1 - x/auction/types/expected_keepers.go | 6 ------ x/psm/keeper/msg_server.go | 2 +- x/psm/types/psm.go | 1 - 6 files changed, 4 insertions(+), 16 deletions(-) diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index 0f880eb..54e5bb8 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -345,7 +345,6 @@ func NewAppKeeper( appKeepers.AccountKeeper, appKeepers.BankKeeper, &appKeepers.VaultsKeeper, - &appKeepers.OracleKeeper, logger, authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) diff --git a/x/auction/keeper/keeper.go b/x/auction/keeper/keeper.go index c461403..6d1d5cc 100644 --- a/x/auction/keeper/keeper.go +++ b/x/auction/keeper/keeper.go @@ -21,10 +21,9 @@ type ( logger log.Logger // keepers - authKeeper types.AccountKeeper - bankKeeper types.BankKeeper - vaultKeeper types.VaultKeeper - OracleKeeper types.OracleKeeper + authKeeper types.AccountKeeper + bankKeeper types.BankKeeper + vaultKeeper types.VaultKeeper // the address capable of executing a MsgUpdateParams message. Typically, this // should be the x/gov module account. @@ -55,7 +54,6 @@ func NewKeeper( ak types.AccountKeeper, bk types.BankKeeper, vk types.VaultKeeper, - ok types.OracleKeeper, logger log.Logger, authority string, @@ -73,7 +71,6 @@ func NewKeeper( authKeeper: ak, bankKeeper: bk, vaultKeeper: vk, - OracleKeeper: ok, AuctionIdSeq: collections.NewSequence(sb, types.AuctionIdSeqPrefix, "auction_id_sequence"), LastestAuctionPeriods: collections.NewItem(sb, types.LastestAuctionPeriodPrefix, "lastestAuctionPeriods", collections.Int64Value), BidIdSeq: collections.NewMap(sb, types.BidIdSeqPrefix, "bid_id_sequence", collections.Uint64Key, collections.Uint64Value), diff --git a/x/auction/module/module.go b/x/auction/module/module.go index d7019c7..bde3f2c 100644 --- a/x/auction/module/module.go +++ b/x/auction/module/module.go @@ -206,7 +206,6 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { in.AccountKeeper, in.BankKeeper, &in.VaultKeeper, - &in.OracleKeeper, in.Logger, authority.String(), ) diff --git a/x/auction/types/expected_keepers.go b/x/auction/types/expected_keepers.go index bc1509b..ecb87cd 100644 --- a/x/auction/types/expected_keepers.go +++ b/x/auction/types/expected_keepers.go @@ -3,8 +3,6 @@ package types import ( "context" - "cosmossdk.io/math" - addresscodec "cosmossdk.io/core/address" sdk "github.com/cosmos/cosmos-sdk/types" vaulttypes "github.com/onomyprotocol/reserve/x/vaults/types" @@ -48,7 +46,3 @@ type VaultKeeper interface { GetVault(ctx context.Context, vaultId uint64) (vaulttypes.Vault, error) GetAllowedMintDenoms(ctx context.Context) []string } - -type OracleKeeper interface { - GetPrice(ctx context.Context, base, quote string) *math.LegacyDec -} diff --git a/x/psm/keeper/msg_server.go b/x/psm/keeper/msg_server.go index 74b262a..25d34d9 100644 --- a/x/psm/keeper/msg_server.go +++ b/x/psm/keeper/msg_server.go @@ -151,7 +151,7 @@ func (k Keeper) checkLimitTotalStablecoin(ctx context.Context, coin sdk.Coin) er return err } if (totalStablecoinLock.Add(coin.Amount)).GT(totalLimit) { - return fmt.Errorf("unable to perform %s token swap transaction because the amount of %s you want to swap exceeds the allowed limit, can only swap up to %s%s", coin.Denom, coin.Denom, (totalLimit).Sub(totalStablecoinLock).String(), coin.Denom) + return fmt.Errorf("unable to perform %s token swap transaction: exceeds the allowed limit %s , can only swap up to %s%s", coin.Denom, coin.Denom, (totalLimit).Sub(totalStablecoinLock).String(), coin.Denom) } return nil diff --git a/x/psm/types/psm.go b/x/psm/types/psm.go index 7101a22..016969f 100644 --- a/x/psm/types/psm.go +++ b/x/psm/types/psm.go @@ -19,7 +19,6 @@ func GetMsgStablecoin(msg getStablecoinFromMsg) StablecoinInfo { type getStablecoinFromMsg interface { GetDenom() string GetLimitTotal() math.Int - // GetPrice() math.LegacyDec GetFeeIn() math.LegacyDec GetFeeOut() math.LegacyDec GetSymBol() string