solana-labs / perpetuals

Solana perpetuals reference implementation
Other
66 stars 36 forks source link

Known issues with Virtual Assets with the current design #38

Open mzs-dev opened 7 months ago

mzs-dev commented 7 months ago

A few things to note when listing virtual assets on the pool (especially when using Pyth Network Oracles)

  1. When initialising a virtual asset Custody, we need to have a dedicated mint account and an associated token account created as placeholders to satisfy validation checks associated to the existing structure.

  2. For non-crypto assets (FX/Metals/Commodites) Pyth's oracles operate based on CME's trading hours and outisde of the said trading hours, any ixs that require oracle prices for such assets (get_assets_under_management for instance) would fail unless we have alternative solutions.

  3. It should be noted that when price oracles are stale outisde of the defined trading hours, positions can't be closed but they oblige the acrrued borrow_fee to be paid and if collective_position PnL accounting discounts the said PnL during off-market hours, movement of LPs in/out of the pool becomes gameable.