Skip to content

On-Chain Contract Operations

The server exposes ABI-encoded calldata builders and transaction submission helpers for the core on-chain settlement operations.

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)

Operator-driven fills for specific orders outside the normal matching flow.

fillOrder(Order order, uint256 fillAmount)
fillOrders(Order[] orders, uint256[] fillAmounts)

Permanently marks orders as canceled in the Exchange contract on-chain.

cancelOrder(Order order)
cancelOrders(Order[] orders)

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”

Converts collateral into a complete set of conditional outcome tokens.

POST /ctf/split

Recombines a full set of outcome tokens back into collateral.

POST /ctf/merge

After resolution, exchanges winning outcome tokens for collateral at face value.

POST /ctf/redeem

Transforms No positions into Yes positions across other outcomes within a NegRisk market.

convertPositions(bytes32 marketId, uint256 indexSet, uint256 amount)
  • marketId — The NegRisk market identifier
  • indexSet — Bitmask of outcome indices (e.g., 1 = outcome 0, 2 = outcome 1)
  • amount — Number of tokens to convert

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;
}
ContractAddress
CTF Exchange0xA642f9165D192Ff13b1D43a0Ef56B3BD074614bB
NegRisk CTF Exchange0x700eaF3f3FEb1D3f2aE67000e1A4FA41a6E35DF1
CTF ERC11550x4D97DCd97eC945f40cF65F87097ACe5EA0476045
NegRisk Adapter0x0d8FA66CFe5D5EF96D6be9C4e808BD4279527d6e
USDC.e0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174