swap.quickswap.v1.QuickSwapBrokerService
GetBrokerStats
GetBrokerStats reads the broker's QuickSwap activity in a window, per UTC day or month: QuickSwaps created by status, deposits credited and payouts delivered per asset, and the service, broker and affiliate fees charged per asset. Errors: - NOT_FOUND: BROKER_NOT_FOUND. - INTERNAL: STATS_INCOMPLETE, with the swap_id of a QuickSwap whose records the stats cannot read.
Request
curl --request POST \ \
--url 'https://api.testnet.polyester.com/swap.quickswap.v1.QuickSwapBrokerService/GetBrokerStats' \
--header 'Content-Type: application/json' \
--header 'Connect-Protocol-Version: 1' \
--data '{
"broker": "value",
"endTime": "2025-01-01T00:00:00Z",
"groupBy": "DAY",
"startTime": "2025-01-01T00:00:00Z"
}'Responses
{
"periods": [
{
"createdCount": "1",
"delivered": [
{
"amount": {
"baseUnits": "value",
"decimals": 36
},
"assetId": 100
}
],
"deposited": [
{
"amount": {
"baseUnits": "value",
"decimals": 36
},
"assetId": 100
}
],
"fees": [
{
"affiliateFee": {
"baseUnits": "value",
"decimals": 36
},
"assetId": 100,
"brokerFee": {
"baseUnits": "value",
"decimals": 36
},
"serviceFee": {
"baseUnits": "value",
"decimals": 36
}
}
],
"periodStart": "2025-01-01T00:00:00Z",
"statuses": [
{
"count": "1",
"status": "ALLOCATING"
}
]
}
]
}swap.quickswap.v1.GetBrokerStatsRequestswap.quickswap.v1.GetBrokerStatsResponseBroker name. A broker API key may name only its own broker.
The period to group by.
Start of the window, inclusive. A window that starts or ends inside a period counts only the part of that period inside the window.
End of the window, exclusive, at most 366 days after start_time.
Start of the UTC day or month.
QuickSwaps created in the period, inside the window.
The status.
QuickSwaps in it.
Asset, as an AssetConfig.ledger_id from GET /v1/chain/deposit-withdraw/config.
Unsigned integer amount in the token's smallest unit (for example satoshis or wei), as a decimal string without sign, exponent, separators or leading zeros; at most 78 digits.
Token decimals: the display amount is base_units / 10^decimals. Required in requests, where it must equal AssetChainVariant.source_decimals (the token's on-chain decimals) in GET /v1/chain/deposit-withdraw/config of the asset the amount is in: the source asset for a SOURCE_AMOUNT amount; the destination asset for a DESTINATION_AMOUNT amount and for Protection.min_amount_out.
Asset, as an AssetConfig.ledger_id from GET /v1/chain/deposit-withdraw/config.
Unsigned integer amount in the token's smallest unit (for example satoshis or wei), as a decimal string without sign, exponent, separators or leading zeros; at most 78 digits.
Token decimals: the display amount is base_units / 10^decimals. Required in requests, where it must equal AssetChainVariant.source_decimals (the token's on-chain decimals) in GET /v1/chain/deposit-withdraw/config of the asset the amount is in: the source asset for a SOURCE_AMOUNT amount; the destination asset for a DESTINATION_AMOUNT amount and for Protection.min_amount_out.
Asset charged, as an AssetConfig.ledger_id from GET /v1/chain/deposit-withdraw/config.
Unsigned integer amount in the token's smallest unit (for example satoshis or wei), as a decimal string without sign, exponent, separators or leading zeros; at most 78 digits.
Token decimals: the display amount is base_units / 10^decimals. Required in requests, where it must equal AssetChainVariant.source_decimals (the token's on-chain decimals) in GET /v1/chain/deposit-withdraw/config of the asset the amount is in: the source asset for a SOURCE_AMOUNT amount; the destination asset for a DESTINATION_AMOUNT amount and for Protection.min_amount_out.
Unsigned integer amount in the token's smallest unit (for example satoshis or wei), as a decimal string without sign, exponent, separators or leading zeros; at most 78 digits.
Token decimals: the display amount is base_units / 10^decimals. Required in requests, where it must equal AssetChainVariant.source_decimals (the token's on-chain decimals) in GET /v1/chain/deposit-withdraw/config of the asset the amount is in: the source asset for a SOURCE_AMOUNT amount; the destination asset for a DESTINATION_AMOUNT amount and for Protection.min_amount_out.
Unsigned integer amount in the token's smallest unit (for example satoshis or wei), as a decimal string without sign, exponent, separators or leading zeros; at most 78 digits.
Token decimals: the display amount is base_units / 10^decimals. Required in requests, where it must equal AssetChainVariant.source_decimals (the token's on-chain decimals) in GET /v1/chain/deposit-withdraw/config of the asset the amount is in: the source asset for a SOURCE_AMOUNT amount; the destination asset for a DESTINATION_AMOUNT amount and for Protection.min_amount_out.
| Key | HTTP status | Connect code | Error | When |
|---|---|---|---|---|
| unauthenticated | 401 | unauthenticated | Unauthenticated | Authentication required. |
| permission-denied | 403 | permission_denied | Permission Denied | Permission denied. |
| invalid-argument | 400 | invalid_argument | Invalid Argument | Invalid argument. |
| not-found | 404 | not_found | Not Found | Not found. |
| unavailable | 503 | unavailable | Unavailable | Service unavailable. |