Comments (3)
I'm not sure exactly what you're trying to do, you might find it better to write your own smart contract that fits whatever use case you have in mind (you need to pay back the flashloan somehow). This is specifically for swapping aTokens for other aTokens, and the flashloan lets you swap when you don't have enough collateral, paying off the loan using the old collateral.
from aave-paraswap-test.
It is the offset of the fromAmount
parameter in the calldata
to the AugustusSwapper
method. It is used in ParaSwapLiquiditySwapAdapter
only when you want to swap the entire aToken balance (otherwise set to 0). Since you don't know the balance in advance (it is constantly earning interest) this value needs to be modified by the smart contract within the transaction, and that's why it needs to know the offset, so that the data can be inserted at the right location, before performing the swap. The simpleSwap
method does not support this use case, since it hardcodes the parameters to external contract calls, so that is why the offset for that is not included, and also why the simpleSwap
method is excluded in all the swapAll
test scripts when using ParaSwap SDK (but if not doing swap all balance, it is fine to use simpleSwap
).
from aave-paraswap-test.
Thanks for replying,
I got it properly. so to do a swap, I need to have aToken
which is swapFrom
an asset in liquidity pool to use Paraswap Adapter. I just want to swap with flashloan. When I saw this contract in Aave adapter folder in github repo I suppose that this contract receives the flashloan then swaps the amount with paraswap and then deposits the srcAmount
. I understand it's not like that now. So is there a way to do that? I think I can do that with my contract using BaseParaSwapAdapter
. but I just want to ask can I use ParaswapLiquiditySwap
contract to just swap?
from aave-paraswap-test.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aave-paraswap-test.