# How Does Robin Markets Work?

**Step 1. Stake Your Polymarket Positions**

Users connect their wallet and stake their Polymarket outcome tokens (YES or NO) into our  vault.

Each market is tracked independently and liquidity is pooled in the same contract to have control over which DeFi strategies it is deployed into, optimize earnings or pull out ally liquidity in case of emergencies&#x20;

In return, you receive vault shares as ERC-1155 tokens, representing your position and your share of future yield. Each side (YES/ NO) of each market receives a different share token.

**Step 2. Vault Pairs and Merges Positions**

Robin automatically matches opposing positions (YES vs NO). When equal amounts exist, these positions are merged into USDC, effectively creating a delta-neutral position. This is done using the merge function in the Polymarket Conditional Token Framework (CTF) contract. The merged funds can then be safely deployed into yield protocols, as the directional risk is canceled out.

**Step 3. Capital is Deployed to DeFi**

The merged USDC is supplied to a variety of DeFi yield sources, starting with our Yearn vault optimizing Morpho and Aave v3 yields on Polygon. Yield begins accruing continuously and is distributed:

* per market by shares based on the amount of USDC (paired outcome tokens) contributed, similar to how an ERC-4626 vault operates&#x20;
* per market side (YES / NO) by a time-weighed-average price (TWAP) that is provided by the Robin TWAP Oracle
* per user via yield indices

Unmatched tokens remain idle until they can be paired and merged.

**Step 4. Track and Compound**

While the prediction market is live, Robin Markets keeps your position active and yield-bearing. You can view your accumulated yield and estimated APY directly from the web app. All funds remain on-chain and non-custodial. You can withdraw your funds at any time (compare the “Risks” section of these docs). If your withdrawal amount is sitting unmatched and idle in the vault, it will be directly transferred to you. If no idle amount is available, the required USDC amount is first withdrawn from the underlying strategy, converted into outcome tokens and then transferred to you - all in one step and immediately.

In the future we might introduce strategies that require capital lockups, however this would always be disclosed and actively selected by the user before deploying capital into said strategies.

**Step 5. Withdraw Anytime**

You don’t need to wait for market resolution.

When you withdraw:

* Your shares are redeemed
* The vault returns:
* Your underlying tokens (YES / NO)
* Your earned yield (in USDC)

If needed, the vault will:

* Withdraw funds from yield strategies
* Reconstruct positions from USDC

All of this happens in a single transaction.<br>

**Step 6. Market Resolution & Redemption**

If you choose to stay until market resolution (the result is on Polymarket), you will withdraw your winnings from the bet and your earned yield with one click. This will trigger two actions under the hood:&#x20;

* Your outcome tokens and yield are withdrawn from Robin Markets to Polymarket
* Your winning tokens are redeemed on Polymarket for USD.

This is done so the statistics of your Polymarket portfolio, like PnL and win rate, stay consistent regardless of deploying into Robin Markets or not.

<br>


---

# Agent Instructions: 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://robin-markets.gitbook.io/robin-markets-docs/how-does-robin-markets-work.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.
