Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeFi Alert #705

Open
D4nte opened this issue Apr 13, 2022 · 6 comments
Open

DeFi Alert #705

D4nte opened this issue Apr 13, 2022 · 6 comments

Comments

@D4nte
Copy link
Contributor

D4nte commented Apr 13, 2022

Problem

DeFi smart contract have automated actions that may lead to impact of the asset of one user.

For example, in the case of a lending platform, an under-collaterized loan might get a margin call or liquidation that automatically sell the collateral on the market.

Receiving alerts before such event occurred is valuable to the end user.

For example. at Aave they recommend using HAL which is a Web3 IFTTT service. HAL is centralized.
Also, when you give your Ethereum address to HAL you can also give your email, Twitter, Slack and Discord. A great way to dox yourself.

Proposed Solutions

Create a monitoring node (monitor) that watches the blockchain and dispatch alerts over Waku.
Build a SDK to process said alerts in the user's wallet/PoC website.

sequenceDiagram
  Monitor->>Ethereum: Monitor Aave contract
  Note over Monitor: Calculate Health Factor for Alice's Address
  Note over Monitor: Alice's Health Factor drops below 2
  Monitor ->> Waku: Alert for Alice
  Waku ->> Alice's Wallet: Alert for Alice
  Note over Alice's Wallet: Display Alert
  Note over Alice's Wallet: Alice take action and increase her collateral
Loading

Notes

First PoC can manually take the address to monitor.
Then, we can add a system where users (via wallet or dAPP) send a subscription message over Waku. From which moment the monitor can start monitoring their address and sending alerts.

Maybe the subscription can be done on chain, as a payment to a potential monitor. Some economic incentives would need to be designed as if they are payment done to 1 monitor then there may be poor redundancy/censorship resistance.
Having a pool system might make sense.

@D4nte D4nte added the bounty label Apr 13, 2022
@D4nte
Copy link
Contributor Author

D4nte commented Apr 13, 2022

Note that this could be eligible for an Aave grant.

@molekilla
Copy link

how do I apply for this bounty?

@molekilla
Copy link

This is easy. But I haven't been able to run js-waku in Node, we can disucss off topic andI can share you my github repo. If js-waku could be made to work with Node then we can monitor and do the bounty proposal

@D4nte
Copy link
Contributor Author

D4nte commented May 3, 2022

@molekilla This is a bounty idea. We haven't yet decided to move forward with it. Watch the issue and you'll be alerted if we make it a bounty.

js-waku targets the Browser but it should work in NodeJS. Feel free to open an issue so I can investigate.

However, if you are deploying NodeJS services then I'd recommend to look into nwaku and using the JSON RPC API.
The main reason for this recommendation is that only the "light client" side of the protocols have been implemented in js-waku so far, whereas nwaku has most/all the protocols implemented.

@dmh1974
Copy link

dmh1974 commented May 19, 2022

@molekilla i had a bit of tribulation getting js-waku to work with node. but ultimately succeeded. i think the latest release may have addressed some of the issues. feel free to contact me out of band, i can provide the steps i used for a successful install and implementation (if your issues persist)

@D4nte
Copy link
Contributor Author

D4nte commented May 27, 2022

Note I do maintain a project that uses js-waku with NodeJS: https://github.com/status-im/waku-tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Icebox
Development

No branches or pull requests

4 participants