Skip to content

[Bug]: Predict buy-with-any-token deposit flow does not fire SUBMITTED analytics event #28473

@caieu

Description

@caieu

Describe the bug

When a user places a buy order using the pay-with-any-token flow, the PREDICT_TRADE_TRANSACTION analytics event with status: submitted is never fired for the deposit transition (PAY_WITH_ANY_TOKEN → DEPOSITING). The direct balance flow correctly fires this event, but the deposit path returns early before reaching the existing tracking call, leaving a gap in the analytics funnel.

Expected behavior

The deposit flow should fire a PREDICT_TRADE_TRANSACTION event with status: submitted when transitioning to DEPOSITING state, matching the behavior of the direct order path. The event should also include the predict_token_address property identifying which external token the user selected for payment.

Screenshots/Recordings

No response

Steps to reproduce

  1. Enable the predictWithAnyToken feature flag
  2. Open the Predict buy screen for any market
  3. Select an external payment token (e.g. MATIC, USDC on Polygon)
  4. Enter a bet amount and tap Confirm
  5. Observe that no PREDICT_TRADE_TRANSACTION event with status: submitted is fired when the order transitions to DEPOSITING state

Error messages or log output

No error — the event is silently skipped because `placeOrder()` returns early
at the deposit path (PredictController.ts, PAY_WITH_ANY_TOKEN branch)
before reaching the existing trackPredictOrderEvent() call.

Where was this bug found?

Internal release testing

Version

7.73.0

Build number

4275

Build type

None

Device

Iphone simulator

Operating system

iOS

Additional context

No response

Severity

The root cause is in PredictController.placeOrder(). When the active order state is PAY_WITH_ANY_TOKEN, the method transitions to DEPOSITING and returns early (line ~940-985) before the trackPredictOrderEvent({ status: SUBMITTED }) call at line ~1033 which only fires for the direct order path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageIssue needs to be triagedregression-RC-7.73.0Regression bug that was found in release candidate (RC) for release 7.73.0release-7.74.0Issue or pull request that will be included in release 7.74.0type-bugSomething isn't working

    Type

    No fields configured for Bug.

    Projects

    Status

    To be triaged

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions