Hey @krunalunidex, thanks for submitting this!
Overall, adapter looks good, but one issue is that the adapter lists the protocol launch date as 2020-10-30, but queries after that date are still failing. Even 2021-10-30 (1 year after launch) is still failing.
Can you update the launch date to be the date that fees become available?
Also, the query seems to make the assumption that the FTM data will always be returned first, and the USDC data will always be returned second. It seems that this assumption might not always hold up.
It should be easier to query the dayData
entities by ID instead, such as the ID 0x0000000000000000000000000000000000000000-19169
for FTM and 0x04068da6c83afcfa0e13ba15a6696662335d5b75-19169
for USDC. The second number in the ID is the day number, you can look at the Uniswap adapter for an example of how to use those.
Also, an icon must be included in the adapter, preferably an SVG icon. Click the “Image Library” in the bottom left of the adapter editor to upload an icon.
Other than that, couple style fixes:
- The
Promise.all
on line 9 is unnecessary, can be reduced to this:
const ftmPrice = await sdk.coinGecko.getHistoricalPrice('fantom', date);
- The use of “variable” for Graph queries is deprecated, you can simplify the code to this:
const data = await sdk.graph.query(
'unidex-finance/unidexleverage',
graphQuery,
{
date: sdk.date.dateToTimestamp(date),
nextDate,
},
);