Skip to content
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

Merged
merged 7 commits into from
Jan 22, 2025
Merged

[ECO-2631] Add coingecko routes #498

merged 7 commits into from
Jan 22, 2025

Conversation

CRBl69
Copy link
Collaborator

@CRBl69 CRBl69 commented Jan 6, 2025

Description

This PR adds the routes CoinGecko needs to list emojicoin.fun

Testing

Query both routes on the /coingecko parent route.

Checklist

  • Did you check all checkboxes from the linked Linear task?

Copy link

vercel bot commented Jan 6, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
emojicoin-dot-fun ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 22, 2025 8:59pm
emojicoin-dot-fun-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 22, 2025 8:59pm

Copy link
Collaborator

@xbtmatt xbtmatt left a 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

@CRBl69
Copy link
Collaborator Author

CRBl69 commented Jan 17, 2025

Copy link
Collaborator

@xbtmatt xbtmatt left a 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

Copy link
Collaborator

@xbtmatt xbtmatt left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants