-
Notifications
You must be signed in to change notification settings - Fork 20
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
Add synthetics API routes #5
base: add-synthetics
Are you sure you want to change the base?
Conversation
switch to satsuma
Remove Default Pricing for Stablecoins
- Removed Default pricing with stable pairs. - Filter out Single token GM pools
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
// open: 1, | ||
// close: 1, | ||
// } | ||
// } |
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.
is this change expected? if this function is no longer need maybe better to delete it?
// high: 1, | ||
// low: 1, | ||
// } | ||
// } |
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.
if this logic is not needed, let's remove this code
|
||
const callsByMarket = markets.reduce<Record<string, any>>((acc, market) => { | ||
const longTokenPrice = prices[market.longToken]; | ||
const indexTokenPrice = market.indexToken === "0x0000000000000000000000000000000000000000" ? longTokenPrice : prices[market.indexToken]; |
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 can use AddressZero from constants.ts instead of "0x0000000000000000000000000000000000000000"
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.
Understood, completed it now
indexTokenPrice, | ||
longTokenPrice, | ||
shortTokenPrice, | ||
'0xab15365d3aa743e766355e2557c230d8f943e195dc84d9b2b05928a07b635ee1', |
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.
let's create a variable for this value to improve readability?
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.
Thanks for the suggestion added it into the configs
const result = results[index]; | ||
if (result && result.result) { | ||
const gmPrice = (result.result[0] * BigInt(1000) / USD_DIVISOR); | ||
const tokenPrice = Number(Number(gmPrice) / 1000); |
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.
i think just Number(gmPrice) / 1000
should work, no need to wrap in Number one more time
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.
Hi @gdev8317, I receive an error if I do not double wrap Number(gmPrice), will keep this for now.
Made several changes in accordance to the standards laid out in Coingecko: https://docs.google.com/document/d/1v27QFoQq1SKT3Priq3aqPgB70Xd_PnDzbOCiuoCyixw/edit?tab=t.0#heading=h.pama79xv4dlm
-> This approach is currently static, any suggestions on improving this integration using the tokens API.