-
Notifications
You must be signed in to change notification settings - Fork 21
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
[ECO-2631] Add coingecko routes #498
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Can you link in the PR description the API specs for this? And maybe in a jsdoc comment on route.ts on both endpoints or in a README.md
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.
The /tickers
endpoint is different for an AMM DEX:
"ticker_id": "0x55d398326f99059ff775485246999027b3197955_0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c",
"base_currency": "0x55d398326f99059ff775485246999027b3197955",
"target_currency": "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c",
“pool_id”:
“0x36696169c63e42cd08ce11f5deebbcebae652050”,
"last_price":"50.0",
"base_volume":"10",
"target_volume":"500",
“liquidity_in_usd”:“100”,
"bid":"49.9",
"ask":"50.1",
It also says we have to provide the +2/-2% depth but that's actually really complicated so we can just wait for them to ask for it if it's really necessary.
We do, however, need the liquidity_in_usd
field, for which I think you can just use the virtual reserves if it's in the bonding curve and the real reserves if it's post bonding curve, convert base to quote, add to quote, then multiply the sum of that by the Aptos USD price
src/typescript/frontend/src/app/coingecko/historical_trades/route.ts
Outdated
Show resolved
Hide resolved
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 added the changes, should be good now, I'll make sure it's correct before merging.
…s for estimated liquidity in USD, add revalidate to avoid DDOS
Co-authored-by: Matt <[email protected]>
Description
This PR adds the routes CoinGecko needs to list emojicoin.fun
Testing
Query both routes on the
/coingecko
parent route.Checklist