pmxt icon indicating copy to clipboard operation
pmxt copied to clipboard

Myriad `claimWinnings` (`POST /markets/claim`) spec capability not implemented in `MyriadExchange` or either SDK

Open realfishsam opened this issue 5 months ago • 0 comments

Gap

The Myriad API spec defines POST /markets/claim which retrieves a trade claim and the transaction calldata needed to claim winnings for a resolved market. MyriadExchange in core has no claimWinnings() method and neither SDK exposes a wrapper. Without this method, users who traded on Myriad markets cannot retrieve their winnings through the PMXT interface — they must go directly to the Myriad API or frontend.

Core

Spec: core/specs/myriad/myriad.yaml line 799:

/markets/claim:
  post:
    description: Get a trade claim and transaction calldata for a specific market.
    # Request: { marketId, tradeType }
    # tradeType enum: [claim_winnings, claim_voided]
    # Response: claim object with transaction calldata for on-chain settlement

The response contains on-chain transaction calldata that the user must submit to finalize their payout.

core/src/exchanges/myriad/index.ts — MyriadExchange public interface includes fetchMarketsImpl, fetchEventsImpl, fetchOHLCV, fetchOrderBook, fetchTrades, fetchMyTrades, createOrder, cancelOrder, fetchOrder, fetchOpenOrders, fetchPositions, fetchBalance, watchOrderBook, watchTrades, close. No claimWinnings() method exists.

TypeScript SDK

Missing — no claimWinnings in sdks/typescript/pmxt/client.ts. The Myriad SDK class inherits only the methods exposed by MyriadExchange.

Python SDK

Missing — no claim_winnings in sdks/python/pmxt/client.py or sdks/python/pmxt/_exchanges.py.

Evidence

# Spec defines the endpoint
grep -n "claim" core/specs/myriad/myriad.yaml
# line 799: /markets/claim
# line 829: enum: [claim_winnings, claim_voided]

# Core exchange — no implementation
grep -rn "claimWinnings\|claim_winnings" core/src/exchanges/myriad/
# (no matches)

# Both SDKs — no wrapper
grep -rn "claimWinnings\|claim_winnings" sdks/
# (no matches)

Impact

Myriad markets settle on-chain. When a market resolves, winning positions must be claimed explicitly via a signed transaction before funds are released. Without claimWinnings() (or an equivalent buildClaimTx() / submitClaim() pair), users who traded on Myriad through PMXT cannot close the settlement loop using the same SDK — they must switch to the raw Myriad API or UI to collect winnings. This breaks the unified trading workflow for Myriad and leaves funds inaccessible through the SDK.


Found by automated Core-to-SDK surface coverage audit

realfishsam avatar Jun 16 '26 16:06 realfishsam