Skip to content

[Feat]: add ETH → WETH auto-wrap in buy flow for WETH-based prediction pools #74

Description

@kushbosamiya

Feature and its Use Cases

Problem

All active prediction pools on Fate EVM use WETH as the base token.
Users who hold only native ETH hit a hard dead-end when they try to buy
Bull or Bear tokens:

"Insufficient balance. You have 0 base tokens available."

The app provides no in-product path to resolve this. The current
team-documented workaround (ref: Discord #fate-evm, 3 Mar 2026) is to
direct users to an external Etherscan writeContract page to manually
call WETH.deposit() before returning to the app.

This is a significant UX gap — a first-time user interacting with any
active pool on Sepolia will hit this error with no actionable guidance.


Current Flow vs Proposed Flow

Current buy flow (broken path for ETH-only wallets)

flowchart TD
    A([User opens pool page]) --> B[Enters buy amount]
    B --> C{WETH balance >= amount?}
    C -- YES --> D[Check allowance]
    C -- NO --> E[Error toast\nInsufficient balance]
    E --> F[ User sent to external Etherscan page]
    F --> G[Manually calls WETH.deposit on Etherscan]
    G --> H[Returns to app and retries]
    D --> I{Allowance >= amount?}
    I -- YES --> J[ buy tx submitted]
    I -- NO --> K[approve tx]
    K --> J

    style E fill:#ef4444,color:#fff
    style F fill:#f97316,color:#fff
    style G fill:#f97316,color:#fff
Loading

Proposed buy flow (ETH toggle in-product)

flowchart TD
    A([User opens pool page]) --> B[Enter buy amount]

    B --> C{Pool uses WETH as base token?}

    C -- No --> D[Normal ERC20 buy flow]

    C -- Yes --> E[Show payment toggle<br/>WETH or ETH]

    E --> F{User selects payment source}

    F -- WETH --> G{WETH balance >= amount?}
    G -- Yes --> L[Check allowance]
    G -- No --> M[Insufficient WETH<br/>Show ETH balance hint]

    F -- ETH --> H{ETH balance >= amount?}
    H -- No --> N[Insufficient ETH]

    H -- Yes --> I[Step 1: Wrap ETH to WETH<br/>WETH.deposit]

    I --> I2{Wrap tx confirmed?}

    I2 -- No --> O[Wrap failed<br/>Rollback UI]
    I2 -- Yes --> J[Step 2: Approve WETH]

    L --> P{Allowance >= amount?}
    J --> P

    P -- No --> J
    P -- Yes --> Q[Step 3: Buy tokens]

    Q --> R{Buy tx confirmed?}

    R -- Yes --> S[Tokens received<br/>Refresh pool state]
    R -- No --> T[Buy failed<br/>Show error toast]

    style I fill:#3b82f6,color:#fff
    style J fill:#8b5cf6,color:#fff
    style Q fill:#10b981,color:#fff
    style S fill:#10b981,color:#fff
    style O fill:#ef4444,color:#fff
    style N fill:#ef4444,color:#fff
    style T fill:#ef4444,color:#fff
Loading

Additional Context

No response

Code of Conduct

  • I have joined the Discord server and will post updates there
  • I have searched existing issues to avoid duplicates

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions