2022-01-08 00:39:27 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
package kava.hard.v1beta1;
|
|
|
|
|
|
|
|
import "cosmos/base/v1beta1/coin.proto";
|
|
|
|
import "cosmos_proto/cosmos.proto";
|
2022-11-22 23:22:07 +00:00
|
|
|
import "gogoproto/gogo.proto";
|
2022-01-08 00:39:27 +00:00
|
|
|
|
2024-05-01 03:17:24 +00:00
|
|
|
option go_package = "github.com/0glabs/0g-chain/x/hard/types";
|
2022-01-08 00:39:27 +00:00
|
|
|
option (gogoproto.goproto_getters_all) = false;
|
|
|
|
|
|
|
|
// Params defines the parameters for the hard module.
|
|
|
|
message Params {
|
2022-11-22 23:22:07 +00:00
|
|
|
repeated MoneyMarket money_markets = 1 [
|
|
|
|
(gogoproto.castrepeated) = "MoneyMarkets",
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
|
|
|
string minimum_borrow_usd_value = 2 [
|
2022-01-08 00:39:27 +00:00
|
|
|
(gogoproto.customname) = "MinimumBorrowUSDValue",
|
2022-11-22 23:22:07 +00:00
|
|
|
(cosmos_proto.scalar) = "cosmos.Dec",
|
2022-01-08 00:39:27 +00:00
|
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
|
2022-11-22 23:22:07 +00:00
|
|
|
(gogoproto.nullable) = false
|
2022-01-08 00:39:27 +00:00
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
// MoneyMarket is a money market for an individual asset.
|
|
|
|
message MoneyMarket {
|
2022-11-22 23:22:07 +00:00
|
|
|
string denom = 1;
|
|
|
|
BorrowLimit borrow_limit = 2 [(gogoproto.nullable) = false];
|
|
|
|
string spot_market_id = 3 [(gogoproto.customname) = "SpotMarketID"];
|
|
|
|
string conversion_factor = 4 [
|
|
|
|
(cosmos_proto.scalar) = "cosmos.Int",
|
2022-01-08 00:39:27 +00:00
|
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
|
2022-11-22 23:22:07 +00:00
|
|
|
(gogoproto.nullable) = false
|
2022-01-08 00:39:27 +00:00
|
|
|
];
|
|
|
|
InterestRateModel interest_rate_model = 5 [(gogoproto.nullable) = false];
|
2022-11-22 23:22:07 +00:00
|
|
|
string reserve_factor = 6 [
|
|
|
|
(cosmos_proto.scalar) = "cosmos.Dec",
|
2022-01-08 00:39:27 +00:00
|
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
|
2022-11-22 23:22:07 +00:00
|
|
|
(gogoproto.nullable) = false
|
2022-01-08 00:39:27 +00:00
|
|
|
];
|
|
|
|
string keeper_reward_percentage = 7 [
|
2022-11-22 23:22:07 +00:00
|
|
|
(cosmos_proto.scalar) = "cosmos.Dec",
|
2022-01-08 00:39:27 +00:00
|
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
|
2022-11-22 23:22:07 +00:00
|
|
|
(gogoproto.nullable) = false
|
2022-01-08 00:39:27 +00:00
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
// BorrowLimit enforces restrictions on a money market.
|
|
|
|
message BorrowLimit {
|
2022-11-22 23:22:07 +00:00
|
|
|
bool has_max_limit = 1 [(gogoproto.jsontag) = "has_max_limit"];
|
2022-01-08 00:39:27 +00:00
|
|
|
string maximum_limit = 2 [
|
2022-11-22 23:22:07 +00:00
|
|
|
(cosmos_proto.scalar) = "cosmos.Dec",
|
2022-01-08 00:39:27 +00:00
|
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
|
2022-11-22 23:22:07 +00:00
|
|
|
(gogoproto.nullable) = false
|
2022-01-08 00:39:27 +00:00
|
|
|
];
|
|
|
|
string loan_to_value = 3 [
|
2022-11-22 23:22:07 +00:00
|
|
|
(cosmos_proto.scalar) = "cosmos.Dec",
|
2022-01-08 00:39:27 +00:00
|
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
|
2022-11-22 23:22:07 +00:00
|
|
|
(gogoproto.nullable) = false
|
2022-01-08 00:39:27 +00:00
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
// InterestRateModel contains information about an asset's interest rate.
|
|
|
|
message InterestRateModel {
|
|
|
|
string base_rate_apy = 1 [
|
|
|
|
(gogoproto.customname) = "BaseRateAPY",
|
2022-11-22 23:22:07 +00:00
|
|
|
(cosmos_proto.scalar) = "cosmos.Dec",
|
2022-01-08 00:39:27 +00:00
|
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
|
2022-11-22 23:22:07 +00:00
|
|
|
(gogoproto.nullable) = false
|
2022-01-08 00:39:27 +00:00
|
|
|
];
|
|
|
|
string base_multiplier = 2 [
|
2022-11-22 23:22:07 +00:00
|
|
|
(cosmos_proto.scalar) = "cosmos.Dec",
|
2022-01-08 00:39:27 +00:00
|
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
|
2022-11-22 23:22:07 +00:00
|
|
|
(gogoproto.nullable) = false
|
2022-01-08 00:39:27 +00:00
|
|
|
];
|
|
|
|
string kink = 3 [
|
2022-11-22 23:22:07 +00:00
|
|
|
(cosmos_proto.scalar) = "cosmos.Dec",
|
2022-01-08 00:39:27 +00:00
|
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
|
2022-11-22 23:22:07 +00:00
|
|
|
(gogoproto.nullable) = false
|
2022-01-08 00:39:27 +00:00
|
|
|
];
|
|
|
|
string jump_multiplier = 4 [
|
2022-11-22 23:22:07 +00:00
|
|
|
(cosmos_proto.scalar) = "cosmos.Dec",
|
2022-01-08 00:39:27 +00:00
|
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
|
2022-11-22 23:22:07 +00:00
|
|
|
(gogoproto.nullable) = false
|
2022-01-08 00:39:27 +00:00
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
// Deposit defines an amount of coins deposited into a hard module account.
|
|
|
|
message Deposit {
|
|
|
|
string depositor = 1 [
|
|
|
|
(cosmos_proto.scalar) = "cosmos.AddressBytes",
|
2022-11-22 23:22:07 +00:00
|
|
|
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"
|
|
|
|
];
|
|
|
|
repeated cosmos.base.v1beta1.Coin amount = 2 [
|
|
|
|
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
|
|
|
repeated SupplyInterestFactor index = 3 [
|
|
|
|
(gogoproto.castrepeated) = "SupplyInterestFactors",
|
|
|
|
(gogoproto.nullable) = false
|
2022-01-08 00:39:27 +00:00
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
// Borrow defines an amount of coins borrowed from a hard module account.
|
|
|
|
message Borrow {
|
|
|
|
string borrower = 1 [
|
|
|
|
(cosmos_proto.scalar) = "cosmos.AddressBytes",
|
2022-11-22 23:22:07 +00:00
|
|
|
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"
|
|
|
|
];
|
|
|
|
repeated cosmos.base.v1beta1.Coin amount = 2 [
|
|
|
|
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
|
|
|
repeated BorrowInterestFactor index = 3 [
|
|
|
|
(gogoproto.castrepeated) = "BorrowInterestFactors",
|
|
|
|
(gogoproto.nullable) = false
|
2022-01-08 00:39:27 +00:00
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
// SupplyInterestFactor defines an individual borrow interest factor.
|
|
|
|
message SupplyInterestFactor {
|
|
|
|
string denom = 1;
|
|
|
|
string value = 2 [
|
2022-11-22 23:22:07 +00:00
|
|
|
(cosmos_proto.scalar) = "cosmos.Dec",
|
2022-01-08 00:39:27 +00:00
|
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
|
2022-11-22 23:22:07 +00:00
|
|
|
(gogoproto.nullable) = false
|
2022-01-08 00:39:27 +00:00
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
// BorrowInterestFactor defines an individual borrow interest factor.
|
|
|
|
message BorrowInterestFactor {
|
|
|
|
string denom = 1;
|
|
|
|
string value = 2 [
|
2022-11-22 23:22:07 +00:00
|
|
|
(cosmos_proto.scalar) = "cosmos.Dec",
|
2022-01-08 00:39:27 +00:00
|
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
|
2022-11-22 23:22:07 +00:00
|
|
|
(gogoproto.nullable) = false
|
2022-01-08 00:39:27 +00:00
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
// CoinsProto defines a Protobuf wrapper around a Coins slice
|
|
|
|
message CoinsProto {
|
2022-11-22 23:22:07 +00:00
|
|
|
repeated cosmos.base.v1beta1.Coin coins = 1 [
|
|
|
|
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
2022-01-08 00:39:27 +00:00
|
|
|
}
|