Skip to main content
Embedded mode is built on a clear separation of trust: the user authorises only what they intend to swap, nexroute supplies opaque backrun calldata, and at no point can either party take funds the other has not authorised.

Permit2 trust scope

The user signs a Permit2 typed-data message that specifies:
  • input token
  • maximum amount
  • spender (the wrapper the partner deploys, or the partner’s router for the composition shape)
  • deadline
  • nonce
Nothing the wrapper or the partner router does, including running nexroute’s backrun calldata, can pull more than the permit grants. A new permit and signature are required for every transaction; Permit2 marks the nonce as used on first transfer, so the same signature cannot be replayed.

Backrun calldata trust

nexroute’s backrun runs after the user’s swap, on nexroute’s own capital. The user never approves nexroute’s backrun contract or signs a permit for it, so a malicious or buggy backrun can affect only nexroute’s own funds. The user’s funds are out of reach. You control the call boundary in both shapes: call the backrun after the swap, and send the swap’s output to the user (receiver = user) rather than leaving it in the contract that makes the call.

Aggregator calldata trust

The aggregator swap calldata is built by the partner, not by nexroute. The user reviews the swap intent in their wallet (token, amount, deadline) before signing the Permit2 message. The partner is responsible for:
  • using a trusted aggregator
  • setting receiver = user so output tokens go to the end user
  • including a sane minAmountOut
Embedded mode does not interpose on these decisions. They are partner-side correctness concerns.

Failure semantics

The user transaction never partially commits. Either the user’s swap goes through (with or without a successful backrun), or the entire transaction reverts and the user loses only gas.

Privacy

Embedded mode does not, on its own, provide privacy. A transaction submitted to the public mempool can be observed by searchers, builders, and validators, who may extract the embedded MEV by copying the backrun calldata into a higher-priority transaction or by reordering the block. To prevent this, submit the constructed transaction through a private relay (Flashbots, MEV-Share, builder relays) instead of the public mempool.

Network

  • Per-partner IP allowlist enforced at the network layer for the backrun API
  • HTTPS for all endpoints
  • TLS termination at the endpoint; in-flight encryption end-to-end from partner to nexroute