Skip to content

feat(request): Tempo DEX funding from OUSD (stack 4/6) - #277

Draft
brendanjryan wants to merge 1 commit into
brendan/machine-fetch-3-planfrom
brendan/machine-fetch-4-tempo-dex
Draft

brendanjryan wants to merge 1 commit into
brendan/machine-fetch-3-planfrom
brendan/machine-fetch-4-tempo-dex

Conversation

@brendanjryan

@brendanjryan brendanjryan commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

4/6 — Phase 2. Pays a Tempo charge in a USD token the wallet lacks by buying it on the Tempo DEX from OUSD, USDC.e, or pathUSD in the same transaction (machine-fetch tempoDex + Mppx auto-swap, fallback: false so the inputs are an allowlist — mppx-1). --funding auto|tempo|off, TEMPO_FUNDING, config funding, and --max-slippage-bps. Refuses before signing a swap the access key's limit can't cover (keys update cta) or nothing held can cover (fund cta). Receipts and --dry-run report the swap. e2e: pays from OUSD through an unpublished access key (needs mppx-3).

Paired PRs

wallet-cli vendors machine-fetch main @ d168943 (0.3.0) and mppx brendan/wallet-cli-needs @ 8295134 (mppx@0.12.0 + the commits merged upstream as 82810df and 0acc2bc), pinned by commit until we choose to upgrade.

A Tempo charge in a listed USD token the wallet does not hold now buys it on
the Tempo DEX in the same transaction, through machine-fetch's tempoDex and
Mppx auto-swap, from OUSD, then USDC.e, then pathUSD, with slippage from
--max-slippage-bps (default 50). The funder reads the balance first: a wallet
that holds the token gets an available receipt and no swap, and one whose
balance cannot be read pays as before.

Before signing it refuses a swap the access key's stored limit cannot cover
(E_LIMIT_EXCEEDED with the keys update cta) or no configured input can cover
(E_INSUFFICIENT_FUNDS with the fund cta), since Mppx appends its own inputs.
MACH settlement never swaps. --funding auto|tempo|off, TEMPO_FUNDING, and the
funding config setting choose the mode; auto behaves as tempo until
cross-chain funding lands.

The receipt and --write-meta name the swap's input and maximum, and --dry-run
reports the funder when the balance is short. The e2e harness pays an MPP
charge in USDC from OUSD on the local chain.
@brendanjryan
brendanjryan force-pushed the brendan/machine-fetch-4-tempo-dex branch from 8fa3fe0 to f181bbd Compare October 19, 2026 21:48
@brendanjryan
brendanjryan force-pushed the brendan/machine-fetch-3-plan branch from e32c441 to 4a56d7b Compare October 19, 2026 21:48
brendanjryan added a commit that referenced this pull request Oct 20, 2026
The Tempo DEX funder took the first input the wallet held enough of, and only
checked the access key's limit for it when the store recorded one. A key whose
limits list leaves a token out cannot spend it on chain, so a wallet holding
only pathUSD under a key limited to OUSD and USDC.e signed a swap the chain
refused, reported against the payment token instead of pathUSD.

The funder now skips inputs the key may not spend: the stored limit when the
store has one, else the chain's (the remaining limit of a published limited
key, and zero for a token an unpublished key's signed limits leave out). When
no spendable input is held it refuses before signing and names the token, and
the swap's inputs are pinned to the chosen one so Mppx cannot pick another.
Fixes Phase 2 behavior (#277); found by the live mainnet run.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant