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

# Sell fund shares

> Sell tokenized money market fund shares for stablecoins from a registered wallet.

Use the withdraw endpoint to sell fund shares from a [registered wallet](https://docs.privy.io/wallets/actions/earn/tokenized-money-market-funds/register-wallets.md). Privy sends the shares to WisdomTree. Privy then tracks the order as a wallet action until the proceeds reach the wallet.

### Redemption flow

1. Privy creates the order as a wallet action with status `pending`, and sends the wallet's shares to WisdomTree.
2. WisdomTree fills the order. A `secondary` order fills from the fund's onchain pool. A `primary` order fills at the daily NAV strike.
3. The status moves to `succeeded` once the proceeds reach the wallet.

## Usage

To sell fund shares, send a `POST` request to:

```bash theme={"system"}
https://api.privy.io/v1/wallets/{wallet_id}/earn/tmmf/withdraw
```

### Parameters

The body describes the order.

**shares** `string` *required*

The number of fund shares to sell, as a decimal string, e.g. `"10.000000"`.

**withdraw\_asset** `string` *required*

The currency of the proceeds, e.g. `"USDC"`. Case-insensitive.

**chain** `string` *required*

The chain the order trades on. Use `ethereum_sepolia` in the sandbox.

**fund** `string` *required*

The fund ticker, e.g. `"WTGXX"`. Case-insensitive.

**environment** `'sandbox' | 'production'`

The WisdomTree environment the order trades in. Defaults to `production`. Use `sandbox` to test.
See [how the sandbox
works](https://docs.privy.io/wallets/actions/earn/tokenized-money-market-funds/sandbox.md#how-the-sandbox-works).

**order\_type** `'primary' | 'secondary'` *required*

How the order fills: `secondary` from the fund's onchain pool, which is faster, or `primary`
directly with the fund at the next NAV strike.

**reference\_id** `string`

Your app's identifier for the order. Privy returns it on the wallet action.

**nonce** `string`

A unique value of at least 24 characters that prevents replaying a signed request.

> [!NOTE]
>
> Wallets with `owner_id` present must provide an [authorization
> signature](https://docs.privy.io/api-reference/authorization-signatures.md) as a request header.

### Returns

The endpoint returns the order as a wallet action. It has the same fields as a [purchase](https://docs.privy.io/wallets/actions/earn/tokenized-money-market-funds/buy.md#returns), with three differences:

* `type` is always `"tmmf_withdraw"`.
* In the `wisdomtree_settlement` step, `requested` holds the shares sent, e.g. `{"fund": "WTGXX", "amount": "10"}`.
* In the same step, `received` holds the proceeds, e.g. `{"withdraw_asset": "USDC", "amount": "9.99"}`.

### Example

This request sells 10 WTGXX shares for USDC through the fund's pool.

```bash theme={"system"}
curl -X POST https://api.privy.io/v1/wallets/{wallet_id}/earn/tmmf/withdraw \
  -H "privy-app-id: <your-app-id>" \
  -H "Authorization: Basic <credentials>" \
  -H "privy-authorization-signature: <authorization-signature>" \
  -H "Content-Type: application/json" \
  -d '{
    "shares": "10.000000",
    "withdraw_asset": "USDC",
    "chain": "ethereum_sepolia",
    "fund": "WTGXX",
    "order_type": "secondary",
    "environment": "sandbox"
  }'
```

```json Example response theme={"system"}
{
  "id": "<action-id>",
  "wallet_id": "<your-wallet-id>",
  "type": "tmmf_withdraw",
  "status": "pending",
  "reference_id": null,
  "created_at": "2026-11-01T12:00:00.000Z"
}
```

> [!NOTE]
>
> **Idempotency on errors:** This endpoint returns `pending` immediately. Replaying the same key
> returns the cached response. On a synchronous 5xx, Privy deletes the record so the same key
> retries fresh. Action outcomes (`rejected`, `failed`, `succeeded`) arrive via
> [webhooks](https://docs.privy.io/wallets/actions/webhooks.md) and [polling](https://docs.privy.io/wallets/actions/status.md). Policy violations
> always allow fresh retries.

## Statuses and failures

A sale has the same [statuses and common errors](https://docs.privy.io/wallets/actions/earn/tokenized-money-market-funds/buy.md#statuses-and-failures) as a purchase. For a sale, the wallet must hold enough shares. A `failed` sale means WisdomTree failed or refunded the order after Privy sent the shares (`order_refunded`).

> [!TIP]
>
> To know when the proceeds reach the wallet, poll [get wallet
> action](https://docs.privy.io/api-reference/wallets/actions/get.md). Or listen for the
> `wallet_action.tmmf_withdraw.succeeded`
> [webhook](https://docs.privy.io/wallets/actions/earn/tokenized-money-market-funds/webhooks.md).

## Next steps

Once the sale succeeds, show the updated position. Use webhooks to follow future orders.

> [card] [List positions](https://docs.privy.io/wallets/actions/earn/tokenized-money-market-funds/get-positions.md)
>
> Show the wallet's shares, their value, and pending orders.

> [card] [Webhooks](https://docs.privy.io/wallets/actions/earn/tokenized-money-market-funds/webhooks.md)
>
> Receive order webhooks when a sale completes.
