{"version":3,"sources":["../../../src/common/types/balanceTypes.ts"],"sourcesContent":["import { BigDecimal } from '@nadohq/utils';\nimport { HealthType } from './healthTypes';\nimport { PerpProduct, ProductEngineType, SpotProduct } from './productTypes';\n\nexport type BalanceSide = 'long' | 'short';\n\nexport type BalanceHealthContributions = Record<HealthType, BigDecimal>;\n\n/**\n * Shared properties of a product balance\n */\ninterface BaseBalance {\n  type: ProductEngineType;\n  productId: number;\n  // Amount for the balance\n  amount: BigDecimal;\n  // Contributions to subaccount health\n  healthContributions: BalanceHealthContributions;\n}\n\n/**\n * Balance for a perp product\n */\nexport interface PerpBalance extends BaseBalance {\n  type: ProductEngineType.PERP;\n  /**\n   * As there is no \"quote\" product for the perp engine, this is a representation of the net quote balance\n   * associated with the position. The entry cost and funding is rolled into this.\n   */\n  vQuoteBalance: BigDecimal;\n}\n\nexport type PerpBalanceWithProduct = PerpBalance & PerpProduct;\n\n/**\n * Balance for a spot product\n */\nexport interface SpotBalance extends BaseBalance {\n  type: ProductEngineType.SPOT;\n}\n\nexport type SpotBalanceWithProduct = SpotBalance & SpotProduct;\n\nexport type Balance = PerpBalance | SpotBalance;\nexport type BalanceWithProduct =\n  | SpotBalanceWithProduct\n  | PerpBalanceWithProduct;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}