CarmineOptions / derisk-research

MIT License
5 stars 17 forks source link

Add informative warning message when a nonexistent loan is selected on the dashboard #184

Open lukaspetrasek opened 2 days ago

lukaspetrasek commented 2 days 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, the dashboard crashes on an "IndexError". Run the dashboard locally and try it yourself. image 3) Handle such cases by showing an informative warning, e.g. "No loan for the user exists on the lending protocol."

martinvibes commented 2 days ago

hey @lukaspetrasek can i hop on this issue

onlydustapp[bot] commented 2 days 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 2 days 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.

Kaminar-i commented 2 days ago

Hey @lukaspetrasek , I’d love to take on this issue and help solve it! Here’s how I would approach it:

  1. First, I’ll read through the Contributor Guidelines and README to ensure I understand the project structure, coding standards, and the process you’re following.

  2. Next, I’ll dive into the current implementation of the Streamlit dashboard, specifically the part that displays the details of a single loan. I’ll review the relevant section in app.py at this line, and check out the dashboard to get a feel for how it’s currently working.

  3. I’ll run the dashboard locally to reproduce the issue. Under the "Detail of a loan" section, I’ll simulate a case where there’s no loan for a given user or protocol combination and observe the "IndexError" crash you mentioned.

  4. To fix the issue, I’ll implement a solution to gracefully handle cases where no loan exists for the user under the given protocol. Instead of crashing, the dashboard will show a clear, informative warning, like:
    "No loan for the user exists on the lending protocol."

Once that’s done, I’ll thoroughly test the changes locally to ensure the issue is resolved and the user experience is improved. I’m confident this approach will fix the "IndexError" and make the dashboard more user-friendly.

onlydustapp[bot] commented 2 days 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 2 days 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.

PabloVillaplana commented 2 days ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I am a Full Stack developer with 6 years of experience in the industry, I am super excited to be able to contribute to Web 3 projects, this to continue paving my way as an Open Source Contributor. I am from Dojo Coding Community

How I plan on tackling this issue

First, I’ll read through the Contributor Guidelines and README to ensure I understand the project structure, coding standards, and the process you’re following.

Next, I’ll dive into the current implementation of the Streamlit dashboard, specifically the part that displays the details of a single loan. I’ll review the relevant section in app.py at this line, and check out the dashboard to get a feel for how it’s currently working.

I’ll run the dashboard locally to reproduce the issue. Under the "Detail of a loan" section, I’ll simulate a case where there’s no loan for a given user or protocol combination and observe the "IndexError" crash you mentioned.

To fix the issue, I’ll implement a solution to gracefully handle cases where no loan exists for the user under the given protocol. Instead of crashing, the dashboard will show a clear, informative warning, like: "No loan for the user exists on the lending protocol."

Dprof-in-tech commented 2 days ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hello, i am Dprof-in-tech, an experienced Full Stack Blockchain Developer and I am excited to contribute my skills to this project in this ODHACK 8. With a strong background in Next.js, TypeScript, JavaScript, React, Node.js, Rust and Cairo, I've honed my technical skills across the blockchain development landscape.

My journey with OnlyDust began at Edition 2, and I've since made 34 contributions across 11 projects. This extensive experience on the platform has allowed me to develop a keen understanding of delivering high-quality solutions under tight deadlines. I bring a unique blend of technical prowess and user-centric design to every project, whether I'm crafting immersive 3D experiences or developing innovative smart contracts.

My track record demonstrates my ability to adapt quickly and contribute effectively to diverse challenges. I'm confident in my capacity to tackle new problems and drive innovation in the blockchain space. As we begin ODHACK 8, I'm eager to leverage my hackathon experience and technical skills to push the boundaries of what's possible in blockchain development.

Below is a link to my OnlyDust public profile. https://app.onlydust.com/u/Dprof-in-tech

How I plan on tackling this issue

