Skip to content

Bug: getTickSize() does not include token_id in URL #199

@jittoshi

Description

@jittoshi

The getTickSize method in src/client.ts constructs the URL as ${this.clobBase}/tick-size without the required ?token_id=${tokenID} query parameter.

Per API docs: GET /tick-size?token_id=...

This causes 400 "Invalid token id" errors when placing orders.

Fix: Change to const url = \${this.clobBase}/tick-size?token_id=${tokenID}`;`

Error logs:
[CLOB Client] request error {"status":400,"statusText":"Bad Request","data":{"error":"Invalid token id"},"config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"env":{},"headers":{"Accept":"application/json, text/plain, /","User-Agent":"axios/0.27.2"},"method":"get","url":"https://clob.polymarket.com/tick-size","params":{}}}

Failed to place order: TypeError: Cannot read properties of undefined (reading 'toString')
at ClobClient. (/Users/.../node_modules/@polymarket/clob-client/dist/client.js:101:60)
at ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions