2022-01-08 00:39:27 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
package kava.cdp.v1beta1;
|
|
|
|
|
|
|
|
import "cosmos/base/v1beta1/coin.proto";
|
|
|
|
import "cosmos_proto/cosmos.proto";
|
|
|
|
import "gogoproto/gogo.proto";
|
|
|
|
import "google/protobuf/timestamp.proto";
|
|
|
|
|
2022-11-22 23:22:07 +00:00
|
|
|
option go_package = "github.com/kava-labs/kava/x/cdp/types";
|
2022-01-08 00:39:27 +00:00
|
|
|
option (gogoproto.goproto_getters_all) = false;
|
|
|
|
|
|
|
|
// CDP defines the state of a single collateralized debt position.
|
|
|
|
message CDP {
|
2022-11-22 23:22:07 +00:00
|
|
|
uint64 id = 1 [(gogoproto.customname) = "ID"];
|
|
|
|
bytes owner = 2 [
|
2022-01-08 00:39:27 +00:00
|
|
|
(cosmos_proto.scalar) = "cosmos.AddressBytes",
|
2022-11-22 23:22:07 +00:00
|
|
|
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"
|
2022-01-08 00:39:27 +00:00
|
|
|
];
|
2022-11-22 23:22:07 +00:00
|
|
|
string type = 3;
|
|
|
|
cosmos.base.v1beta1.Coin collateral = 4 [(gogoproto.nullable) = false];
|
|
|
|
cosmos.base.v1beta1.Coin principal = 5 [(gogoproto.nullable) = false];
|
|
|
|
cosmos.base.v1beta1.Coin accumulated_fees = 6 [(gogoproto.nullable) = false];
|
|
|
|
google.protobuf.Timestamp fees_updated = 7 [
|
|
|
|
(gogoproto.stdtime) = true,
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
|
|
|
string interest_factor = 8 [
|
|
|
|
(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 by an account to a cdp
|
|
|
|
message Deposit {
|
2022-11-22 23:22:07 +00:00
|
|
|
uint64 cdp_id = 1 [(gogoproto.customname) = "CdpID"];
|
2022-01-08 00:39:27 +00:00
|
|
|
string depositor = 2 [
|
|
|
|
(cosmos_proto.scalar) = "cosmos.AddressBytes",
|
2022-11-22 23:22:07 +00:00
|
|
|
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"
|
2022-01-08 00:39:27 +00:00
|
|
|
];
|
|
|
|
cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false];
|
|
|
|
}
|
|
|
|
|
|
|
|
// TotalPrincipal defines the total principal of a given collateral type
|
|
|
|
message TotalPrincipal {
|
2022-11-22 23:22:07 +00:00
|
|
|
string collateral_type = 1;
|
|
|
|
cosmos.base.v1beta1.Coin amount = 2 [(gogoproto.nullable) = false];
|
2022-01-08 00:39:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// TotalCollateral defines the total collateral of a given collateral type
|
|
|
|
message TotalCollateral {
|
2022-11-22 23:22:07 +00:00
|
|
|
string collateral_type = 1;
|
|
|
|
cosmos.base.v1beta1.Coin amount = 2 [(gogoproto.nullable) = false];
|
2022-01-08 00:39:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// OwnerCDPIndex defines the cdp ids for a single cdp owner
|
|
|
|
message OwnerCDPIndex {
|
|
|
|
repeated uint64 cdp_ids = 1 [(gogoproto.customname) = "CdpIDs"];
|
|
|
|
}
|