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

# Configuration

> Configure the Orica SDK for your environment.

## Initialization Methods

> [tab] TypeScript
>
> ### From Chain (Recommended)
>
> Automatically fetches IDLs from the blockchain:
>
> ```typescript theme={"dark"}
> import { OricaSDK } from "@neko/orica-sdk";
> import { Connection, PublicKey } from "@solana/web3.js";
>
> const connection = new Connection("https://api.mainnet-beta.solana.com");
> const sdk = await OricaSDK.createFromChain(connection);
> ```
>
> With custom program IDs:
>
> ```typescript theme={"dark"}
> const sdk = await OricaSDK.createFromChain(
>   connection,
>   new PublicKey("your_orica_program_id"),
>   new PublicKey("your_disputes_program_id")
> );
> ```
>
> ### With Local IDLs
>
> Use pre-downloaded IDL files for offline initialization:
>
> ```typescript theme={"dark"}
> import oricaIdl from "./orica.json";
> import disputesIdl from "./orica_disputes.json";
>
> const sdk = new OricaSDK({
>   connection,
>   oricaProgramId: new PublicKey("oEarJ8xDDssLcWwgkSpRVVbmiUyeDnoHFNAHPp6eetw"),
>   disputesProgramId: new PublicKey("oVEzkDiY2FZP4ADfCeUfrg8jgCoMnPcVQao99indSqN"),
>   oricaIdl,
>   disputesIdl,
> });
> ```

> [tab] Python
>
> ### From Chain (Recommended)
>
> Automatically fetches IDLs from the blockchain:
>
> ```python theme={"dark"}
> from orica_sdk import OricaSDK
> from solana.rpc.async_api import AsyncClient
>
> connection = AsyncClient("https://api.mainnet-beta.solana.com")
> sdk = await OricaSDK.create(connection)
> ```
>
> With custom program IDs:
>
> ```python theme={"dark"}
> from solders.pubkey import Pubkey
>
> sdk = await OricaSDK.create(
>     connection,
>     orica_program_id=Pubkey.from_string("your_orica_program_id"),
>     disputes_program_id=Pubkey.from_string("your_disputes_program_id"),
> )
> ```
>
> ### From Local IDL Files
>
> Use pre-downloaded IDL files:
>
> ```python theme={"dark"}
> sdk = await OricaSDK.create_from_files(
>     connection,
>     orica_idl_path="./orica.json",
>     disputes_idl_path="./orica_disputes.json",
> )
> ```

***

## Configuration Interfaces

> [tab] TypeScript
>
> ```typescript theme={"dark"}
> interface OricaSDKConfig {
>   connection: Connection;        // Solana RPC connection
>   oricaProgramId?: PublicKey;    // Orica program ID (defaults to mainnet)
>   disputesProgramId?: PublicKey; // Disputes program ID (defaults to mainnet)
>   oricaIdl: any;                 // Orica program IDL
>   disputesIdl: any;              // Disputes program IDL
> }
> ```

> [tab] Python
>
> ```python theme={"dark"}
> # OricaSDK.create() parameters
> connection: AsyncClient           # Solana RPC connection
> orica_program_id: Pubkey | None   # Orica program ID (defaults to mainnet)
> disputes_program_id: Pubkey | None # Disputes program ID (defaults to mainnet)
> wallet: Wallet | None             # Optional wallet for signing
> ```

***

## Default Program IDs

Both SDKs default to mainnet program IDs:

| Program | Address |
| - | - |
| Orica | `oEarJ8xDDssLcWwgkSpRVVbmiUyeDnoHFNAHPp6eetw` |
| Disputes | `oVEzkDiY2FZP4ADfCeUfrg8jgCoMnPcVQao99indSqN` |

> [tab] TypeScript
>
> ```typescript theme={"dark"}
> import { ORICA_PROGRAM_ID, DISPUTES_PROGRAM_ID } from "@neko/orica-sdk";
> ```

> [tab] Python
>
> ```python theme={"dark"}
> from orica_sdk import ORICA_PROGRAM_ID, DISPUTES_PROGRAM_ID
> ```

***

## RPC Providers

The SDK works with any Solana RPC provider:

| Provider | Free Tier | Notes |
| - | - | - |
| Helius | Yes | Fast, reliable |
| QuickNode | Yes | Good rate limits |
| Triton | Yes | Low latency |
| Public RPC | Yes | Rate limited |

> [tab] TypeScript
>
> ```typescript theme={"dark"}
> // Helius
> const connection = new Connection(
>   "https://mainnet.helius-rpc.com/?api-key=YOUR_KEY"
> );
>
> // QuickNode
> const connection = new Connection(
>   "https://your-endpoint.solana-mainnet.quiknode.pro/YOUR_KEY/"
> );
>
> // Public (not recommended for production)
> const connection = new Connection("https://api.mainnet-beta.solana.com");
> ```

> [tab] Python
>
> ```python theme={"dark"}
> # Helius
> connection = AsyncClient("https://mainnet.helius-rpc.com/?api-key=YOUR_KEY")
>
> # QuickNode
> connection = AsyncClient(
>     "https://your-endpoint.solana-mainnet.quiknode.pro/YOUR_KEY/"
> )
>
> # Public (not recommended for production)
> connection = AsyncClient("https://api.mainnet-beta.solana.com")
> ```

***

## Commitment Levels

| Level | Latency | Certainty |
| - | - | - |
| `processed` | \~400ms | May be reverted |
| `confirmed` | \~1s | 66%+ stake voted |
| `finalized` | \~12s | Maximum certainty |

> [tab] TypeScript
>
> ```typescript theme={"dark"}
> const connection = new Connection(
>   "https://api.mainnet-beta.solana.com",
>   { commitment: "confirmed" }
> );
> ```

> [tab] Python
>
> ```python theme={"dark"}
> from solana.rpc.commitment import Confirmed
>
> connection = AsyncClient(
>     "https://api.mainnet-beta.solana.com",
>     commitment=Confirmed
> )
> ```

***

## Accessing Clients

> [tab] TypeScript
>
> ```typescript theme={"dark"}
> const sdk = await OricaSDK.createFromChain(connection);
>
> // Core market operations
> const oricaClient = sdk.orica;
>
> // Dispute operations  
> const disputesClient = sdk.disputes;
>
> // Shared connection
> const conn = sdk.connection;
> ```

> [tab] Python
>
> ```python theme={"dark"}
> sdk = await OricaSDK.create(connection)
>
> # Core market operations
> orica_client = sdk.orica
>
> # Dispute operations
> disputes_client = sdk.disputes
>
> # Shared connection
> conn = sdk.connection
> ```

***

## Fetch Options (TypeScript)

Many TypeScript fetch methods accept options for metadata handling:

```typescript theme={"dark"}
interface FetchOptions {
  includeMetadata?: boolean;  // Fetch IPFS metadata
  metadataTimeout?: number;   // Timeout in ms (default: 5000)
}

const markets = await sdk.orica.fetchAllMarkets({
  includeMetadata: true,
  metadataTimeout: 10000,
});
```

***

## Next Steps

> [card] [Markets](https://docs.orica.markets/sdk/markets.md)
>
> Fetch and query market data.

> [card] [Trading](https://docs.orica.markets/sdk/trading.md)
>
> Execute trades programmatically.


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