Post

@Julien_devatom what are the challenges in particular?
as i understand it, the api is a wrapper for onchain calls and then uses aggregated price feeds for the final usd conversion.
is the complexity with the state sync, or with aggregate price sources, or something else altogether?
English

@ruvaag You cannot use the market oracle because of its permissionless aspect. Someone can play with it and add a price like 1ETH = 1USDC
So we use market oracle price for position health computation, but we add usd price sources manually for USD display conversion
English

yeah i think you’ll have to maintain a registry of your own prices for the final usd conversion. we dealt with a small scale version of this at sentiment.
eg you probably need to cache eth/usd price from a cex or multiple cexes and then use that with all */ETH oracle pairs
for onchain derivatives you might have to source prices from the deepest liquidity pair + factor in impact if your consumers care about price impact
you’re right - the more i think about it the more complex it gets. it’s probably super costly too lmao. does the ui absolutely need to support every pair? restriction seems like the way to go… only support what your api consumers want.
English

@ruvaag Yes exactly! With the product growth, the "support what your api consumers want" becomes bigger & bigger ahah and Morpho is an infra so this support is very powerful on a product perspective.
English