> ## 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.

# Place a position

> Choose a market, take a YES or NO position, and wait for confidential computation to finalize.

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>;
};

## Before you begin

To place a position, you need:

* A signed-in Flew account with a connected Solana wallet
* Enough SOL for the position and transaction fees
* An active market that has not reached its closing time
* A position amount that meets the market's minimum

You can open only one position per wallet in each market. After your first position finalizes, you cannot add another position to the same market.

## Step 1: Open an active market

Browse **Markets**, **Events**, or **SOL Official Markets**, then open the market you want to participate in. Review:

* The market question
* Closing time
* Resolution method
* Resolution and claim deadlines
* Minimum position amount, when shown

Live YES and NO pool totals are encrypted, so Flew does not display live pool odds during the active phase.

## Step 2: Choose your side

* Choose **YES** if you believe the market condition will be satisfied.
* Choose **NO** if you believe the market condition will not be satisfied.

## Step 3: Enter an amount

Enter the total SOL you want to spend. Flew deducts the global protocol fee from this amount and credits the remaining net amount to your position.

Your amount, wallet address, and transaction are public on Solana. Your YES or NO side is stored as encrypted position data on-chain during the active phase.

## Step 4: Submit the position

Click the button labeled **Bet *amount* SOL on YES** or **Bet *amount* SOL on NO**, then approve the Solana transaction.

Flew then waits for the Arcium computation to update the encrypted market pools and finalize your position. Do not submit another market action while the computation is pending.

<Note>
  A confirmed wallet transaction and a finalized Arcium computation are separate
  stages. Keep the page open until Flew reports that the position has completed.
</Note>

## Placement sequence

<DocsFlowEmbed flowId="position-placement" title="Position placement user flow" height={720} mobileHeight={820} />

Do not close the page or submit another action after wallet confirmation while Flew is still waiting for Arcium finalization.

## View your position

Open **Profile**, then find **Your Positions**. Flew shows your stored amount, side, market result, and claim status when the associated position data is available.

If Flew cannot recover the stored position-encryption data, the interface may show an **Encryption key not found** warning. Your on-chain payout or refund rights remain available, but some private position details may not be displayed.

## What Flew and Solana can observe

* **Public on Solana:** Wallet address, position amount, market interaction, transaction signature, and timing
* **Encrypted on-chain during the active phase:** YES or NO side and aggregate pool state
* **Processed by Flew services:** Position amount, side, wallet, Privy account identifier, and position-encryption data needed to prepare transactions and display position history

See [Privacy and data handling](/legal/privacy-policy) for details.

## Exit or settle

Before closing, an eligible position can use [early exit](/guides/early-exit). After the market resolves, a winning position can claim its payout. If the market misses its resolution deadline, you can claim a refund during the refund window.
