|
24 | 24 | if len(query_params_chain_id) == 1 and not st.session_state.chain_id:
|
25 | 25 | st.session_state.chain_id = query_params_chain_id[0]
|
26 | 26 |
|
| 27 | +def display_recent_rounds(): |
| 28 | + # Fetch and process round data |
| 29 | + rounds = utils.get_round_summary() |
| 30 | + current_time = pd.Timestamp.now(tz='UTC') |
| 31 | + rounds = rounds[(rounds['donations_end_time'].dt.tz_convert('UTC') < current_time) & (rounds['votes'] > 0)] |
| 32 | + rounds = rounds.sort_values('donations_end_time', ascending=False) |
| 33 | + |
| 34 | + # Create round links and prepare display data |
| 35 | + rounds['Round Link'] = rounds.apply(lambda row: f"https://qf-calculator.fly.dev/?round_id={row['round_id']}&chain_id={row['chain_id']}", axis=1) |
| 36 | + rounds_display = rounds[['round_name', 'Round Link', 'votes', 'uniqueContributors', 'amountUSD']] |
| 37 | + |
| 38 | + # Configure column display |
| 39 | + column_config = { |
| 40 | + "Round Link": st.column_config.LinkColumn( |
| 41 | + "Round Link", |
| 42 | + display_text="Go to Round", |
| 43 | + help="Click to view round details" |
| 44 | + ), |
| 45 | + "votes": st.column_config.NumberColumn( |
| 46 | + "Total Votes", |
| 47 | + help="Total number of votes in the round" |
| 48 | + ), |
| 49 | + "uniqueContributors": st.column_config.NumberColumn( |
| 50 | + "Unique Contributors", |
| 51 | + help="Number of unique contributors in the round" |
| 52 | + ), |
| 53 | + "amountUSD": st.column_config.NumberColumn( |
| 54 | + "Total Amount (USD)", |
| 55 | + help="Total amount donated in USD", |
| 56 | + format="$%.2f" |
| 57 | + ) |
| 58 | + } |
| 59 | + |
| 60 | + # Display the dataframe |
| 61 | + st.header("Recent Rounds That Have Ended:") |
| 62 | + st.dataframe( |
| 63 | + rounds_display.head(20), |
| 64 | + column_config=column_config, |
| 65 | + hide_index=True |
| 66 | + ) |
| 67 | + |
| 68 | + |
27 | 69 | def validate_input():
|
28 | 70 | """Validate the presence of round_id and chain_id in the URL."""
|
29 | 71 | if st.session_state.round_id is None or st.session_state.chain_id is None:
|
30 | 72 | st.header("Oops! Something went wrong. You're not supposed to be here 🙈")
|
31 | 73 | st.subheader("Please provide round_id and chain_id in the URL")
|
32 | 74 | st.subheader('Example: https://qf-calculator.fly.dev/?round_id=23&chain_id=42161')
|
| 75 | + display_recent_rounds() |
33 | 76 | st.stop()
|
34 | 77 | return st.session_state.round_id.lower(), int(st.session_state.chain_id)
|
35 | 78 |
|
@@ -469,7 +512,7 @@ def main():
|
469 | 512 | filter_in_csv = handle_csv_upload(purpose='filter in')
|
470 | 513 |
|
471 | 514 | half_and_half = False
|
472 |
| - with st.expander("Advanced: give results as half COCM / half QF"): |
| 515 | + with st.expander("Advanced: Give results as half COCM / half QF"): |
473 | 516 | st.write('''
|
474 | 517 | Toggle the switch below to calculate a matching result blending COCM and QF, instead of pure COCM.
|
475 | 518 | In this case, funding amounts will be found for each mechanism, normalized to the size of the matching pool, and then averaged for each project.
|
@@ -499,8 +542,8 @@ def main():
|
499 | 542 |
|
500 | 543 | # Quadratic Funding Method Comparison section
|
501 | 544 | st.header('💚 Quadratic Funding Method Comparison')
|
502 |
| - st.write('''Quadratic funding helps us solve coordination failures by creating a way for community members to fund what matters to them while amplifying their impact. However, its assumption that people make independent decisions can be exploited to unfairly influence the distribution of matching funds.''') |
503 |
| - st.write('''Connection-oriented cluster-matching (COCM) doesn't make this assumption. Instead, it quantifies just how coordinated groups of actors are likely to be based on the social signals they have in common. Projects backed by more independent agents receive greater matching funds. Conversely, if a project's support network shows higher levels of coordination, the matching funds are reduced, encouraging self-organized solutions within more coordinated groups. ''') |
| 545 | + st.write('''[Quadratic funding](https://wtfisqf.com) helps us solve coordination failures by creating a way for community members to fund what matters to them while amplifying their impact. However, its assumption that people make independent decisions can be exploited to unfairly influence the distribution of matching funds.''') |
| 546 | + st.write('''[Connection-oriented cluster-matching (COCM)](https://wtfiscocm.streamlit.app/) doesn't make this assumption. Instead, it quantifies just how coordinated groups of actors are likely to be based on the social signals they have in common. Projects backed by more independent agents receive greater matching funds. Conversely, if a project's support network shows higher levels of coordination, the matching funds are reduced, encouraging self-organized solutions within more coordinated groups. ''') |
504 | 547 |
|
505 | 548 | # Allow removal of projects from matching distribution
|
506 | 549 | all_projects = data['df']['project_name'].unique()
|
|
0 commit comments