You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the current BatchRequesterLoop, if the Coingecko API is down AND orchestrators have a non-zero minFeeInUSD, then no batches will be requested aka no withdrawals back to Ethereum will occur.
Empirically I've noticed the Coingecko public API can be a bit flaky sometimes (at least in the trading bot's usage) so we shouldn't depend on it to function in order to process withdrawals. It's nice that we have retries currently at least but ideally, we should make this flow independent of whether Coingecko works or not, as it's entirely plausible that their API goes down for a day.
I propose the following change:
add a separate goroutine that periodically checks Coingecko prices in the background (e.g. once per hour) and updates it in a coingeckoPrices map[common.Address]float64 defined on the peggyOrchestrator struct. This will keep a reasonably up to date mapping of the prices from Coingecko. The denoms for which this should be fetched are for any ERC-20 denom in the bank supply
Change the CheckFeeThreshold function to return the price from coingeckoPrices if the s.priceFeeder.QueryUSDPrice returns an error. So
Note: currently this isn't an issue since we're running the orchestrators with a 0 minFeeInUSD setting but in the future we should change this in order to increase the economic robustness of the bridge.
The text was updated successfully, but these errors were encountered:
In the current BatchRequesterLoop, if the Coingecko API is down AND orchestrators have a non-zero
minFeeInUSD
, then no batches will be requested aka no withdrawals back to Ethereum will occur.peggo/orchestrator/main_loops.go
Lines 311 to 315 in dd5760b
peggo/orchestrator/main_loops.go
Lines 331 to 339 in dd5760b
Empirically I've noticed the Coingecko public API can be a bit flaky sometimes (at least in the trading bot's usage) so we shouldn't depend on it to function in order to process withdrawals. It's nice that we have retries currently at least but ideally, we should make this flow independent of whether Coingecko works or not, as it's entirely plausible that their API goes down for a day.
I propose the following change:
coingeckoPrices map[common.Address]float64
defined on thepeggyOrchestrator
struct. This will keep a reasonably up to date mapping of the prices from Coingecko. The denoms for which this should be fetched are for any ERC-20 denom in the bank supplyCheckFeeThreshold
function to return the price fromcoingeckoPrices
if thes.priceFeeder.QueryUSDPrice
returns an error. SoNote: currently this isn't an issue since we're running the orchestrators with a 0
minFeeInUSD
setting but in the future we should change this in order to increase the economic robustness of the bridge.The text was updated successfully, but these errors were encountered: