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

Allow to set the matching pool token & amount to be something other than USD #3839

Closed
laurenluz opened this issue Mar 11, 2024 · 37 comments
Closed
Assignees
Labels
P1 it's a blocker to other tasks or issues.

Comments

@laurenluz
Copy link
Member

for many rounds, we will have matching pools in tokens beyond USD...

MATIC, mpETH, USDGLO, DAI, etc...

To date, all our matching pools are set as "matching pool amount in USD" - in admin bro & in the backend, and this number is used for a variety of other things including

I would like to be able to choose a chain & a token for the matching pool (and have this set in our backend) and then set the amount in that token. We will need to consider then that we should fetch the price of the token when showing estimated matching etc.

I think this is a backend first issue.

@jainkrati

@laurenluz laurenluz added the P2 A normal to do item or feature. label Mar 11, 2024
@jainkrati jainkrati assigned CarlosQ96 and unassigned jainkrati Mar 19, 2024
@jainkrati
Copy link
Collaborator

@CarlosQ96 pls pick this once your p0,p1 issues are done

@laurenluz laurenluz added P1 it's a blocker to other tasks or issues. and removed P2 A normal to do item or feature. labels Mar 27, 2024
@laurenluz
Copy link
Member Author

bumping the priority here, would love this to get done before our next qf round!

@laurenluz
Copy link
Member Author

can we make this a priority? for the polygon round, I'd love to put the "matching funds" in the db as... MATIC...

is that going to be crazy? @CarlosQ96 😇

@CarlosQ96
Copy link
Collaborator

Im estimating this issue and will leave my estimation here tomorrow morning. I have to check if there is any side effect in the different codes like the weight/distributions.

@CarlosQ96
Copy link
Collaborator

I feel this can work, but we should set a display setting. Because we save in the database BOTH the USD value and the token amount.
So it depends on what we want to show to the user.

Would require frontend to read this setting and choose the appropiate column to display.
But just adding it, can be 1 hour at most. If this is the way we want it. @laurenluz

@jainkrati
Copy link
Collaborator

@laurenluz pls confirm if we can go ahead with what carlos proposed above.

Adding @RamRamez for FE changes once @CarlosQ96 has implemented the BE changes.

@jainkrati
Copy link
Collaborator

@laurenluz waiting on you to confirm

@laurenluz
Copy link
Member Author

yeah that sounds fine. so we would set in admin bro if we want to show the USD value or the token value in that case?

