CTFExchange is a Polymarket-compatible order-matching contract that
settles trades against ConditionalTokens. PredictStreet deploys it
with the quadratic taker-fee formula fee = k × P × (1−P) × outcomeTokens.
See Fees for the math.
Key entry points
Fee formula
feeRateBps ≤ MAX_FEE_RATE_BIPS (1000).
Events
Security invariants
- Signature replay impossible — every filled order’s hash stored
in
orderStatus[hash].isFilledOrCancelled. - Maker authority cryptographic —
makerfield verified againstsignerviavaultFactory.vaultOf(signer)(VAULT) or equality (EOA). - Admin can pause but not seize — no admin function transfers user funds.
- Operator rotatable —
removeOperator(address)disables compromised key.
MatchFailed reason codes
When batchMatchOrders catches a per-leg revert, the reason bytes are the
4-byte selector of the original custom error. Common ones:
Decode the bytes with
cast 4byte 0x<selector> or by computing
bytes4(keccak256(<errorSig>)).
Source
Paste0x4074c225b296E1E556c565B0C3Ddba305E63E7c4 on
Blockscout for
verified source + ABI.