Skip to content

Conversation

cl-mayowa
Copy link
Collaborator

@cl-mayowa cl-mayowa commented Sep 3, 2025

Closes #OPDATA-3656

Description

This PR adds Copper EA as one of the EA to complete the solstice PoR endpoint.
......

Changes

  • Added wallets endpoint
  • Added subscription transport
  • Added a util file

NB: I did not add a changeset and test is scrappy

Steps to Test

yarn test packages/source/copper/test

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 3, 2025

🦋 Changeset detected

Latest commit: 0eff9cd

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

This PR includes changesets to release 1 package
Name Type
@chainlink/copper-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

@Subarna-Singh Subarna-Singh marked this pull request as ready for review September 8, 2025 13:19
Comment on lines +22 to +37
ETHEREUM_RPC_URL: {
description: 'RPC url of Ethereum node',
type: 'string',
default: '',
},
ETHEREUM_RPC_CHAIN_ID: {
description: 'Ethereum chain id',
type: 'number',
default: 1,
},
ARBITRUM_RPC_URL: {
description: 'RPC url of Arbitrum node',
type: 'string',
default: '',
},
ARBITRUM_RPC_CHAIN_ID: {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need both Eth and Arbi

Copy link
Contributor

Choose a reason for hiding this comment

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

I was using arbitrum for USDT, USDC, SOl and ETH.
USTB is available only on Ethereum.

However, what is the thumb rule of using a price feed? Which chain do we prefer?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd say just use Ethereum for everything then

Comment on lines +188 to +190
if (param.currencies && param.currencies.length > 0) {
parameters.currencies = param.currencies.join(',')
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this required? Can they just dump all currency to us in a portfolio?

Copy link
Contributor

Choose a reason for hiding this comment

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

When a new token is added to the portfolio, the jobspec input parameter must be configured to include the appropriate priceOracle value. This ensures that we only process currencies for which price oracles have been set up

Copy link
Contributor

Choose a reason for hiding this comment

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

Right but the jobSpec already contains them under the token field?

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.

I wrote a piece that does toUSD conversion via feeds here: https://github.com/smartcontractkit/external-adapters-js/pull/4001/files#diff-b055dd5883b7d442ff66fab11e1b72a8c60be605839d13b94e4f65323e11ec6aR13

Wonder if your EA should simply reference my EA or vice versa?

Eventually we do want to swap into the streams solution

Comment on lines +22 to +37
ETHEREUM_RPC_URL: {
description: 'RPC url of Ethereum node',
type: 'string',
default: '',
},
ETHEREUM_RPC_CHAIN_ID: {
description: 'Ethereum chain id',
type: 'number',
default: 1,
},
ARBITRUM_RPC_URL: {
description: 'RPC url of Arbitrum node',
type: 'string',
default: '',
},
ARBITRUM_RPC_CHAIN_ID: {
Copy link
Contributor

Choose a reason for hiding this comment

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

I was using arbitrum for USDT, USDC, SOl and ETH.
USTB is available only on Ethereum.

However, what is the thumb rule of using a price feed? Which chain do we prefer?

)
}

// if (adapterSettings.ETHEREUM_RPC_URL) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Removed these comments

Comment on lines +188 to +190
if (param.currencies && param.currencies.length > 0) {
parameters.currencies = param.currencies.join(',')
}
Copy link
Contributor

Choose a reason for hiding this comment

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

When a new token is added to the portfolio, the jobspec input parameter must be configured to include the appropriate priceOracle value. This ensures that we only process currencies for which price oracles have been set up

@Subarna-Singh
Copy link
Contributor

I wrote a piece that does toUSD conversion via feeds here: https://github.com/smartcontractkit/external-adapters-js/pull/4001/files#diff-b055dd5883b7d442ff66fab11e1b72a8c60be605839d13b94e4f65323e11ec6aR13

Wonder if your EA should simply reference my EA or vice versa?

Eventually we do want to swap into the streams solution

I dont understand the ask here.

@Subarna-Singh
Copy link
Contributor

I wrote a piece that does toUSD conversion via feeds here: https://github.com/smartcontractkit/external-adapters-js/pull/4001/files#diff-b055dd5883b7d442ff66fab11e1b72a8c60be605839d13b94e4f65323e11ec6aR13
Wonder if your EA should simply reference my EA or vice versa?
Eventually we do want to swap into the streams solution

I dont understand the ask here.

I think I understand.
You want to limit call to price feeds.
Using a single EA for that and using copper/binance only for balance retrieval makes sense.

@mxiao-cll
Copy link
Contributor

Using a single EA for that and using copper/binance only for balance retrieval makes sense.

No, I mean to re-use code that does token to USD calculation, we do want to use a single EA eventually once we switch to streams

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.

3 participants