Skip to content

feat(polymarket): v0.6.2 — neg_risk redemption support for proxy/deposit wallets#62

Open
skylavis-sky wants to merge 2 commits intomainfrom
feat/polymarket-negrisk-proxy-redeem
Open

feat(polymarket): v0.6.2 — neg_risk redemption support for proxy/deposit wallets#62
skylavis-sky wants to merge 2 commits intomainfrom
feat/polymarket-negrisk-proxy-redeem

Conversation

@skylavis-sky
Copy link
Copy Markdown
Collaborator

@skylavis-sky skylavis-sky commented May 6, 2026

Summary

  1. neg_risk redeem via POLY_PROXY wallet — Bug: redeem bailed with "not yet supported" for neg_risk markets when tokens were held in proxy wallet. Root cause: negrisk_redeem_via_proxy() was not implemented. Fix: added negrisk_redeem_via_proxy() in onchainos.rs that ABI-encodes NegRiskAdapter.redeemPositions and routes through PROXY_FACTORY.

  2. neg_risk redeem via DEPOSIT_WALLET — Bug: deposit wallet mode was not handled for neg_risk markets. Root cause: wallet routing in redeem_one() fell through to EOA for deposit wallet mode. Fix: added negrisk_redeem_via_deposit_wallet() that batches the redemption call through the relayer wallet batch endpoint.

  3. Version bump to 0.6.2 — Bumped Cargo.toml, Cargo.lock, plugin.yaml, .claude-plugin/plugin.json, and all SKILL.md version references from 0.6.1 → 0.6.2.

Files Changed

File Change
src/commands/redeem.rs Remove "proxy not supported" bail for neg_risk; add deposit wallet routing; route to negrisk_redeem_via_proxy / negrisk_redeem_via_deposit_wallet
src/onchainos.rs Add negrisk_redeem_via_proxy() (routes through PROXY_FACTORY) and negrisk_redeem_via_deposit_wallet() (routes through relayer wallet batch)
Cargo.toml Version 0.6.1 → 0.6.2
Cargo.lock Updated polymarket-plugin version
plugin.yaml Version 0.6.1 → 0.6.2
.claude-plugin/plugin.json Version 0.6.1 → 0.6.2
SKILL.md Version refs updated to 0.6.2
CHANGELOG.md Added v0.6.2 entry

Live Verification

Tested redeem across all 3 wallet modes on Polygon (chain 137) using BTC 5-minute Up/Down markets (standard binary, neg_risk: false).

Test 1 — Deposit wallet redeem (11:35PM–11:40PM ET, BTC went Up)

$ polymarket-plugin redeem --market-id 0x3fb8383fd79dd000555ad453653ce64faf559e489932a25270fa0f8c5679a004
{
  "ok": true,
  "data": {
    "condition_id": "0x3fb8383fd79dd000555ad453653ce64faf559e489932a25270fa0f8c5679a004",
    "question": "Bitcoin Up or Down - May 6, 11:35PM-11:40PM ET",
    "deposit_wallet_note": "redeemPositions confirmed via deposit wallet. pUSD transferred to deposit wallet.",
    "deposit_wallet_tx": "0x646243127ec6b73b7d46f381f7b93bfd4d60c441410581467c4bba11f599bb48",
    "neg_risk": false
  }
}

Tx: https://polygonscan.com/tx/0x646243127ec6b73b7d46f381f7b93bfd4d60c441410581467c4bba11f599bb48

Test 2 — EOA + proxy wallet redeem (11:45PM–11:50PM ET, BTC went Down)

$ polymarket-plugin redeem --market-id 0x90a4d8f57e4b45d9d83300ddca328d40c6245a37a582d500b895ed48bc623030
{
  "ok": true,
  "data": {
    "condition_id": "0x90a4d8f57e4b45d9d83300ddca328d40c6245a37a582d500b895ed48bc623030",
    "question": "Bitcoin Up or Down - May 6, 11:45PM-11:50PM ET",
    "eoa_note": "EOA redeemPositions confirmed.",
    "eoa_tx": "0xec528428f874a47f9a9dbbbc43a8825ebc6017630835857835a3d5092cdfde3c",
    "proxy_note": "Proxy redeemPositions confirmed via PROXY_FACTORY.",
    "proxy_tx": "0x94c08d846496d94db8365d93225bdecaea6f794ff302c90ad46ed1ce58a45815",
    "neg_risk": false
  }
}

EOA tx: https://polygonscan.com/tx/0xec528428f874a47f9a9dbbbc43a8825ebc6017630835857835a3d5092cdfde3c
Proxy tx: https://polygonscan.com/tx/0x94c08d846496d94db8365d93225bdecaea6f794ff302c90ad46ed1ce58a45815

Note on neg_risk paths: The 5-minute BTC Up/Down markets are standard binary (neg_risk: false). The new negrisk_redeem_via_proxy() and negrisk_redeem_via_deposit_wallet() code paths (NegRiskAdapter route) were not exercised in this run — no resolved neg_risk multi-outcome market positions were available. The old blocking error ("not yet supported") is removed; the new routing code is exercised on the first real neg_risk win.

Checklist

  • Version bumped in Cargo.toml, Cargo.lock, plugin.yaml, plugin.json, SKILL.md
  • PR scope: only skills/polymarket-plugin/ files
  • No stub/placeholder code
  • Binary builds cleanly (cargo build --release)
  • Live end-to-end verification (deposit wallet + EOA + proxy wallet redeem — 3 confirmed txs)
  • SKILL.md Proactive Onboarding + Quickstart sections present

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant