Skip to content

Conversation

dskloetc
Copy link
Contributor

@dskloetc dskloetc commented Sep 19, 2025

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

Description

This PR adds the transport functionality for the FTSE SFTP external adapter, making it functional for the first time.
The EA downloads a CSV file from SFTP and parses the current value of a specified index out of it.
Previous PRs added utilities for downloading the file and parsing the CSV.
This PR brings all of it together.

The PR is based on this PR by @chray-zhang. Because he's on vacation I decided to clean it up instead of reviewing it.

Additionally I first split out these PRs to make this PR easier to review:

I made this PR 2 separate commits. The first commit has Chray's changes from the original PR and the second commit has my change on top of it. But I recommend reviewing it as a single change.

Changes

  1. Remove unused definitions.
  2. Make boilerplate code more in line with standard generated boilerplate.
  3. Add filename in the response data to make it clear which file was used to parse the index value from.
  4. Change endpoint name from ftse_sftp to sftp to avoid unnecessary redundancy.
  5. Add transport handler which uses previously merged utilities to download and parse the necessary file.
  6. Remove ftse-sftp from README black list.

Steps to Test

  1. Run added unit tests and integration tests
yarn test packages/sources/ftse-sftp/test/
  1. Manually
curl --silent -S -X POST http://localhost:8080 -H 'Content-Type: application/json' -d '{
  "data": {
  "instrument": "FTSE100INDEX"
}
}'
{
  "data": {
    "filename": "ukallv1809.csv",
    "result": {
      "indexCode": "UKX",
      "indexSectorName": "FTSE 100 Index",
      "numberOfConstituents": 100,
      "indexBaseCurrency": "GBP",
      "gbpIndex": 9228.11104112
    }
  },
  "statusCode": 200,
  "result": 9228.11104112,
  "timestamps": {
    "providerDataRequestedUnixMs": 1758277954190,
    "providerDataReceivedUnixMs": 1758277956684
  },
  "meta": {
    "adapterName": "FTSE_SFTP",
    "metrics": {
      "feedId": "{\"instrument\":\"ftse100index\"}"
    }
  }
}
curl --silent -S -X POST http://localhost:8080 -H 'Content-Type: application/json' -d '{
  "data": {
  "instrument": "Russell1000INDEX"
}
}'
{
  "data": {
    "filename": "daily_values_russell_250918.CSV",
    "result": {
      "indexName": "Russell 1000® Index",
      "close": 3633.43
    }
  },
  "statusCode": 200,
  "result": 3633.43,
  "timestamps": {
    "providerDataRequestedUnixMs": 1758277966697,
    "providerDataReceivedUnixMs": 1758277967910
  },
  "meta": {
    "adapterName": "FTSE_SFTP",
    "metrics": {
      "feedId": "{\"instrument\":\"russell1000index\"}"
    }
  }

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 or update the soak testing blacklist.
  • 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.

Copy link

changeset-bot bot commented Sep 19, 2025

🦋 Changeset detected

Latest commit: 80d40de

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

This PR includes changesets to release 1 package
Name Type
@chainlink/ftse-sftp-adapter Major

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 marked this pull request as ready for review September 19, 2025 10:35
@dskloetc dskloetc requested a review from mxiao-cll September 19, 2025 13:59
Copy link
Contributor

@mxiao-cll mxiao-cll left a comment

Choose a reason for hiding this comment

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

Wait for release

@dskloetc dskloetc enabled auto-merge (squash) September 19, 2025 14:14
@dskloetc dskloetc merged commit 725e85e into main Sep 19, 2025
17 checks passed
@dskloetc dskloetc deleted the kloet/ftse branch September 19, 2025 14:21
@github-actions github-actions bot mentioned this pull request Sep 19, 2025
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