> For the complete documentation index, see [llms.txt](https://docs.opium.network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.opium.network/for-developers/opium-protocol-v2/opiumproxyfactory.md).

# 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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.opium.network/for-developers/opium-protocol-v2/opiumproxyfactory.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
