Skip to content

docs/guides/hosted-errors.mdx cites a slippage-floor formula and source line for marketable-limit SELL orders that don't exist in either SDK #1911

Description

@realfishsam

Gap

docs/guides/hosted-errors.mdx states the validator's slippage floor is "currently worst_price ≥ best_bid × 0.8 + 0.029, see _hosted_typeddata.py:519". Neither the cited formula nor the additive +0.029 epsilon term exists anywhere in either SDK's actual bound calculation for a marketable-limit SELL.

Core

N/A — this validation lives entirely in the SDKs' typed-data / order-building layer, not core.

TypeScript SDK

sdks/typescript/pmxt/hosted-typed-data.ts:533-548 — the actual bound is lower = bestBid * (1 - slippagePct/100), with no additive epsilon term.

Python SDK

sdks/python/pmxt/_hosted_typeddata.py:504-531 — the actual polymarket_sell bound is lower_bound = best_price * (Decimal("1") - (slippage_pct / Decimal("100"))), also with no additive term. grep -n "029" over the entire file returns zero matches — there is no 0.029 constant anywhere in _hosted_typeddata.py, contradicting the doc's specific line citation (_hosted_typeddata.py:519).

Evidence

Read both hosted-typed-data.ts:533-548 and _hosted_typeddata.py:504-531 directly and confirmed the formula shape (best_price * (1 - slippage_pct/100), no +0.029). Grepped _hosted_typeddata.py for "029" and got no matches, so the cited line/constant doesn't correspond to any real code.

Impact

A developer debugging a rejected marketable-limit SELL order who reads the doc's cited formula and line number to reverse-engineer the actual threshold computes the wrong floor (the real floor is strictly best_price × (1 − slippage_pct/100), which is lower than the documented formula implies for typical slippage_pct values) and cannot locate the cited constant in source to verify it, since it doesn't exist.


Found by automated Core-to-SDK surface coverage audit

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2: mediumbugSomething isn't workingcore-sdk-gapCore engine capabilities not exposed in SDKsdocumentationImprovements or additions to documentationeffort: small

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions