-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NFT-765: Market updates twitter bot #395
base: main
Are you sure you want to change the base?
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. |
@@ -138,87 +137,3 @@ export function useControllerPricesData(): ControllerPricesDataReturn { | |||
error: null, | |||
}; | |||
} | |||
|
|||
function targets( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cnasc is this still needed? think we used a % based now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not related, but seems we should be able to sort in the swap query itself? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point
const underlyingDecimals = await erc20Contract( | ||
configs[token].underlyingAddress, | ||
token, | ||
).decimals(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
easier to get this from the subgraph and save RPC calls? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you make a graphql below so could combine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
roger
if (poolYesterdayRes.error) { | ||
throw new Error(poolYesterdayRes.error.message); | ||
} | ||
const volumeUSDYesterday = poolYesterdayRes.data?.pool?.volumeUSD || 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cnasc did we find that this is not accurate and we had to sum the hourly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.