Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

203
Visualizações
How to structure queries and a data model in JavaScript to show matching data from various sources?

I'm working on a POC to pull data from various liquidity pools (paired tokens, i.e. WEI/USDT from various exchanges.

In trying to create something like the DAI chart seen here:

enter image description here

I am trying to come up with a query and data model in JavaScript to contain this data.

The given would be "DAI". First get Uniswap results with DAI pools (any pool pairs containing "DAI"). Then get a list of results from SushiSwap of matching "WETH". Since both sources will likely not have all matching pools, with these two lists in memory, create a list of all items that match, i.e. USDT/WETH (matching in green in the image above).

I initially was going to create an associative array with a list of tokens to match:

poolList["Uniswap"] = { collection of pool objects }
poolList["Sushiswap"] = { collection of pool objects }

Where the collection data would looks something like

{
  "data": {
    "pools": [
      {
        "token0": {
          "id": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
          "name": "Wrapped Ether",
          "symbol": "WETH"
        },
        "token1": {
          "id": "0xd1063ee5ec2891991a29fefb52bcc448cd386844",
          "name": "BanDogge Mastiff",
          "symbol": "DOGGE"
        }
      },
      {
        "token0": {
          "id": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
          "name": "Wrapped Ether",
          "symbol": "WETH"
        },

How would one store the data from various exchanges so that either a filters list exists of common pairs, or create some sort of 2D array reflecting how the chart above appears?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I went about looking at this at the ground level: What kind of data problem is this?

In addressing this, I was able to work through a suggested response to my question, What can be used to identify the source collection for common elements from n-number of collections? and came up with a solution that renders the data in a workable format:

enter image description here

The table does not exactly reflect the initial question, however, (index) represents the pool name or token pairs, i.e. USDT/ETH. Subsequent columns represent exchanges and their properties that contain these token pairs or liquidity pools.

To maintain the context of the original question and to assist others, the full code solution can be found here.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda