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

Pr 727 create oracle services data agregator #769

Conversation

netboz
Copy link
Contributor

@netboz netboz commented Dec 13, 2022

Description

  • Add value aggregator in front of services providers

Fixes #727

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update ( configuration file changed )

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • From 3 mocked services, asserts the median is computed from the received values
  • From 4 mocked services ( even number ) asserts the median from the 2 mean values is returned

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@tenmoves
Copy link
Contributor

this pr fixes #727 and not 272 (typo)

@netboz netboz force-pushed the pr_727_create_oracle_services_data_agregator branch from 1bb00eb to 1c71468 Compare December 14, 2022 15:36
netboz added a commit to netboz/archethic-node that referenced this pull request Dec 14, 2022
@samuelmanzanera samuelmanzanera added the core team Assigned to the core team label Dec 15, 2022
@netboz netboz added oracle chain Involve OracleChain enhancements labels Dec 15, 2022
@samuelmanzanera
Copy link
Member

I did try the PR and I got this error:
image

@bchamagne
Copy link
Member

bchamagne commented Jan 5, 2023

I tried to block 1 of the 3 providers (coinmarketcap) and I get this result:

2023-01-05 13:29:05.633 [warning] Service : Archethic.OracleChain.Services.UCOPrice : Cannot fetch values from
                provider: Archethic.OracleChain.Services.UCOPrice.Providers.CoinMarketCap with reason : [failed_connect: [{:to_address, {'coinmarketcap.com', 80}}, {:inet, [:inet], :econnrefused}], failed_connect: [{:to_address, {'coinmarketcap.com', 80}}, {:inet, [:inet], :econnrefused}]].
2023-01-05 13:29:05.703 [warning] Service : Archethic.OracleChain.Services.UCOPrice : Unexpected answer while querying provider : {:ok, {false, Archethic.OracleChain.Services.UCOPrice.Providers.CoinMarketCap}}
{:ok, %{"eur" => 0.04285300000000001, "usd" => 0.04542245773793001}}

The price is really far from what's on the 2 other provider (coinpaprika and coingecko are at ~0.8)

When I log result from the UCOPrice module :

_result: %{
  "eur" => [0.08478673041826183, 0.08488114771271422, 0.08625688028498835,
   0.08266352536799974, 0.08570600000000002],
  "usd" => [0.08987052666466204, 0.08997060520215051, 0.09142882643806899,
   0.0876200146429952, 0.09084491547586002]
}
{:ok, %{"eur" => 0.04285300000000001, "usd" => 0.04542245773793001}}

@netboz netboz force-pushed the pr_727_create_oracle_services_data_agregator branch from 38ba4b2 to d1dfc75 Compare January 6, 2023 12:50
@Neylix Neylix merged commit 7354d91 into archethic-foundation:develop Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core team Assigned to the core team enhancements oracle chain Involve OracleChain
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create an oracle data aggregator
5 participants