Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fee Module #273

Closed
Tracked by #276
jcx120 opened this issue May 24, 2022 · 12 comments
Closed
Tracked by #276

Fee Module #273

jcx120 opened this issue May 24, 2022 · 12 comments

Comments

@jcx120
Copy link

jcx120 commented May 24, 2022

Build a "Fees" container component with the following elements:

  1. Average Transaction Fee: 0.0002 XLM
  2. Graph of Average Transaction Fee over time (24hr, 30d)
    • May need to be derived from Hubble data and stored in time series
  3. Base operation fee: 0.00001 XLM
    • Src: static variable from code
  4. Base reserve: 0.5 XLM
    • Src: static variable from code
  5. Fee Stats (Last 5 Ledgers)
    • Metric | Value

Considerations:

  • The "Fees" container component will need to be created
  • Use Stellar Design System (SDS) components as much as possible.
  • Icons should also be used from the SDS ( component). It's OK if they differ slightly.
  • Backend data will vary depending on the data element
  • Only on Mainnet (no Testnet).
@jcx120 jcx120 mentioned this issue May 24, 2022
3 tasks
@raphaelmartins1993
Copy link

jcx120
Average Transaction Fee: 0.0002 XLM

Could you send us more information about the calc to this average?

Graph of Average Transaction Fee over time (24hr, 30d)

  • May need to be derived from Hubble data and stored in time series

Is it possible to bring us more context about this data source from Hubble? Which tables, etc.

  1. Base operation fee: 0.00001 XLM
  2. Base reserve: 0.5 XLM

These two information are fixed?

@jcx120
Copy link
Author

jcx120 commented Jun 1, 2022

  1. For Average Transaction Fee, we can use this sample query in Hubble to get the average over the last 30 days:
  with fees as (
    select sum(t.fee_charged) as total_fees, sum(t.operation_count) as total_ops
    from `hubble-261722.crypto_stellar_internal_2.history_transactions` t
    join `hubble-261722.crypto_stellar_internal_2.history_ledgers` l
    on t.ledger_sequence = l.sequence
    where l.closed_at >= timestamp(date_add(current_date(), INTERVAL -30 DAY))
  ) 
  select total_fees / total_ops 
  from fees
  1. Base Operation Fee and Base Reserve are static constants in the code. They are fixed and can be pulled out of the API. ie: https://developers.stellar.org/api/introduction/xdr/
    See "base_fee_in_stroops", "base_reserve_in_stroops"

@jcx120
Copy link
Author

jcx120 commented Jun 2, 2022

Here's a fees dashboard already in Hubble that might also be useful: https://hubble-metabase.herokuapp.com/dashboard/24

@italomlp
Copy link

italomlp commented Jun 9, 2022

Here are some screenshots of the possible final chart for this Fee module. Feedback is much appreciated, maybe for changing some colors, spacings, etc. LMK your thoughts @jcx120

Click to see screenshots:

PS: I'm using fake values, don't take them into account.

Screen Shot 2022-06-09 at 15 04 21 Screen Shot 2022-06-09 at 15 04 30 Screen Shot 2022-06-09 at 15 04 40 Screen Shot 2022-06-09 at 15 04 54

@jcx120
Copy link
Author

jcx120 commented Jun 9, 2022

Design wise, they look good (maybe the last one is preferred).

@raphaelmartins1993
Copy link

Hello @jcx120, we have a question about Fee Stats (last 5 ledgers).
We would like to know if this information should be real time.

Analyzing the dashboard v1, we believe that this data is in real time. Therefore, we will be able to use the data we have in the frontend related to ledgers.

The other option would be to collect this data directly through the SDK with Horizon.

Can you confirm this information for us?
Thank you so much!

@jcx120
Copy link
Author

jcx120 commented Jun 15, 2022

Yes, this can be in "near real time" given its last 5 ledgers. The fee stats api call should give you everything you need:
https://horizon.stellar.org/fee_stats

@lccoronel
Copy link

lccoronel commented Jun 21, 2022

Hi @jcx120 and @quietbits, we did the "Fee Stats (last 5 ledgers)" table, following the dashboard v1 and applying the Stellar`s Design system, it was like this:

Screen Shot 2022-06-21 at 12 04 08

we still need apply and adjust somethings, but what do you think?

@jcx120
Copy link
Author

jcx120 commented Jun 21, 2022

Looks good - one minor thing is to add a label to the units (stroops). Like this:

"Fee Stats (Last 5 ledgers), Fee unit in stroops."

once all the data is in these modules, we'll have UX to do a review and adjust the design if needed.

@raphaelmartins1993
Copy link

Hi @jcx120!!

During the development of this task, we came across a few questions.

  • The query you gave us would give the average of transaction fees for the entire month, this made us unsure as to whether this data should be displayed somewhere directly or in a graph. If it's a graph, we would need a different query to show data in an interval (such as 30 24hrs interval data points for 30 days graph).

  • Is the data from this query already the values we want to display? Or do we need to multiply them for the price of a specific asset such as XLM?

Thank you!

@jcx120
Copy link
Author

jcx120 commented Jul 5, 2022

@raphaelmartins1993

  1. You'll need to adjust the query parameters to get the other intervals (INTERVAL -30 DAY). A graph over the intervals (1D , 30D) would be nice to have. We can skip the 1 hour interval. IF getting anything other than the current 30D is too complex, just leave it as a graph over 30D.
  2. Fees are usually in stroops (and should be labeled as such). See comment: Fee Module  #273 (comment)

@lccoronel
Copy link

#302

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants