-
Notifications
You must be signed in to change notification settings - Fork 7
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
Handle Swap Orders in On-Ramp Experience #7
Comments
Then we make an escrow contract and pay for failures. I expect them to be rare. @rndquu rfc |
It depends on input asset's liquidity. |
We can whitelist mainstream assets if its a problem |
I don't think it will be, I can work around it with their API. And also part of what I was saying in main issue is that this other "parts" should be built to never fail. I hope there isn't a need for a escrow contract but at the end of the day it's a private key doing those tasks at the back, we can just hop in and manually compensate in the extremely unlucky scenario of a fail. |
Can't the transaction be made to be atomic? It seems conceptually possible. If it fails just revert everything. We might even be able to make use of permits for redeeming from escrow. Basically if our system detects a failure we can send a permit for the user to withdraw and try again. We just need to make sure that the escrow is regularly cleared out because it seems like a shaky part of the system regarding attack vectors. |
Problem is we are on mainnet, gas is expensive, we will just lose a lot of funds. I think retrying the swaps in the unlikely scenario a quote is not met is the best approach.
This is a good idea. I also think that if we have a very precise fees and quoting mechanism we can allow users to receive from some UUSD already in Gnosis and then use their submited funds to cover it. Then we could have a instantaneous UUSD feature for an extra fee. |
I like the idea of better UX but this also means that we are assuming risk. Anyways, if we are getting paid for it then I think its worth a shot. We might just need to set limits for safety reasons i.e. instant transfer up to 10k UUSD a day etc. |
Yes that makes sense, I think we can try it out post MVP. |
|
Super cool, thank you very much. |
In developing the UUSD on-ramp experience to Gnosis we must handle swapping from any available token in CoW Swap to LUSD and UBQ. The suggested approach in #4 is just bundling swap, mint and bridge into a multicall. However that's not viable since CoW Swap operates in an asynchronous way, you don't get your tokens as soon as you send a swap transaction, a relayer has to send your order to solvers and then it settles which can take up to minutes. This also means that we must track potentially multiple orders at the same time in our backend without mixing, which needs extra care. Another super delicate case is order expiration: what if CoW Swap fails to resolve the swap in sufficient time? The solution should return funds in that case and should warn possible failure based on pool liquidity even before the user submits a transaction.
The text was updated successfully, but these errors were encountered: