Solexplorer / compound-account-service

0 stars 1 forks source link

Build an account service for Compound #1

Open Solexplorer opened 3 years ago

Solexplorer commented 3 years ago

Total bounty is 400 ~ 600 DAI.

Expectation:

For the Compound Protocol, set up a service to get the details for each borrowing account.

Need to do:

Tools:

Description

There is already an API for that data here: https://compound.finance/docs/api#AccountService but that data is always behind some blocks so don't use the API, I need it to be retrieved on-chain.

Eventually the data has to be in this format:

{
  "address": "0xbac065be2e8ca097e9ac924e94af000dd3a5663",
  "health": { "value": "1.07264275673050348990755599431194797431802239523113293682619605751591901" },
  "tokens": [
    {
      "address": "0xf5dce57282a584d2746faf1593d3121fcac444dc",
      "borrow_balance_underlying": {"value": "131.4682716123015"},
      "lifetime_borrow_interest_accrued": {"value": "0.44430505829286"},
      "lifetime_supply_interest_accrued": {"value": "0.0000021671829864899976"},
      "supply_balance_underlying": {"value": "0.0"}
    }
  ],
  "total_borrow_value_in_eth": {"value": "0.5100157047140227313856015174794473200000000000000000000000000000" },
  "total_collateral_value_in_eth": {"value": "0.54706465148029978664135447293587201124121731200000000000000000000000000" }
}

The explanation for each field is defined in the link provided above. You might use this guide as a reference if needed: https://blog.baowebdev.com/2020/02/how-to-build-accounts-service-for-compound-finance/

Note

If you're able to do it, please apply to the bounty and let's get in touch if you have any questions.

Quality and time of completion determine the final bounty amount.

gitcoinbot commented 3 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 600.0 DAI (600.0 USD @ $1.0/DAI) attached to it.

gitcoinbot commented 3 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 265 years, 6 months from now. Please review their action plans below:

1) baldator has applied to start work _(Funders only: approve worker | reject worker)_.

Hi, I'd like to help you develop this: I've python experience and I'm looking for a project in order to learn web3. Please feel free to contact me if you need references or you want to know about my background. Thanks, Marco 2) amitsagtani97 has applied to start work _(Funders only: approve worker | reject worker)_.

Hey, I was going through the description and it looks interesting to me. I have good experience with the Python and databases.

I can create the method to fetch data about all the borrowed accounts and save them in the database. For database, I was checking for polling solutions and came across this -> https://pusher.com/tutorials/mongodb-change-streams We can use MongoDB and poll data at fixed interval.

Looking forward to contribute to this project as a part of GitCoin bounty. 3) jatinj615 has applied to start work _(Funders only: approve worker | reject worker)_.

Hey, I would like to take this up, I have worked extensively in python and plan on using thegraph to get the required account data. 4) dirtybits has been approved to start work.

I could do this for you fairly quickly with 3 main parts, build out a database updater, a MongoDB database, and a client to retrieve information on the accounts.The Database updater can be constantly running with some sort of detection each block, I'd imagine you're going cloud for this then in deployment. Client then just sifts through that database using address as key, nothing too special. Most of the work here being in collecting and aggregating that information which isn't too difficult using pandas and Numpy to sort and process the data

Learn more on the Gitcoin Issue Details page.

Solexplorer commented 3 years ago

@dirtybits Can you get in touch with me on telegram? https://t.me/nardoe

gitcoinbot commented 3 years ago

@dirtybits Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

gitcoinbot commented 3 years ago

@dirtybits Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

gitcoinbot commented 3 years ago

@dirtybits Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

dirtybits commented 3 years ago

Hello, checking in here @gitcoinbot

gitcoinbot commented 3 years ago

@dirtybits Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

gitcoinbot commented 3 years ago

@dirtybits Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

gitcoinbot commented 3 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


@dirtybits due to inactivity, we have escalated this issue to Gitcoin's moderation team. Let us know if you believe this has been done in error!

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

dirtybits commented 3 years ago

@gitcoinbot I will submit what I have in PR as the work done.

gitcoinbot commented 3 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


The funding of 600.0 DAI (600.0 USD @ $1.0/DAI) attached to this issue has been cancelled by the bounty submitter