15 Commits

Author SHA1 Message Date
romandvo
5cdbf5b2d7
Avoid CoinGecko's API rate limit with time delays
Updating token prices with ./mev prices fetch-all can fail due to CoinGecko's API rate limits https://www.coingecko.com/en/api/pricing_2 (10-30 requests a minute)

Error message:
ValueError: {'status': {'error_code': 429, 'error_message': "You've exceeded the Rate Limit. Please visit https://www.coingecko.com/en/api/pricing to subscribe to our API plans for higher rate limits."}}

Currently, TOKEN_ADDRESSES length is 14 which can (and does) fail the function, depending on the dynamic limit

By introducing time delays between API queries we can avoid hitting the limit and failing the price update.
2023-03-16 14:11:25 +02:00
Gui Heise
df8525d582 Correct instance name 2022-01-19 17:03:06 -05:00
Gui Heise
f0064e01b2 Shared function, start/end -> after/before 2022-01-19 16:48:20 -05:00
Gui Heise
c4f82bdbd6 Add prices-range 2022-01-19 15:43:59 -05:00
Gui Heise
d8f896bda3 Add Eth and Weth prices 2022-01-18 16:33:32 -05:00
Gui Heise
3072e4a826 Specify coingecko id's and remove async keyword from cli 2022-01-14 13:17:37 -05:00
Gui Heise
2e22103713 Add coingecko api 2022-01-13 01:26:53 -05:00
Luke Van Seters
5b1efd5e6d Support all tokens we have supported for coinbase 2022-01-10 12:27:08 -05:00
Gui Heise
1916c81293 Fix USDC const 2021-12-22 14:59:34 -05:00
Luke Van Seters
b9544eb18b Fix whitespace for isort 2021-12-14 13:14:13 -05:00
Luke Van Seters
d5f73b5e3a Run isort on all files 2021-12-13 18:46:39 -05:00
Gui Heise
d736b38845 Add coinbase names for addresses 2021-12-08 15:09:06 -05:00
Gui Heise
00c73b228d Add supported token addresses 2021-12-07 15:53:45 -05:00
Luke Van Seters
bed8520bc8 Write prices on fetch-all 2021-11-18 11:55:42 -05:00
Luke Van Seters
2dc14218bf Add support for fetching all supported prices 2021-11-18 11:43:59 -05:00