> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flew.live/llms.txt
> Use this file to discover all available pages before exploring further.

# Resolution and settlement

> Understand market outcomes, winning payouts, refunds, and settlement deadlines.

export const DocsFlowEmbed = ({flowId, title, height = 760, mobileHeight, baseUrl}) => {
  const localWebOrigin = "http://localhost:3004";
  const productionWebOrigin = "https://www.flew.live";
  const getTheme = () => {
    if (typeof document === "undefined") return "light";
    const root = document.documentElement;
    const explicitTheme = root.dataset.theme || root.dataset.colorMode;
    if (explicitTheme === "dark" || root.classList.contains("dark")) {
      return "dark";
    }
    if (explicitTheme === "light") return "light";
    return window.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light";
  };
  const getDefaultOrigin = () => {
    if (typeof window === "undefined") return productionWebOrigin;
    const isLocalDocs = ["localhost", "127.0.0.1", "::1"].includes(window.location.hostname);
    return isLocalDocs ? localWebOrigin : productionWebOrigin;
  };
  const iframeRef = useRef(null);
  const [theme, setTheme] = useState("light");
  const [isMobile, setIsMobile] = useState(false);
  const [isLoaded, setIsLoaded] = useState(false);
  const [hasTimedOut, setHasTimedOut] = useState(false);
  const [attempt, setAttempt] = useState(0);
  const [detectedOrigin, setDetectedOrigin] = useState(productionWebOrigin);
  const origin = useMemo(() => {
    const value = baseUrl || detectedOrigin;
    try {
      return new URL(value).origin;
    } catch {
      return detectedOrigin;
    }
  }, [baseUrl, detectedOrigin]);
  const source = useMemo(() => {
    const safeFlowId = String(flowId || "").replace(/[^a-z0-9-]/gi, "");
    const params = new URLSearchParams({
      embed: "1",
      theme: "system",
      attempt: String(attempt)
    });
    return `${origin}/docs-flow/${safeFlowId}?${params.toString()}`;
  }, [attempt, flowId, origin]);
  const postTheme = useCallback(nextTheme => {
    iframeRef.current?.contentWindow?.postMessage({
      type: "flew-docs-theme",
      theme: nextTheme
    }, origin);
  }, [origin]);
  useEffect(() => {
    setDetectedOrigin(getDefaultOrigin());
    setTheme(getTheme());
    const media = window.matchMedia?.("(prefers-color-scheme: dark)");
    const mobileMedia = window.matchMedia?.("(max-width: 640px)");
    const updateTheme = () => setTheme(getTheme());
    const updateMobile = () => setIsMobile(Boolean(mobileMedia?.matches));
    const observer = new MutationObserver(updateTheme);
    observer.observe(document.documentElement, {
      attributes: true,
      attributeFilter: ["class", "data-theme", "data-color-mode"]
    });
    updateMobile();
    media?.addEventListener?.("change", updateTheme);
    mobileMedia?.addEventListener?.("change", updateMobile);
    return () => {
      observer.disconnect();
      media?.removeEventListener?.("change", updateTheme);
      mobileMedia?.removeEventListener?.("change", updateMobile);
    };
  }, []);
  useEffect(() => {
    postTheme(theme);
  }, [postTheme, theme]);
  useEffect(() => {
    if (isLoaded) return undefined;
    const timeout = window.setTimeout(() => setHasTimedOut(true), 12000);
    return () => window.clearTimeout(timeout);
  }, [attempt, isLoaded]);
  const retry = () => {
    setIsLoaded(false);
    setHasTimedOut(false);
    setAttempt(value => value + 1);
  };
  const handleLoad = () => {
    setIsLoaded(true);
    setHasTimedOut(false);
    postTheme(theme);
  };
  const accessibleTitle = title || "Flew user flow";
  const effectiveMobileHeight = mobileHeight || height;
  const frameHeight = isMobile ? effectiveMobileHeight : height;
  return <figure className="flew-docs-flow not-prose" style={{
    "--flew-flow-height": `${height}px`,
    "--flew-flow-mobile-height": `${effectiveMobileHeight}px`
  }} aria-label={accessibleTitle}>
      <div className="flew-docs-flow__viewport">
        {!isLoaded && !hasTimedOut && <div className="flew-docs-flow__status" role="status" aria-live="polite">
            <span className="flew-docs-flow__spinner" aria-hidden="true" />
            <span>Loading interactive diagram…</span>
          </div>}

        {hasTimedOut && !isLoaded && <div className="flew-docs-flow__status" role="alert">
            <strong>
              The interactive diagram is taking longer than expected.
            </strong>
            <span>You can try again or open it directly in Flew.</span>
            <div className="flew-docs-flow__actions">
              <button type="button" onClick={retry}>
                Try again
              </button>
              <a href={source} target="_blank" rel="noreferrer">
                Open diagram
              </a>
            </div>
          </div>}

        <iframe ref={iframeRef} key={attempt} className="flew-docs-flow__frame" src={source} title={accessibleTitle} style={{
    height: `${frameHeight}px`,
    minHeight: `${frameHeight}px`
  }} loading="lazy" onLoad={handleLoad} onError={() => setHasTimedOut(true)} allow="fullscreen" />
      </div>

      <figcaption className="flew-docs-flow__caption">
        <span>
          Use the controls to zoom or fit the view.
        </span>
        <a href={source} target="_blank" rel="noreferrer">
          Open full screen
        </a>
      </figcaption>
    </figure>;
};

After betting closes, a market moves through resolution and settlement. You do not need to resolve the market yourself. Follow the market status and claim any payout or refund before its displayed deadline.

## What happens after betting closes

<Steps>
  <Step title="Awaiting resolution">
    New positions and early exits are no longer available. The market page shows
    **Awaiting Resolution** while the final outcome is being determined.
  </Step>

  <Step title="Outcome finalized">
    When resolution completes, the market displays the final outcome and moves
    to **Resolved**. Flew also reveals the aggregate YES and NO pool totals
    needed to calculate payouts.
  </Step>

  <Step title="Claim window">
    A winning position can use **Claim Payout** until the claim period ends. A
    losing position receives no payout.
  </Step>
</Steps>

The **Policy & Timeline** and **Deadlines** sections on the market page show the resolution window, claim period, refund period, and their exact timestamps. These deadlines use Solana cluster time, which can differ slightly from your device clock.

## Settlement sequence

<DocsFlowEmbed flowId="resolution-settlement" title="Resolution and settlement user flow" height={840} mobileHeight={960} />

Both actions must complete within the deadline shown on the market page. A position can receive either its applicable payout or refund only once.

## How winning payouts work

Flew uses pool-based settlement. The placement fee is deducted when a position enters the market, so settlement calculations use each position's net amount.

For a winning position:

$$
\text{Payout} = \text{Your Net Position} \times
\frac{\text{YES Pool} + \text{NO Pool}}{\text{Winning Pool}}
$$

Your payout contains:

* Your net position amount
* Your proportional share of the losing pool

For example, if your net position represents 10% of the winning pool, you receive 10% of the combined net pools. Integer division and vault balance safeguards can round the final transfer down by a small number of lamports.

## Claim a winning payout

1. Connect the wallet that placed the position.
2. Open the resolved market, or go to **Profile → Your Positions**.
3. Confirm that the market shows your position as a winner.
4. Click **Claim Payout** and approve the Solana transaction.
5. Keep the page open while the encrypted computation finalizes.

After finalization, the payout is transferred to your connected wallet and the position is marked as claimed. Each position can settle only once.

<Warning>
  Claim before the displayed **Claim period ends** deadline. After the claim
  period expires, an unclaimed winning position can no longer receive its
  payout.
</Warning>

## Refunds when resolution is missed

If the market does not resolve before its resolution deadline, it displays **Refunds Available**.

An eligible refund returns your **net position amount**. It does not return the placement fee that was deducted when you entered the market.

To claim a refund:

1. Connect the wallet that placed the position.
2. Open the market while it shows **Refunds Available**.
3. Click **Claim Refund** and approve the Solana transaction.
4. Keep the page open while the encrypted computation finalizes.

The refund is transferred to your wallet after finalization, and the position is marked as claimed.

<Warning>
  Refunds are available only until the displayed **Refund period ends**
  deadline. After that deadline, the position can no longer claim a refund.
</Warning>

## What remains private

Resolution reveals the aggregate YES and NO pool totals. Your individual position side and net amount remain encrypted in the position account during the normal resolution flow.

When you claim, Arcium privately evaluates the encrypted position. The resulting payout or refund transfer, wallet addresses, and transaction are public on Solana.

## If a claim does not complete

* Confirm that the same wallet used for the position is connected.
* Check that the claim or refund deadline has not passed.
* Wait for the current computation to finish before trying another action.
* If the transaction fails or finalization is interrupted, refresh the market and check whether **Claim Payout** or **Claim Refund** is still available before retrying.

<Note>
  The interface can reflect a deadline-based status before a later transaction
  writes the corresponding state update on-chain. Always follow the effective
  status and countdown displayed on the market page.
</Note>
