Skip to content

Unable to fetch prices for Safes with a high number of assets #2314

Open
@iamacook

Description

Description

Our current prices provider (CoinGecko) seemingly has a limit for the number of token prices that can be requested at once, throwing an error if this is breached:

Error getting token prices: Error: Error getting {addresses} price from provider [status: 10012] 

If this happens, an empty array of token prices is returned by the datasource, meaning that fiat balances are 0.

We should incrementally fetch prices based on the provider limit and concatenate them accordingly. We should also add warnings specific to the error code, should this limit be changed without us knowing.

Note: receiving spam tokens can cause su

Reproduction steps

  1. Fetch the balances on a Safe with a high number of assets, e.g. eth:0x220866b1a2219f40e72f5c628b65d54268ca3a9d or gno:0xB8d760a90a5ed54D3c2b3EFC231277e99188642A (the latter has a lot of spam tokens).
  2. Oberve the datasource error from CoinGecko (the following is taken upon creation of this issue):
Error getting token prices: Error: Error getting 0x4208aa4d7a9a10f4f8bb7f6400c1b2161d946969,0xb6ed7644c69416d67b522e20bc294a9a9b405b31,0x8bc49e1869e90090392cc345265c2379c4cfa0bb,0x6251669aba170683f33acba845b2eda89d90773e,0x7af22777c70ef7e673f70ccd3148731e8aa74b22,0xbbfbb2e65da09897cfb1318f827bad1934079660,0xbcde3b2d6f85311a4b718ddb5c9f0b99989d094d,0x3bb78746c214a4f5f68de6691966e958c2a8b90f,0x3eb26ff6973072a9453cdc5606c3346bafa3701e,0x7e3e8761c02d97ce32651f28f055ef9c216b699c,0xbb97a6449a6f5c53b7e696c8b5b6e6a53cf20143,0xf973d5d0248305af5db2a81d3f677f1f61e9b517,0x9f0f0c7ca28667cfe9cc66913d85b5385117399f,0x73885eb0da4ba8b061acf1bfc5ea7073b07ccea2,0x32f53f8c54f8b2930f2bef3a16dc6b4d5aae2e9c,0x60992cb28140c1ef341bafa898619d31cff41146,0x00000006e55a9364b657e3b91cd0411b4fd11ac2,0xa0d2d40fd0ca003223b29e7a40360abd00e7fadf,0x9abacdf9f3ad8db6f4bac4b52afe94377419e8cc,0x026ade9ba164881c80de6d49580193c3528303db,0x8c71171117e350f4a1cd883f9976419333b46e15,0xfa52aed72100f36cfa6fe6679903ecab184a8ff3,0x2f273e976bc94d1092ec0f547c3f3ab8e4e89570,0x476f143d75b851538a39aabc5af0fd412a343f60,0x0b037269d25c48304482d3e2e7c66590fdfda8d6,0x8e7ee09e129c96f3b4f5894056bf6a08e3846ca2,0xce369947497728129e75ac5160d7c2cd76fd5910,0x7ffd4f91540118ae3cc849897ca3c4064deae3a6,0xa8162a07efa81602c3803772d18d1789a44fd87a,0xdf7a6a1214b3cbd3f9812434437f61a0d4cbbe1f,0x566fa3a666f4a5036bb598f6364e3f50c2066179,0xa04e18e86408fa651c144f10de5236493d070e78,0x8ee84fed29b2e7161d373976c5a13e933793ca3e,0x1f7dd05abec2b6f3de5c2623be223fb64c34f87e,0x6f7d1c3bf1ee0f64a36968260abd5bfbda96e807,0x60538710b4f8ab01273611ca7211ec28d1cc2b18,0xd149ee917f953f807a8dc94eae3b6eecf71a7efb,0x69a74a6b50ad6a11ad838ce3c520b92922db07ae,0x3dc8b6f80a4bdf33db1cae2d44db9e28eb15b7cd,0x82b314f48ebf61672de01a47e2ae9aac65527c54,0x2e53ca775c5358a41b45cd0407e7d7f7a84c863f,0xda311c916277b9990d2e614e842f4c091ce9afe0,0x5593f9e0ee647eb869ac565c98da9b49854413a8,0x5e72db27bdea3a74c92172391a652f3dd2f7df82,0x134f18a6864efb61ea8636d1bdb0cc3c4c8fd797,0xbafd9e1ed130e79c4bf0c4be0638b340c6d732b9,0x7e135a7ca9bcaaeff6e92cdbc5fa0a92a8bb0603,0xf529bad4092d1babac2f653032d7c862c8682a53,0x8e49dc57bbf92fc2f7e58e9fb4996764acc4a9b8,0x51bb725d1a1a4dcc0385cda9ed1c7fe1481dfcc3,0x3c4f8fe3cf50eca5439f8d4de5bdf40ae71860ae,0x288c72aab7e6d1f688964c95404bc34dc0978528,0x63e785789fc40791399038e9cea7cdd39aa9cd1a,0x8ba3d1c8c8f0804d0c20179a956ac27856a05f66,0xdce4550b1e46a88e7969000605be5cb1bbddc034,0x594daad7d77592a2b97b725a7ad59d7e188b5bfa,0x3e19f8808d651ebf3a67025f05123b44c6beb239,0xb8d36015ddc669557d424121ce21ba1dcf7a0860,0x5c885be435a9b5b55bcfc992d8c085e4e549661e,0x65af88070c589d7f73798ddbf976a4977270c726,0x60f2ca386ebf2ec4b03bb7d875cb13a7593a9813,0x9c0352a53f3e13f34fce89fde9c1e564217ef849,0x9b9090dfa2cebbef592144ee01fe508f0c817b3a,0x72c5192e420b604af118f891c1057836b39291a4,0x852a6080ea48b2b3c56a61ad15975a80f587e09a,0x8aa8d3703ca52b47263e33f2efc4dfa82f20c9af,0x22682a51efe7fc012b585daca8075bdeefdc4378,0xf0a06c0612591c8de92ae4fe448426f9094ee823,0x47ab23a0838d2cf4b1e3995186c2f8082fb660e4,0x2d94bfdbd982e4e988928ddc2c4cf26d5ff115cd,0xc2927ed3042e49ec456c20dfd3c48787ee92e33c,0xb2321247d244289852607b983955fd3eaf78eec5,0x89c786c3c669ad19e8b2228d855afe9b29965def,0xde0bda4693cdd2a7f24c231ba88b51058ea6b4d6,0xb1a7f14d1681a5c23a4c098b4ede8be96bb945e6,0x4f22dd9cc043518446d5d0fdca82d00a5563a399,0xf4b5c9ecca2634b839fef75df9da993a4b2d50e0,0x235c4e29d1d8b5c7886e35dfcb441c2a990280db,0x444f0a89416dfb8981e027fe4ba37868a22d47cd,0x54aa57c4d8aa5a2e9ee7f3b6c7bdf3193324dd68,0xe075c2eb2271442db62986d820008d19aaa91223,0x8807da74fe74803f4e98950f66488da507ac3d80,0x48e9c94fb4f252b6aed287dca2381b760de5fb89,0x457245a8195d22d0313008aeb002b8bb5502ff8a,0xafbfe89f37f35c93001700eb6b6f5b99dda6a1d0,0x801d20cc9c011d24f6b0e69ad8e607aaf3f1a91e,0xc4698edb9d4629b5fe33bddca3fd36ec69166cdd,0x5e5d77b8d04376e951787118d8c68ff24227b128,0x22e845cbbafda629c0401de5f23e3f73b0cfa68a,0xb4bfdee9dde791f1416db37fb857cff18ba7ba15,0x3fcc0c22ec7737a74a83f54f938cae32e69b7fc0,0x72029a101ea0783af587cd8da27e9de7bace061a,0x86e51b516c20adc70ba45bb44930e713625b44ca,0x0d02755a5700414b26ff040e1de35d337df56218,0xbcdc4faa88071cbb7dd9820cc781fe98f23cc65b,0x79e28533f36ed6adc19ecdd98ead6acb1e26a41e,0xf2f7f30c2b6a2dcc62075347ec2bc5f174a7334a,0xbfdadf21a318d1896c8281033ebd56a31d8f8321,0xcbead46c119ca7174fa63df1c5bc90406da9c628,0xe5d89696d170a5af25d38ffb96b6539a0b537653 price from provider [status: 10012] 

Expected behavior

  1. Prices are requested according to provider batch limits and concatenated.
  2. Should an error occur for specific token(s) we return null to signifiy we aren't aware of the price.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions