Opium Network
  • Opium Documentation
  • Introduction to Opium
    • What is Opium
    • FAQs
  • Restrictions
    • Restrictions
  • Security and Audits
    • Disclaimer
    • Audits
    • Bounty program
  • Governance
    • Decentralized setup
    • Governance flow
      • Proposal creating
      • Process of voting – technical description
    • $Opium governance token
  • For users
    • Opium.Finance
    • opium.exchange
  • FOR DEVELOPERS
    • Deployment Addresses
      • Opium Protocol v2
      • Opium Protocol v1
    • High-level overview
    • Opium Protocol V2
      • Core
      • Registry
      • SyntheticAggregator
      • OracleAggregator
      • OpiumProxyFactory
      • OpiumPositionToken
    • Opium Protocol V1
      • Core
      • Registry
      • TokenMinter
      • TokenSpender
      • SyntheticAggregator
      • OracleAggregator
      • Helpers
      • Interfaces
      • Common Errors
        • OracleAggregator Errors
        • Core Errors
      • oID - Oracle recipe
      • sID - Derivative recipe
      • EIP-2547: Composable Multiclass Token
    • Tutorials
      • OracleId examples
      • SyntheticId examples
      • End-to-end tutorial
    • Opium API
      • Subgraph V2
      • Subgraph V1
    • SDK
      • Opium V2 SDK
      • Opium Finance Pools SDK
      • Swap Rate SDK/API
  • Complex description
    • Glossary
    • Opium derivatives
    • Oracle and derivative recipes
    • Oracle and derivative registers
    • Opium margin
    • Opium swaps (TMtm)
    • Opium order books
Powered by GitBook
On this page

Was this helpful?

  1. FOR DEVELOPERS
  2. Opium Protocol V1

SyntheticAggregator

It allows users and consumer contracts to query information about a given derivative recipe and, internally, it is provided with some stateful logic to initialize a new financial product’s sensitive data.

Contract functions description

getAuthorCommission(bytes32 _derivativeHash, Derivative memory _derivative) public returns(uint256 commission)

It returns the uint256 amount of fees in basis point 10000 that the derivative recipe’s author will receive for creating the given derivative recipe. Internally, the function performs stateful logic via the _initDerivative function to check if a derivative’s data has already been initialized and, if not, it initializes it.

getAuthorAddress(bytes32 _derivativeHash, Derivative memory _derivative) public returns(address authorAddress)

It returns the address of the recipient of derivative recipe author’s fees. Internally, the function performs stateful logic via the _initDerivative function to check if a derivative’s data has already been initialized and, if not, it initializes it.

getMargin(bytes32 _derivativeHash, Derivative memory _derivative) public returns(uint256 buyerMargin, uint256 sellerMargin)

It returns the margin of the LONG (buyer) and SHORT(seller) positions of a derivative recipe. As the margins are fully customizable, it checks the collateral requirements specified in the related derivative recipe by calling the `getMargin` function specified in the IDerivativeLogic interface. Internally, the function performs stateful logic to check if a derivative’s data has already been initialized and, if not, it initializes it.

isPool(bytes32 _derivativeHash, Derivative memory _derivative) public returns(bool result)

PreviousTokenSpenderNextOracleAggregator

Last updated 3 years ago

Was this helpful?