-
Notifications
You must be signed in to change notification settings - Fork 4
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
ERC-20 token prices #691
ERC-20 token prices #691
Conversation
this adds gpl'd code to our repo |
dc98a8f
to
4e52598
Compare
4c1db1c
to
aab2e4d
Compare
287fbc3
to
9c6302a
Compare
0cbe365
to
668490f
Compare
9c6302a
to
1b19994
Compare
1b19994
to
a7a1a83
Compare
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 putting this all together! Looks good so far
78b89d3
to
22b47b3
Compare
c9175a3
to
f227a8f
Compare
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! The api descriptions are looking good; left a couple minor questions but I think it's getting very close.
}, | ||
{ | ||
Name: "reserve1", | ||
EvmType: "uint112", |
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.
TIL there's a uint112
Token0: token0Addr, | ||
Token1: token1Addr, |
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.
Does uniswap enforce some ordering on token0/token1? Like is it possible to create a usdt/wrose pair and then create a wrose/usdt pair that's distinct from it? (and if uniswap combines the pairs, would nexus do the same?)
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.
my reading of the actual contract is they have to have the lower token address in token0
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.
Thank you! Looks good, left a minor comment
02677db
to
3d2712f
Compare
ironically making the code more complicated imo
a992f5f
to
6d55d50
Compare
had to disable the gocyclo on visit evm event |
this adds a "relative" token price estimate and total value estimate to the tokens API.
this data comes from on-chain swap contracts. for contracts that follow the Uniswap v2 interface, we index the swap contracts in a new
chain.evm_swap_pairs
table. the pair contracts emit a "Sync" event, which reports a contract's reserves, and the contract trades its two tokens in proportion to its reserves of the two tokens.we add a new configuration that specifies a collection of swap contracts identified by their "factory" contract plus a "reference" token. the relative token price estimate for a token is available when there is a swap pair contract for that token and the reference token or if the token is the reference token itself.
in this PR, we select illumineX swap and Wrapped ROSE (0x8Bc2B030b299964eEfb5e1e0b36991352E56D2D3) for Sapphire mainnet.