Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/components/scenes/RampCreateScene.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,12 @@ export const RampCreateScene: React.FC<Props> = (props: Props) => {
if (fiatUsdRate == null) return
let abort = false
const applyInitial = async (): Promise<void> => {
if (abort) return
if (abort || direction !== 'buy') return
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we adding this constraint? Why not have this default amount for sell too?

Copy link
Collaborator Author

@Jon-edge Jon-edge Oct 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes no UX sense. The amount is completely dependent on your balance and what you choose to sell. The buy flow's $500 default is an effort to improve our revenue.

Also, it was the task's ask and pretty sure aligns with our legacy behavior.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the fix is:

const maxSpendExchangeAmount = await getMaxSpendExchangeAmount(
  selectedWallet,
  selectedCrypto.tokenId,
  denomination
)
      
setExchangeAmount({ amount: Math.min(initialFiat, maxSpendExchangeAmount) })

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// Don't override if the user has started typing or fiat input is disabled
if (
hasAppliedInitialAmount.current ||
amountTypeSupport.onlyCrypto ||
'empty' in exchangeAmount ||
!('empty' in exchangeAmount) ||
lastUsedInput != null ||
shouldShowRegionSelect
) {
Expand Down Expand Up @@ -287,7 +287,8 @@ export const RampCreateScene: React.FC<Props> = (props: Props) => {
selectedFiatCurrencyCode,
shouldShowRegionSelect,
fiatUsdRate,
exchangeAmount
exchangeAmount,
direction
])

// Create rampQuoteRequest based on current form state
Expand Down
Loading