Giter VIP home page Giter VIP logo

defi-mooc-lab2's Introduction

Hey 👋

I'm a Ph.D. student at Imperial College London, supervised by Dr. Arthur Gervais. My research interests span blockchains and system security with a recent focus on decentralized finance (DeFi). DeFi is one of the most promising applications of blockchains. I'm motivated to understand the risks and vulnerabilities of the DeFi ecosystem. Many of the DeFi security issues are caused by the inherent properties of blockchains and flawed protocol designs. In my research, I'm trying to improve the security of DeFi from both the underlying blockchain and the high-level DeFi protocol perspective.

Check out my personal page if you are interested.

defi-mooc-lab2's People

Contributors

camelop avatar kaihuaqin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

defi-mooc-lab2's Issues

Setting working environment

I know I'm late, but which is easier & faster?
-To install docker on my mobile using this site
https://gist.github.com/FreddieOliveira/efe850df7ff3951cb62d74bd770dce27
-Or to setup the JS node working environment? I don't know where to start writing the code!
I see place for requests or methods that seems to fit only for one function
.
What I understand is that I need something like any language editor ( or should I use GitHub itself? Didn't see anyone did that from the screenshots in discord?)
I mean, what I understand is that I should copy this template contract file you are providing, then write my coding steps as I understand them to finish to perform the required Liquidation?
.
One last enquiry since I find in discord people are using mainnet, that's not real liquidation right?
I mean just to make sure we are not giving any real borrower a hard time here, right?
.
Thanks

Assistance Needed

Hello!

I am in need of guidance for Lab 2. I am a finance professional, not a programmer (though I have been learning to code in Solidity). Could you please assist?

Many thanks!

Grace

Related to prerequisites

Hi, I'm currently in the process of learning solidity/smart contract programming to try and solve this lab but just realized that what I am learning uses brownie while I see a hardhat file here. Is using JS over python compulsory for this assignment?

I also feel 2-3 weeks is too less time to learn a new language along with the concept and then implement the project so I want to know if I should scrap what I'm learning right now and find out a hardhat tutorial? Any suggestions if that is the case? Would be grateful for any kind of advice, thanks!

Shouldn't profit be proportional to liquidated amount?

I'm trying to get the most learning value of this exercise and have tried different options:
-In systematic 2 steps full liquidation (liquidating 1568 ETH), I get profit of 24.11 ETH
https://github.com/DrShymaa2022/defi-mooc-lab2
-If I compared this to 1 step profit as 21...ETH, it seems reasonable and satisfiable to increase it by about 1/7 = 14%
-However, if we looked at the details of the results 2 annoying observations:
1-How come a gain of 142 ETH ends to be only 24.1?
2-How come what a lot of people did of liquidating less than ≤1000 leads to more than double the profit (43.8 ETH, for difference gain ranging from 86 to 94 if we applied 2 steps
https://github.com/Shymaa-Arafat/defi-mooc-lab2/blob/a00d99b0dd63c1da3cf32d9b918f63b8bfcd72c0/contracts/LiquidationOperator.sol)?
.
-If the flash swap charges ratio "rt" for the Flashloan, ie for loan X we payback (1+rt)X { rt<1 in fact should be 0.003?}
If X1>> X2
X1 leads to 142 ETH
X2 leads to 86 ETH
Profit Pr= gain from liquidation - ratio
X
for Pr1 < Pr2 ( what happened in the runs)
rt*(X1-X2)> gain difference
in our case
rt1.5m$ >142-86 ETH
rt> 56
1.8/1500
rt> 0.0672
no way uniswap charges more than 6.7%????
If we added more exact values ( difference is nearly 20 ETH)
It should be rt = 76*1.8/1500 = 9.1%
.
If this is not the case as I think, please take the time to find out what is the common mistake most of us had fallen in and was not discovered by the test script
( I tried running other people codes and changing parameters or printing details to check it out) and was not discovered by the test script
.
-Finally, would be helpful for the next course version if the read me guide shed some light on using uniswap router or regular call to payback and pros & cons of both ( people in discord mentioned re-entrancy attack)
.
Thanks
Uploading IMG_20220608_184540.jpg…
Uploading IMG_20220603_223350.jpg…

Submission?

Who do we submit LiquidationOperator.sol to? Or is our lab linked automatically by fetching the username/email and the contract from Alchemy?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.