Hello everyone, is there any way to interact with deposit/withdraw functions of a DEX or a yield aggregator using Solidity? I'm new to these things, I'm a C#/C++ Dev, I was expecting to find some APIs on those platforms' github.
May 30, 2021, 3:14 AM
You can create on telos blockchain if you know c/c++
May 30, 2021, 6:02 AM
Problem half-solved. I need to use Solidity, I found the right yield aggregator, but I need the DEX now. Curve isn't built with Solidity, then I tried with UniswapV3 but it doesn't have docs for V3, then I tried with UniswapV2 but I'd have lost too much for the swap, then I tried 1inch but it doesn't have a router afaik.
May 30, 2021, 6:06 AM
You can interact with other contracts, yep.
May 30, 2021, 8:31 AM
I'm trying to swap using UniSwapV3 Router, but I'm wasting time cause Openzeppelin sucks.
May 30, 2021, 8:32 AM
???
OpenZeppelin is awesome dude.
I use it on daily basis.
May 30, 2021, 8:36 AM
The github repo sucks. I'm dealing with Solidity 0.6.6 and all deps don't work. I'm remaking all of them on my repo, using the 0.6.0.
May 30, 2021, 8:37 AM
What's the issue with v2 router?
May 30, 2021, 8:37 AM
The issue with v2 router is that I can't swap without losing 50%
On v3 router I can swap and lose only 0.225% or something like that.
May 30, 2021, 8:38 AM
Why that specific version?
May 30, 2021, 8:38 AM
Aave's flash loan works on 0.6.6 according to the guide.
May 30, 2021, 8:39 AM
Umm losing what exactly?😅 Fees?
May 30, 2021, 8:41 AM
Example: I need to swap a stable coin for a stable coin, the amount to swap is 1mln. When I make the swap, the amount is not 1mln, but 400k. That's a huge difference.
On v3 if I swap 1mln, I get 1mln.
May 30, 2021, 8:43 AM
Aah the lower liquidity. Yeah I think most of them migrated to v3 liquidity pool
Maybe try sushis router then?
May 30, 2021, 8:44 AM
It gives me 200k
Anyway, I got 20 error like these. That's not my fault obviously. How can I compile a contract that need dependences that don't find their dependences? That's a nightmare.
May 30, 2021, 8:49 AM
That's wierd. Just tried usdc usdt and for 1 mil I get 980k
May 30, 2021, 8:49 AM
And USDT -> USDC?
May 30, 2021, 8:50 AM
982k
May 30, 2021, 8:51 AM
Mine was an example. I got a flash loan of 10mln+.
May 30, 2021, 8:51 AM
Well I'm using frontend
May 30, 2021, 8:51 AM
Try to swap 10mln+, you'll lose at least 15%.
May 30, 2021, 8:51 AM
You can't expect that much liquidity other than uniswap tbh🙃
May 30, 2021, 8:53 AM
1inch
I'm not sure how to deal with it tbh
May 30, 2021, 8:56 AM
1inch is not a dex, its an aggregator of dex
May 30, 2021, 9:01 AM
Ah
May 30, 2021, 9:01 AM
Swaps through different dexes at the same time
May 30, 2021, 9:01 AM
That's cool
May 30, 2021, 9:02 AM
They have some kind of aggregation router, not sure how exactly that works
May 30, 2021, 9:02 AM
Well, I'm gonna use uniswap v3.
The main problem is that it uses solidity 0.7.6, but I can't use this version.
May 30, 2021, 9:04 AM
Why not?
Why are you importing external contracts/interfaces?
You should develop with Truffle honestly for starters.
May 30, 2021, 9:20 AM
Cause all files were on 0.6.6
Nvm, I'm gonna redo everything.
All flash loan platforms use 0.5.0/0.6.6
UniSwapV3 uses 0.7.6.
Nvm, I'm gonna redo everything.
All flash loan platforms use 0.5.0/0.6.6
UniSwapV3 uses 0.7.6.
May 30, 2021, 9:20 AM
For instance: SafeMath can be copied locally pretty easily
May 30, 2021, 9:20 AM
think this is a real issue.
Have you tried dydx? They don't have flashloan per se. But you could build a canonical contract to do the same
Have you tried dydx? They don't have flashloan per se. But you could build a canonical contract to do the same
May 30, 2021, 9:41 AM
I'm trying dydx right now, I need to deal with js tho.
May 30, 2021, 9:42 AM
Yeah, there's that
May 30, 2021, 9:43 AM