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

# Disputes

> Interact with the dispute resolution system.

The `sdk.disputes` client provides methods for participating in dispute resolution.

***

## Fetch Dispute

Get the dispute status for a market:

> [tab] TypeScript
>
> ```typescript theme={"dark"}
> const dispute = await sdk.disputes.fetchDispute(marketAddress);
>
> if (dispute) {
>   console.log("Status:", dispute.status);
>   console.log("Votes for dispute:", dispute.votesForDispute.toString());
>   console.log("Total weight:", dispute.totalPoolWeight.toString());
>   console.log("Message count:", dispute.messageCount);
> }
> ```

> [tab] Python
>
> ```python theme={"dark"}
> dispute = await sdk.disputes.fetch_dispute(market_address)
>
> if dispute:
>     print(f"Status: {dispute.status.value}")
>     print(f"Votes for dispute: {dispute.votes_for_dispute}")
>     print(f"Total weight: {dispute.total_pool_weight}")
>     print(f"Message count: {dispute.message_count}")
> ```

***

## Fetch All Disputes

Get all active disputes:

> [tab] TypeScript
>
> ```typescript theme={"dark"}
> const disputes = await sdk.disputes.fetchAllDisputes();
>
> for (const { publicKey, account } of disputes) {
>   console.log("Market:", account.market.toBase58());
>   console.log("Status:", account.status);
> }
> ```

> [tab] Python
>
> ```python theme={"dark"}
> disputes = await sdk.disputes.fetch_all_disputes()
>
> for address, dispute in disputes:
>     print(f"Market: {dispute.market}")
>     print(f"Status: {dispute.status.value}")
> ```

***

## Fetch Dispute Config

Get the dispute program configuration:

> [tab] TypeScript
>
> ```typescript theme={"dark"}
> const config = await sdk.disputes.fetchDisputeConfig();
>
> console.log("Market Program:", config.marketProgramId.toBase58());
> console.log("Min Pool for Dispute:", config.minPoolForDispute.toString());
> ```

> [tab] Python
>
> ```python theme={"dark"}
> config = await sdk.disputes.fetch_dispute_config()
>
> print(f"Market Program: {config.market_program_id}")
> print(f"Min Pool for Dispute: {config.min_pool_for_dispute}")
> ```

***

## Dispute Structure

> [tab] TypeScript
>
> ```typescript theme={"dark"}
> interface Dispute {
>   market: PublicKey;
>   marketId: BN;
>   openedAt: BN;
>   status: DisputeStatus;
>   totalPoolWeight: BN;
>   totalNoWeight: BN;
>   votesForDispute: BN;
>   messageCount: number;
>   resolvedBy: PublicKey | null;
>   finalOutcome: Outcome | null;
>   bump: number;
> }
>
> type DisputeStatus = "voting" | "active" | "resolved" | "expired";
> ```

> [tab] Python
>
> ```python theme={"dark"}
> @dataclass
> class Dispute:
>     market: Pubkey
>     market_id: int
>     opened_at: int
>     status: DisputeStatus
>     total_pool_weight: int
>     total_no_weight: int
>     votes_for_dispute: int
>     message_count: int
>     resolved_by: Pubkey | None
>     final_outcome: Outcome | None
>     bump: int
>
> class DisputeStatus(Enum):
>     VOTING = "voting"
>     ACTIVE = "active"
>     RESOLVED = "resolved"
>     EXPIRED = "expired"
> ```

***

## Check Threshold (TypeScript)

Check if a dispute has reached the activation threshold:

```typescript theme={"dark"}
const dispute = await sdk.disputes.fetchDispute(marketAddress);

if (dispute) {
  const thresholdMet = sdk.disputes.isDisputeThresholdMet(dispute);
  console.log("Threshold met:", thresholdMet);
}
```

The threshold is >50% of total pool weight.

***

## Next Steps

> [card] [Voting](https://docs.orica.markets/sdk/voting.md)
>
> Cast votes in disputes.

> [card] [Messages](https://docs.orica.markets/sdk/messages.md)
>
> Post and boost messages.


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