Exchange Queries
There are several queries for getting information about things in the exchange module.
- OrderFeeCalc
- GetOrder
- GetOrderByExternalID
- GetMarketOrders
- GetOwnerOrders
- GetAssetOrders
- GetAllOrders
- GetCommitment
- GetAccountCommitments
- GetMarketCommitments
- GetAllCommitments
- GetMarket
- GetAllMarkets
- Params
- CommitmentSettlementFeeCalc
- ValidateCreateMarket
- ValidateMarket
- ValidateManageFees
- GetPayment
- GetPaymentsWithSource
- GetPaymentsWithTarget
- GetAllPayments
- PaymentFeeCalc
OrderFeeCalc
The OrderFeeCalc
query is used to find out the various required fee options for a given order.
The idea is that you can provide your AskOrder or BidOrder in this query in order to identify what fees you'll need to pay.
Either an ask_order
or a bid_order
must be provided, but not both.
Each response field is a list of options available for the requested order. If a response field is empty, then no fee of that type is required.
When creating the AskOrder
, choose one entry from creation_fee_options
to provide as the order_creation_fee
.
Then, choose one entry from settlement_flat_fee_options
and provide that as the seller_settlement_flat_fee
.
For ask orders, the settlement_ratio_fee_options
is purely informational and is the minimum that seller's settlement ratio fee that will be for the order.
When creating the BidOrder
, choose one entry from creation_fee_options
to provide as the order_creation_fee
.
Then choose one entry from each of settlement_flat_fee_options
and settlement_ratio_fee_options
, add them together, and provide that as the buyer_settlement_fees
.
QueryOrderFeeCalcRequest
See also: AskOrder, and BidOrder.
QueryOrderFeeCalcResponse
GetOrder
Use the GetOrder
query to look up an order by its id.
QueryGetOrderRequest
QueryGetOrderResponse
Order
See also: AskOrder, and BidOrder.
GetOrderByExternalID
Orders with external ids can be looked up using the GetOrderByExternalID
query.
QueryGetOrderByExternalIDRequest
QueryGetOrderByExternalIDResponse
See also: Order.
GetMarketOrders
To get all of the orders in a given market, use the GetMarketOrders
query.
Results can be optionally limited by order type (e.g. "ask" or "bid") and/or a minimum (exclusive) order id.
This query is paginated.
QueryGetMarketOrdersRequest
QueryGetMarketOrdersResponse
See also: Order.
GetOwnerOrders
To get all of the orders with a specific owner (e.g. buyer or seller), use the GetOwnerOrders
query.
Results can be optionally limited by order type (e.g. "ask" or "bid") and/or a minimum (exclusive) order id.
This query is paginated.
QueryGetOwnerOrdersRequest
QueryGetOwnerOrdersResponse
See also: Order.
GetAssetOrders
To get all of the orders with a specific asset denom, use the GetAssetOrders
query.
Results can be optionally limited by order type (e.g. "ask" or "bid") and/or a minimum (exclusive) order id.
This query is paginated.
QueryGetAssetOrdersRequest
QueryGetAssetOrdersResponse
See also: Order.
GetAllOrders
To get all existing orders, use the GetAllOrders
query.
This query is paginated.
QueryGetAllOrdersRequest
QueryGetAllOrdersResponse
See also: Order.
GetCommitment
To find out how much an account has committed to a market, use the GetCommitment
query.
QueryGetCommitmentRequest
QueryGetCommitmentResponse
GetAccountCommitments
To look up the amounts an account has committed to any market, use the GetAccountCommitments
query.
QueryGetAccountCommitmentsRequest
QueryGetAccountCommitmentsResponse
GetMarketCommitments
To get the amounts committed to a market by any account, use the GetMarketCommitments
query.
QueryGetMarketCommitmentsRequest
QueryGetMarketCommitmentsResponse
GetAllCommitments
To get all funds committed by any account to any market, use the GetAllCommitments
query.
QueryGetAllCommitmentsRequest
QueryGetAllCommitmentsResponse
GetMarket
All the information and setup for a market can be looked up using the GetMarket
query.
QueryGetMarketRequest
QueryGetMarketResponse
See also: Market.
GetAllMarkets
Use the GetAllMarkets
query to get brief information about all markets.
QueryGetAllMarketsRequest
QueryGetAllMarketsResponse
MarketBrief
Params
The exchange module params can be looked up using the Params
query.
QueryParamsRequest
QueryParamsResponse
See also: Params.
CommitmentSettlementFeeCalc
To find out the additional tx fee required for a commitment settlement, use the CommitmentSettlementFeeCalc
query.
QueryCommitmentSettlementFeeCalcRequest
See also: MsgMarketCommitmentSettleRequest.
QueryCommitmentSettlementFeeCalcResponse
ValidateCreateMarket
It's possible for a MsgGovCreateMarketRequest to result in a market setup that is problematic.
To verify that one is not problematic, this ValidateCreateMarket
can be used.
If the result has:
gov_prop_will_pass
=false
, then either submitting the proposal will fail, or theMsg
will result in an error ("failed") after the proposal is passed. Theerror
field will have details.gov_prop_will_pass
=true
and a non-emptyerror
field, then theMsg
would successfully run, but would result in the problems identified in theerror
field.gov_prop_will_pass
=true
and an emptyerror
field, then there are no problems with the providedMsg
.
QueryValidateCreateMarketRequest
See also: MsgGovCreateMarketRequest.
QueryValidateCreateMarketResponse
ValidateMarket
An existing market's setup can be checked for problems using the ValidateMarket
query.
Any problems detected will be returned in the error
field.
QueryValidateMarketRequest
QueryValidateMarketResponse
ValidateManageFees
It's possible for a MsgGovManageFeesRequest to result in a problematic setup for a market.
To verify that one does not result in such a state, use this ValidateManageFees
query.
If the result has:
gov_prop_will_pass
=false
, then either submitting the proposal will fail, or theMsg
will result in an error ("failed") after the proposal is passed. Theerror
field will have details.gov_prop_will_pass
=true
and a non-emptyerror
field, then theMsg
would successfully run, but would result in the problems identified in theerror
field.gov_prop_will_pass
=true
and an emptyerror
field, then there are no problems with the providedMsg
.
QueryValidateManageFeesRequest
See also: MsgGovManageFeesRequest.
QueryValidateManageFeesResponse
GetPayment
Use the GetPayment
query to look up a payment by source
and external_id
.
QueryGetPaymentRequest
QueryGetPaymentResponse
See also: Payment.
GetPaymentsWithSource
To get all payments with a specific source
, use the GetPaymentsWithSource
query.
This query is paginated.
QueryGetPaymentsWithSourceRequest
QueryGetPaymentsWithSourceResponse
See also: Payment.
GetPaymentsWithTarget
To get all payments with a specific target
, use the GetPaymentsWithTarget
query.
This query is paginated.
QueryGetPaymentsWithTargetRequest
QueryGetPaymentsWithTargetResponse
See also: Payment.
GetAllPayments
A listing of all existing payments can be found using the GetAllPayments
query.
This query is paginated.
QueryGetAllPaymentsRequest
QueryGetAllPaymentsResponse
See also: Payment.
PaymentFeeCalc
The PaymentFeeCalc
query can be used to calculate the fees for creating or accepting a payment.
QueryPaymentFeeCalcRequest
See also: Payment.