Skip to content

Commit

Permalink
Update Kusama/Polkadot metrics (paritytech#910)
Browse files Browse the repository at this point in the history
  • Loading branch information
svyatonik authored Apr 19, 2021
1 parent 03168a7 commit c0d1f98
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@
"targets": [
{
"exemplar": true,
"expr": "Westend_to_Millau_Sync_kusama_price / Westend_to_Millau_Sync_polkadot_price",
"expr": "Westend_to_Millau_Sync_kusama_to_base_conversion_rate / Westend_to_Millau_Sync_polkadot_to_base_conversion_rate",
"interval": "",
"legendFormat": "At exchanges (actually Polkadot -> Kusama)",
"legendFormat": "Outside of runtime (actually Polkadot -> Kusama)",
"refId": "A"
},
{
Expand Down Expand Up @@ -377,9 +377,9 @@
"targets": [
{
"exemplar": true,
"expr": "Westend_to_Millau_Sync_polkadot_price / Westend_to_Millau_Sync_kusama_price",
"expr": "Westend_to_Millau_Sync_polkadot_to_base_conversion_rate / Westend_to_Millau_Sync_kusama_to_base_conversion_rate",
"interval": "",
"legendFormat": "At exchanges (actually Kusama -> Polkadot)",
"legendFormat": "Outside of runtime (actually Kusama -> Polkadot)",
"refId": "A"
},
{
Expand Down
16 changes: 8 additions & 8 deletions relays/bin-substrate/src/chains/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,21 @@ pub(crate) fn add_polkadot_kusama_price_metrics<T: finality_relay::FinalitySyncP
FloatJsonValueMetric::new(
registry,
prefix,
"https://api.coingecko.com/api/v3/simple/price?ids=Polkadot&vs_currencies=usd".into(),
"$.polkadot.usd".into(),
"polkadot_price".into(),
"Polkadot price in USD".into(),
"https://api.coingecko.com/api/v3/simple/price?ids=Polkadot&vs_currencies=btc".into(),
"$.polkadot.btc".into(),
"polkadot_to_base_conversion_rate".into(),
"Rate used to convert from DOT to some BASE tokens".into(),
)
})
.map_err(|e| anyhow::format_err!("{}", e))?
.standalone_metric(|registry, prefix| {
FloatJsonValueMetric::new(
registry,
prefix,
"https://api.coingecko.com/api/v3/simple/price?ids=Kusama&vs_currencies=usd".into(),
"$.kusama.usd".into(),
"kusama_price".into(),
"Kusama price in USD".into(),
"https://api.coingecko.com/api/v3/simple/price?ids=Kusama&vs_currencies=btc".into(),
"$.kusama.btc".into(),
"kusama_to_base_conversion_rate".into(),
"Rate used to convert from KSM to some BASE tokens".into(),
)
})
.map_err(|e| anyhow::format_err!("{}", e))?
Expand Down

0 comments on commit c0d1f98

Please sign in to comment.