CarmineOptions / derisk-research

MIT License
9 stars 48 forks source link

Infer the "Detail of a loan" parameters #185

Closed lukaspetrasek closed 1 month ago

lukaspetrasek commented 1 month ago

Steps:

0) Read our Contributor Guidelines and README. 1) Check out the current implementation of our streamlit dashboard, specifically the part that displays the details of a specific loan: https://github.com/CarmineOptions/derisk-research/blob/master/app.py#L393. The dashboard can be found here. 2) Under "Detail of a loan", anyone can search for statistics of a loan specified by the address of the user and the protocol name. However, if the combination of the address and protocol doesn't exist, i.e., there is no loan for the given user under the given protocol, because a) the user's address is correct, but missing the leading zeroes, or image b) the protocol name is correct, but not exactly matching either "zkLend", "Nostra Alpha", or "Nostra Mainnet" image the dashboard crashes on an "IndexError" error, and the loan is not found or displayed. Run the dashboard locally and try it yourself. 3) Handle such cases by a) adding the leading zeroes to the user's address, or b) infering the correct protocol name to match the values in the "loans_data" dataframe, so that the loan details are displayed in these scenarios.

od-hunter commented 1 month ago

Hi @lukaspetrasek , please can I be assigned this please? This is my first time contributing to this repo and I’d love to be given the opportunity.

To solve this issue, I’d take the following steps:

  1. I’ll review the logic around line 393 in app.py and run the dashboard locally to reproduce the error.
  2. ⁠I’ll add leading zeroes. I’ll normalize the user address by adding leading zeroes to match the required length (e.g., 42 characters for Ethereum addresses).
  3. ⁠I’ll use fuzzy matching (e.g., difflib) to infer the correct protocol name if it doesn't exactly match "zkLend", "Nostra Alpha", or "Nostra Mainnet".
  4. ⁠I’ll update Loan Search (ie to implement the above fixes before querying the loans_data dataframe.
  5. I’ll test different address formats and protocol names to ensure loan details are displayed correctly without crashes.

Please assign me.

martinvibes commented 1 month ago

hello @lukaspetrasek i am a frontend dev and blockchain developer please can i work on this issue :) and would love to be a contributor

onlydustapp[bot] commented 1 month ago

Hi @od-hunter! Maintainers during the ODHack # 8.0 will be tracking applications via OnlyDust. Therefore, in order for you to have a chance at being assigned to this issue, please apply directly here, or else your application may not be considered.

onlydustapp[bot] commented 1 month ago

Hi @martinvibes! Maintainers during the ODHack # 8.0 will be tracking applications via OnlyDust. Therefore, in order for you to have a chance at being assigned to this issue, please apply directly here, or else your application may not be considered.

onlydustapp[bot] commented 1 month ago

Hi @martinvibes! Maintainers during the ODHack # 8.0 will be tracking applications via OnlyDust. Therefore, in order for you to have a chance at being assigned to this issue, please apply directly here, or else your application may not be considered.

dev-chinx commented 1 month ago

hello @lukaspetrasek i would love to work on this issue

onlydustapp[bot] commented 1 month ago

Hi @dev-chinx! Maintainers during the ODHack # 8.0 will be tracking applications via OnlyDust. Therefore, in order for you to have a chance at being assigned to this issue, please apply directly here, or else your application may not be considered.

ShantelPeters commented 1 month ago

Please can I be assigned to this issue @lukaspetrasek

onlydustapp[bot] commented 1 month ago

Hi @ShantelPeters! Maintainers during the ODHack # 8.0 will be tracking applications via OnlyDust. Therefore, in order for you to have a chance at being assigned to this issue, please apply directly here, or else your application may not be considered.

Kaminar-i commented 1 month ago

@lukaspetrasek, Please can i get on this issue

How i would solve the Issue:

  1. Familiarize with the Project:

    • First, I'll thoroughly read the Contributor Guidelines and README to understand the code structure, standards, and processes.
    • I’ll also review the current Streamlit dashboard implementation, particularly the section displaying loan details, located at the specified line in app.py.
  2. Replicate the Issue Locally:

    • I'll clone the repository and run the dashboard locally to reproduce the "IndexError" and analyze how the system behaves when the user’s address lacks leading zeroes or the protocol name doesn't exactly match the allowed values.
  3. Address Missing Leading Zeroes:

    • To handle user addresses missing leading zeroes, I’ll write a function that pads the address with leading zeroes until it matches the required format before searching in the loans_data dataframe.
  4. Handle Protocol Name Inference:

    • For protocol name mismatches, I’ll add a fuzzy matching mechanism or create a mapping system to infer the closest valid protocol names ("zkLend", "Nostra Alpha", or "Nostra Mainnet") from user input, even if there are small deviations in the provided protocol name.
  5. Test and Validate:

    • After implementing these fixes, I’ll rerun the dashboard locally to ensure the issues are resolved and that the loan details display correctly even with missing zeroes or slight protocol name mismatches.
  6. Submit PR:

    • Finally, I'll write clear documentation on the changes made, perform thorough testing, and submit a pull request for review.

This approach should fix the "IndexError" and make the dashboard more robust and user-friendly.

