blockworks-foundation/mango-v4

PerpMarkets currently can only exist for registered tokens

Closed this issue · 1 comments

ckamm commented

While each PerpMarket stores its own oracle account, the health code (and possibly other parts of the code) is not able to deal with that. Instead it uses the oracle registered for the base_token_index.

Technically, we can allow creating perp markets for oracles that are not associated with any spot token.

TODO:

  • drop base_token_index in PerpMarket
  • in health, don't use base_token_index to look up the oracle
  • instead, pass an oracle account along with each PerpMarket (this will mean each perp market now requires two accounts for health checking instead of one!)
ckamm commented

Fixed by @conj0iner in #224