-
Notifications
You must be signed in to change notification settings - Fork 3
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 spot price after swap to schema #25
Conversation
Maybe make it optional for all but v3s? |
schemas/dex/schema.json
Outdated
@@ -246,6 +246,10 @@ | |||
"description": "The amount of the output token, decimal normalized.", | |||
"type": "number" | |||
}, | |||
"spot_price_after_swap": { | |||
"description": "The spot price in the pool after the swap is complete.", |
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.
Should this be in USD? Or is there another denomination across all dexs?
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 keep it not optional, if a protocol doesn't have this available, they can mark it null or 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.
It's a ratio between the two tokens. v3 DEXs show the tick after the swap, which tells us the price ratio.
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 we add something about this to the description?
schemas/dex/schema.json
Outdated
@@ -246,6 +246,10 @@ | |||
"description": "The amount of the output token, decimal normalized.", | |||
"type": "number" | |||
}, | |||
"spot_price_after_swap": { | |||
"description": "The spot price in the pool after the swap is complete.", |
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 keep it not optional, if a protocol doesn't have this available, they can mark it null or 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.
Lgtm, thanks! I think we should just add a little more color to the description
Proposal to add spot price after swap to the DEX swap schema. I want this so I can tell which liquidity is in range at any given time.
I don't know if this is feasible for all DEX types. Maybe we should have a separate table for v3 swaps that includes the tick after the swap (which I believe is standard in Uniswap v3 DEXs).