Skip to content

nav-fund-services: Make sure the queried date range does not go past FundOfficialAccountingLastAvailableDate - #5392

Merged
dskloetc merged 5 commits into
mainfrom
kloet/nav-fund-dates
Sep 24, 2026
Merged

dskloetc merged 5 commits into
mainfrom
kloet/nav-fund-dates

Conversation

@dskloetc

@dskloetc dskloetc commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

https://smartcontract-it.atlassian.net/browse/OPDATA-8508

Description

When trying to get data for a new GlobalFundID, I was getting errors about the queried date range. It turned out there is an extra requirement that the toDate is not allowed to be after the value of FundOfficialAccountingLastAvailableDate.

This was never an issue because apparently FundOfficialAccountingLastAvailableDate and toDate were aligned on other funds. But not with this new fund.

Changes

  1. Add code to fetch FundOfficialAccountingLastAvailableDate.
  2. Take FundOfficialAccountingLastAvailableDate into account when determining the date range to use.
  3. Update/add tests.

Steps to Test

curl --silent -S -X POST http://localhost:8080 -H 'Content-Type: application/json' -d '{
  "data": {
    "endpoint": "nav",
    "globalFundID": 257726,
    "resultField": "endingBalance"
  }
}'

{
  "statusCode": 200,
  "result": 186.45354297,
  "data": {
    "globalFundID": 257726,
    "navPerShare": 0,
    "nextNavPerShare": null,
    "navDate": "09-15-2026",
    "endingBalance": 186.45354297,
    "navDateTimestampMs": 1789455600000
  },
  "timestamps": {
    "providerDataRequestedUnixMs": 1790172412636,
    "providerDataReceivedUnixMs": 1790172415910,
    "providerIndicatedTimeUnixMs": 1789430400000
  },
  "meta": {
    "adapterName": "NAV_FUND_SERVICES",
    "transportName": "default_single_transport",
    "metrics": {
      "feedId": "{\"globalFundID\":257726,\"navDateTimestampTimezone\":\"america/los_angeles\",\"resultField\":\"endingbalance\"}"
    }
  }
}

Quality Assurance

  • If a new adapter was made, or an existing one was modified so that its environment variables have changed, update the relevant infra-k8s configuration file.
  • If a new adapter was made, or an existing one was modified so that its environment variables have changed, update the relevant adapter-secrets configuration file.
  • If a new adapter was made, or a new endpoint was added, update the test-payload.json file with relevant requests.
  • The branch naming follows git flow (feature/x, chore/x, release/x, hotfix/x, fix/x) or is created from Jira.
  • This is related to a maximum of one Jira story or GitHub issue.
  • Types are safe (avoid TypeScript/TSLint features like any and disable, instead use more specific types).
  • All code changes have 100% unit and integration test coverage. If testing is not applicable or too difficult to justify doing, the reasoning should be documented explicitly in the PR.

@changeset-bot

changeset-bot Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 76adcbc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@chainlink/nav-fund-services-adapter Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dskloetc
dskloetc force-pushed the kloet/nav-fund-dates branch from 896e000 to 76adcbc Compare September 23, 2026 14:15
@dskloetc
dskloetc marked this pull request as ready for review September 23, 2026 14:49
@dskloetc
dskloetc requested a review from a team September 23, 2026 15:01
@dskloetc
dskloetc merged commit 4b62119 into main Sep 24, 2026
22 of 23 checks passed
@dskloetc
dskloetc deleted the kloet/nav-fund-dates branch September 24, 2026 08: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.

2 participants