Skip to main content

IVaultPriceFeed Interface

The IVaultPriceFeed interface defines the functions available in the VaultPriceFeed contract, which serves as the price oracle system for the Satoshi Perps protocol.

Price Retrieval

Returns the price of a token with various options for price calculation.
Returns the primary price from the oracle without any adjustments.

Price Feed Configuration

Sets a price adjustment for a token, either as an additive or multiplicative factor.
Sets the spread in basis points between the maximum and minimum price for a token.
Sets the Chainlink price feed address for a token.
Sets the address of the secondary price feed.

Price Adjustment Access

Returns the adjustment basis points for a token.
Returns whether the adjustment for a token is additive or multiplicative.
Returns the spread basis points for a token.

Price Feed Access

Returns the Chainlink price feed address for a token.
Returns the address of the secondary price feed.

Price Calculation

Applies configured adjustments to a token’s price.

Usage Notes

  • The VaultPriceFeed serves as the central price oracle for the Satoshi Perps protocol.
  • It prioritizes Chainlink oracles but can fall back to secondary sources.
  • Price adjustments and spreads can be configured per token.
  • The _maximise parameter determines whether to return the maximum or minimum price based on the spread.

Security Considerations

  • Price data is critical for the protocol’s security, as it affects position sizing, liquidations, and swaps.
  • Chainlink oracles are preferred for their reliability and decentralization.
  • Adjustments should be used carefully as they directly affect pricing throughout the protocol.