Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Your Render PR Server URL is https://papr-interface-pr-395.onrender.com. Follow its progress at https://dashboard.render.com/web/srv-cfrodst3t398eelin3jg. |
| }; | ||
| } | ||
|
|
||
| function targets( |
There was a problem hiding this comment.
moved this into its own helper file
e54b5e6 to
5b1a0c6
Compare
| * On one swap there was a tremendous market price which ruins the chart. | ||
| * Let's filter that one out. | ||
| */ | ||
| const OUTLIER_TIMESTAMP = 1675965383; |
There was a problem hiding this comment.
@cnasc is this still needed? think we used a % based now?
There was a problem hiding this comment.
We can get rid of this, we do throw out values that we judge are "too high"
| ) { | ||
| const now = Math.floor(Date.now() / 1000); | ||
|
|
||
| const sortedSwaps = [...swaps].sort( |
There was a problem hiding this comment.
not related, but seems we should be able to sort in the swap query itself? 🤔
| const underlyingDecimals = await erc20Contract( | ||
| configs[token].underlyingAddress, | ||
| token, | ||
| ).decimals(); |
There was a problem hiding this comment.
easier to get this from the subgraph and save RPC calls? 🤔
There was a problem hiding this comment.
you make a graphql below so could combine
There was a problem hiding this comment.
true, think its more readable to do this than entire graphQL call, we're on the server and tweeting every hour so performance less important?
lib/updates/market.ts
Outdated
| url: configs[token].paprSubgraph, | ||
| }); | ||
| const res = await graphQLClient | ||
| .query<TargetUpdatesByControllerQuery>(TargetUpdatesByControllerDocument, { |
There was a problem hiding this comment.
could possibly optimize by having a query that only fetches the most recent target? or just do an RPC call for target and newTarget?
There was a problem hiding this comment.
or if you want an accurate change over the last hour you had mentioned two RPC calls and passing in block height from an hour ago
| if (poolYesterdayRes.error) { | ||
| throw new Error(poolYesterdayRes.error.message); | ||
| } | ||
| const volumeUSDYesterday = poolYesterdayRes.data?.pool?.volumeUSD || 0; |
There was a problem hiding this comment.
@cnasc did we find that this is not accurate and we had to sum the hourly?
There was a problem hiding this comment.
We looked at summing the hourly data, but the fields came up as 0. My understanding is that this method is correct
|
@adamgobes reminder I think we decided I think this can go in |
No description provided.