Skip to content

Feature: "build only" mode — return unsigned transaction without submitting #53

@realfishsam

Description

@realfishsam

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:

  1. Our API calls PMXT to find the best-priced exchange and build the trade calldata
  2. The raw calldata is returned to the user's frontend
  3. The user signs one transaction that hits our on-chain router
  4. 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 sign

Why 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.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions