Vectorize EVERYTHING

Thus far all the Moralis ā€œconvenience functionsā€ seem to run in scalar mode. You can have the price for any token you like at any block you like. Oneā€¦dataā€¦pointā€¦perā€¦call.

If you want to see any dynamics at all you wind up creating legions of API calls in a map or for loop. And itā€™s HORRIFYINGLY inefficient, slow, and unreliable to have the internet in every step of the loop.

[Every function that takes a network,
Every function that takes an address,
Every function that takes a to_block,
] NEEDS TO OPTIONALLY TAKE AN ARRAY.

And yes that opens up a data size issue. Soā€¦I dunnoā€¦ Limit each API call to 1000 or even 100 responses? I.e. require {(network.length * address.length * to_block) <= 100.}

We can work with that. Itā€™d still be 100x faster and more reliable than what we have now. And it doesnā€™t seem like that hard a change to make.

Do the loops on the server side, not across the entire internet.

Then we can create proper historical charts and algorithms.

Weā€™re going to bludgeon the Moralis servers with wave after wave of legions of tiny little API calls anyway until you make it happen. #DeathBy1000APICalls

1 Like