CarmineOptions / derisk-research

MIT License
5 stars 23 forks source link

Infer the step in the collateral token range from the token price #189

Open lukaspetrasek opened 5 days ago

lukaspetrasek commented 5 days ago

Steps:

0) Read our Contributor Guidelines and README. 1) Check out the current implementation of "get_collateral_token_range": https://github.com/CarmineOptions/derisk-research/blob/master/src/helpers.py#L57. It returns the list of token prices for which we compute liquidable debt displayed on the main chart titled "Liquidable debt and the corresponding supply ..." on our dashboard. 2) Currently, the steps (USD values) in the token range are hardcoded, e.g. 50 for ETH, or 0.01. Derive these from the given token price, such that there are roughly 50 values in the range, but the steps must by chosen such that the chart is readable, i.e. 110^X, 210^X, 5*10^X.

raizo07 commented 5 days ago

Can I work on this

onlydustapp[bot] commented 5 days ago

Hi @raizo07! 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.

ooochoche commented 5 days ago

@lukaspetrasek I would be able to take on this task! I've gone through the guidelines, README, and the current implementation, and I have a solid grasp of what needs to be done.

onlydustapp[bot] commented 5 days ago

Hi @ooochoche! 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.

CristopherAguilar10 commented 5 days ago

I would like to undertake this task.

Estimated Timeline: • Start Date: September 26, 2024 • Completion Date: September 30, 2024

A Short Summary of Relevant Skills: I have solid experiences in Python development, especially those of dynamic range calculations and financial data visualization. I had worked on projects that needed the development of scalable solutions for financial charts, ensuring the readability of data through dynamic adjustments. This background means I am particularly suited to accomplish the task efficiently.

Approach: • I’ll start by reviewing the current hardcoded implementation of get_collateral_token_range and its role in the dashboard’s liquidable debt chart. • Then I’ll have to refactor the function to dynamically determine the token price range such that about 50 intervals are always used. Also, the steps should be easy-to-read multiples of 1 × 10^X, 2 × 10^X, or 5 × 10^X. • Finally, I will verify the solution with a variety of tokens in order to assert that it scales well and remains readable for all types of price ranges.

onlydustapp[bot] commented 5 days ago

Hi @CristopherAguilar10! 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 5 days ago

Hi @CristopherAguilar10! 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.

Josh-121 commented 5 days ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Python / smart contract dev and have contributed in similar issues in previous od hacks. Looking forward to making first contribution here

How I plan on tackling this issue

  1. Review Current Implementation: Analyze the existing code to understand how token ranges are currently hardcoded and how they're used in the dashboard.

  2. Define Requirements:

    • Generate a range of ~50 values based on token price.
    • Ensure steps are readable (1*10^X, 2*10^X, 5*10^X).
  3. Dynamic Step Calculation:

    • Derive steps based on the token’s price using logarithmic scaling.
    • Adjust steps to maintain readability and consistent intervals.
  4. Work on any feedback/recommendations

ooochoche commented 5 days ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

@lukaspetrasek

How I plan on tackling this issue

I would be able to take on this task! I've gone through the guidelines, README, and the current implementation, and I have a solid grasp of what needs to be done.

MullerTheScientist commented 5 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 experience in languages like Python, Cairo, Solidity, React, and JavaScript, Rust.

How I plan on tackling this issue

i will Determine the price range Get the current token price (e.g., ETH price) Decide on the desired price range (e.g., 10% to 100% of the current price)

od-hunter commented 5 days ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hi, please can I be assigned this? 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 have to first understand how the function currently calculates token prices and ranges. 2.⁠ ⁠⁠I’ll replace hardcoded steps with a dynamic calculation based on the token price to generate approximately 50 values that are readable. 3.⁠ ⁠⁠I’ll modify the function to derive the step size using powers of ten or multiples, ensuring the generated range is clear and useful. 4.⁠ ⁠⁠I’ll then test the updated function to verify it returns appropriate values for various token prices and displays correctly on the chart. 5.⁠ ⁠⁠Lastly, I’ll provide documentation for the changes, explaining the new dynamic step calculation.

Please assign me.

gregemax commented 5 days ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I have experience in Python and building financial models involving token price ranges. My understanding of working with token pricing and chart readability will help me implement dynamic step calculations that provide clear, informative charts for users.

How I plan on tackling this issue

I would analyze the token price data to dynamically infer steps, aiming for around 50 values while ensuring readability using factors like powers of 10 (e.g., 1, 2, 5 * 10^X). I’d then modify the get_collateral_token_range function to generate the steps based on these calculations and test it with various tokens

thesledge04 commented 5 days ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I have a solid foundation in Python and algorithm development. This allows me to efficiently calculate step sizes, apply logarithmic scaling, and generate clean, readable ranges for the chart. My experience with data visualization tools, such as Streamlit and other charting libraries, helps me understand how to format the steps for the best readability on charts. This ensures that the generated price ranges look professional and are easy to interpret. I am proficient in handling numerical calculations, including logarithmic scaling and step rounding, which is crucial for this task. I can ensure that the step values remain logical and that the displayed values on the chart make sense to users.

How I plan on tackling this issue

Understand Current Implementation:

Review the current function get_collateral_token_range in helpers.py, where the token price steps are hardcoded. Dynamically Calculate Step Size:

Define the range based on the token price (e.g., from 50% to 150% of the price). Calculate the step size so that there are approximately 50 values in the range:

step = (1.5 token_price - 0.5 token_price) / 50 Round Step to Readable Values:

Ensure the steps follow readable patterns like 1 10^X, 2 10^X, or 5 * 10^X for better chart readability:

import math def round_to_readable_step(step): exponent = math.floor(math.log10(step)) base_step = step / (10 exponent) if base_step < 2: return 1 * (10 * exponent) elif base_step < 5: return 2 (10 exponent) else: return 5 * (10 ** exponent) Generate the Token Range:

Use the rounded step to generate roughly 50 values over the range:

def get_collateral_token_range(token_price): min_price = 0.5 token_price max_price = 1.5 token_price step = round_to_readable_step((max_price - min_price) / 50) return [min_price + i * step for i in range(50)] Test and Iterate:

Run tests with various token prices to ensure the range contains readable steps and fits the ~50 values requirement. Ensure charts display properly with the new steps.

onlydustapp[bot] commented 5 days ago

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

lukaspetrasek commented 5 days ago

Hi everyone, assigning @Josh-121!

@Josh-121 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.

djeck1432 commented 2 days ago

Hi @Josh-121 any progress, if you need any help, just let me know

Josh-121 commented 2 days ago

Hi @Josh-121 any progress, if you need any help, just let me know

Yes ser. Would reach out soon

djeck1432 commented 2 days ago

Hi @Josh-121 any progress, if you need any help, just let me know

Yes ser. Would reach out soon

Thank, feel free to assign me as code reviewer. thank you