Skip to main content

IShortsTracker Interface

The IShortsTracker interface defines the functions available in the ShortsTracker contract, which tracks global short positions across the Satoshi Perps protocol.

Position Tracking

Updates the global short data when a position is increased or decreased.
Calculates the global profit or loss for all short positions of a token.

State Access

Returns the total size of all short positions for a token.
Returns the average entry price of all short positions for a token.
Returns whether the global short data is ready for use.

Administration

Sets whether the global short data is ready for use.
Sets or removes a handler that can update global short data.
Initializes global short data during contract deployment or migration.

Usage Notes

  • The ShortsTracker complements the Vault’s native tracking of long positions.
  • It provides specialized tracking for short positions across the protocol.
  • Only authorized handlers (like PositionManager and BasePositionManager) can update the global short data.
  • The global short data is essential for funding rate calculations and protocol monitoring.

Security Considerations

  • Access to update functions is restricted to prevent manipulation of short position data.
  • The readiness flag ensures that data isn’t used before it’s properly initialized.
  • Accurate short position tracking is critical for proper funding rate calculations.