Closed benefacto closed 7 months ago
1+2 The methods and sdk I wrote are working and tested.
Regarding Testing scenarios and report first I expect a finished product that has been minimally tested by the developer. For example if a supportAndSwap flow exists the developer that does it should at least try a real swap and not just assume the code is correct. The same goes for testing all data that should be read from subgraph, blockchain or elsewhere, that should first be verified as working by the developer. @Joshua-Jack is supposed to know what has been done or not been done, I don't understand why we need to produce a report at this point in time on what's not meeting the requirements.
Once a feature is working if it doesnt have a ticket then you should create one and then assign it to @vldkhh for testing.
Hi @sirpy , thank you for your recent clarification regarding the methods and SDK, as well as the guidance on utilizing the Uniswap SDK for the swap path. This is incredibly helpful as I navigate the existing framework.
I understand and acknowledge the expectation of delivering a minimally tested product. I will ensure thorough testing of the features from my end, and I'm currently reviewing the error handling approach to ensure it aligns with best practices. I’ll provide detailed examples and code references for further review once this is in place.
I'd like to bring to your attention that I'm stepping into this project at a stage where the budget is nearly exhausted, which limits the extent of the work I can undertake. Coupled with the limited context and handover, and the reduced availability of Josh for clarification, this has posed significant challenges. However, I am committed to making the most of the resources at hand and pushing the project forward as efficiently as possible.
I greatly appreciate your and the GoodDollar team's support during this transition. Once I have a functional version ready, I'll create tickets for comprehensive testing and verification.
Thanks again for your understanding and assistance. Your input is crucial in helping me to adapt quickly and contribute effectively under these circumstances.
@benefacto regarding uniswap
approve
the input token.@benefacto regarding uniswap
- the path generating code you shared doesnt seem to include the pool fee.
- remember that in the swap flow user has to first
approve
the input token.
Thanks for the callouts! I fleshed out the examples a bit more so that this issue should not sufficiently describe the implementation path at this point. Do continue to let me know if you notice any gaps though.
Hi @benefacto !
The approach described for implementing token swaps isn't ideal because it doesn't factor in the need to find the most efficient route given a set of pools. That's actually not a trivial problem.
I recommend using an API-based solution instead, like https://1inch.io/api/
It's easier and will provide better swap prices for app users
The approach described for implementing token swaps isn't ideal because it doesn't factor in the need to find the most efficient route given a set of pools. That's actually not a trivial problem.
I recommend using an API-based solution instead, like https://1inch.io/api/
It's easier and will provide better swap prices for app users
We use uniswapv3 on celo specifically, if 1inch api works then fine, other wise the uniswapv3 sdk should be good enough
The approach described for implementing token swaps isn't ideal because it doesn't factor in the need to find the most efficient route given a set of pools. That's actually not a trivial problem. I recommend using an API-based solution instead, like https://1inch.io/api/ It's easier and will provide better swap prices for app users
We use uniswapv3 on celo specifically, if 1inch api works then fine, other wise the uniswapv3 sdk should be good enough
You're right, 1inch doesn't support CELO.
To use uniswapv3 sdk in this manner, I will need to identify and whitelist a set of pools that will provide the swap routes we want to support. We can support swapping a limited set of tokens to G$, preferably only those that share a pool with it.
I don't know how far along this feature already is. I'm not suggesting we need to redo anything that is already completed.
@krisbitney Can you point to the docs? I believe there's an official celo token list, used by ubeswap, we can use that list. Just tokens that share a pool isn't a solution as there's basically just 1 main pool cusd/G$
@krisbitney Can you point to the docs? I believe there's an official celo token list, used by ubeswap, we can use that list. Just tokens that share a pool isn't a solution as there's basically just 1 main pool cusd/G$
Nevermind, you're right. There is a solution to this. https://docs.uniswap.org/sdk/v3/guides/swaps/routing
I translated the uniswap v2 and v3 SDKs to AssemblyScript before and refactored a lot of the Uniswap v2 and v3 front ends to use a async wasm module versions of the SDKs. That was more than a year ago, and the smart order router wasn't yet an available solution, so things worked differently.
@krisbitney status of this?
@krisbitney status of this?
Completed
@decentralauren @patpedrosa was it decided that for now we only accept G$'s donation?
@krisbitney or there is a bug as for me only the G$ token shows up in the currency list
@decentralauren @patpedrosa was it decided that for now we only accept G$'s donation?
@krisbitney or there is a bug as for me only the G$ token shows up in the currency list
I'm not aware of a bug. It was working last I saw. But one-time donations are only in G$.
One-time donations can be made in any currency. The only difference between the flows is that one-time donations are not done with Superfluid.
@krisbitney @patpedrosa
So to be super clear: On time payments > any token Streaming > only gooddollar
Is that right?
If yes then @krisbitney the token list is applied to wrong type of paymemt
One-time donations can be made in any currency. The only difference between the flows is that one-time donations are not done with Superfluid.
@sirpy @L03TJ3 This is not supported in the GoodCollective SDK. Is it the case that it is supported in the smart contract but the SDK is incomplete?
@krisbitney @patpedrosa
So to be super clear: On time payments > any token Streaming > only gooddollar
Is that right?
If yes then @krisbitney the token list is applied to wrong type of paymemt
In the GoodCollective SDK, only the method supportFlowWithSwap
supports swaps. The others do not.
@sirpy @patpedrosa need clarification on how this should (have) been implemented
supportflowwithswap supports swapping tokens to G$ and then streaming the G$s @L03TJ3
Okay. And for single donations? @sirpy
@decentralauren @patpedrosa @L03TJ3 Firstly I would discourage single donations. And make recurrent donations the default. If we must we can probably add swap and donate single
@sirpy ok. We'll put a new ticket in the backlog for this to address later.
Business Description
This issue aims to refine and expand the cryptocurrency donation process in our application, making it more flexible, user-friendly, and secure.
Here's an overview of what will be accomplished:
Streamlined Token Swapping: We're simplifying the process of swapping various cryptocurrencies (like WBTC, cUSD, CELO) into G$ tokens. This will make it easier for users to donate using their preferred cryptocurrency.
Efficient Path Calculation for Swaps: Our system will intelligently calculate the most efficient path for each currency swap, ensuring cost-effectiveness and speed in transactions.
Seamless Integration with Superfluid Donation Flow: We're enhancing our application to dynamically handle different swap paths. This allows for a more versatile and adaptable donation flow, accommodating various types of cryptocurrencies.
User-Friendly Frontend Experience: The frontend of the application will be updated to support these new features, making it intuitive for users to make donations with different cryptocurrencies.
Compliance and Collaboration: Our team will ensure that the implementation aligns with the project requirements and standards. Regular communication and collaboration within the team are key aspects of this process.
In summary, these enhancements will significantly improve the way users can donate using cryptocurrencies, making the process more versatile, user-friendly, and secure.
Technical Implementation
1. Approve Swap
2. Fetch and Calculate Swap Path:
Pool
object that can be used for calculating theswapPath
.const route = new Route([pool], token1, token2); const swapPath = encodeRouteToPath(route);