Dec 16, 2024 01:53 PM
I am fetching specific cryptocurrency data from CoinGecko using the Data Fetcher and populating it into a table called Tokens. Additionally, I have a table called Positions, which is linked to the Tokens table. The Positions table is where I track my Liquidity Pools.
The challenge arises because the order of the Tokens table can change dynamically since it is populated with live data refreshed several times a day. Changes in market cap or the addition of new coins may shift data up or down in the Tokens table. This can lead to issues in the Positions table, where the linked entries might display incorrect coins.
For example, let's say my Tokens table initially contains the following coins: BTC, ETH, ARB, USDC, SUI, FET, and MATIC. Suppose I’m tracking the MATIC/USDC pair in a Liquidity Pool within the Positions table. At first, MATIC is in row 7, and USDC is in row 4 in the Tokens table.
Now, if the market cap changes or I add a new coin, such as SOL, which is inserted into row 4, the data in the Tokens table shifts. USDC moves to row 5, and row 4 now shows SOL. Consequently, the Positions table updates incorrectly, displaying MATIC/SOL instead of MATIC/USDC.
Is there a way to prevent this issue and ensure that the Positions table maintains accurate references to the intended coins, regardless of the shifting rows in the Tokens table?
Dec 16, 2024 08:13 PM
Hi,
Please show primary and linked fields in both tables, at least 2-3 records. You can hide other fields and filter records, if you don't want to share too much info. Also,
Positions table updates incorrectly, displaying MATIC/SOL instead of MATIC/USDC - how it looks like? Do you have 2 different linked fields in Positions table?
Dec 17, 2024 11:00 AM - edited Dec 17, 2024 11:04 AM
Here is an example as current
For demo purpose; I’ve added a new coin (SOL) to the Tokens table. A similar scenario could occur if CoinGecko's market data changes, causing items in the Tokens table to rearrange. As a result, all my USDC from the Quote Token column has shifted to Doge, and several other coins under the Base Token column have also moved.
Dec 17, 2024 01:59 PM
It looks harder than I think before.
I see that a reason of problem is the way how data refreshed in the table, so you should seek for answer in Data Fetcher, not Airtable. I never used this extension and I can't test 3rd party extensions in my environment, but I just trying to guess.
Maybe you should change a write mode from 'Append' to 'Update' according to this help Article? So it will maintain accurate references to records already existing?