-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Swaps completing on-chain before swapper detects completion #8534
Labels
Comments
|
This comment was marked as spam.
This comment was marked as spam.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Overview
See #8518 (comment) for more context. Authoring this as a bug as it looks like that from a user perspective, though really is a feature, TBD with @shapeshift/product during grooming.
THOR, LI.Fi, and Chainflip Txs complete on-chain (sometimes much, much) before the swap is marked as complete. This PR is to fix this by detecting outbound Tx and marking the swap as complete:
CoW may also be affected, though most likely isn't, see its
checkTradeStatus
implementation.By "complete on-chain", we mean Tx is seen in Tx history (potentially with 0 confirmations for UTXOs, which is fine as we update UTXO balances optimistically)
0x, Portals, and Arbitrum Bridge currently use
checkEvmSwapStatus
(i.e detects a given Tx is confirmed on-chain) to detect completion:https://github.com/search?q=repo%3Ashapeshift%2Fweb%20checkEvmSwapStatus&type=code
Jupiter rely on the exact same logic for Solana:
web/packages/swapper/src/swappers/JupiterSwapper/endpoints.ts
Line 98 in d690560
On the other hand, CoW, THOR, Li.Fi, and Chainflip rely on APIs for completion detection:
web/packages/swapper/src/swappers/CowSwapper/endpoints.ts
Lines 175 to 181 in d690560
web/packages/swapper/src/swappers/ThorchainSwapper/endpoints.ts
Lines 630 to 637 in d690560
web/packages/swapper/src/swappers/LifiSwapper/endpoints.ts
Lines 274 to 284 in d690560
web/packages/swapper/src/swappers/ChainflipSwapper/endpoints.ts
Lines 292 to 294 in d690560
The thing is, APIs may take much longer for things to detect things as complete (e.g Li.Fi), vs. us detecting seen Tx.
References and additional details
See description
Acceptance Criteria
checkTradeStatus
(which works on a hop/hash-based basis) i.echeckTradeStatus
should be returningTxStatus.Confirmed
as soon as we know of the buy TxidNeed By Date
No response
Screenshots/Mockups
No response
Estimated effort
No response
The text was updated successfully, but these errors were encountered: