Skip to content

v0.30.5 — redeem actually pays out (pUSD collateral adapters)

Choose a tag to compare

@VickyXAI VickyXAI released this 13 Jul 19:07

Fixes a real-money bug: action:"redeem" returned success + a tx hash while redeeming 0 shares (Polymarket data-api: REDEEM size=0).

Root cause (verified on-chain): V2-era CLOB token_ids are still keyed to USDC.e (standard) / the legacy NegRiskAdapter's wrapped collateral (neg-risk) — not pUSD. Redeeming via CTF.redeemPositions with pUSD collateral computes a positionId nobody holds, and the CTF does not revert on zero balance — it burns nothing, pays nothing, and the tx succeeds.

Fix: redeem now routes through Polymarket's canonical pUSD collateral adapters (contracts; Sourcify exact_match; identity constants verified on-chain): CtfCollateralAdapter 0xAdA100Db00Ca00073811820692005400218FcE1f (standard) and NegRiskCtfCollateralAdapter 0xadA2005600Dec949baf300f4C6120000bDB6eAab (neg-risk). They pull your outcome tokens, redeem through the right path, and pay the winnings back as pUSD.

⚠️ Existing wallets: run action:"setup" confirm:true once before your next redeem — it grants the two new adapter approvals (setup reads approvals on-chain every run and signs what's missing).

Hardening from the adversarial audit of the fix: success message reports the actual payout delta (a $0 payout with winning tokens held returns a loud ⚠️, not ✅); EOA path checks receipt.status; relayer failure text now triggers the missing-approval hint. 153 tests green.