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

Asset list report update #2289

Merged
merged 10 commits into from
Aug 7, 2024
Merged

Asset list report update #2289

merged 10 commits into from
Aug 7, 2024

Conversation

kattylucy
Copy link
Collaborator

@kattylucy kattylucy commented Jul 18, 2024

Update asset list report

  • Use subquery instead of onchain for the snapshots
  • Add new columns/value pairs
  • Add new date filter for asset report
  • Set as default filter value

#2273

  • Dev

@kattylucy kattylucy force-pushed the asset_list_report_update branch 3 times, most recently from 78419ee to 433f6d7 Compare July 23, 2024 20:13
@kattylucy kattylucy force-pushed the asset_list_report_update branch 3 times, most recently from c597118 to 38b9cc0 Compare July 25, 2024 18:24
@kattylucy kattylucy marked this pull request as ready for review July 25, 2024 18:24
Copy link

github-actions bot commented Jul 25, 2024

PR deployed in Google Cloud
URL: https://pr2289-app-ff-production.k-f.dev
Commit #: 4b4e7b5
To access the functions directly check the corresponding deploy Action

Copy link

github-actions bot commented Jul 25, 2024

PR deployed in Google Cloud
URL: https://app-pr2289.k-f.dev
Commit #: 4b4e7b5
To access the functions directly check the corresponding deploy Action

@hieronx
Copy link
Contributor

hieronx commented Jul 28, 2024

@kattylucy I was curious to test the new asset list report for the LTF pool (https://pr2289-app-ff-production.k-f.dev/#/pools/4139607887/reporting/asset-list) but ran into a few small issues, fixed those here: #2323

Besides that, it looks great though! Nice job refactoring the centrifuge.js code to use the subquery data :)

One main comment: it would be great if the Day dropdown could default to the date of today. (but remain Jan 1 of the year for all other reports).

@kattylucy
Copy link
Collaborator Author

Awesome, thanks for the help - I will fix the date @hieronx

@hieronx
Copy link
Contributor

hieronx commented Jul 28, 2024

