yuichiroaoki / poly-flashloan-bot

Flashloan Bot on Polygon
https://yuichiroaoki.medium.com/flashloan-bot-on-polygon-part-2-3eae0ac33986?sk=80821da4ca1d0462c7c9ae617df56bdd
MIT License
303 stars 192 forks source link

loanAmount: 10000000000, #26

Open ezera23 opened 2 years ago

ezera23 commented 2 years ago

Is it normal to have 10 billions in my transaction debug as loanAmount and I set only 10000 as loan amount

ezera23 commented 2 years ago

I made another try by changing the const loanAmount to 1000 in config.ts and still have 10billion in the debug. let me know if its just some 0 added due to format number thanks

yuichiroaoki commented 2 years ago

That probably shows the numbers in wei not in unit.

You can format that number with ethers.js.

ref. https://docs.ethers.io/v5/api/utils/display-logic/#utils-formatUnits