djeck1432 / spotnet

1 stars 11 forks source link

Create statistic endpoint #71

Open djeck1432 opened 3 hours ago

djeck1432 commented 3 hours ago
  1. Read guideline here
  2. Set up the project, read README.md how to do that.
  3. Create new endpoint get_stats method GET which will return all user amounts and number of unique users
  4. Create crud method to fetch all amounts for all users where position.status is opened
  5. Create crud method to fetch all unique users
Josh-121 commented 2 hours ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Software engineering background majored in backend smart contract development. Looking to make first contribution on this project

How I plan on tackling this issue

Procedure:

  1. Define the Endpoint (GET) Endpoint: /api/stats

  2. Implement the get_stats Method Functionality: This method will return the total amount of user transactions and the number of unique users.

Define a function (e.g., get_stats) that handles the logic for fetching user amounts and unique users. Query Database:

Use a query to get the total amount of transactions for all users. Use another query to get the count of unique users. Return Response:

Return the results in JSON format.

  1. Implement CRUD Methods a. Fetch All Amounts for Users with Open Status Endpoint: /api/amounts/open
  2. Perform tests and work on any feedback
  3. I like orange.