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
  • Domain logic
  • Actors
  • Data / control flow
  • Restrictions

Was this helpful?

  1. FOR DEVELOPERS
  2. Opium Protocol V2

OpiumProxyFactory

Domain logic

It is the only entry point to perform stateful operations on derivative positions - as derivative positions are represented as erc20 tokens, these operations include minting and burning and the deployment itself of a new erc20 contracts.

Actors

All the stateful logic of the OpiumProxyFactory is expected to involve only Core - as the controller of the OpiumProxyFactory - and the Opium position tokens - as an entity which is manipulated by the OpiumProxyFactory.

Data / control flow

The stateful operations are expected to have a one way data and control flow whereby the Core contract calls the OpiumProxyFactory with the financial parameters of a derivative and subsequently the OpiumProxyFactory ‘translates’ the financial parameters into an erc20 api compatible language - i.e: the creation of a new derivative with LONG and SHORT positions is translated into the deployment of two erc20 contracts with an equivalent supply each.

Restrictions

All the stateful functions should only be accessible to the Core contract

PreviousOracleAggregatorNextOpiumPositionToken

Last updated 3 years ago

Was this helpful?