Approach for Add Informative Warning Message When a Nonexistent Loan is Selected on the Dashboard (#184):

I will review the Contributor Guidelines: To ensure compliance with project standards, I will carefully read through the Contributor Guidelines and README provided in the project repository. This will help ensure that my approach aligns with the team’s expectations, development processes, and code quality standards. I will examine the current implementation of the loan details section: I will focus on the existing implementation of the "Detail of a loan" feature found in the file app.py at line 393.

By running the dashboard locally, I will reproduce the error that occurs when a user inputs a combination of address and protocol that does not match any existing loan. This typically results in an IndexError, which currently crashes the dashboard. I will implement a check to handle nonexistent loans:

I will add a conditional check within the part of the code responsible for fetching loan data to verify if there is any matching loan for the provided address and protocol. If no loan exists, I will modify the logic to return an informative warning message rather than allowing the application to crash. The message will read: "No loan for the user exists on the lending protocol." This will ensure that the user is notified of the issue in a user-friendly manner without causing a disruption in the dashboard's functionality.

I will ensure the display of the warning is clear and non-intrusive: I will style the warning message to match the existing design system, ensuring it stands out without overwhelming the user interface. The message will be displayed near the input fields or within the loan detail section, maintaining consistency with the overall dashboard layout.

I will test the functionality thoroughly: I will run the dashboard locally and test a variety of valid and invalid address-protocol combinations to ensure that: For valid combinations, the correct loan details are displayed as expected. For invalid combinations (i.e., nonexistent loans), the informative warning message is displayed and the dashboard does not crash.

I will also test edge cases, such as empty inputs and partially filled inputs, to ensure that the application handles all scenarios gracefully.

I will ensure the code adheres to project standards: I will review the code to ensure it is clean, follows the project’s style guide, and adheres to any other specific guidelines mentioned in the Contributor Guidelines. I will gather feedback and make necessary adjustments:

After implementing the solution, I will submit a pull request for review. Based on feedback from the team or project maintainers, I will make any required adjustments to further improve the solution.

Estimated Timeline: Start Date: Immediately upon assignment. Estimated Completion Date: 2 days from the start date (ETA: 2 days).

rishabhguptareal commented 2 days ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I am master of none jack of all basically i am learner of tech. I analyzed this problem and got the soultions. here is the step by step approach how it can be be leveraged into existing codebase.

In the app.py file, we have to search for the section of code that handles the "Detail of a loan" functionality, specifically the part that retrieves the loan details based on the user's address and protocol name.

then, we have to Add the loan existence check

Insert the loan existence check code before the section that retrieves the loan details. This check will ensure that the loan exists before trying to access its details.

then i will Implement the get_loan_details function

Implement the get_loan_details function that takes the address and protocol as input and returns None if the loan doesn't exist.

and then we will Update the loan details display code

Update the code that displays the loan details to use the st.write function only if the loan exists. If the loan doesn't exist, we will display the warning message using st.warning.

How I plan on tackling this issue

I've read the Contributor Guidelines and README, and I've checked out the current implementation of the Streamlit dashboard, specifically the part that displays the details of a specific loan. To handle the case where the combination of the address and protocol doesn't exist, we can add a simple check before trying to access the loan details. If the loan doesn't exist, we can display an informative warning message instead of crashing with an "IndexError".

Here is the approach that i will use:

In the app.py file, we have to search for the section of code that handles the "Detail of a loan" functionality, specifically the part that retrieves the loan details based on the user's address and protocol name. then, we have to Add the loan existence check Insert the loan existence check code before the section that retrieves the loan details. This check will ensure that the loan exists before trying to access its details.

then i will Implement the get_loan_details function

Implement the get_loan_details function that takes the address and protocol as input and returns None if the loan doesn't exist.

and then we will Update the loan details display code

Update the code that displays the loan details to use the st.write function only if the loan exists. If the loan doesn't exist, we will display the warning message using st.warning.

i have already written the code. eager to conribute

Jayse007 commented 2 days 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.

How I plan on tackling this issue

I would make use of if and else statements. The if statement to check whether the combination of the address and protocol doesn't exist and if block they don't the block would return "No loan for the user exists on the lending protocol.".

josephchimebuka commented 2 days ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hello @lukaspetrasek I am Joseph I am a frontend developer and blockchain developer and I am also an active contributor here on only dust here is my profile https://app.onlydust.com/u/josephchimebuka. This is my first time to contribute to this repo ill appreciate the opportunity to contribute. this is a couple of frontend and blockchain projects i have built https://metacrypt.vercel.app/ https://mattedsgn.com/

How I plan on tackling this issue

I will add warning when a non-existent loan is added on a blockchain by following the steps aligned before submitting a PR. I shouldd conclude this iissue in 2-3 days

rishabhguptareal commented 2 days ago

i have already written the code and applied through onlydust also

martinvibes commented 2 days ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

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

How I plan on tackling this issue

Understand Guidelines: Read the contributor guidelines and README.

Examine Current Code: Review the loan details section in app.py to understand how loans are displayed.

Identify Error: Verify that an "IndexError" occurs when searching for a nonexistent loan.

Add Error Handling:

Implement a check for the existence of loan data for the specified user and protocol. If no loan exists, display a warning message, such as "No loan for the user exists on the lending protocol." Local Testing: Run the dashboard locally to ensure the warning message appears correctly.

Commit Changes: Commit and push your changes for review

onlydustapp[bot] commented 2 days ago

The maintainer lukaspetrasek has assigned PabloVillaplana to this issue via OnlyDust Platform. Good luck!

lukaspetrasek commented 2 days ago

Hi everyone, assigning @PabloVillaplana!

@PabloVillaplana 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.

PabloVillaplana commented 1 day ago

@lukaspetrasek Thank you for the opportunity to contribute to the project. 🎉.I have already joined the telegram group, I will be installing the project and testing to acquire more knowledge about the project. If I have doubts or questions I will let you know.