Get Price

Get the price for a market (best bid or best ask).

HTTP REQUEST

GET /<clob-endpoint>/price

Request Payload Parameters

NameRequiredTypeDescription
token_idyesstringtoken ID to get price for
sideyesstringbuy or sell

Response

{"price": ".512"}

print(
    client.get_price(
        token_id="71321045679252212594626385532706912750332728571942532289631379312455583992563", side="buy
    )
)

Get Prices

Get the prices for a group of markets (best bid or best ask).

HTTP REQUEST

POST /<clob-endpoint>/prices

Request Payload Parameters

NameRequiredTypeDescription
paramsyesBookParamssearch params for books

A BookParams object is of the form:

NameRequiredTypeDescription
token_idyesstringtoken ID of market to get book for
sideyesstringBUY or SELL

Response

{[asset_id]: {[side]: price}}

resp = client.get_prices(
    params=[
        BookParams(
            token_id="71321045679252212594626385532706912750332728571942532289631379312455583992563",
            side="BUY",
        ),
        BookParams(
            token_id="71321045679252212594626385532706912750332728571942532289631379312455583992563",
            side="SELL",
        ),
        BookParams(
            token_id="52114319501245915516055106046884209969926127482827954674443846427813813222426",
            side="BUY",
        ),
        BookParams(
            token_id="52114319501245915516055106046884209969926127482827954674443846427813813222426",
            side="SELL",
        ),
    ]
)
print(resp)