Defines the way in which the state of the House is being stored in the chain.
Deposit
The Deposit message is used to store the data of a particular deposition in the blockchain. The deposit is allowed on the markets that are in Active status. The deposit entity consists of the following fields:
creator: The address of the deposit message creator account.
depositor_address: The address of the depositor.
market_uid: It is the unique identifier of a market.
participation_index: The index of the participation of the market.
amount: The amount of the deposit.
fee: The amount of paid fee for the deposition.
liquidity: The amount of available liquid amount for participation (amount - fee).
withdraw_count: The count of withdrawals on a deposit.
total_withdraw_amount: The total amount of withdrawal value till now.
The proto for the Deposit messages is as follows:
// Deposit represents the deposit against a market held by an account.message Deposit {option(gogoproto.equal)=false;option(gogoproto.goproto_getters)=false;option(gogoproto.goproto_stringer)=false;// creator is the bech32-encoded address of the depositor.string creator =1 [ (gogoproto.moretags) = "yaml:\"creator\"" ];// creator is the bech32-encoded address of the depositor.string depositor_address =2 [ (gogoproto.moretags) = "yaml:\"depositor_address\"" ];// market_uid is the uid of market/order book against which deposit is being// made.string market_uid =3 [(gogoproto.customname) = "MarketUID",(gogoproto.jsontag) = "market_uid",json_name = "market_uid" ];// participation_index is the index corresponding to the order book// participationuint64 participation_index =4 [ (gogoproto.moretags) = "yaml:\"participation_index\"" ];// amount is the amount being deposited on an order book to be a housestring amount =5 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",(gogoproto.nullable) = false,(gogoproto.moretags) = "yaml:\"amount\"" ];// withdrawal_count is the total count of the withdrawals from an order bookuint64 withdrawal_count =6 [ (gogoproto.moretags) = "yaml:\"withdrawals\"" ];// total_withdrawal_amount is the total amount withdrawn from the liquidity// providedstring total_withdrawal_amount =7 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",(gogoproto.nullable) = false,(gogoproto.moretags) = "yaml:\"total_withdrawal_amount\"" ];}
Withdraw
The Withdraw message is used to store the data of a particular withdrawal in the blockchain. The withdraw entity consists of the following fields:
creator: The withdrawal message creator address.
id: The sequential ID of withdrawal generated by the blockchain.
address: The address of the depositor account.
market_uid: It is the unique identifier of a market.
participation_index: The index of the participants created when deposited.
mode: The mode of withdrawal.
amount: The amount of withdrawal.
The proto for the withdrawal messages is as follows:
// Withdrawal represents the withdrawal against a deposit.message Withdrawal {option(gogoproto.equal)=false;option(gogoproto.goproto_getters)=false;option(gogoproto.goproto_stringer)=false;// creator is the bech32-encoded address of the depositor.string creator =1 [ (gogoproto.moretags) = "yaml:\"creator\"" ];// withdrawal is the withdrawal attempt id.uint64 id =2 [(gogoproto.customname) = "ID",(gogoproto.jsontag) = "id",json_name = "id",(gogoproto.moretags) = "yaml:\"id\"" ];// address is the bech32-encoded address of the depositor.string address =3 [ (gogoproto.moretags) = "yaml:\"address\"" ];// market_uid is the uid of market against which the deposit is// being made.string market_uid =4 [(gogoproto.customname) = "MarketUID",(gogoproto.jsontag) = "market_uid",json_name = "market_uid" ];// participation_index is the id corresponding to the book participationuint64 participation_index =5 [ (gogoproto.moretags) = "yaml:\"participation_index\"" ];// mode is the withdrawal mode enum valueWithdrawalMode mode =6 [ (gogoproto.moretags) = "yaml:\"mode\"" ];// amount is the amount being withdrawn.string amount =7 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",(gogoproto.nullable) = false,(gogoproto.moretags) = "yaml:\"amount\"" ];}
Enums
// WithdrawalMode is the enum type for the withdrawal mode.enum WithdrawalMode {// invalid WITHDRAWAL_MODE_UNSPECIFIED =0;// full WITHDRAWAL_MODE_FULL =1;// partial WITHDRAWAL_MODE_PARTIAL =2;}