Discussion: Support of the Standard Relayer API (Contract Addresses vs. Symbols)
See original GitHub issueWhile skimming through the available 0x relayers to get a better idea of what exchanges may be possible to be supported, I noticed that the 0x schema for order books actually returns asks and bids in terms of the maker and taker address, not by the resolved symbol. Example: https://github.com/0xProject/standard-relayer-api/blob/master/http/v2.md#get-v2orderbook
Are there plans to support exchanges that use the 0x SRA? This would require the ability to pass in a contract address as an alternative to a symbol. On a similar note, it raises the question of asset resolution. For example, if a user passes ABC
, there currently aren’t any checks to ensure that ABC
actually corresponds to the same assets. Given the goal of supporting any asset on any exchange, I see a couple paths off the top of my head:
1a) For major exchanges, keep a hard-coded mapping of symbol -> contract address if it’s easily identifiable (ZRX, AST, BNB, etc.) 1b) Only support exchanges that provide tokens included in the “supported assets” mapping 2) Only support exchanges that allow retrieval of order books with contract addresses
And the potential issues:
1a) This obviously has a scaling problem and also brings up issues if contracts are redeployed 1b) This limits the amount of exchanges and assets available unless they’re manually maintained in 1a 2) This allows for more flexibility in the sense that I could provide any address and if it shows up in an exchange we know that it’s the same asset across exchanges but it limits consumers to knowing the address for the token contract, which they may not. Similar to 1b, this limits the amount of exchanges that could be supported.
Just some things that crossed my mind while looking around. Interested to get some feedback. 😃
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:12 (9 by maintainers)
Top GitHub Comments
@tmlee @stefanmendoza I integrated the CoinGecko API in this PR https://github.com/perich/ethereum-dex-prices-service/pull/33
@grahamperich If you are looking to retrieve contract address, you may try our CoinGecko API which requires no key
For instance https://api.coingecko.com/api/v3/coins/0x, you will be able to access the contract address Full docs at https://www.coingecko.com/api
Let me know what you make of that and happy to answer any questions