Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
House module, module accounts definition.
There is one account in the Accounts module.
House Fee Collector: This account holds the participation fee of all participants.
Name of the account: house_fee_collector
House module parameter types and definition.
The House module has the following parameters:
Min Deposit: minimum allowed amount of deposit.
House Participation Fee: the fee that the depositor needs to pay to become the house of a market
The proto for the params is as follows:
House module CLI.
This section specifies the queries, transactions, and required payloads. By following this section, one can get a deep understanding of the functioning of the house
module in the SGE Network chain.
The main logic of the House module definitions and methods.
There are several steps for a deposit to be made:
Set participation fee.
Initiate participation in the market by order book module.
Set the participation index generated by the order book module.
Check the authz grant to be available for the message creator and depositor address in the ticket.
Update authz spend limit or delete if is zero.
Set the deposit in the state of the blockchain.
There are several steps for a withdrawal to be made:
Get the corresponding deposit.
Check the amount and validate if it is possible to pay.
Call the order bookkeeper to liquidate the participation.
Check the authz grant to be available for the message creator and depositor address in the ticket.
Update authz withdrawal limit or delete if is zero.
Set the withdrawal in the state.
Modify and set the deposit and put the withdrawal info.
This section elaborates on the transaction message handler methods being exposed by the House module.
When a deposit transaction is processed, the following things happen:
Validate the incoming deposit message.
Call the Deposit
method of the keeper.
The RPC for adding a market is as follows:
The request message for Deposit
is MsgDeposit
. The proto for the request message is as follows:
The response message for Deposit
is MsgDepositResponse
. The proto for the request message is as follows:
When a withdrawal transaction is processed, the following things happen:
Validate the incoming deposit message.
Call the Deposit
method of the keeper.
The RPC for adding a market is as follows:
The request message for Withdraw
is MsgWithdraw
. The proto for the request message is as follows:
The response message for Withdraw
is MsgWithdrawResponse
. The proto for the request message is as follows:
Defines the way in which the state of the House is being stored in the chain.
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:
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:
The below transaction can be used to deposit on the blockchain.
The below table specifies the details of the arguments used in the above transaction:
The below transaction can be used to withdraw on the blockchain.
The below table specifies the details of the arguments used in the above transaction:
House module CLI queries.
The below table explains the details of the argument required for the above query:
The below table explains the details of the argument required for the above query:
The below table explains the details of the argument required for the above query:
Argument | Description | Type | Validation | Example |
---|---|---|---|---|
Argument | Description | Type | Validation | Example |
---|---|---|---|---|
Params | Description | Type | Validation | Example |
---|---|---|---|---|
Params | Description | Type | Validation | Example |
---|---|---|---|---|
Params | Description | Type | Validation | Example |
---|---|---|---|---|
market_uid
Unique Identifier of a market
string
Required
Valid UUID
0435e5b6-635f-11ed-90a6-bb470175dfce
amount
is the deposit amount (contains bet fee also)
Integer
Positive
Should be greater than the minimum deposit amount of the module
100000000
ticket
ticket data of deposit
string
Required
Valid Ticket
market_uid
Unique Identifier of a market
string
Required
Valid UUID
0435e5b6-635f-11ed-90a6-bb470175dfce
participation_index
The index of the participation when creating deposit
uint64
Required
10
ticket
Ticket data of the withdraw
string
Required
Valid UUID
mode
Mode of the withdrawal (full or partial)
uint32
Required
1
amount
is the deposit amount (contains bet fee also)
Integer
Positive
Should be greater than the minimum deposit amount of the module
100000000
account
depositor account address
string
Required
Valid Address
sge1059gavv45jdp0l7c4kkskr0jae02j9cxmjr3f3
account
depositor account address
string
Required
Valid Address
sge1059gavv45jdp0l7c4kkskr0jae02j9cxmjr3f3
depositor-addr
creator account address
string
Required
Valid Address
sge1059gavv45jdp0l7c4kkskr0jae02j9cxmjr3f3
market_uid
UUID of the merket
string
Required
Valid UUID
Existing market
8483cc8a-d4c8-44ef-9f06-971ec7afe059
participation_index
participation index of the orderbook participation
uint64
Required
Numeric
Existing participation
1
id
sequential id of the withdrawal
uint64
Required
Numeric
Existing ID
1