On-Chain Contract Operations
The server exposes ABI-encoded calldata builders and transaction submission helpers for the core on-chain settlement operations.
CTF Exchange Operations
Section titled “CTF Exchange Operations”matchOrders
Section titled “matchOrders”The primary settlement mechanism. Pairs a taker order with one or more maker orders for on-chain execution.
matchOrders(Order takerOrder, Order[] makerOrders, uint256 takerFillAmount, uint256[] makerFillAmounts)fillOrder / fillOrders
Section titled “fillOrder / fillOrders”Operator-driven fills for specific orders outside the normal matching flow.
fillOrder(Order order, uint256 fillAmount)fillOrders(Order[] orders, uint256[] fillAmounts)cancelOrder / cancelOrders
Section titled “cancelOrder / cancelOrders”Permanently marks orders as canceled in the Exchange contract on-chain.
cancelOrder(Order order)cancelOrders(Order[] orders)incrementNonce
Section titled “incrementNonce”Advances the sender’s on-chain nonce, which invalidates every order signed with the previous nonce.
incrementNonce()ConditionalTokens (CTF ERC1155) Operations
Section titled “ConditionalTokens (CTF ERC1155) Operations”splitPosition
Section titled “splitPosition”Converts collateral into a complete set of conditional outcome tokens.
POST /ctf/splitmergePositions
Section titled “mergePositions”Recombines a full set of outcome tokens back into collateral.
POST /ctf/mergeredeemPositions
Section titled “redeemPositions”After resolution, exchanges winning outcome tokens for collateral at face value.
POST /ctf/redeemNegRiskAdapter Operations
Section titled “NegRiskAdapter Operations”convertPositions
Section titled “convertPositions”Transforms No positions into Yes positions across other outcomes within a NegRisk market.
convertPositions(bytes32 marketId, uint256 indexSet, uint256 amount)marketId— The NegRisk market identifierindexSet— Bitmask of outcome indices (e.g., 1 = outcome 0, 2 = outcome 1)amount— Number of tokens to convert
Order Struct
Section titled “Order Struct”Every Exchange operation uses this standard Order struct:
struct Order { uint256 salt; address maker; address signer; address taker; uint256 tokenId; uint256 makerAmount; uint256 takerAmount; uint256 expiration; uint256 nonce; uint256 feeRateBps; uint8 side; // 0 = BUY, 1 = SELL uint8 signatureType; // 0 = EOA, 1 = OPENFISH_PROXY, 2 = GNOSIS_SAFE bytes signature;}Contract Addresses (Polygon)
Section titled “Contract Addresses (Polygon)”| Contract | Address |
|---|---|
| CTF Exchange | 0xA642f9165D192Ff13b1D43a0Ef56B3BD074614bB |
| NegRisk CTF Exchange | 0x700eaF3f3FEb1D3f2aE67000e1A4FA41a6E35DF1 |
| CTF ERC1155 | 0x4D97DCd97eC945f40cF65F87097ACe5EA0476045 |
| NegRisk Adapter | 0x0d8FA66CFe5D5EF96D6be9C4e808BD4279527d6e |
| USDC.e | 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174 |