Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

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 nameTypeRequiredDescription
priceProjectionSet<PriceProjection>NoThe projection of price data you want to receive in the response.

The PriceProjection Type was previously defined as:

ValueDescription
SP_AVAILABLEThe amount available at SP
SP_TRADEDThe amount traded at SP
EX_BEST_OFFERSThe best orders for each runner
EX_ALL_OFFERSThe complete market depth for all runners. EX_ALL_OFFERS trumps EX_BEST_OFFERS if both settings are present
EX_TRADEDThe 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 nameTypeRequiredDescription
priceProjectionPriceProjectionNoThe projection of price data you want to receive in the response.

PriceProjection

The PriceProjection type has now changed to:

Field nameTypeRequiredDescription
priceDataSet<PriceData>noThe projection of price data you want to receive in the response.
exBestOfferOverRidesnoExBestOfferOverRidesSelection to narrow down the best offer prices to those you are interested in.
virtualisebooleannoIndicates 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

ValueDescription
SP_AVAILABLEThe amount available at SP
SP_TRADEDThe amount traded at SP
EX_BEST_OFFERSThe best orders for each runner
EX_ALL_OFFERSThe complete market depth for all runners. EX_ALL_OFFERS trumps EX_BEST_OFFERS if both settings are present
EX_TRADEDThe amount traded for each runner

ExBestOfferOverRides

Field nameTypeRequiredDescription
bestPricesDepthintnoThe 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.
rollupModelRollupModelnoThe 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.
rollupLimitintnoThe 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

ValueDescription
STAKEThe volumes will be rolled up to the minimum value which is >= rollupLimit.
PAYOUTThe volumes will be rolled up to the minimum value where the payout( price * volume ) is >= rollupLimit.
NONENo rollup will be applied. However the volumes will be filtered by currency specific minimum stake unless overridden specifically for the channel.
  • No labels