Seeing it now in action, a few more small comments:

  • Let's remove the ID column, it doesn't add any useful information
  • Would be great to make the Name column values clickable, going to the asset detail page (https://pr2289-app-ff-production.k-f.dev/#/pools/4139607887/assets/1)
  • Would be great to, by default, sort by maturity date such that the furthest date in the future is at the top. I tried this already but it doesn't seem to work correctly.

And two issues I noticed in the DYF pool (see https://pr2289-app-ff-production.k-f.dev/#/pools/1655476167/reporting/asset-list, put date to 27/7/24):

  • If the maturity date is undefined, it should state Open-end rather than Jan 1, 1970.
  • If the notional is undefined, let's show - in the Face value column rather than 0.00 USDC.

@sophialittlejohn
Copy link
Collaborator

Nice work! Also just tested it and noticed a few things:

  1. the filters for active, repaid and overdue don't seem to work yet
  2. some pools don't have data in the asset-list report despite having assets (e.g https://app-pr2289.k-f.dev/#/pools/3783931117/assets). The loans are only in "Created" state so I'm not sure if they should appear in the report or not?

@kattylucy
Copy link
Collaborator Author

kattylucy commented Jul 30, 2024

The first one is definitely a bug, thanks for pointing out. The second question, I kept the previous logic regarding which loans to display, based on prev log we shouldn't display 'created' status loans. Do we want to change this? @hieronx @sophialittlejohn

@hieronx
Copy link
Contributor

hieronx commented Jul 30, 2024

@kattylucy I would include Created assets if you select Status All, but make the default Status filter Ongoing. (and rename Active to Ongoing)

@kattylucy
Copy link
Collaborator Author

I apologize but it seems like the subquery only returns ongoing assets - is not returning 'created' assets at all

@sophialittlejohn
@hieronx

@hieronx
Copy link
Contributor

hieronx commented Jul 30, 2024

Ah ok, then just leave them out. Would still default the status to Ongoing so repaid assets don't show up by default.

@hieronx
Copy link
Contributor

hieronx commented Jul 30, 2024

@kattylucy looking great!

One more comment: could you change the quantity col formatting from 10,170.00 USDC to 10,170.00?

@kattylucy
Copy link
Collaborator Author

kattylucy commented Jul 30, 2024

@hieronx Let me look into it! Thanks!!

@kattylucy kattylucy force-pushed the asset_list_report_update branch 2 times, most recently from e295e84 to 27809cc Compare July 30, 2024 19:10
@kattylucy
Copy link
Collaborator Author

One thing here, when clicking like this

reporting -> asset list report -> asset name

we go to the route for the specific asset. When clicking back, it takes me to the asset list instead of the table for reporting, should we change the behavior so the back button takes back to the prev page based on the user last page?

hope my question makes sense

@hieronx

@hieronx
Copy link
Contributor

hieronx commented Jul 30, 2024

we go to the route for the specific asset. When clicking back, it takes me to the asset list instead of the table for reporting, should we change the behavior so the back button takes back to the prev page based on the user last page?

Good point. Seems to make sense to me to change it like you suggest. @sophialittlejohn any thoughts?

@hieronx
Copy link
Contributor

hieronx commented Jul 31, 2024

@kattylucy two more comments from latest check:

Screenshot 2024-07-31 at 13 29 40

The sorting by maturity date doesn't seem to fully work yet.

Also, when the face value is undefined, can you change it to -? It should only show 0.0 if it is actually 0, not if it is undefined and thus does not apply. As seen on https://pr2289-app-ff-production.k-f.dev/#/pools/1655476167/reporting/asset-list.

@kattylucy
Copy link
Collaborator Author

@hieronx do you mind sending me the pool and the date you are using so I can confirm the issues? having a hard time reproducing the errors - thank you!

@hieronx
Copy link
Contributor

hieronx commented Jul 31, 2024

The face value I tested on https://pr2289-app-ff-production.k-f.dev/#/pools/1655476167/reporting/asset-list, with today's date.

The maturity dates I tested on https://pr2289-app-ff-production.k-f.dev/#/pools/4139607887/reporting/asset-list, also with today's date.

@kattylucy kattylucy force-pushed the asset_list_report_update branch 2 times, most recently from 778e825 to b7d1dc4 Compare August 1, 2024 13:33
Copy link
Contributor

@hieronx hieronx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me!

@@ -144,22 +144,36 @@ export type SubqueryAssetTransaction = {
export type SubqueryAssetSnapshot = {
__typename?: 'AssetSnapshot'
asset: {
actualOriginationDate: number
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Subquery never returns Rates or CurrencyBalances so this type is now misleading. getAssetSnapshots also uses this type and doesn't return any of the new additions, so consumers of that function may now expect values to be there that aren't there. I would suggest creating separate SubqueryPoolAssetSnapshot and PoolAssetSnapshot types to have the functions accurately reflect what they return

@@ -182,12 +296,15 @@ export function AssetList({ pool }: { pool: Pool }) {
setCsvData(undefined)
URL.revokeObjectURL(dataUrl)
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [data])
}, [snapshots])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some lint warnings in this file. for this line it's fine to disable

React.useEffect(() => {
if (!data.length) {
useEffect(() => {
if (!snapshots?.length) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why check for snapshots now and not data ? data may end up having no items because of the snapshots being filtered

const basePath = useBasePath()
const { loanStatus, startDate, setCsvData } = useContext(ReportContext)
const { data: poolMetadata } = usePoolMetadata(pool)
const poolCreditType = useMemo(() => poolMetadata?.pool?.asset.class || 'privateCredit', [poolMetadata])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would only keep the useMemo for data, the others here do more harm than good

@kattylucy kattylucy force-pushed the asset_list_report_update branch 2 times, most recently from e6a8fa3 to f563a16 Compare August 5, 2024 16:32
kattylucy and others added 8 commits August 6, 2024 08:07
- Name should be a link to asset page
- Undefined should display as '-'
- Undefined maturity date should display as open-end
- Data table should sort by default using maturity date desc
- Remove id column
this is unrelated to this work but when running the linter I found two warning of unused values
just a cleanup
@hieronx hieronx merged commit 732ea5f into main Aug 7, 2024
13 checks passed
@hieronx hieronx deleted the asset_list_report_update branch August 7, 2024 06:58
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

Successfully merging this pull request may close these issues.

4 participants