Greg
@greg
Just deployed an experimental token (not a memecoin, you can't buy it) — its a smart contract that transparently manages an Aave position of 2 parts ETH to 1 part USDC. Effectively 2x leveraged ETH Ownership of the token represents ownership of the underlying assets, so users can redeem the underlying ETH at any time It's designed to be permissionless, but I don't trust my Solidity skills enough and don't want you to lose money so I've restricted depositing to myself. Just excited about my first defi contract and wanted to share :) https://github.com/gskril/aave-manager
11 replies
15 recasts
90 reactions
Blinky Stitt
@flashprofits.eth
Neat. You should use a flash loan instead of calling _withdrawEthSwapForUsdcAndRepay three times. You already have a uniswap trade in there so just use that as the source of all the initial funds.
1 reply
0 recast
0 reaction
Greg
@greg
hmmm not sure I fully understand — the reason I broke it into 3 chunks is because aave wouldn't let me withdraw collateral before repaying the loan since the position could get liquidated you're suggesting i should take a flash loan of USDC to repay the loan so I can withdraw collateral in and rebalance in one go?
1 reply
0 recast
0 reaction
Blinky Stitt
@flashprofits.eth
Yeah. Flash everything you need to pay Aave, withdraw collateral, then pay for the flash loan.
1 reply
0 recast
0 reaction
Greg
@greg
interesting- i guess the difference is small flash loan fee vs gas fee on the looped swap&repay? or something else i’m not considering?
1 reply
0 recast
0 reaction
Blinky Stitt
@flashprofits.eth
If you flash from Aave, there's a fee (.09%). If you flash from Uniswap, it's the trade fee (which you are already paying for swapping)
2 replies
0 recast
0 reaction