onlydustapp[bot] commented 1 month ago

Hi @Kaminar-i! Maintainers during the ODHack # 8.0 will be tracking applications via OnlyDust. Therefore, in order for you to have a chance at being assigned to this issue, please apply directly here, or else your application may not be considered.

onlydustapp[bot] commented 1 month ago

Hi @od-hunter! Maintainers during the ODHack # 8.0 will be tracking applications via OnlyDust. Therefore, in order for you to have a chance at being assigned to this issue, please apply directly here, or else your application may not be considered.

MooreTheAnalyst commented 1 month ago

Hello, please can i be assigned this issue?

onlydustapp[bot] commented 1 month ago

Hi @MooreTheAnalyst! Maintainers during the ODHack # 8.0 will be tracking applications via OnlyDust. Therefore, in order for you to have a chance at being assigned to this issue, please apply directly here, or else your application may not be considered.

BernalHQ commented 1 month ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hi, my name is Bernal, and I’m a software developer with four years of experience. I’m passionate about contributing to projects and learn, and I would love the opportunity to contribute to this project

How I plan on tackling this issue

The first step is to understand the project and how it works. Once I have a good understanding of it, I’ll propose a solution to the issue. After that, I’ll implement the solution and run some tests to ensure everything works correctly.

Josh-121 commented 1 month ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

software engineer with experience in smart contract development and contributor to similar issues in previous hackthons

How I plan on tackling this issue

Review Current Implementation:

Analyze the existing code at the specified section (app.py#L393) to understand how loan details are fetched and how errors occur when the address or protocol name doesn’t match exactly. Handle Missing Leading Zeros:

Implement a check to detect if the user's address is missing leading zeroes. Automatically prepend the necessary zeroes to match the correct format before performing the loan search.

work on recommmendation/feedback

Jayse007 commented 1 month ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I would like to take this task, this task will be delivered within 4 days (26, september, 2024-30, september, 2024). My name is Shawon James. I am a programmer who specializes in Python. I have been using Python for over 7 years. I have a very strong understanding of the language, its fundamentals and some of the more complicated things. I use python to solve problems (sometimes with the use of popular algorithms), automation of tasks, web scraping, backend development, data analysis. I have experience with pandas library in python.

How I plan on tackling this issue

CASE 1: I would use :startswith" method that comes with string data types in an if statement to handle checking if it starts with a leading zero, then add the leading zero before checking if the user exists.
CASE 2: I would make use of indexing to ensure matching of the "loans_data" and protocol name

od-hunter commented 1 month ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

please can I be assigned this issue? I'm a blockchain developer with experience in html, css, react, JavaScript,TypeScript and solidity, python and Cairo.

How I plan on tackling this issue

To solve this issue, I’d take the following steps: 1.⁠ ⁠I’ll review the logic around line 393 in app.py and run the dashboard locally to reproduce the error. 2.⁠ ⁠⁠I’ll add leading zeroes. I’ll normalize the user address by adding leading zeroes to match the required length (e.g., 42 characters for Ethereum addresses). 3.⁠ ⁠⁠I’ll use fuzzy matching (e.g., difflib) to infer the correct protocol name if it doesn't exactly match "zkLend", "Nostra Alpha", or "Nostra Mainnet". 4.⁠ ⁠⁠I’ll update Loan Search (ie to implement the above fixes before querying the loans_data dataframe. 5.⁠ ⁠I’ll test different address formats and protocol names to ensure loan details are displayed correctly without crashes.

Please assign me.

ScottyDavies commented 1 month ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I have a background in software development and data analysis, with experience in Python and web frameworks

How I plan on tackling this issue

I would take the following approach:

Input Validation: I will Implement checks to ensure that the user address has the correct format, adding leading zeroes as necessary.

Protocol Name Matching: Create a function to normalize the protocol name input. This function would match user input against valid options ("zkLend", "Nostra Alpha", "Nostra Mainnet") using case-insensitive comparison.

Error Handling: Wrap the loan retrieval logic in a try-except block to catch potential IndexError exceptions. If an error occurs, provide a fallback to display a message indicating that no loan was found, instead of crashing.

onlydustapp[bot] commented 1 month ago

The maintainer lukaspetrasek has assigned od-hunter to this issue via OnlyDust Platform. Good luck!

lukaspetrasek commented 1 month ago

Hi everyone, assigning @od-hunter!

@od-hunter Let me know if everything is clear. If you have any questions, please ask here. What is you TG handler please? 🙏🏼

Consider joining our TG group. See also our contributor guidelines.

od-hunter commented 1 month ago

Hi everyone, assigning @od-hunter!

@od-hunter Let me know if everything is clear. If you have any questions, please ask here. What is you TG handler please? 🙏🏼

Consider joining our TG group. See also our contributor guidelines.

Thank you ser🫡

djeck1432 commented 1 month ago

Hi @od-hunter any progress, if you need any help, just let me know

od-hunter commented 1 month ago

Hi @od-hunter any progress, if you need any help, just let me know

Yes ser, will push a pr soon.

djeck1432 commented 1 month ago

Hi @od-hunter you have 24 hours to open draft PR otherwise this issue will be assigned to another user.