and in admin bro the user would set the matching pool token & amount in that token? (rather than the USD value as we have it now?? @CarlosQ96 @RamRamez

@RamRamez
Copy link
Collaborator

RamRamez commented May 1, 2024

I added "allocated Token Symbol" and "allocated Token Chain Id" in AdminJS that allows us to set for new QF rounds.
@laurenluz what about past QF rounds? maybe we can set USDT and token chain for them manually.

@laurenluz
Copy link
Member Author

Re: your comment in the discord:

What changes do you need on FE? Replacing the dollar sign with token symbol for estimated matching would be enough?

Yes! On the frontend, actually we need to consider several places... Right now, there are even bugs in what we show.... we are showing estimated matching table in DAI, when the round is not necessarily in DAI....

On donate page (should say "$amount" or "amount tokenname")
image

On project single page (should say $amount" or "amount tokenname" in both the estaimted matching total amounts... and in the table, where right now it is saying DAI.. it should only say DAI if the token is DAI for that round)
image

On project single page donate tab, qf round subtab: (should say "$amount" or "amount tokenname")
image

On project card: (should say "$amount" or "amount tokenname")
image

@laurenluz what about past QF rounds? maybe we can set USDT and token chain for them manually.

If we have some kind of input field in adminJS where admin can set the matching pool amount, token.... I can retroactively edit the past rounds. Ideally, I could input:

  • matching pool amount (in token)
  • token symbol
  • token chain id

... and then the USD value of the matching pool amount is fetched using price discovery from our backend...
but if the price fetching will be too challenging... we can also have a field where admin inputs the USD amount for the matching pool (they can look it up and approximate).

Ideally, we could have the option if the admin wants to show the matching pool in the Token... or show the USD value instead.

wdyt @RamRamez ? cc @koday1

@RamRamez
Copy link
Collaborator

RamRamez commented May 1, 2024

@laurenluz token Is QF token chain id used anywhere? I've already added that field to QFRound, I'm just asking for clarification.

@laurenluz
Copy link
Member Author

I don't think it is... but I would love to use it in our qf round data export because atm... I need to filter through many addresses for each project to find the one to send matching funds to (as a new column)

Just fyi @CarlosQ96

@jainkrati
Copy link
Collaborator

@RamRamez can you take up the FE changes for this as well

@RamRamez
Copy link
Collaborator

RamRamez commented May 2, 2024

@RamRamez can you take up the FE changes for this as well

I'm on it

@RamRamez
Copy link
Collaborator

RamRamez commented May 2, 2024

@laurenluz
Copy link
Member Author

oh I don't have an ability to lock into this verson of admin bro - it's different from prod. Do I need to set something up for it specifically? @RamRamez
(I've never set up admin bro login for staging)

@laurenluz
Copy link
Member Author

laurenluz commented May 3, 2024

Thanks for helping me set up the login @RamRamez!! Testing now, here's the bugs I'm finding:

AllocatedFund = 10k MATIC
USD value = $80k

When set to show USD value:

  • On the stats banner (when I'm set to show the allocated fund in USD)... this should show $80,000 (for some reason, it didn't change when I updated admin bro):
    image

  • project card looks good

  • project single page "card" looks good, both in the estimate matching table & the big value

  • project single page donation tab for the round looks good

When set to show MATIC value:

  • On the QF stats banner (when I'm set to show the allocated fund in MATIC)... this should show 10,000 MATIC
    image

  • project card looks good

  • project single page "card" looks good, both in the estimate matching table & the big value

  • project single page donation tab for the round looks good

If you are fixing things on that banner @RamRamez maybe you can also address this rounding issue on the stats banner...

  • This should show up to 2 decimal places... i.e. $693.67
image

RamRamez added a commit that referenced this issue May 3, 2024
…-token-&-amount-to-be-something-other-than-USD-#3839
@RamRamez
Copy link
Collaborator

RamRamez commented May 3, 2024

Thanks for helping me set up the login @RamRamez!! Testing now, here's the bugs I'm finding:

AllocatedFund = 10k MATIC USD value = $80k

When set to show USD value:

  • On the stats banner (when I'm set to show the allocated fund in USD)... this should show $80,000 (for some reason, it didn't change when I updated admin bro):
    image
  • project card looks good
  • project single page "card" looks good, both in the estimate matching table & the big value
  • project single page donation tab for the round looks good

When set to show MATIC value:

  • On the QF stats banner (when I'm set to show the allocated fund in MATIC)... this should show 10,000 MATIC
    image
  • project card looks good
  • project single page "card" looks good, both in the estimate matching table & the big value
  • project single page donation tab for the round looks good

If you are fixing things on that banner @RamRamez maybe you can also address this rounding issue on the stats banner...

  • This should show up to 2 decimal places... i.e. $693.67
image

@laurenluz Thanks for testing.
Done!

@laurenluz
Copy link
Member Author

Looks great! I just checked again, and didn't see any issues on the preview.

RamRamez added a commit that referenced this issue May 6, 2024
…-token-&-amount-to-be-something-other-than-USD-#3839

# Conflicts:
#	src/apollo/gql/gqlProjects.ts
#	src/apollo/gql/gqlQF.ts
#	src/apollo/types/types.ts
RamRamez added a commit that referenced this issue May 6, 2024
…oken-&-amount-to-be-something-other-than-USD-#3839

Allow to set the matching pool token & amount to be something other than usd
@RamRamez RamRamez assigned maryjaf and unassigned RamRamez and CarlosQ96 May 6, 2024
@RamRamez
Copy link
Collaborator

RamRamez commented May 6, 2024

@maryjaf to test and verify

@maryjaf
Copy link
Collaborator

maryjaf commented May 6, 2024

please take a look on below video @RamRamez

  • In the first step, the QF round data in admin is set on MATIC
  • Then I've checked the box : Allocated Fund USD Preferred
  • after refreshing QF page, the "Galactic Giving Metrics" has been updated correctly and 80000$ is shown
  • but the other items is shown based on matic and after second refreshing it has been fixed
Screen.Recording.2024-05-06.at.4.15.36.PM.mov

@RamRamez
Copy link
Collaborator

RamRamez commented May 6, 2024

@maryjaf project cards need about 1 minute before refresh, I think it's ok because it's only set once for each QF round.

@koday1
Copy link
Collaborator

koday1 commented May 7, 2024

@maryjaf @RamRamez Do you know when this will be merged to prod? Glo Dollar is asking if we can change the matching estimate table from DAI to USDGLO, this issue will allow that and I am hoping to provide them with a date when it will be available. Thanks in advance

@RamRamez
Copy link
Collaborator

RamRamez commented May 7, 2024

@jainkrati @divine-comedian can we have a release for FE and BE soon to make this feature live?

@laurenluz
Copy link
Member Author

on prod I'm seeing an issue in admin bro now trying to edit the round:
image

@Meriem-BM
Copy link
Collaborator

@RamRamez I guess it's related to her role? can you confirm what role is that email registered with on prod.

@RamRamez
Copy link
Collaborator

RamRamez commented May 9, 2024

@Meriem-BM her role is "admin" so he must be able to edit, I can't edit that page too with my own account, I had access before tho.
I tested master branch locally and it allows me to edit the QF round, so I think there's no problem with codes

@Meriem-BM
Copy link
Collaborator

Meriem-BM commented May 9, 2024

I see, so there must be an error that appears on deployed prod, can you share with me the prod link and an account to test @RamRamez

@koday1
Copy link
Collaborator

koday1 commented May 15, 2024

@RamRamez @Meriem-BM Checking in here, any updates from last week? Have we tested this further?

Cc @laurenluz

@maryjaf
Copy link
Collaborator

maryjaf commented May 16, 2024

I've tested again on production and I didn't see the authorization error on edit page again, it seems it has been resolved .
Do you also confirm that it is solved? @laurenluz

@laurenluz
Copy link
Member Author

I'm not getting the error on production, but also... this isn't working as expected. @RamRamez @maryjaf

I set this for galactic giving round:
image

but I still see all the values in USD or DAI

image

image

Is this because the round was set up before we pushed this fix?

@maryjaf
Copy link
Collaborator

maryjaf commented May 16, 2024

Is this because the round was set up before we pushed this fix?

No, on stg it works also for rounds that was set up before, it seems there is a problem on prod @RamRamez

image

@RamRamez
Copy link
Collaborator

@laurenluz this is not on production yet, it's only on staging as we talked before.
If you need this, I can prepare a cherry-pick for release.

@laurenluz
Copy link
Member Author

laurenluz commented May 16, 2024

but it is on production @RamRamez 🤔 the bug I had before was on prod... now there is no bug, but it doesn't work as expected.

the screenshot I shared editing the round - that's all from admin bro in prod.

Krati told me like last week that you guys merged & @maryjaf & I have been checking prod.

Is admin bro up to date, but it's not supposed to be controlling things on the FE on prod? or how is this working?

@RamRamez
Copy link
Collaborator

but it is on production @RamRamez 🤔 the bug I had before was on prod... now there is no bug, but it doesn't work as expected.

the screenshot I shared editing the round - that's all from admin bro in prod.

Krati told me like last week that you guys merged & @maryjaf & I have been checking prod.

Is admin bro up to date, but it's not supposed to be controlling things on the FE on prod? or how is this working?

@laurenluz backend is merged on production so you can see the new fields are added in AdminJS but frontend not merged yet so it won't apply the changes.

@laurenluz
Copy link
Member Author

ooh I see.

@RamRamez
Copy link
Collaborator

@laurenluz this feature is now live on production, you set custom tokens for matching pools, also you can define QF round banner and sponsors from AdminJS. Besides that, you can fill "Allocated Fund USD" and "Allocated Token Symbol" fields for previous QF rounds using AdminJS to show in /qf-archive page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 it's a blocker to other tasks or issues.
Projects
None yet
Development

No branches or pull requests

8 participants