New API-NG Release (beta) - 8th May 2013
This release introduces changes to the listMarketBook operation. These changes give far greater control over the shape of data returned by the "BEST_OFFERS" price projection. As a consequence of these changes YOU WILL HAVE TO CHANGE YOUR CLIENT. We have tried to minimise the need for these changes, but feel that the benefits of these new features are sufficient for a breaking change during the beta period to ensure a clean interface in future.
New Functionality
The new listMarketBook operation gives you greater control over the shape of data returned to you so that you can immediately see the prices to which you can back or lay a specific amount of Stake or Risk.. It allows the following parameters to be configured:
- Return virtual prices, or not.
- Configure the depth of the best prices returned to you. The current default for this is a depth of 3 prices on either side.
- Rollup available prices - you can configure the rollup amount and type.
So, for example, you could make a single request for a price depth of 1, showing at which price you will have a stake of £10 fully matched.Â
Sample Request
A sample request to listMarketBook would previously have looked like this
Old JSON-RPC
Â
[{"jsonrpc": "2.0", "method": "SportsAPING/v1.0/listMarketBook", "params": {"marketIds":["1.107674427"],"priceProjection":["EX_BEST_OFFERS"]}, "id": 1}] |
The equivalent operation now looks like this:
New JSON-RPC
Â
[{"jsonrpc": "2.0", "method": "SportsAPING/v1.0/listMarketBook", "params": {"marketIds":["1.107674427"],"priceProjection":{"priceData":["EX_BEST_OFFERS"]}}, "id": 1}] |
Â
Previous Version
listMarketBook previously required the priceProjection parameter:
Parameter name | Type | Required | Description |
---|---|---|---|
priceProjection | Set<PriceProjection> | No | The projection of price data you want to receive in the response. |
The PriceProjection Type was previously defined as:
Value | Description |
---|---|
SP_AVAILABLE | The amount available at SP |
SP_TRADED | The amount traded at SP |
EX_BEST_OFFERS | The best orders for each runner |
EX_ALL_OFFERS | The complete market depth for all runners. EX_ALL_OFFERS trumps EX_BEST_OFFERS if both settings are present |
EX_TRADED | The amount traded for each runner |
New Version
After this release, API-NG calls to listMarketBook shall continue to accept the PriceProjection parameter, however this parameter has been changed:
Parameter name | Type | Required | Description |
---|---|---|---|
priceProjection | PriceProjection | No | The projection of price data you want to receive in the response. |
PriceProjection
The PriceProjection type has now changed to:
Field name | Type | Required | Description |
---|---|---|---|
priceData | Set<PriceData> | no | The projection of price data you want to receive in the response. |
exBestOfferOverRides | ExBestOfferOverRides | no | Selection to narrow down the best offer prices to those you are interested in. |
virtualise | boolean | no | Indicates if the returned prices should include virtual prices. Applicable to EX_BEST_OFFERS and EX_ALL_OFFERS price projections only. Default value is false. |
PriceData
PriceData - which replicates the old PriceProjection type
Value | Description |
---|---|
SP_AVAILABLE | The amount available at SP |
SP_TRADED | The amount traded at SP |
EX_BEST_OFFERS | The best orders for each runner |
EX_ALL_OFFERS | The complete market depth for all runners. EX_ALL_OFFERS trumps EX_BEST_OFFERS if both settings are present |
EX_TRADED | The amount traded for each runner |
ExBestOfferOverRides
Field name | Type | Required | Description |
---|---|---|---|
bestPricesDepth | int | no | The maximum number of prices to return on each side for each runner. Only applicable for EX_BEST_OFFERS Price Projection.Should be an integer > 0.Default value is 3, maximum value is 10. |
rollupModel | RollupModel | no | The model to use when rolling up available sizes. Only applicable for EX_BEST_OFFERS price projection. If unspecified defaults to STAKE rollup model with rollupLimit of minimum stake in the specified currency. |
rollupLimit | int | no | The volume limit to use when rolling up returned sizes. The exact definition of the limit depends on the rollupModel. Only applicable for EX_BEST_OFFERS price projection. It is mandatory when a rollupModel is specified, ignored if no model is specified. |
RollupModel
Value | Description |
---|---|
STAKE | The volumes will be rolled up to the minimum value which is >= rollupLimit. |
PAYOUT | The volumes will be rolled up to the minimum value where the payout( price * volume ) is >= rollupLimit. |
NONE | No rollup will be applied. However the volumes will be filtered by currency specific minimum stake unless overridden specifically for the channel. |