Prices API

How come the prices API only displays the bid and offer prices in percentage format? Maybe I’m wrong here but the results seem to be in the percentage format rather than fractional or decimal, atleast for horse racing selections.

If the responses are only displayed in the percentage format, is there a way to convert it to the decimal format?

In the old oddsfeed.xml, you could get the format in decimal and fractional formats too.

  "31274144": {
    "bids": [
      {
        "price": 6711,
        "quantity": 229197
      },
      {
        "price": 6369,
        "quantity": 866287
      },
      {
        "price": 6289,
        "quantity": 1055422
      }
    ],
    "offers": [
      {
        "price": 7246,
        "quantity": 1364156
      },
      {
        "price": 7752,
        "quantity": 1524454
      },
      {
        "price": 7812,
        "quantity": 2069360
      }
    ]
  },

Hi,

We chose not to display prices in fractional or decimal format in the API as our exchange’s internal systems are built with percentage odds and decimals or fractional would be approximates. You can convert on the client side with the formulas that are provided in the api docs.

Thanks, João

Hey Joao,

Thank you very much!

Instantly found the guide.

Ugnius

To add to this, I understand the odds are as percentages, but what are the quantities displayed as? They are clearly not GBP

Hello

We’re having trouble getting the back and lay back.

Hello would it please be possible to get information about volume recovery and back and lay offers.

Best regards

Hey,

What issues are you having? Information on all requests is in the docs: https://docs.smarkets.com/#/

Hi Michael, sorry for the late response. Quantities are returned in your account currency.

Hi Eddie,

I’m facing troubles with the Get orders function.
I’m getting an “error_type”: “AUTH_REQUIRED”, do I need a special token or an api key ? If yes, how could I get it ? I tried with a Post sessions which returns a token but even with that, I’m having this error message.

Regards

Can you please make sure that your session token is in a correct format. This topic might be helpful:

Hi Eddie,

Thanks for your return, you’re right, session token was not in a correct format.
Now, I can use the Get orders function but I have an other question:
I tought I could get the odd and the side (back/lay) in this section which is not the case. In which section could I get these informations ?

Thanks

Regards

Thank you for reply.
I don’t find odd lay and back. Do you know the solution ? Please

Which route are you using? /v3/orders/ retrieves your current active orders and the price they were executed at.

If you want to get back and lay odds for contracts in a specific market use /v3/markets/{market_ids}/quotes/

Hi Eddie,

Thanks for your answer.
I used /v3/markets/{market_ids}/quotes/ for a specific horses market.
But the only response I catch is the price and the quantity for a bid.
I attached an example from my jupyter notebook.
I can’t find the back/lay information.

Regards quotes_smarkets

Hello Georges. The response you’ve attached does show the prices for the contracts in the specified market. The bids are the best currently available prices to lay and the offers are the best prices currently available to back.

How can we differentiate between LAY and BACK offers?

Thank you advance

As per Dave’s last message:

bids = lay prices
offers = back prices

Rather than start a new thread I thought I’d ask here.

In the OP: Is the “quantity” how much has been matched or how much is currently available.

I am trying to work out how much money there is available at specific odds to place an order.

I think I’m being stupid, but I’m struggling to understand how values like “6711” represent percentages? And I’m not sure what Quantity is referring to either?

Hi Charlie, apologies for the late reply.

This price is in percentage basis points.

Example: 5000 = 50%
To convert it to decimal odds, just divide 10000 by it
Example: 10000 / 5000 = 2.0 (decimal odds).

This price has to conform to a valid tick on the exchange; an invalid price error will be returned if it does not.

Quantity is the sum of the total pot (back+lay) in case the order is matched.
The units are 1/100 of a UK penny.

Example: Quantity 1 = 0.0001 GBP
To convert it to back stake, just multiply by the price and divide by 100000000
Example: 100000 (quantity) * 5000 (price) / 100000000 = 5 GBP back stake

For reference the documentation can be found here:
https://docs.smarkets.com/#/prices/get_quotes

if you click into the schema bit of the response, down until you get into the tick property you will find the documentation.

1 Like