Multiplier Flashloan Introduction ~Aave compatible~ Part.1

https://docs.multiplier.finance/

Disclaimer

  1. V2 has rich features like batch flashloans, but with its complexity I prefer to use V1 for simple flashloan to execute arbitrage strategy
  2. A sample flashloan demo is given with the V1 code base in github [4]
  3. Actually V1 has more liquidity compared to V2 (it is significant)
V1 & V2 liquidity comparison
  1. Your contract calls Aave LendingPool contract , requesting a Flashloan of a certain amount of a reserve
  2. LendingPool transfers the requested amount of the reserve to your contract, then calls executeOperation function on your contract (or another contract that you specify as _receiver )
  3. The contract holds the Flashloaned amount , executed any arbitrary operation in its code. When your code has finished, the contract needs to transfer the Flashloaned amount of reserve back to the LendingPool
  4. LendingPool contract compared the balance of the reserve before and after the contract execution, ensuring that the balance of the reserve is exactly the same as before plus the taken fee (0.06%)
  5. All of the above happens in 1 transaction (hence in a single block)
  1. A solidity contract should be deployed in a network to invoke flashloan
  2. Write a JS script to call this contract with the contract holding BNB
Coding in Remix environment
# test smart contract address
0xD0dA84acf504097Fe1a59D9C9273E868FdbfcDe6
$ npm run test
Transaction hash: 0x1775b0d58bc3b4f79a8848c1baf2bc246811787e33b06438f3ba4ab3fa1f61fe
https://bscscan.com/tx/0x1775b0d58bc3b4f79a8848c1baf2bc246811787e33b06438f3ba4ab3fa1f61fe

--

--

--

Cloud Architect and Blockchain Enthusiast, techflare.blog, Vinyl DJ, Backpacker. ブロックチェーン・クラウド(AWS/Azure)関連の記事をパブリッシュ。バックパッカーとしてユーラシア大陸を陸路横断するなど旅が趣味。

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Creating Passive Income For Free!

5 Reasons Why Cryptocurrency Investments Are Profitable Now

A closer look at the AtomicMarket — AtomicAssets Hub Update 2

$RADAR listing on BitMart

Introducing A New Trading Paradigm

First DEX built by independent partner Plutos Network launches on Public Mint

BUILDING A PRODUCT THAT SUSTAINS ITSELF

“How Much BTC Should I Own?” Is Not a Relevant Question — Here Is the Mindset You Should Adopt

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Yuya Sugano

Yuya Sugano

Cloud Architect and Blockchain Enthusiast, techflare.blog, Vinyl DJ, Backpacker. ブロックチェーン・クラウド(AWS/Azure)関連の記事をパブリッシュ。バックパッカーとしてユーラシア大陸を陸路横断するなど旅が趣味。

More from Medium

Flash Loans, Arbitrage, and DeFi

​​What Are DeFi Flash Loans & How To Prevent Flash Loan Attacks?

Flashloan Bot on Polygon Part.1

Launch a Uniswap Clone App and Build Your Decentralized Exchange