Repository navigation
feat: add direct mUSD fiat injection flow for Money Account deposits - #9080
Merged
Merged
Conversation
OGPoyraz
added a commit
that referenced
this pull request
Jun 10, 2026
OGPoyraz
force-pushed
the
feat/direct-musd-fiat-for-money-account
branch
from
June 10, 2026 12:21
d97ba76 to
4f1e16f
Compare
OGPoyraz
added a commit
that referenced
this pull request
Jun 10, 2026
OGPoyraz
force-pushed
the
feat/direct-musd-fiat-for-money-account
branch
from
June 10, 2026 12:22
4f1e16f to
436fbe7
Compare
OGPoyraz
added a commit
that referenced
this pull request
Jun 10, 2026
OGPoyraz
force-pushed
the
feat/direct-musd-fiat-for-money-account
branch
from
June 10, 2026 12:48
436fbe7 to
f19439b
Compare
OGPoyraz
force-pushed
the
feat/direct-musd-fiat-for-money-account
branch
from
June 10, 2026 12:57
f19439b to
79ef620
Compare
matthewwalsh0
self-requested a review
June 10, 2026 16:34
matthewwalsh0
requested changes
Jun 11, 2026
matthewwalsh0
requested changes
Jun 11, 2026
… QuoteRequest, flag rename, gas overhead and fallback fixes
OGPoyraz
commented
Jun 12, 2026
matthewwalsh0
approved these changes
Jun 12, 2026
| relayRequestOverrides?: Partial<QuoteRequest>; | ||
| }; | ||
|
|
||
| async function executeFiatQuotePipeline( |
|
|
||
| const relayTotalFeeUsd = gasDeductedFromSource | ||
| ? getRelayTotalFeeUsd(relayQuote) | ||
| : getNonGasRelayFeeUsd(relayQuote); |
Member
There was a problem hiding this comment.
Minor, if we're using our gas station for the relay quote, won't the user still need to cover the source network cost as it's calculated from the gas fee token so includes the original gas fee plus commission but it will be paid via additional input token?
Similarly, if a native token, there could still be a source network cost?
Do we add this back somewhere else?
Member
Author
There was a problem hiding this comment.
As this is for mUSD flow and Monad transactions are paid by us, this was increasing the total ramps quote unnecessarily, but again as this is just for quoting it's safe for now, I will revisit in case if we need presented fee fixes.
This was referenced Jun 12, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
This PR adds an alternative fiat deposit flow for Money Account behind the
useFiatMUSDQuoteToInjectForMoneyAccountfeature flag (confirmations_pay_fiat).Current flow: Fiat provider buys ETH on Mainnet → Relay bridges ETH to Monad, swaps to mUSD, and vaults into the boring vault.
New flow (flag ON + probe succeeds): Fiat provider buys mUSD directly on Monad → delivers to the Money Account address → Relay only vaults (approve + deposit) on the same chain. No bridging or swapping needed.
New flow (flag ON + probe fails): Falls back silently to the current ETH flow.
Key changes
New file:
fiat-direct-musd-quotes-for-money-account.tsprobeMusdFiatAvailability— lightweight probe that verifies at least one fiat provider can sell mUSD on Monad before committing to the direct pathgetDirectMusdToMoneyAccountQuotes— quote function that usesMUSD_MONAD_FIAT_ASSETas the fiat asset and delivers to the Money Account address (txParams.from) instead of the user's EVM accountModified files:
FiatStrategy.ts— routes to the new quote function when flag is ON + transaction ismoneyAccountDeposit, with fallback togetFiatQuotesif the probe fails or returns emptyfiat-submit.ts— detects the direct-mUSD path at submit time by inspecting the stored quote's source chain/token (immune to flag changes between quote and submit), overrideswalletAddressandfiatAssetaccordinglyTransactionPayController.ts— removes eagercaipAssetIdassignment from theshouldUpdateFiatTokenblock;caipAssetIdis now set by whichever quote function succeeds, eliminating a race condition between the controller's synchronous write and the async quote phasefiat-quotes.ts— exports shared helpers (getRampsQuote,buildRelayRequestFromAmountFiat,combineQuotes,getRelayTotalFeeUsd,getRequiredTokens) for reuse, addscaipAssetIdto theupdateFiatPaymentcallutils.ts— exportsresolveTransactionType, addsisMoneyAccountDepositTransactionfeature-flags.ts— addsuseFiatMUSDQuoteToInjectForMoneyAccounttoFiatFlagstype + getterconstants.ts— addsCHAIN_ID_MONAD,MUSD_MONAD_ADDRESS,MUSD_MONAD_FIAT_ASSET,MUSD_PROBE_AMOUNT_USDDesign decisions
getFiatQuotescaipAssetIdwriter: MovingcaipAssetIdfrom the controller to the quote functions eliminates a race condition and ensures it always matches the actual quote returnedReferences
Plans/transak-musd-inject-money-account.mdChecklist
Note
Medium Risk
Changes fiat quote/submit and relay recipient behavior on Money Account deposit paths; mitigated by feature flag, provider probe, and fallback to the legacy ETH flow.
Overview
Adds an optional direct mUSD fiat deposit path for Money Account deposits when
confirmations_pay_fiat.directMoneyMusdEnabledis on: probes ramps for mUSD on Monad, then quotes/submits with mUSD delivered to the Money Account (txParams.from) and relay overrides (recipient,paymentOverride: moneyAccount), skipping the ETH→bridge→mUSD path. Probe failure or empty direct quotes fall back to the existing fiat+relay flow.fiatPayment.caipAssetIdis no longer set on payment-method change inTransactionPayController; successful quote paths now setcaipAssetIdandrampsQuotetogether ingetFiatQuotes. Submit detects the direct route from the stored quote’s mUSD-on-Monad source (not the flag) for wallet address, asset validation, and order polling.Relay quotes accept an optional
recipient; fiat fee adjustment can exclude source-network gas when the source token is not native gas. New Monad/mUSD constants,isMoneyAccountDepositTransaction, and expanded tests for standard and direct flows.Reviewed by Cursor Bugbot for commit cade68a. Bugbot is set up for automated code reviews on this repo. Configure here.