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

# Redemptions

> Check redemption status for users.

## Get User Redemption

Check if a user has redeemed their position in a market.

```
GET /markets/{market_address}/redemptions/{user_address}
```

**market\_address** `string` *required*

The address of the market.

**user\_address** `string` *required*

The wallet address of the user.

```bash cURL theme={"dark"}
curl "https://api.orica.markets/markets/ABC123.../redemptions/User456..."
```

```typescript TypeScript theme={"dark"}
const response = await fetch(
  `https://api.orica.markets/markets/${marketAddress}/redemptions/${userAddress}`
);
const { has_redeemed, redemption } = await response.json();
```

### Response (Not Redeemed)

```json theme={"dark"}
{
  "has_redeemed": false,
  "redemption": null
}
```

### Response (Redeemed)

```json theme={"dark"}
{
  "has_redeemed": true,
  "redemption": {
    "id": 123,
    "market_address": "ABC123...",
    "user_address": "User456...",
    "payout": 5000000000,
    "payout_usdc": 5000.00,
    "fee": 15000000,
    "fee_usdc": 15.00,
    "timestamp": 1704240000,
    "slot": 234567890,
    "signature": "5K7x..."
  }
}
```

### Response Fields

**has\_redeemed** `boolean`

Whether the user has already redeemed.

**redemption** `object`

Redemption details (null if not redeemed).

**Redemption Object**

**id** `number`

Internal redemption ID.

**market\_address** `string`

The market address.

**user\_address** `string`

The user's wallet address.

**payout** `number`

Total payout in base units.

**payout\_usdc** `number`

Total payout in USDC.

**fee** `number`

Redemption fee in base units.

**fee\_usdc** `number`

Redemption fee in USDC.

**timestamp** `number`

Unix timestamp of redemption.

**signature** `string`

Solana transaction signature.

***

## Usage Example

Check redemption status before calling the redeem instruction:

```typescript theme={"dark"}
async function redeemIfNeeded(marketAddress: string, userAddress: string) {
  const response = await fetch(
    `https://api.orica.markets/markets/${marketAddress}/redemptions/${userAddress}`
  );
  const { has_redeemed } = await response.json();
  
  if (has_redeemed) {
    console.log("Already redeemed");
    return;
  }
  
  // Proceed with redemption transaction
  const redeemIx = await sdk.orica.buildRedeem(
    new PublicKey(userAddress),
    userUsdcAccount,
    new PublicKey(marketAddress)
  );
  // ... send transaction
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.