-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[Bug]: Predict with any token uses incorrect quote when placing bet #28413
Copy link
Copy link
Labels
needs-triageIssue needs to be triagedIssue needs to be triagedregression-prod-7.73.0Regression bug that was found in production in release 7.73.0Regression bug that was found in production in release 7.73.0release-7.74.0Issue or pull request that will be included in release 7.74.0Issue or pull request that will be included in release 7.74.0type-bugSomething isn't workingSomething isn't working
Metadata
Metadata
Assignees
Labels
needs-triageIssue needs to be triagedIssue needs to be triagedregression-prod-7.73.0Regression bug that was found in production in release 7.73.0Regression bug that was found in production in release 7.73.0release-7.74.0Issue or pull request that will be included in release 7.74.0Issue or pull request that will be included in release 7.74.0type-bugSomething isn't workingSomething isn't working
Type
Fields
Give feedbackNo fields configured for Bug.
Projects
StatusShow more project fields
To be triaged
Describe the bug
When placing a bet on Predict using the "Pay with Any Token" flow, the deposit amount sent to the quote is calculated before the order preview fees have fully loaded. This causes the system to request a swap quote for only the raw bet amount (e.g. $1.00) instead of the correct total that includes preview fees (e.g. $1.04 = $1.00 bet + $0.04 in provider/MetaMask fees).
This means the user could end up swapping fewer tokens than actually needed to cover the full bet + fees, potentially causing the deposit transaction to underperform or fail silently on the protocol side.
Expected behavior
The deposit amount should only be calculated and forwarded to the quote engine after the order preview (including fees) has fully loaded. The total amount passed to the "Pay with Any Token" swap quote should be:
depositAmount = betAmount + providerFee + metamaskFee - predictBalance (rounded up to 2 decimal places)
For example, for a $1.00 bet with $0.03 provider fee and $0.01 MetaMask fee, and $0.00 predict balance, the deposit amount should be $1.04, not $1.00.
Screenshots/Recordings
No response
Steps to reproduce
Error messages or log output
Where was this bug found?
Live version (from official store)
Version
7.73.0
Build number
4275
Build type
None
Device
Iphone 16
Operating system
iOS
Additional context
No response
Severity
No response