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

# Global State

> Fetch protocol configuration and fees.

Global state contains protocol-wide configuration including fee settings, USDC mint, and admin list.

***

## Fetch Global State

> [tab] TypeScript
>
> ```typescript theme={"dark"}
> const globalState = await sdk.orica.fetchGlobalState();
>
> console.log("Authority:", globalState.authority.toBase58());
> console.log("Market Count:", globalState.marketCount.toString());
> console.log("USDC Mint:", globalState.usdcMint.toBase58());
> console.log("Fee Vault:", globalState.feeVault.toBase58());
> ```

> [tab] Python
>
> ```python theme={"dark"}
> global_state = await sdk.orica.fetch_global_state()
>
> print(f"Authority: {global_state.authority}")
> print(f"Market Count: {global_state.market_count}")
> print(f"USDC Mint: {global_state.usdc_mint}")
> print(f"Fee Vault: {global_state.fee_vault}")
> ```

***

## Fee Information

> [tab] TypeScript
>
> ```typescript theme={"dark"}
> const globalState = await sdk.orica.fetchGlobalState();
>
> console.log("Market Creation Fee:", globalState.creationFee.toString(), "lamports");
> console.log("Protocol Trading Fee:", globalState.authorityTradingFeeBps, "bps");
> console.log("Creator Trading Fee:", globalState.creatorTradingFeeBps, "bps");
> console.log("Redemption Fee:", globalState.redemptionFeeBps, "bps");
>
> // Total trading fee
> const totalTradingFeeBps = globalState.authorityTradingFeeBps + globalState.creatorTradingFeeBps;
> console.log("Total Trading Fee:", totalTradingFeeBps / 100, "%");
> ```

> [tab] Python
>
> ```python theme={"dark"}
> global_state = await sdk.orica.fetch_global_state()
>
> print(f"Market Creation Fee: {global_state.creation_fee} lamports")
> print(f"Protocol Trading Fee: {global_state.authority_trading_fee_bps} bps")
> print(f"Creator Trading Fee: {global_state.creator_trading_fee_bps} bps")
> print(f"Redemption Fee: {global_state.redemption_fee_bps} bps")
>
> # Total trading fee
> total_trading_fee_bps = global_state.authority_trading_fee_bps + global_state.creator_trading_fee_bps
> print(f"Total Trading Fee: {total_trading_fee_bps / 100}%")
> ```

***

## Admin List

> [tab] TypeScript
>
> ```typescript theme={"dark"}
> const globalState = await sdk.orica.fetchGlobalState();
>
> console.log("Admins:");
> for (const admin of globalState.admins) {
>   console.log(" -", admin.toBase58());
> }
> ```

> [tab] Python
>
> ```python theme={"dark"}
> global_state = await sdk.orica.fetch_global_state()
>
> print("Admins:")
> for admin in global_state.admins:
>     print(f" - {admin}")
> ```

***

## Global State Structure

> [tab] TypeScript
>
> ```typescript theme={"dark"}
> interface GlobalState {
>   authority: PublicKey;           // Protocol authority
>   admins: PublicKey[];            // List of admins
>   creationFee: BN;                // Fee to create market (lamports)
>   authorityTradingFeeBps: number; // Protocol trading fee (basis points)
>   creatorTradingFeeBps: number;   // Creator trading fee (basis points)
>   redemptionFeeBps: number;       // Redemption fee (basis points)
>   usdcMint: PublicKey;            // USDC token mint
>   feeVault: PublicKey;            // Protocol fee collection account
>   marketCount: BN;                // Total markets created
>   bump: number;                   // PDA bump
>   feeVaultBump: number;           // Fee vault PDA bump
> }
> ```

> [tab] Python
>
> ```python theme={"dark"}
> @dataclass
> class GlobalState:
>     authority: Pubkey           # Protocol authority
>     admins: list[Pubkey]        # List of admins
>     creation_fee: int           # Fee to create market (lamports)
>     authority_trading_fee_bps: int  # Protocol trading fee (basis points)
>     creator_trading_fee_bps: int    # Creator trading fee (basis points)
>     redemption_fee_bps: int     # Redemption fee (basis points)
>     usdc_mint: Pubkey           # USDC token mint
>     fee_vault: Pubkey           # Protocol fee collection account
>     market_count: int           # Total markets created
>     bump: int                   # PDA bump
>     fee_vault_bump: int         # Fee vault PDA bump
> ```

***

## Derive Global State PDA

> [tab] TypeScript
>
> ```typescript theme={"dark"}
> const [globalStatePDA, bump] = sdk.orica.pda.globalState();
> console.log("Global State address:", globalStatePDA.toBase58());
> ```

> [tab] Python
>
> ```python theme={"dark"}
> global_state_pda, bump = sdk.orica.pda.global_state()
> print(f"Global State address: {global_state_pda}")
> ```

***

## Next Steps

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

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


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