-
-
Notifications
You must be signed in to change notification settings - Fork 106
Description
Summary
Add a way to get a fully-encoded, unsigned transaction payload from PMXT without it being submitted to the network. This would let integrators sign and broadcast the transaction themselves (or route it through an on-chain middleware contract).
Use case
We're building a Smart Order Router (SOR) that wraps prediction market trades in a non-custodial fee-collection contract. The flow looks like this:
- Our API calls PMXT to find the best-priced exchange and build the trade calldata
- The raw calldata is returned to the user's frontend
- The user signs one transaction that hits our on-chain router
- The router takes a 1% fee, then forwards the remaining funds + calldata to the winning exchange
For this to work, we need PMXT to return the encoded exchange calldata (unsigned tx or inner calldata bytes) rather than executing the trade itself.
Proposed API (rough sketch)
const tx = await client.buildOrder({
exchange: 'polymarket',
marketId: '...',
outcome: 'YES',
amount: 9_900_000, // USDC base units
side: 'BUY'
});
// tx.to, tx.data, tx.value — ready to forward or signWhy this matters
Without this, PMXT can only be used in custodial flows where the server holds signing keys. A "build only" mode unlocks non-custodial integrations, on-chain fee middleware, and wallet-based dApps.