> For the complete documentation index, see [llms.txt](https://funarchy.gitbook.io/funarchy/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://funarchy.gitbook.io/funarchy/security-for-prediction-market/trading-mechanism/amm-risks/permanent-loss/equal-market-state.md).

# Equal market state

Equal market state mean that Yes/No shares price are equal.

{% stepper %}
{% step %}
**Liquidity provision after Market Creation**

* Situation: User A deposits 1,000 USDC to create a Trump win (YES/NO) market just now.\
  User C add liquidity this market same 1000USDC.
* LP Position: Since User A provided initial liquidity and User C came in and provided liquidity when there were no transactions thereafter, we only need to add $1000 worth of liquidity to the existing equation.
* $$Yes(2000) \* No(2000) = 2000^2$$
* Status: Since no transaction has yet occurred, both Users A and B hold LP shares worth 1,000. Furthermore, the market is split 50:50.<br>
  {% endstep %}

{% step %}
**Trading occurs**

* Situation: As time passes and information and news emerge that Trump is likely to win, User B purchases $1,000 worth of Yes at once.
* AMM Operation: FPMM temporarily provides liquidity to the formula that processes this order.
  * But $$2000^2$$must not be broken.\
    \
    So, with the information we know, $$No(3000)$$, and the fixed value $$2000^2$$we can calculate the Yes share that will come out later.
  * $$Yes(x) \* No(3000)  = 2000^2$$
    * $$Yes(x) = 2000^2 / No(3000)$$\
      $$Yes(x) =  1333.33$$
  * This should leave you with a total of 1333.33 Yes shares for a total of $1000.
* LP Position Change:\
  In conclusion, Yes's share was left at 1333.33, so B received a total of 1666.67.\
  \
  $$Yes(3000) - Yes(1333.33) =  1666.67$$\
  \
  so B received a total of 1666.67.\
  In other words, while the liquidity provider is still "providing liquidity," in reality, **they are heavily betting on the No side, which is more likely to lose.**
  * $$Yes(1333.33) \* No(3000) = 2000^2$$
  * This changes the Yes/No price ratio from 50:50 ⇒ 69:31.
  * User A and B are loss up to this point can be derived using the following formula.
    * $$V(p) = (\text{YES Price}) + (\text{No Price})$$
    * $$V(p) = \mathbf{2} \cdot \sqrt{k} \cdot \sqrt{p(1-p)}$$
    * *Initial price ratio*: $$V(0.5) \propto \sqrt{0.5 \times 0.5} = \sqrt{0.25} = 0.5$$
    * *Price ratio thereafter*: $$V(0.69) \propto \sqrt{0.69 \times 0.31} = \sqrt{0.2139} = 0.46$$
    * $$Ratio = \frac{V(0.69)}{V(0.5)} = \frac{0.46}{0.5} = 0.92 \quad (92%)$$
  * So, User A and B's funds are reduced from $1000 to only $920.
    {% endstep %}

{% step %}
**Market closed and loss confirmed**

* Result: \
  The actual election results are confirmed as Trump's victory, so YES wins and NO loses.
* Conclusion: \
  Users A and B will both be left with approximately $666.67. Even if the market has a 3% transaction fee, $15 will go to each user, leaving only $681.67.<br>
  {% endstep %}
  {% endstepper %}


---

# 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, and the optional `goal` query parameter:

```
GET https://funarchy.gitbook.io/funarchy/security-for-prediction-market/trading-mechanism/amm-risks/permanent-loss/equal-market-state.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
