-
Notifications
You must be signed in to change notification settings - Fork 66
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
Store a list of the markets created #143
Comments
There are 3 typical onchain integrators I have in mind: liquidators, routers, MetaMorpho vaults. But it seems to me that expecting integrators to only store an id is unrealistic: it doesn't give them the ability to have specific behavior depending on the market parameters (collateral, asset, oracles, irm, lltv) without having to CALL Blue. As an integrator, I would be better off storing this data in my contract rather than calling Blue after having SLOAD the stored market id. So I don't think there's a pragmatic usecase defending 1. I don't think 2. has a pragmatic usecase either (cc @oumar-fall @julien-devatom @mlgarchery @ghivert). So for now, I am against adding code for no pragmatic usecase. |
It could be useful for oracle to have a mapping id => parameters to retrieve the relevant parameters while just passing an id. |
Regarding 2. Having to fetch the markets list from a subgraph is quite a nightmare imo (any dependency to a subgraph isn't really likely imo). The main reason is that it disallows us to work on past blocks or to work on a fork which is quite mandatory for testing purposes. Idk what the offchain team thinks |
It's still possible to pass the whole market data though, so maybe it does not have a real use case |
Sure but it's clearly less optimized, maybe the oracle just needs a few variables to work |
Some thoughts:
so I don't think that we should add this |
I agree with the points above, and also it does not seem that useful to have that list (point 2) because there could be a lot of unused markets randomly created since it is permissionless. We can close this, unless you want to have more feedback from the offchain team |
I'm ok to close this issue as well |
Uniswap uses a subgraph to list all created pairs and they upload them to an ipns node (like here) So this is ok to me to use a subgraph (or any event fetcher, not so hard) |
This idea:
One implementation could be to do something similar to Enumerable Maps of OZ, and write something like:
marketMap.set(id, market)
The text was updated successfully, but these errors were encountered: