How the Polymarket neg-risk adapter works
Pooled collateral, the CTF vs neg-risk distinction, contract address 0xd91E80cF..., and why it matters for redemption bots.
Two collateral models on Polymarket
Polymarket markets are built on two different smart contract patterns, and understanding the difference matters for redeeming positions and for bots that touch on-chain settlement.
CTF (Conditional Token Framework): each binary market has two outcome tokens (YES and NO). YES + NO = $1.00 always. You mint a pair by depositing $1 USDC. You redeem a winning token for $1 USDC.
Neg-risk adapter: a pooled model where a single $1 deposit creates a position across multiple mutually exclusive outcomes. Think of a "Which team will win the tournament?" market with 8 teams -- the neg-risk adapter lets you hold any combination of team outcomes with a single pool of collateral.
The neg-risk contract address
The Neg-Risk Adapter is deployed on Polygon at:
0xd91E80cF2605A1a8a0e3b7aEbA3f073c37C52d0e
You can view it on Polygonscan. The contract exposes functions for splitting, merging, and converting positions across the pooled set of outcomes.
How collateral is pooled
In a neg-risk market with N outcomes, you can hold YES on any number of them. The contract enforces that the sum of all winning outcome payouts does not exceed the deposited collateral. This is why you can "short" the field: buy NO on all outcomes means you profit if any one outcome resolves NO (which is most of them in a large field).
deposit $1 → get 1 share of each of N outcome tokens
resolve outcome k → outcome k pays $1, all others pay $0
The CTF model is simpler: just YES and NO, always summing to $1. The neg-risk adapter is CTF underneath, but wraps it with the pooled accounting layer.
Why it matters for bots
-
Redemption path differs: CTF positions are redeemed via the CTF contract directly. Neg-risk positions require calling the adapter contract first to convert pooled positions back to CTF positions before redemption.
-
Token IDs differ: a CTF YES token ID is a function of the condition ID. A neg-risk token ID is a function of the neg-risk market ID. If your bot attempts to redeem a neg-risk token via the CTF path, the transaction will revert.
-
The Gamma API flags it: the
neg_riskboolean field in the Gamma market response tells you which model the market uses.
async function getMarketType(conditionId) {
const res = await fetch(`https://gamma-api.polymarket.com/markets/${conditionId}`)
const market = await res.json()
return {
isNegRisk: market.neg_risk === true,
negRiskMarketId: market.neg_risk_market_id ?? null,
}
}Redeeming a CTF position
For a standard binary (non-neg-risk) resolved market, redemption is:
const CTF_ADDRESS = '0x4D97DCd97eC945f40cF65F87097ACe5EA0476045'
async function redeemCTF(wallet, conditionId, indexSets, amounts) {
const ctf = new ethers.Contract(CTF_ADDRESS, CTF_ABI, wallet)
// parentCollectionId is bytes32(0) for top-level conditions
const tx = await ctf.redeemPositions(
USDC_ADDRESS,
ethers.constants.HashZero,
conditionId,
indexSets, // [1] for YES (index 0), [2] for NO (index 1)
{ gasLimit: 200_000 }
)
return tx.wait()
}Redeeming a neg-risk position
For neg-risk, you call the adapter's convertPositions first, which creates equivalent CTF positions, then redeem those:
const NEG_RISK_ADAPTER = '0xd91E80cF2605A1a8a0e3b7aEbA3f073c37C52d0e'
async function redeemNegRisk(wallet, negRiskMarketId, amounts) {
const adapter = new ethers.Contract(NEG_RISK_ADAPTER, NEG_RISK_ABI, wallet)
// Convert neg-risk tokens to CTF tokens
const tx = await adapter.convertPositions(negRiskMarketId, amounts, { gasLimit: 300_000 })
await tx.wait()
// Then proceed with normal CTF redemption
}Detecting which path to take in the redeemer bot
The redeemer bot checks the neg_risk field before deciding which redemption path to use:
async function redeemPosition(wallet, conditionId) {
const { isNegRisk, negRiskMarketId } = await getMarketType(conditionId)
if (isNegRisk) {
await redeemNegRisk(wallet, negRiskMarketId, ...)
} else {
await redeemCTF(wallet, conditionId, ...)
}
}Gas costs
CTF redemption: ~80,000-120,000 gas on Polygon, typically under $0.01 at normal gas prices. Neg-risk conversion + redemption: ~150,000-250,000 gas due to the two-step process.
Always check MATIC balance before attempting redemption. The redeemer bot keeps a MATIC reserve of at least 0.1 MATIC to cover gas on up to 10 redemptions.
Summary
- CTF: simple binary YES/NO, $1 deposit per pair, redeem directly via the CTF contract.
- Neg-risk: pooled collateral across N outcomes, adapter at
0xd91E80cF..., requires a convert step before CTF redemption. - Check the Gamma API
neg_riskfield to determine which path to use. - Neg-risk redemption costs roughly 2x more gas than CTF.
Related bots
resolution-scalper — Near-certain outcome buyer
Buys $0.95-$0.99 outcomes across Polymarket and holds to resolution for the $0.01-$0.05 spread. Skips esports / close sports via keyword filter, dedupes correlated markets, 20-position cap.
redeemer — On-chain position redeemer
Claims resolved Polymarket positions on-chain via the Safe relayer. Supports standard CTF and neg-risk adapter. Dry-run by default, --live to execute, batches of 20. Free in every bundle.