{"id":27742555,"url":"https://github.com/astarnetwork/dapp-staking-oracle","last_synced_at":"2025-08-11T02:07:40.190Z","repository":{"id":232395970,"uuid":"775568669","full_name":"AstarNetwork/dapp-staking-oracle","owner":"AstarNetwork","description":"Scripts for off-chain dapp staking v3 oracle service","archived":false,"fork":false,"pushed_at":"2024-08-02T10:16:20.000Z","size":91,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-28T16:57:25.681Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AstarNetwork.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-03-21T16:22:02.000Z","updated_at":"2024-08-02T10:16:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"13f4d715-1842-4c9d-be42-12502a235e86","html_url":"https://github.com/AstarNetwork/dapp-staking-oracle","commit_stats":null,"previous_names":["astarnetwork/dapp-staking-oracle"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AstarNetwork/dapp-staking-oracle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstarNetwork%2Fdapp-staking-oracle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstarNetwork%2Fdapp-staking-oracle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstarNetwork%2Fdapp-staking-oracle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstarNetwork%2Fdapp-staking-oracle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AstarNetwork","download_url":"https://codeload.github.com/AstarNetwork/dapp-staking-oracle/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstarNetwork%2Fdapp-staking-oracle/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269819032,"owners_count":24480087,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-28T16:42:58.024Z","updated_at":"2025-08-11T02:07:40.167Z","avatar_url":"https://github.com/AstarNetwork.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dApp Staking Oracle Service\n\nSimple script to ensure periodic native currency (ASTR or SDN) price feed to the network.\n\n## Overview\n\nThe script is fairly simple, and can be summed up into a few main steps.\n\n### Price Feed Aggregation\n\nPrice is taken from multiple sources, together with the timestamp.\nIt is possible that some sources might return errors or will be faulty in some way - they will be ignored.\nOnly valid return values will be considered for further processing.\n\n### Outdated Price Filtering\n\nPrice isn't pushed on-chain very often. At best, it can be updated once per hour.\nThis can easily be changed in the future, but due to some current source limitations, resolution is limited to 1 hour.\n\nIt's possible that some price feeds won't be updated since the last time query, essentially remaining the same.\nSuch data is considered to be stale, and we should ignore it.\n\nOnly the price feeds which have been updated since the last time script queried can be considered valid input.\n\n### Post-processing \u0026 Submission\n\nTo avoid problematic price feed outliers (bugs, malicious manipulations, etc.) script will consider the median of fetched values.\n\nOnce median is calculated, it will be submitted on-chain via a signed transaction.\n\n## Running\n\nFirst make sure to prepare the configuration file that will be used.\n\nInstall all of the required dependencies with `yarn install`.\n\nRun the program with `SEED='...' yarn start -c \u003cpath-to-config-file\u003e`.\n\n(`SEED` can be omitted if user wants to run as `Alice`)\n\n## Config\n\n`config.json` contains various parameters used to configure the service.\nThe URL parameters are self explanatory - depending on whether communication with L1 node via https or wss is needed, different endpoints can be provided. For L2, only single endpoint is needed.\n\nThe `network` parameter specifies which network is being fed the price values. Only supported options are `Astar` and `Shiden` (case-insensitive). For `Shibuya`, user should still use `Astar` as the parameter.\n\nThe `updateCadenceHours` parameter specifies how often should new price feed be checked, and potentially updated.\n\nThe `nativeCurrencySymbol` is used to specify on-chain enum value of the native currency ticker, e.g. `ASTR` or `SDN`.\n\n## Env\n\nUnless in test environment, user should specify the seed phrase or the private key to derive the account which will submit price updates to the chain.\n\nThe variable is `SEED`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastarnetwork%2Fdapp-staking-oracle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fastarnetwork%2Fdapp-staking-oracle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastarnetwork%2Fdapp-staking-oracle/lists"}