Skip to content

Contracts ​

All contracts are on Polygon (chain ID 137).

ContractAddress
Peerkets escrow (PredexEscrowV3)Final deployment pending. Test deployment: 0xaBE8c3A4263d440757e11AB57dbb0Cb53aF921c4
pUSD0xC011a7E12a19f7B1f670d46F03B03f3342E82DFB
Conditional Tokens (older markets)0x4D97DCd97eC945f40cF65F87097ACe5EA0476045
PositionManager (Protocol V2 markets)0x006F54F7f9A22e0000CC2AB60031000000ae9fEF

Units ​

Shares and pUSD both use 6 decimals. price is pUSD units per 1e6 share units, so 62¢ is 620000. The cost of shares at price is shares * price / 1e6, rounded down.

Functions ​

FunctionWhoWhat
createOrder(ledger, tokenId, side, price, shares, expiry, taker)makerOpens an order. side 0 = maker buys, 1 = maker sells. taker = zero address for anyone.
fill(orderId, shares)takerFills part or all of an order.
cancel(orderId)makerCloses the order and returns the unfilled part.
reclaimExpired(orderId)anyoneAfter expiry, returns the unfilled part to the maker.
getOrder(orderId)viewMaker, taker, ledger, side, status, expiry, tokenId, price, shares, filled, pusdLeft.

Funds are pushed in, not pulled: createOrder and fill succeed only if the escrow's balance already covers what it tracks plus the new amount. Always send the transfer and the call in the same transaction (one Deposit Wallet batch) — untracked funds can be used by whoever calls next.

ActionBatch
Post a sellledger.safeTransferFrom(wallet → escrow, tokenId, shares) + createOrder(…, side 1, …)
Post a buypUSD.transfer(escrow, cost) + createOrder(…, side 0, …)
Fill a sell orderpUSD.transfer(escrow, cost) + fill(orderId, shares)
Fill a buy orderledger.safeTransferFrom(wallet → escrow, tokenId, shares) + fill(orderId, shares)

Events ​

solidity
event OrderCreated(uint256 indexed orderId, address indexed maker, address taker, address ledger,
    uint256 tokenId, uint8 side, uint256 price, uint256 shares, uint48 expiry);
event OrderFilled(uint256 indexed orderId, address indexed taker, uint256 shares, uint256 pusd);
event OrderClosed(uint256 indexed orderId, uint8 status, uint256 sharesReturned, uint256 pusdReturned);

OrderClosed.status: 2 = filled, 3 = cancelled (cancel or reclaim).

Peerkets is in beta and is not affiliated with Polymarket. Not available to U.S. persons or in restricted regions.