Get Midpoint

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

HTTP REQUEST

GET /<clob-endpoint>/midpoint

Request Payload Parameters

NameRequiredTypeDescription
token_idyesstringtoken ID market to get price for

Response

{"mid": "0.55"}

resp = client.get_midpoint(
    "71321045679252212594626385532706912750332728571942532289631379312455583992563"
)
print(resp)
print("Done!")

Get Midpoints

Get the midpoint prices for a set of market (halfway between best bid or best ask).

HTTP REQUEST

POST /<clob-endpoint>/midpoints

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

Response

{[asset_id]: mid_price}

resp = client.get_midpoints(
    params=[
        BookParams(
            token_id="71321045679252212594626385532706912750332728571942532289631379312455583992563"
        ),
        BookParams(
            token_id="52114319501245915516055106046884209969926127482827954674443846427813813222426"
        ),
    ]
)
print(resp)