# Zeta Markets decoder (Carbon 2.0)

> Decode Zeta Markets instructions, accounts and events in Rust with carbon-zeta-decoder 2.0.0. Program ID ZETAxsqBRek56DhiGXrn75yj2NHU3aYUnxvHXpkf3aD.

`carbon-zeta-decoder` decodes the instructions, accounts and events of the Zeta Markets program (`ZETAxsqBRek56DhiGXrn75yj2NHU3aYUnxvHXpkf3aD`): 107 instructions, 23 account types, 8 events. It is generated with Codama from the program's IDL; see [decoders](https://carbon.sevenlabs.org/concepts/decoders.md) for how decoders plug into a pipeline.

|                  |                                                                                                   |
| ---------------- | ------------------------------------------------------------------------------------------------- |
| Crate            | [`carbon-zeta-decoder`](https://crates.io/crates/carbon-zeta-decoder/2.0.0) 2.0.0                 |
| Install          | `cargo add carbon-zeta-decoder@2.0.0`                                                             |
| Program ID       | `ZETAxsqBRek56DhiGXrn75yj2NHU3aYUnxvHXpkf3aD` (`carbon_zeta_decoder::PROGRAM_ID`)                 |
| Category         | [Perpetuals & derivatives](https://carbon.sevenlabs.org/decoders/perpetuals.md)                   |
| Decoder          | `carbon_zeta_decoder::ZetaDecoder`                                                                |
| Instruction enum | `instructions::ZetaInstruction`                                                                   |
| Account enum     | `accounts::ZetaAccount`                                                                           |
| Event enum       | `instructions::CpiEvent`                                                                          |
| Features         | `serde`, `postgres`, `graphql` (none enabled by default)                                          |
| API docs         | [docs.rs/carbon-zeta-decoder/2.0.0](https://docs.rs/carbon-zeta-decoder/2.0.0)                    |
| Source           | [decoders/zeta-decoder](https://github.com/sevenlabs-hq/carbon/tree/v2.0.0/decoders/zeta-decoder) |

Other perpetuals and derivatives decoders: [Drift v2](https://carbon.sevenlabs.org/decoders/drift-v2.md), [Jupiter Perpetuals](https://carbon.sevenlabs.org/decoders/jupiter-perpetuals.md). To decode several in one pipeline, see [perpetuals and derivatives decoders](https://carbon.sevenlabs.org/decoders/perpetuals.md).

The `serde` feature derives `Serialize`/`Deserialize` on every type, `postgres` adds tables and processors for [Postgres](https://carbon.sevenlabs.org/guides/postgres.md), and `graphql` adds a schema for the [GraphQL server](https://carbon.sevenlabs.org/guides/graphql.md).

## Usage

This program crawls recent Zeta Markets transactions from the public RPC and prints every decoded `PlacePerpOrderV3` instruction. Add the dependencies:

```sh
cargo add carbon-core@2.0.0 carbon-zeta-decoder@2.0.0 carbon-rpc-transaction-crawler-datasource@2.0.0 carbon-log-metrics@2.0.0 env_logger tokio --features tokio/full
```

`src/main.rs`:

```rust
use {
    carbon_core::{
        error::CarbonResult, instruction::InstructionProcessorInputType, pipeline::Pipeline,
        processor::Processor,
    },
    carbon_log_metrics::LogMetrics,
    carbon_zeta_decoder::{instructions::ZetaInstruction, ZetaDecoder, PROGRAM_ID},
    carbon_rpc_transaction_crawler_datasource::{ConnectionConfig, Filters, RpcTransactionCrawler},
    std::sync::Arc,
};

#[tokio::main]
async fn main() -> CarbonResult<()> {
    env_logger::init();

    // Fetches the program's recent transactions over JSON-RPC, newest first.
    let datasource = RpcTransactionCrawler::new(
        "https://api.mainnet-beta.solana.com".to_string(),
        PROGRAM_ID,
        ConnectionConfig::default(),
        Filters::new(None, None, None),
        None,
    );

    Pipeline::builder()
        .datasource(datasource)
        .metrics(Arc::new(LogMetrics::new()))
        .instruction(ZetaDecoder, InstructionLogger)
        .build()?
        .run()
        .await
}

struct InstructionLogger;

impl Processor<InstructionProcessorInputType<'_, ZetaInstruction>> for InstructionLogger {
    async fn process(
        &mut self,
        input: &InstructionProcessorInputType<'_, ZetaInstruction>,
    ) -> CarbonResult<()> {
        let signature = input.metadata.transaction_metadata.signature;
        if let ZetaInstruction::PlacePerpOrderV3 { data, accounts, .. } = input.decoded_instruction {
            println!("place_perp_order_v3 {signature}: {data:?} state={}", accounts.state);
        }
        Ok(())
    }
}
```

```sh
RUST_LOG=info cargo run
```

Each `PlacePerpOrderV3` instruction prints one line with the transaction signature and the decoded `PlacePerpOrderV3` data. The public endpoint rate-limits requests, so the first lines can take a while; use your own RPC URL for anything beyond a test. See [stream with RPC](https://carbon.sevenlabs.org/guides/stream-with-rpc.md) for the crawler options.

Events published with Anchor's `emit_cpi!` arrive as the `CpiEvent` instruction. Match them with `ZetaInstruction::CpiEvent { data: CpiEvent::TradeEvent(event), .. }` (import `instructions::CpiEvent`); see [Events](#events). If `CpiEvent` never arrives, the program logs its events with `emit!` instead: decode them with [`decode_log_events`](https://carbon.sevenlabs.org/concepts/instructions.md#log-events).

### Decode accounts

The transaction crawler emits transactions only. To decode accounts, use a datasource that emits account updates. This program subscribes to the program's accounts with `programSubscribe` on the public WebSocket endpoint and prints every decoded `CrossMarginAccount` account as it changes. Add the datasource and the Solana RPC types it takes:

```sh
cargo add carbon-rpc-program-subscribe-datasource@2.0.0 solana-client@4.2.2
```

`src/main.rs`:

```rust
use {
    carbon_core::{
        account::AccountProcessorInputType, error::CarbonResult, pipeline::Pipeline,
        processor::Processor,
    },
    carbon_log_metrics::LogMetrics,
    carbon_zeta_decoder::{accounts::ZetaAccount, ZetaDecoder, PROGRAM_ID},
    carbon_rpc_program_subscribe_datasource::{Filters, RpcProgramSubscribe},
    solana_client::rpc_config::{RpcAccountInfoConfig, RpcProgramAccountsConfig, UiAccountEncoding},
    std::sync::Arc,
};

#[tokio::main]
async fn main() -> CarbonResult<()> {
    env_logger::init();

    // Streams every change to an account owned by the program (programSubscribe).
    let config = RpcProgramAccountsConfig {
        account_config: RpcAccountInfoConfig {
            encoding: Some(UiAccountEncoding::Base64),
            ..Default::default()
        },
        ..Default::default()
    };
    let datasource = RpcProgramSubscribe::new(
        "wss://api.mainnet-beta.solana.com".to_string(),
        Filters::new(PROGRAM_ID, Some(config)),
    );

    Pipeline::builder()
        .datasource(datasource)
        .metrics(Arc::new(LogMetrics::new()))
        .account(ZetaDecoder, AccountLogger)
        .build()?
        .run()
        .await
}

struct AccountLogger;

impl Processor<AccountProcessorInputType<'_, ZetaAccount>> for AccountLogger {
    async fn process(
        &mut self,
        input: &AccountProcessorInputType<'_, ZetaAccount>,
    ) -> CarbonResult<()> {
        if let ZetaAccount::CrossMarginAccount(cross_margin_account) = &input.decoded_account.data {
            println!("cross_margin_account {}: {cross_margin_account:?}", input.metadata.pubkey);
        }
        Ok(())
    }
}
```

```sh
RUST_LOG=info cargo run
```

Each update to a `CrossMarginAccount` account prints its address and decoded fields; the program runs until you stop it. Cargo resolves `solana-client` to 4.2.2, the exact version the datasource pins, so both use the same `RpcProgramAccountsConfig` type. To load every existing account once instead of streaming changes, see [load account state](https://carbon.sevenlabs.org/guides/load-account-state.md).

## Instructions

Variants of `ZetaInstruction`. Each is `ZetaInstruction::<Variant> { program_id, data, accounts }`, where `data` and `accounts` are the types listed under the variant, exported from `carbon_zeta_decoder::instructions`. Discriminators are the leading bytes of the instruction data, in hex.

**How an instruction decodes.** The decoder returns a variant only when all of these hold; otherwise the instruction is skipped and no processor is called:

1. The instruction's program ID is `ZETAxsqBRek56DhiGXrn75yj2NHU3aYUnxvHXpkf3aD`.
2. The data starts with the variant's discriminator, and the rest deserializes into its data type.
3. The instruction has at least as many accounts as the variant requires (the "Required accounts" count under each variant).

**Accounts.** They are matched by position, in the order listed. An account marked _optional_ is `None` only when the instruction ends before it; Anchor programs pass the program ID as a placeholder for an omitted optional account, so check for `Some(PROGRAM_ID)` too. Accounts after the listed ones are in `accounts.remaining` as `AccountMeta`s. The decoder doesn't record whether an account signed or was writable: read that from `input.raw_instruction.accounts[i].is_signer` and `.is_writable`, which follow the same order. It doesn't check signer, writable, owner or PDA constraints either; the program enforced those when the transaction executed, so a decoded instruction from a successful transaction already satisfied them.

### `AddMarketIndexes`

Discriminator `5ef690af04a4e9fc` · data `AddMarketIndexes` · accounts `AddMarketIndexesInstructionAccounts`.

No data fields.

Required accounts: 2; extras go to `remaining`.

Fields of `AddMarketIndexesInstructionAccounts`, in account order:

| #  | Field            | Type               |
| -- | ---------------- | ------------------ |
| 0  | `market_indexes` | `Pubkey`           |
| 1  | `zeta_group`     | `Pubkey`           |
| 2… | `remaining`      | `Vec<AccountMeta>` |

### `AddPerpMarketIndex`

Discriminator `7a280e40a912e788` · data `AddPerpMarketIndex` · accounts `AddPerpMarketIndexInstructionAccounts`.

| Field   | Type              |
| ------- | ----------------- |
| `asset` | [`Asset`](#asset) |

Required accounts: 2; extras go to `remaining`.

Fields of `AddPerpMarketIndexInstructionAccounts`, in account order:

| #  | Field            | Type               |
| -- | ---------------- | ------------------ |
| 0  | `market_indexes` | `Pubkey`           |
| 1  | `pricing`        | `Pubkey`           |
| 2… | `remaining`      | `Vec<AccountMeta>` |

### `ApplyPerpFunding`

Discriminator `1752e1dedb7ae6fb` · data `ApplyPerpFunding` · accounts `ApplyPerpFundingInstructionAccounts`.

| Field   | Type              |
| ------- | ----------------- |
| `asset` | [`Asset`](#asset) |

Required accounts: 2; extras go to `remaining`.

Fields of `ApplyPerpFundingInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `state`     | `Pubkey`           |
| 1  | `pricing`   | `Pubkey`           |
| 2… | `remaining` | `Vec<AccountMeta>` |

### `BurnVaultTokens`

Discriminator `e9cba5c9af2bbc9f` · data `BurnVaultTokens` · accounts `BurnVaultTokensInstructionAccounts`.

No data fields.

Required accounts: 5; extras go to `remaining`.

Fields of `BurnVaultTokensInstructionAccounts`, in account order:

| #  | Field             | Type               |
| -- | ----------------- | ------------------ |
| 0  | `state`           | `Pubkey`           |
| 1  | `mint`            | `Pubkey`           |
| 2  | `vault`           | `Pubkey`           |
| 3  | `serum_authority` | `Pubkey`           |
| 4  | `token_program`   | `Pubkey`           |
| 5… | `remaining`       | `Vec<AccountMeta>` |

### `CancelAllMarketOrders`

Discriminator `8bbee6f94da0ce04` · data `CancelAllMarketOrders` · accounts `CancelAllMarketOrdersInstructionAccounts`.

| Field   | Type              |
| ------- | ----------------- |
| `asset` | [`Asset`](#asset) |

Required accounts: 10; extras go to `remaining`.

Fields of `CancelAllMarketOrdersInstructionAccounts`, in account order:

| #   | Field             | Type               |
| --- | ----------------- | ------------------ |
| 0   | `authority`       | `Pubkey`           |
| 1   | `state`           | `Pubkey`           |
| 2   | `margin_account`  | `Pubkey`           |
| 3   | `dex_program`     | `Pubkey`           |
| 4   | `serum_authority` | `Pubkey`           |
| 5   | `open_orders`     | `Pubkey`           |
| 6   | `market`          | `Pubkey`           |
| 7   | `bids`            | `Pubkey`           |
| 8   | `asks`            | `Pubkey`           |
| 9   | `event_queue`     | `Pubkey`           |
| 10… | `remaining`       | `Vec<AccountMeta>` |

### `CancelOrder`

Discriminator `5f81edf00831df84` · data `CancelOrder` · accounts `CancelOrderInstructionAccounts`.

| Field      | Type              |
| ---------- | ----------------- |
| `side`     | [`Side`](#side)   |
| `order_id` | `u128`            |
| `asset`    | [`Asset`](#asset) |

Required accounts: 10; extras go to `remaining`.

Fields of `CancelOrderInstructionAccounts`, in account order:

| #   | Field             | Type               |
| --- | ----------------- | ------------------ |
| 0   | `authority`       | `Pubkey`           |
| 1   | `state`           | `Pubkey`           |
| 2   | `margin_account`  | `Pubkey`           |
| 3   | `dex_program`     | `Pubkey`           |
| 4   | `serum_authority` | `Pubkey`           |
| 5   | `open_orders`     | `Pubkey`           |
| 6   | `market`          | `Pubkey`           |
| 7   | `bids`            | `Pubkey`           |
| 8   | `asks`            | `Pubkey`           |
| 9   | `event_queue`     | `Pubkey`           |
| 10… | `remaining`       | `Vec<AccountMeta>` |

### `CancelOrderByClientOrderId`

Discriminator `73b2c908afb77b77` · data `CancelOrderByClientOrderId` · accounts `CancelOrderByClientOrderIdInstructionAccounts`.

| Field             | Type              |
| ----------------- | ----------------- |
| `client_order_id` | `u64`             |
| `asset`           | [`Asset`](#asset) |

Required accounts: 10; extras go to `remaining`.

Fields of `CancelOrderByClientOrderIdInstructionAccounts`, in account order:

| #   | Field             | Type               |
| --- | ----------------- | ------------------ |
| 0   | `authority`       | `Pubkey`           |
| 1   | `state`           | `Pubkey`           |
| 2   | `margin_account`  | `Pubkey`           |
| 3   | `dex_program`     | `Pubkey`           |
| 4   | `serum_authority` | `Pubkey`           |
| 5   | `open_orders`     | `Pubkey`           |
| 6   | `market`          | `Pubkey`           |
| 7   | `bids`            | `Pubkey`           |
| 8   | `asks`            | `Pubkey`           |
| 9   | `event_queue`     | `Pubkey`           |
| 10… | `remaining`       | `Vec<AccountMeta>` |

### `CancelOrderByClientOrderIdNoError`

Discriminator `354da79daf8390ab` · data `CancelOrderByClientOrderIdNoError` · accounts `CancelOrderByClientOrderIdNoErrorInstructionAccounts`.

| Field             | Type              |
| ----------------- | ----------------- |
| `client_order_id` | `u64`             |
| `asset`           | [`Asset`](#asset) |

Required accounts: 10; extras go to `remaining`.

Fields of `CancelOrderByClientOrderIdNoErrorInstructionAccounts`, in account order:

| #   | Field             | Type               |
| --- | ----------------- | ------------------ |
| 0   | `authority`       | `Pubkey`           |
| 1   | `state`           | `Pubkey`           |
| 2   | `margin_account`  | `Pubkey`           |
| 3   | `dex_program`     | `Pubkey`           |
| 4   | `serum_authority` | `Pubkey`           |
| 5   | `open_orders`     | `Pubkey`           |
| 6   | `market`          | `Pubkey`           |
| 7   | `bids`            | `Pubkey`           |
| 8   | `asks`            | `Pubkey`           |
| 9   | `event_queue`     | `Pubkey`           |
| 10… | `remaining`       | `Vec<AccountMeta>` |

### `CancelOrderHalted`

Discriminator `00c0e902fcfb82a9` · data `CancelOrderHalted` · accounts `CancelOrderHaltedInstructionAccounts`.

| Field      | Type              |
| ---------- | ----------------- |
| `side`     | [`Side`](#side)   |
| `order_id` | `u128`            |
| `asset`    | [`Asset`](#asset) |

Required accounts: 9; extras go to `remaining`.

Fields of `CancelOrderHaltedInstructionAccounts`, in account order:

| #  | Field             | Type               |
| -- | ----------------- | ------------------ |
| 0  | `state`           | `Pubkey`           |
| 1  | `margin_account`  | `Pubkey`           |
| 2  | `dex_program`     | `Pubkey`           |
| 3  | `serum_authority` | `Pubkey`           |
| 4  | `open_orders`     | `Pubkey`           |
| 5  | `market`          | `Pubkey`           |
| 6  | `bids`            | `Pubkey`           |
| 7  | `asks`            | `Pubkey`           |
| 8  | `event_queue`     | `Pubkey`           |
| 9… | `remaining`       | `Vec<AccountMeta>` |

### `CancelOrderNoError`

Discriminator `5f61d7cc6f33ccb8` · data `CancelOrderNoError` · accounts `CancelOrderNoErrorInstructionAccounts`.

| Field      | Type              |
| ---------- | ----------------- |
| `side`     | [`Side`](#side)   |
| `order_id` | `u128`            |
| `asset`    | [`Asset`](#asset) |

Required accounts: 10; extras go to `remaining`.

Fields of `CancelOrderNoErrorInstructionAccounts`, in account order:

| #   | Field             | Type               |
| --- | ----------------- | ------------------ |
| 0   | `authority`       | `Pubkey`           |
| 1   | `state`           | `Pubkey`           |
| 2   | `margin_account`  | `Pubkey`           |
| 3   | `dex_program`     | `Pubkey`           |
| 4   | `serum_authority` | `Pubkey`           |
| 5   | `open_orders`     | `Pubkey`           |
| 6   | `market`          | `Pubkey`           |
| 7   | `bids`            | `Pubkey`           |
| 8   | `asks`            | `Pubkey`           |
| 9   | `event_queue`     | `Pubkey`           |
| 10… | `remaining`       | `Vec<AccountMeta>` |

### `ClaimReferralsRewards`

Discriminator `799c6d9f9edbd98f` · data `ClaimReferralsRewards` · accounts `ClaimReferralsRewardsInstructionAccounts`.

No data fields.

Required accounts: 6; extras go to `remaining`.

Fields of `ClaimReferralsRewardsInstructionAccounts`, in account order:

| #  | Field                      | Type               |
| -- | -------------------------- | ------------------ |
| 0  | `state`                    | `Pubkey`           |
| 1  | `referrals_rewards_wallet` | `Pubkey`           |
| 2  | `user_referrals_account`   | `Pubkey`           |
| 3  | `user_token_account`       | `Pubkey`           |
| 4  | `token_program`            | `Pubkey`           |
| 5  | `user`                     | `Pubkey`           |
| 6… | `remaining`                | `Vec<AccountMeta>` |

### `CleanZetaMarketHalted`

Discriminator `898c5e12e7e8d9cc` · data `CleanZetaMarketHalted` · accounts `CleanZetaMarketHaltedInstructionAccounts`.

| Field   | Type              |
| ------- | ----------------- |
| `asset` | [`Asset`](#asset) |

Required accounts: 4; extras go to `remaining`.

Fields of `CleanZetaMarketHaltedInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `state`     | `Pubkey`           |
| 1  | `market`    | `Pubkey`           |
| 2  | `bids`      | `Pubkey`           |
| 3  | `asks`      | `Pubkey`           |
| 4… | `remaining` | `Vec<AccountMeta>` |

### `CleanZetaMarkets`

Discriminator `7a7f315944e4559d` · data `CleanZetaMarkets` · accounts `CleanZetaMarketsInstructionAccounts`.

No data fields.

Required accounts: 2; extras go to `remaining`.

Fields of `CleanZetaMarketsInstructionAccounts`, in account order:

| #  | Field        | Type               |
| -- | ------------ | ------------------ |
| 0  | `state`      | `Pubkey`           |
| 1  | `zeta_group` | `Pubkey`           |
| 2… | `remaining`  | `Vec<AccountMeta>` |

### `CloseCrossMarginAccount`

Discriminator `cbc4bb3c0daabe45` · data `CloseCrossMarginAccount` · accounts `CloseCrossMarginAccountInstructionAccounts`.

| Field              | Type |
| ------------------ | ---- |
| `subaccount_index` | `u8` |

Required accounts: 3; extras go to `remaining`.

Fields of `CloseCrossMarginAccountInstructionAccounts`, in account order:

| #  | Field                          | Type               |
| -- | ------------------------------ | ------------------ |
| 0  | `cross_margin_account`         | `Pubkey`           |
| 1  | `cross_margin_account_manager` | `Pubkey`           |
| 2  | `authority`                    | `Pubkey`           |
| 3… | `remaining`                    | `Vec<AccountMeta>` |

### `CloseCrossMarginAccountManager`

Discriminator `e8b6b689565876fc` · data `CloseCrossMarginAccountManager` · accounts `CloseCrossMarginAccountManagerInstructionAccounts`.

No data fields.

Required accounts: 2; extras go to `remaining`.

Fields of `CloseCrossMarginAccountManagerInstructionAccounts`, in account order:

| #  | Field                          | Type               |
| -- | ------------------------------ | ------------------ |
| 0  | `cross_margin_account_manager` | `Pubkey`           |
| 1  | `authority`                    | `Pubkey`           |
| 2… | `remaining`                    | `Vec<AccountMeta>` |

### `CloseMarginAccount`

Discriminator `69d729efa6cf0167` · data `CloseMarginAccount` · accounts `CloseMarginAccountInstructionAccounts`.

No data fields.

Required accounts: 3; extras go to `remaining`.

Fields of `CloseMarginAccountInstructionAccounts`, in account order:

| #  | Field            | Type               |
| -- | ---------------- | ------------------ |
| 0  | `margin_account` | `Pubkey`           |
| 1  | `authority`      | `Pubkey`           |
| 2  | `zeta_group`     | `Pubkey`           |
| 3… | `remaining`      | `Vec<AccountMeta>` |

### `CloseOpenOrders`

Discriminator `c8d83fef07e6ff14` · data `CloseOpenOrders` · accounts `CloseOpenOrdersInstructionAccounts`.

| Field       | Type |
| ----------- | ---- |
| `map_nonce` | `u8` |

Required accounts: 9; extras go to `remaining`.

Fields of `CloseOpenOrdersInstructionAccounts`, in account order:

| #  | Field             | Type               |
| -- | ----------------- | ------------------ |
| 0  | `state`           | `Pubkey`           |
| 1  | `zeta_group`      | `Pubkey`           |
| 2  | `dex_program`     | `Pubkey`           |
| 3  | `open_orders`     | `Pubkey`           |
| 4  | `margin_account`  | `Pubkey`           |
| 5  | `authority`       | `Pubkey`           |
| 6  | `market`          | `Pubkey`           |
| 7  | `serum_authority` | `Pubkey`           |
| 8  | `open_orders_map` | `Pubkey`           |
| 9… | `remaining`       | `Vec<AccountMeta>` |

### `CloseOpenOrdersV2`

Discriminator `4e98c4a344b37948` · data `CloseOpenOrdersV2` · accounts `CloseOpenOrdersV2InstructionAccounts`.

| Field       | Type |
| ----------- | ---- |
| `map_nonce` | `u8` |

Required accounts: 8; extras go to `remaining`.

Fields of `CloseOpenOrdersV2InstructionAccounts`, in account order:

| #  | Field             | Type               |
| -- | ----------------- | ------------------ |
| 0  | `state`           | `Pubkey`           |
| 1  | `dex_program`     | `Pubkey`           |
| 2  | `open_orders`     | `Pubkey`           |
| 3  | `margin_account`  | `Pubkey`           |
| 4  | `authority`       | `Pubkey`           |
| 5  | `market`          | `Pubkey`           |
| 6  | `serum_authority` | `Pubkey`           |
| 7  | `open_orders_map` | `Pubkey`           |
| 8… | `remaining`       | `Vec<AccountMeta>` |

### `CloseOpenOrdersV3`

Discriminator `cf0fc64ac5e4b01e` · data `CloseOpenOrdersV3` · accounts `CloseOpenOrdersV3InstructionAccounts`.

| Field       | Type              |
| ----------- | ----------------- |
| `map_nonce` | `u8`              |
| `asset`     | [`Asset`](#asset) |

Required accounts: 9; extras go to `remaining`.

Fields of `CloseOpenOrdersV3InstructionAccounts`, in account order:

| #  | Field                  | Type               |
| -- | ---------------------- | ------------------ |
| 0  | `state`                | `Pubkey`           |
| 1  | `pricing`              | `Pubkey`           |
| 2  | `dex_program`          | `Pubkey`           |
| 3  | `open_orders`          | `Pubkey`           |
| 4  | `cross_margin_account` | `Pubkey`           |
| 5  | `authority`            | `Pubkey`           |
| 6  | `market`               | `Pubkey`           |
| 7  | `serum_authority`      | `Pubkey`           |
| 8  | `open_orders_map`      | `Pubkey`           |
| 9… | `remaining`            | `Vec<AccountMeta>` |

### `CloseSpreadAccount`

Discriminator `bee4fd10c994a1f0` · data `CloseSpreadAccount` · accounts `CloseSpreadAccountInstructionAccounts`.

No data fields.

Required accounts: 3; extras go to `remaining`.

Fields of `CloseSpreadAccountInstructionAccounts`, in account order:

| #  | Field            | Type               |
| -- | ---------------- | ------------------ |
| 0  | `spread_account` | `Pubkey`           |
| 1  | `authority`      | `Pubkey`           |
| 2  | `zeta_group`     | `Pubkey`           |
| 3… | `remaining`      | `Vec<AccountMeta>` |

### `CollectTreasuryFunds`

Discriminator `f3d504ec1af6b4ae` · data `CollectTreasuryFunds` · accounts `CollectTreasuryFundsInstructionAccounts`.

| Field    | Type  |
| -------- | ----- |
| `amount` | `u64` |

Required accounts: 5; extras go to `remaining`.

Fields of `CollectTreasuryFundsInstructionAccounts`, in account order:

| #  | Field                      | Type               |
| -- | -------------------------- | ------------------ |
| 0  | `state`                    | `Pubkey`           |
| 1  | `treasury_wallet`          | `Pubkey`           |
| 2  | `collection_token_account` | `Pubkey`           |
| 3  | `token_program`            | `Pubkey`           |
| 4  | `admin`                    | `Pubkey`           |
| 5… | `remaining`                | `Vec<AccountMeta>` |

### `CrankEventQueue`

> _From the program's IDL:_
>
> The only events that need to be cranked are maker fills.

Discriminator `438561dfb2bcebb5` · data `CrankEventQueue` · accounts `CrankEventQueueInstructionAccounts`.

| Field   | Type              |
| ------- | ----------------- |
| `asset` | [`Asset`](#asset) |

Required accounts: 7; extras go to `remaining`.

Fields of `CrankEventQueueInstructionAccounts`, in account order:

| #  | Field             | Type               |
| -- | ----------------- | ------------------ |
| 0  | `state`           | `Pubkey`           |
| 1  | `pricing`         | `Pubkey`           |
| 2  | `market`          | `Pubkey`           |
| 3  | `event_queue`     | `Pubkey`           |
| 4  | `dex_program`     | `Pubkey`           |
| 5  | `serum_authority` | `Pubkey`           |
| 6  | `perp_sync_queue` | `Pubkey`           |
| 7… | `remaining`       | `Vec<AccountMeta>` |

### `Deposit`

Discriminator `f223c68952e1f2b6` · data `Deposit` · accounts `DepositInstructionAccounts`.

| Field    | Type  |
| -------- | ----- |
| `amount` | `u64` |

Required accounts: 9; extras go to `remaining`.

Fields of `DepositInstructionAccounts`, in account order:

| #  | Field                     | Type               |
| -- | ------------------------- | ------------------ |
| 0  | `zeta_group`              | `Pubkey`           |
| 1  | `margin_account`          | `Pubkey`           |
| 2  | `vault`                   | `Pubkey`           |
| 3  | `user_token_account`      | `Pubkey`           |
| 4  | `socialized_loss_account` | `Pubkey`           |
| 5  | `authority`               | `Pubkey`           |
| 6  | `token_program`           | `Pubkey`           |
| 7  | `state`                   | `Pubkey`           |
| 8  | `greeks`                  | `Pubkey`           |
| 9… | `remaining`               | `Vec<AccountMeta>` |

### `DepositInsuranceVault`

Discriminator `2f35192f6d7a1616` · data `DepositInsuranceVault` · accounts `DepositInsuranceVaultInstructionAccounts`.

| Field    | Type  |
| -------- | ----- |
| `amount` | `u64` |

Required accounts: 8; extras go to `remaining`.

Fields of `DepositInsuranceVaultInstructionAccounts`, in account order:

| #  | Field                       | Type               |
| -- | --------------------------- | ------------------ |
| 0  | `state`                     | `Pubkey`           |
| 1  | `insurance_vault`           | `Pubkey`           |
| 2  | `insurance_deposit_account` | `Pubkey`           |
| 3  | `user_token_account`        | `Pubkey`           |
| 4  | `zeta_vault`                | `Pubkey`           |
| 5  | `socialized_loss_account`   | `Pubkey`           |
| 6  | `authority`                 | `Pubkey`           |
| 7  | `token_program`             | `Pubkey`           |
| 8… | `remaining`                 | `Vec<AccountMeta>` |

### `DepositInsuranceVaultV2`

Discriminator `f22c18135b3b07c9` · data `DepositInsuranceVaultV2` · accounts `DepositInsuranceVaultV2InstructionAccounts`.

| Field    | Type  |
| -------- | ----- |
| `amount` | `u64` |

Required accounts: 9; extras go to `remaining`.

Fields of `DepositInsuranceVaultV2InstructionAccounts`, in account order:

| #  | Field                       | Type               |
| -- | --------------------------- | ------------------ |
| 0  | `state`                     | `Pubkey`           |
| 1  | `pricing`                   | `Pubkey`           |
| 2  | `insurance_vault`           | `Pubkey`           |
| 3  | `insurance_deposit_account` | `Pubkey`           |
| 4  | `user_token_account`        | `Pubkey`           |
| 5  | `zeta_vault`                | `Pubkey`           |
| 6  | `socialized_loss_account`   | `Pubkey`           |
| 7  | `authority`                 | `Pubkey`           |
| 8  | `token_program`             | `Pubkey`           |
| 9… | `remaining`                 | `Vec<AccountMeta>` |

### `DepositV2`

Discriminator `6d4b4599acda9213` · data `DepositV2` · accounts `DepositV2InstructionAccounts`.

| Field    | Type  |
| -------- | ----- |
| `amount` | `u64` |

Required accounts: 8; extras go to `remaining`.

Fields of `DepositV2InstructionAccounts`, in account order:

| #  | Field                     | Type               |
| -- | ------------------------- | ------------------ |
| 0  | `margin_account`          | `Pubkey`           |
| 1  | `vault`                   | `Pubkey`           |
| 2  | `user_token_account`      | `Pubkey`           |
| 3  | `socialized_loss_account` | `Pubkey`           |
| 4  | `authority`               | `Pubkey`           |
| 5  | `token_program`           | `Pubkey`           |
| 6  | `state`                   | `Pubkey`           |
| 7  | `pricing`                 | `Pubkey`           |
| 8… | `remaining`               | `Vec<AccountMeta>` |

### `EditDelegatedPubkey`

Discriminator `89f547592ef91635` · data `EditDelegatedPubkey` · accounts `EditDelegatedPubkeyInstructionAccounts`.

| Field     | Type     |
| --------- | -------- |
| `new_key` | `Pubkey` |

Required accounts: 2; extras go to `remaining`.

Fields of `EditDelegatedPubkeyInstructionAccounts`, in account order:

| #  | Field            | Type               |
| -- | ---------------- | ------------------ |
| 0  | `margin_account` | `Pubkey`           |
| 1  | `authority`      | `Pubkey`           |
| 2… | `remaining`      | `Vec<AccountMeta>` |

### `ExpireSeries`

Discriminator `2da269622c15ab7f` · data `ExpireSeries` · accounts `ExpireSeriesInstructionAccounts`.

| Field              | Type |
| ------------------ | ---- |
| `settlement_nonce` | `u8` |

No named accounts.

### `ExpireSeriesOverride`

Discriminator `6816227b56e08246` · data `ExpireSeriesOverride` · accounts `ExpireSeriesOverrideInstructionAccounts`.

| Field  | Type                                                    |
| ------ | ------------------------------------------------------- |
| `args` | [`ExpireSeriesOverrideArgs`](#expireseriesoverrideargs) |

No named accounts.

### `ForceCancelOrderByOrderId`

Discriminator `b6eb30b3f885d2f0` · data `ForceCancelOrderByOrderId` · accounts `ForceCancelOrderByOrderIdInstructionAccounts`.

| Field      | Type              |
| ---------- | ----------------- |
| `side`     | [`Side`](#side)   |
| `order_id` | `u128`            |
| `asset`    | [`Asset`](#asset) |

Required accounts: 14; extras go to `remaining`.

Fields of `ForceCancelOrderByOrderIdInstructionAccounts`, in account order:

| #   | Field                   | Type               |
| --- | ----------------------- | ------------------ |
| 0   | `zeta_group`            | `Pubkey`           |
| 1   | `greeks`                | `Pubkey`           |
| 2   | `oracle`                | `Pubkey`           |
| 3   | `oracle_backup_feed`    | `Pubkey`           |
| 4   | `oracle_backup_program` | `Pubkey`           |
| 5   | `state`                 | `Pubkey`           |
| 6   | `margin_account`        | `Pubkey`           |
| 7   | `dex_program`           | `Pubkey`           |
| 8   | `serum_authority`       | `Pubkey`           |
| 9   | `open_orders`           | `Pubkey`           |
| 10  | `market`                | `Pubkey`           |
| 11  | `bids`                  | `Pubkey`           |
| 12  | `asks`                  | `Pubkey`           |
| 13  | `event_queue`           | `Pubkey`           |
| 14… | `remaining`             | `Vec<AccountMeta>` |

### `ForceCancelOrderByOrderIdV2`

Discriminator `51f33c5adec929de` · data `ForceCancelOrderByOrderIdV2` · accounts `ForceCancelOrderByOrderIdV2InstructionAccounts`.

| Field      | Type              |
| ---------- | ----------------- |
| `side`     | [`Side`](#side)   |
| `order_id` | `u128`            |
| `asset`    | [`Asset`](#asset) |

Required accounts: 13; extras go to `remaining`.

Fields of `ForceCancelOrderByOrderIdV2InstructionAccounts`, in account order:

| #   | Field                   | Type               |
| --- | ----------------------- | ------------------ |
| 0   | `pricing`               | `Pubkey`           |
| 1   | `oracle`                | `Pubkey`           |
| 2   | `oracle_backup_feed`    | `Pubkey`           |
| 3   | `oracle_backup_program` | `Pubkey`           |
| 4   | `state`                 | `Pubkey`           |
| 5   | `margin_account`        | `Pubkey`           |
| 6   | `dex_program`           | `Pubkey`           |
| 7   | `serum_authority`       | `Pubkey`           |
| 8   | `open_orders`           | `Pubkey`           |
| 9   | `market`                | `Pubkey`           |
| 10  | `bids`                  | `Pubkey`           |
| 11  | `asks`                  | `Pubkey`           |
| 12  | `event_queue`           | `Pubkey`           |
| 13… | `remaining`             | `Vec<AccountMeta>` |

### `ForceCancelOrders`

Discriminator `40b5c43fde4840e8` · data `ForceCancelOrders` · accounts `ForceCancelOrdersInstructionAccounts`.

| Field   | Type              |
| ------- | ----------------- |
| `asset` | [`Asset`](#asset) |

Required accounts: 14; extras go to `remaining`.

Fields of `ForceCancelOrdersInstructionAccounts`, in account order:

| #   | Field                   | Type               |
| --- | ----------------------- | ------------------ |
| 0   | `zeta_group`            | `Pubkey`           |
| 1   | `greeks`                | `Pubkey`           |
| 2   | `oracle`                | `Pubkey`           |
| 3   | `oracle_backup_feed`    | `Pubkey`           |
| 4   | `oracle_backup_program` | `Pubkey`           |
| 5   | `state`                 | `Pubkey`           |
| 6   | `margin_account`        | `Pubkey`           |
| 7   | `dex_program`           | `Pubkey`           |
| 8   | `serum_authority`       | `Pubkey`           |
| 9   | `open_orders`           | `Pubkey`           |
| 10  | `market`                | `Pubkey`           |
| 11  | `bids`                  | `Pubkey`           |
| 12  | `asks`                  | `Pubkey`           |
| 13  | `event_queue`           | `Pubkey`           |
| 14… | `remaining`             | `Vec<AccountMeta>` |

### `ForceCancelOrdersV2`

Discriminator `0e3e95ca8f113873` · data `ForceCancelOrdersV2` · accounts `ForceCancelOrdersV2InstructionAccounts`.

| Field   | Type              |
| ------- | ----------------- |
| `asset` | [`Asset`](#asset) |

Required accounts: 13; extras go to `remaining`.

Fields of `ForceCancelOrdersV2InstructionAccounts`, in account order:

| #   | Field                   | Type               |
| --- | ----------------------- | ------------------ |
| 0   | `pricing`               | `Pubkey`           |
| 1   | `oracle`                | `Pubkey`           |
| 2   | `oracle_backup_feed`    | `Pubkey`           |
| 3   | `oracle_backup_program` | `Pubkey`           |
| 4   | `state`                 | `Pubkey`           |
| 5   | `margin_account`        | `Pubkey`           |
| 6   | `dex_program`           | `Pubkey`           |
| 7   | `serum_authority`       | `Pubkey`           |
| 8   | `open_orders`           | `Pubkey`           |
| 9   | `market`                | `Pubkey`           |
| 10  | `bids`                  | `Pubkey`           |
| 11  | `asks`                  | `Pubkey`           |
| 12  | `event_queue`           | `Pubkey`           |
| 13… | `remaining`             | `Vec<AccountMeta>` |

### `Halt`

Discriminator `189c087941030552` · data `Halt` · accounts `HaltInstructionAccounts`.

| Field   | Type              |
| ------- | ----------------- |
| `asset` | [`Asset`](#asset) |

Required accounts: 3; extras go to `remaining`.

Fields of `HaltInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `state`     | `Pubkey`           |
| 1  | `pricing`   | `Pubkey`           |
| 2  | `admin`     | `Pubkey`           |
| 3… | `remaining` | `Vec<AccountMeta>` |

### `InitializeCombinedInsuranceVault`

Discriminator `4d12b590db54066a` · data `InitializeCombinedInsuranceVault` · accounts `InitializeCombinedInsuranceVaultInstructionAccounts`.

| Field   | Type |
| ------- | ---- |
| `nonce` | `u8` |

Required accounts: 6; extras go to `remaining`.

Fields of `InitializeCombinedInsuranceVaultInstructionAccounts`, in account order:

| #  | Field             | Type               |
| -- | ----------------- | ------------------ |
| 0  | `state`           | `Pubkey`           |
| 1  | `insurance_vault` | `Pubkey`           |
| 2  | `token_program`   | `Pubkey`           |
| 3  | `usdc_mint`       | `Pubkey`           |
| 4  | `admin`           | `Pubkey`           |
| 5  | `system_program`  | `Pubkey`           |
| 6… | `remaining`       | `Vec<AccountMeta>` |

### `InitializeCombinedSocializedLossAccount`

Discriminator `886c58f5e6e06552` · data `InitializeCombinedSocializedLossAccount` · accounts `InitializeCombinedSocializedLossAccountInstructionAccounts`.

| Field   | Type |
| ------- | ---- |
| `nonce` | `u8` |

Required accounts: 6; extras go to `remaining`.

Fields of `InitializeCombinedSocializedLossAccountInstructionAccounts`, in account order:

| #  | Field                     | Type               |
| -- | ------------------------- | ------------------ |
| 0  | `state`                   | `Pubkey`           |
| 1  | `socialized_loss_account` | `Pubkey`           |
| 2  | `token_program`           | `Pubkey`           |
| 3  | `usdc_mint`               | `Pubkey`           |
| 4  | `admin`                   | `Pubkey`           |
| 5  | `system_program`          | `Pubkey`           |
| 6… | `remaining`               | `Vec<AccountMeta>` |

### `InitializeCombinedVault`

Discriminator `3b6369114977e5fc` · data `InitializeCombinedVault` · accounts `InitializeCombinedVaultInstructionAccounts`.

| Field   | Type |
| ------- | ---- |
| `nonce` | `u8` |

Required accounts: 6; extras go to `remaining`.

Fields of `InitializeCombinedVaultInstructionAccounts`, in account order:

| #  | Field            | Type               |
| -- | ---------------- | ------------------ |
| 0  | `state`          | `Pubkey`           |
| 1  | `vault`          | `Pubkey`           |
| 2  | `token_program`  | `Pubkey`           |
| 3  | `usdc_mint`      | `Pubkey`           |
| 4  | `admin`          | `Pubkey`           |
| 5  | `system_program` | `Pubkey`           |
| 6… | `remaining`      | `Vec<AccountMeta>` |

### `InitializeCrossMarginAccount`

Discriminator `1b1ae432d2d3cd5e` · data `InitializeCrossMarginAccount` · accounts `InitializeCrossMarginAccountInstructionAccounts`.

| Field              | Type |
| ------------------ | ---- |
| `subaccount_index` | `u8` |

Required accounts: 6; extras go to `remaining`.

Fields of `InitializeCrossMarginAccountInstructionAccounts`, in account order:

| #  | Field                          | Type               |
| -- | ------------------------------ | ------------------ |
| 0  | `cross_margin_account`         | `Pubkey`           |
| 1  | `cross_margin_account_manager` | `Pubkey`           |
| 2  | `authority`                    | `Pubkey`           |
| 3  | `payer`                        | `Pubkey`           |
| 4  | `zeta_program`                 | `Pubkey`           |
| 5  | `system_program`               | `Pubkey`           |
| 6… | `remaining`                    | `Vec<AccountMeta>` |

### `InitializeCrossMarginAccountManager`

Discriminator `489a0f1ca5d7d1c7` · data `InitializeCrossMarginAccountManager` · accounts `InitializeCrossMarginAccountManagerInstructionAccounts`.

No data fields.

Required accounts: 5; extras go to `remaining`.

Fields of `InitializeCrossMarginAccountManagerInstructionAccounts`, in account order:

| #  | Field                          | Type               |
| -- | ------------------------------ | ------------------ |
| 0  | `cross_margin_account_manager` | `Pubkey`           |
| 1  | `authority`                    | `Pubkey`           |
| 2  | `payer`                        | `Pubkey`           |
| 3  | `zeta_program`                 | `Pubkey`           |
| 4  | `system_program`               | `Pubkey`           |
| 5… | `remaining`                    | `Vec<AccountMeta>` |

### `InitializeInsuranceDepositAccount`

Discriminator `55a372798ba72925` · data `InitializeInsuranceDepositAccount` · accounts `InitializeInsuranceDepositAccountInstructionAccounts`.

| Field   | Type |
| ------- | ---- |
| `nonce` | `u8` |

Required accounts: 5; extras go to `remaining`.

Fields of `InitializeInsuranceDepositAccountInstructionAccounts`, in account order:

| #  | Field                         | Type               |
| -- | ----------------------------- | ------------------ |
| 0  | `insurance_deposit_account`   | `Pubkey`           |
| 1  | `authority`                   | `Pubkey`           |
| 2  | `payer`                       | `Pubkey`           |
| 3  | `system_program`              | `Pubkey`           |
| 4  | `whitelist_insurance_account` | `Pubkey`           |
| 5… | `remaining`                   | `Vec<AccountMeta>` |

### `InitializeMarginAccount`

Discriminator `43eb4266a7ab78c5` · data `InitializeMarginAccount` · accounts `InitializeMarginAccountInstructionAccounts`.

No data fields.

Required accounts: 6; extras go to `remaining`.

Fields of `InitializeMarginAccountInstructionAccounts`, in account order:

| #  | Field            | Type               |
| -- | ---------------- | ------------------ |
| 0  | `margin_account` | `Pubkey`           |
| 1  | `authority`      | `Pubkey`           |
| 2  | `payer`          | `Pubkey`           |
| 3  | `zeta_program`   | `Pubkey`           |
| 4  | `system_program` | `Pubkey`           |
| 5  | `zeta_group`     | `Pubkey`           |
| 6… | `remaining`      | `Vec<AccountMeta>` |

### `InitializeMarketIndexes`

Discriminator `5b3fcd901453b178` · data `InitializeMarketIndexes` · accounts `InitializeMarketIndexesInstructionAccounts`.

| Field   | Type              |
| ------- | ----------------- |
| `nonce` | `u8`              |
| `asset` | [`Asset`](#asset) |

Required accounts: 5; extras go to `remaining`.

Fields of `InitializeMarketIndexesInstructionAccounts`, in account order:

| #  | Field            | Type               |
| -- | ---------------- | ------------------ |
| 0  | `state`          | `Pubkey`           |
| 1  | `market_indexes` | `Pubkey`           |
| 2  | `admin`          | `Pubkey`           |
| 3  | `system_program` | `Pubkey`           |
| 4  | `pricing`        | `Pubkey`           |
| 5… | `remaining`      | `Vec<AccountMeta>` |

### `InitializeMarketNode`

Discriminator `32761515b3f81780` · data `InitializeMarketNode` · accounts `InitializeMarketNodeInstructionAccounts`.

| Field  | Type                                                    |
| ------ | ------------------------------------------------------- |
| `args` | [`InitializeMarketNodeArgs`](#initializemarketnodeargs) |

Required accounts: 5; extras go to `remaining`.

Fields of `InitializeMarketNodeInstructionAccounts`, in account order:

| #  | Field            | Type               |
| -- | ---------------- | ------------------ |
| 0  | `zeta_group`     | `Pubkey`           |
| 1  | `market_node`    | `Pubkey`           |
| 2  | `greeks`         | `Pubkey`           |
| 3  | `payer`          | `Pubkey`           |
| 4  | `system_program` | `Pubkey`           |
| 5… | `remaining`      | `Vec<AccountMeta>` |

### `InitializeMarketStrikes`

Discriminator `bd2eff217e852bab` · data `InitializeMarketStrikes` · accounts `InitializeMarketStrikesInstructionAccounts`.

No data fields.

Required accounts: 5; extras go to `remaining`.

Fields of `InitializeMarketStrikesInstructionAccounts`, in account order:

| #  | Field                   | Type               |
| -- | ----------------------- | ------------------ |
| 0  | `state`                 | `Pubkey`           |
| 1  | `zeta_group`            | `Pubkey`           |
| 2  | `oracle`                | `Pubkey`           |
| 3  | `oracle_backup_feed`    | `Pubkey`           |
| 4  | `oracle_backup_program` | `Pubkey`           |
| 5… | `remaining`             | `Vec<AccountMeta>` |

### `InitializeMarketTifEpochCycle`

Discriminator `c78fad93cacc40cc` · data `InitializeMarketTifEpochCycle` · accounts `InitializeMarketTifEpochCycleInstructionAccounts`.

| Field          | Type  |
| -------------- | ----- |
| `epoch_length` | `u16` |

Required accounts: 5; extras go to `remaining`.

Fields of `InitializeMarketTifEpochCycleInstructionAccounts`, in account order:

| #  | Field             | Type               |
| -- | ----------------- | ------------------ |
| 0  | `state`           | `Pubkey`           |
| 1  | `admin`           | `Pubkey`           |
| 2  | `market`          | `Pubkey`           |
| 3  | `serum_authority` | `Pubkey`           |
| 4  | `dex_program`     | `Pubkey`           |
| 5… | `remaining`       | `Vec<AccountMeta>` |

### `InitializeOpenOrders`

Discriminator `37ea1052642a7ec0` · data `InitializeOpenOrders` · accounts `InitializeOpenOrdersInstructionAccounts`.

No data fields.

Required accounts: 12; extras go to `remaining`.

Fields of `InitializeOpenOrdersInstructionAccounts`, in account order:

| #   | Field             | Type               |
| --- | ----------------- | ------------------ |
| 0   | `state`           | `Pubkey`           |
| 1   | `zeta_group`      | `Pubkey`           |
| 2   | `dex_program`     | `Pubkey`           |
| 3   | `system_program`  | `Pubkey`           |
| 4   | `open_orders`     | `Pubkey`           |
| 5   | `margin_account`  | `Pubkey`           |
| 6   | `authority`       | `Pubkey`           |
| 7   | `payer`           | `Pubkey`           |
| 8   | `market`          | `Pubkey`           |
| 9   | `serum_authority` | `Pubkey`           |
| 10  | `open_orders_map` | `Pubkey`           |
| 11  | `rent`            | `Pubkey`           |
| 12… | `remaining`       | `Vec<AccountMeta>` |

### `InitializeOpenOrdersV2`

Discriminator `dc11551470ae94e3` · data `InitializeOpenOrdersV2` · accounts `InitializeOpenOrdersV2InstructionAccounts`.

No data fields.

Required accounts: 11; extras go to `remaining`.

Fields of `InitializeOpenOrdersV2InstructionAccounts`, in account order:

| #   | Field             | Type               |
| --- | ----------------- | ------------------ |
| 0   | `state`           | `Pubkey`           |
| 1   | `dex_program`     | `Pubkey`           |
| 2   | `system_program`  | `Pubkey`           |
| 3   | `open_orders`     | `Pubkey`           |
| 4   | `margin_account`  | `Pubkey`           |
| 5   | `authority`       | `Pubkey`           |
| 6   | `payer`           | `Pubkey`           |
| 7   | `market`          | `Pubkey`           |
| 8   | `serum_authority` | `Pubkey`           |
| 9   | `open_orders_map` | `Pubkey`           |
| 10  | `rent`            | `Pubkey`           |
| 11… | `remaining`       | `Vec<AccountMeta>` |

### `InitializeOpenOrdersV3`

Discriminator `16bf8b88792754ca` · data `InitializeOpenOrdersV3` · accounts `InitializeOpenOrdersV3InstructionAccounts`.

| Field   | Type              |
| ------- | ----------------- |
| `asset` | [`Asset`](#asset) |

Required accounts: 11; extras go to `remaining`.

Fields of `InitializeOpenOrdersV3InstructionAccounts`, in account order:

| #   | Field                  | Type               |
| --- | ---------------------- | ------------------ |
| 0   | `state`                | `Pubkey`           |
| 1   | `dex_program`          | `Pubkey`           |
| 2   | `system_program`       | `Pubkey`           |
| 3   | `open_orders`          | `Pubkey`           |
| 4   | `cross_margin_account` | `Pubkey`           |
| 5   | `authority`            | `Pubkey`           |
| 6   | `payer`                | `Pubkey`           |
| 7   | `market`               | `Pubkey`           |
| 8   | `serum_authority`      | `Pubkey`           |
| 9   | `open_orders_map`      | `Pubkey`           |
| 10  | `rent`                 | `Pubkey`           |
| 11… | `remaining`            | `Vec<AccountMeta>` |

### `InitializePerpSyncQueue`

Discriminator `0a379ae081aea108` · data `InitializePerpSyncQueue` · accounts `InitializePerpSyncQueueInstructionAccounts`.

| Field   | Type              |
| ------- | ----------------- |
| `nonce` | `u8`              |
| `asset` | [`Asset`](#asset) |

Required accounts: 6; extras go to `remaining`.

Fields of `InitializePerpSyncQueueInstructionAccounts`, in account order:

| #  | Field             | Type               |
| -- | ----------------- | ------------------ |
| 0  | `admin`           | `Pubkey`           |
| 1  | `zeta_program`    | `Pubkey`           |
| 2  | `state`           | `Pubkey`           |
| 3  | `perp_sync_queue` | `Pubkey`           |
| 4  | `pricing`         | `Pubkey`           |
| 5  | `system_program`  | `Pubkey`           |
| 6… | `remaining`       | `Vec<AccountMeta>` |

### `InitializeReferrerAccount`

Discriminator `2d5cca4447433304` · data `InitializeReferrerAccount` · accounts `InitializeReferrerAccountInstructionAccounts`.

No data fields.

Required accounts: 3; extras go to `remaining`.

Fields of `InitializeReferrerAccountInstructionAccounts`, in account order:

| #  | Field              | Type               |
| -- | ------------------ | ------------------ |
| 0  | `referrer`         | `Pubkey`           |
| 1  | `referrer_account` | `Pubkey`           |
| 2  | `system_program`   | `Pubkey`           |
| 3… | `remaining`        | `Vec<AccountMeta>` |

### `InitializeReferrerAlias`

Discriminator `431c034e8c6c148a` · data `InitializeReferrerAlias` · accounts `InitializeReferrerAliasInstructionAccounts`.

| Field   | Type     |
| ------- | -------- |
| `alias` | `String` |

Required accounts: 4; extras go to `remaining`.

Fields of `InitializeReferrerAliasInstructionAccounts`, in account order:

| #  | Field              | Type               |
| -- | ------------------ | ------------------ |
| 0  | `referrer`         | `Pubkey`           |
| 1  | `referrer_alias`   | `Pubkey`           |
| 2  | `referrer_account` | `Pubkey`           |
| 3  | `system_program`   | `Pubkey`           |
| 4… | `remaining`        | `Vec<AccountMeta>` |

### `InitializeSpreadAccount`

Discriminator `ce56fb1b5b6f17d3` · data `InitializeSpreadAccount` · accounts `InitializeSpreadAccountInstructionAccounts`.

No data fields.

Required accounts: 6; extras go to `remaining`.

Fields of `InitializeSpreadAccountInstructionAccounts`, in account order:

| #  | Field            | Type               |
| -- | ---------------- | ------------------ |
| 0  | `spread_account` | `Pubkey`           |
| 1  | `authority`      | `Pubkey`           |
| 2  | `payer`          | `Pubkey`           |
| 3  | `zeta_program`   | `Pubkey`           |
| 4  | `system_program` | `Pubkey`           |
| 5  | `zeta_group`     | `Pubkey`           |
| 6… | `remaining`      | `Vec<AccountMeta>` |

### `InitializeUnderlying`

Discriminator `726cd55caf7c2b13` · data `InitializeUnderlying` · accounts `InitializeUnderlyingInstructionAccounts`.

| Field             | Type   |
| ----------------- | ------ |
| `flex_underlying` | `bool` |

Required accounts: 6; extras go to `remaining`.

Fields of `InitializeUnderlyingInstructionAccounts`, in account order:

| #  | Field             | Type               |
| -- | ----------------- | ------------------ |
| 0  | `admin`           | `Pubkey`           |
| 1  | `zeta_program`    | `Pubkey`           |
| 2  | `state`           | `Pubkey`           |
| 3  | `system_program`  | `Pubkey`           |
| 4  | `underlying`      | `Pubkey`           |
| 5  | `underlying_mint` | `Pubkey`           |
| 6… | `remaining`       | `Vec<AccountMeta>` |

### `InitializeWhitelistDepositAccount`

Discriminator `3de773db51f39e8a` · data `InitializeWhitelistDepositAccount` · accounts `InitializeWhitelistDepositAccountInstructionAccounts`.

| Field   | Type |
| ------- | ---- |
| `nonce` | `u8` |

Required accounts: 5; extras go to `remaining`.

Fields of `InitializeWhitelistDepositAccountInstructionAccounts`, in account order:

| #  | Field                       | Type               |
| -- | --------------------------- | ------------------ |
| 0  | `whitelist_deposit_account` | `Pubkey`           |
| 1  | `admin`                     | `Pubkey`           |
| 2  | `user`                      | `Pubkey`           |
| 3  | `system_program`            | `Pubkey`           |
| 4  | `state`                     | `Pubkey`           |
| 5… | `remaining`                 | `Vec<AccountMeta>` |

### `InitializeWhitelistInsuranceAccount`

Discriminator `2b2ef09b50045666` · data `InitializeWhitelistInsuranceAccount` · accounts `InitializeWhitelistInsuranceAccountInstructionAccounts`.

| Field   | Type |
| ------- | ---- |
| `nonce` | `u8` |

Required accounts: 5; extras go to `remaining`.

Fields of `InitializeWhitelistInsuranceAccountInstructionAccounts`, in account order:

| #  | Field                         | Type               |
| -- | ----------------------------- | ------------------ |
| 0  | `whitelist_insurance_account` | `Pubkey`           |
| 1  | `admin`                       | `Pubkey`           |
| 2  | `user`                        | `Pubkey`           |
| 3  | `system_program`              | `Pubkey`           |
| 4  | `state`                       | `Pubkey`           |
| 5… | `remaining`                   | `Vec<AccountMeta>` |

### `InitializeWhitelistTradingFeesAccount`

Discriminator `c681d8b9f71d69be` · data `InitializeWhitelistTradingFeesAccount` · accounts `InitializeWhitelistTradingFeesAccountInstructionAccounts`.

| Field   | Type |
| ------- | ---- |
| `nonce` | `u8` |

Required accounts: 5; extras go to `remaining`.

Fields of `InitializeWhitelistTradingFeesAccountInstructionAccounts`, in account order:

| #  | Field                            | Type               |
| -- | -------------------------------- | ------------------ |
| 0  | `whitelist_trading_fees_account` | `Pubkey`           |
| 1  | `admin`                          | `Pubkey`           |
| 2  | `user`                           | `Pubkey`           |
| 3  | `system_program`                 | `Pubkey`           |
| 4  | `state`                          | `Pubkey`           |
| 5… | `remaining`                      | `Vec<AccountMeta>` |

### `InitializeZetaGroup`

Discriminator `068724e82327fa47` · data `InitializeZetaGroup` · accounts `InitializeZetaGroupInstructionAccounts`.

| Field  | Type                                                  |
| ------ | ----------------------------------------------------- |
| `args` | [`InitializeZetaGroupArgs`](#initializezetagroupargs) |

Required accounts: 18; extras go to `remaining`.

Fields of `InitializeZetaGroupInstructionAccounts`, in account order:

| #   | Field                     | Type               |
| --- | ------------------------- | ------------------ |
| 0   | `state`                   | `Pubkey`           |
| 1   | `admin`                   | `Pubkey`           |
| 2   | `system_program`          | `Pubkey`           |
| 3   | `underlying_mint`         | `Pubkey`           |
| 4   | `zeta_program`            | `Pubkey`           |
| 5   | `oracle`                  | `Pubkey`           |
| 6   | `oracle_backup_feed`      | `Pubkey`           |
| 7   | `oracle_backup_program`   | `Pubkey`           |
| 8   | `zeta_group`              | `Pubkey`           |
| 9   | `greeks`                  | `Pubkey`           |
| 10  | `perp_sync_queue`         | `Pubkey`           |
| 11  | `underlying`              | `Pubkey`           |
| 12  | `vault`                   | `Pubkey`           |
| 13  | `insurance_vault`         | `Pubkey`           |
| 14  | `socialized_loss_account` | `Pubkey`           |
| 15  | `token_program`           | `Pubkey`           |
| 16  | `usdc_mint`               | `Pubkey`           |
| 17  | `rent`                    | `Pubkey`           |
| 18… | `remaining`               | `Vec<AccountMeta>` |

### `InitializeZetaMarket`

Discriminator `74efe2952ea3dd03` · data `InitializeZetaMarket` · accounts `InitializeZetaMarketInstructionAccounts`.

| Field  | Type                                            |
| ------ | ----------------------------------------------- |
| `args` | [`InitializeMarketArgs`](#initializemarketargs) |

Required accounts: 22; extras go to `remaining`.

Fields of `InitializeZetaMarketInstructionAccounts`, in account order:

| #   | Field              | Type               |
| --- | ------------------ | ------------------ |
| 0   | `state`            | `Pubkey`           |
| 1   | `market_indexes`   | `Pubkey`           |
| 2   | `pricing`          | `Pubkey`           |
| 3   | `admin`            | `Pubkey`           |
| 4   | `market`           | `Pubkey`           |
| 5   | `request_queue`    | `Pubkey`           |
| 6   | `event_queue`      | `Pubkey`           |
| 7   | `bids`             | `Pubkey`           |
| 8   | `asks`             | `Pubkey`           |
| 9   | `base_mint`        | `Pubkey`           |
| 10  | `quote_mint`       | `Pubkey`           |
| 11  | `zeta_base_vault`  | `Pubkey`           |
| 12  | `zeta_quote_vault` | `Pubkey`           |
| 13  | `dex_base_vault`   | `Pubkey`           |
| 14  | `dex_quote_vault`  | `Pubkey`           |
| 15  | `vault_owner`      | `Pubkey`           |
| 16  | `mint_authority`   | `Pubkey`           |
| 17  | `serum_authority`  | `Pubkey`           |
| 18  | `dex_program`      | `Pubkey`           |
| 19  | `system_program`   | `Pubkey`           |
| 20  | `token_program`    | `Pubkey`           |
| 21  | `rent`             | `Pubkey`           |
| 22… | `remaining`        | `Vec<AccountMeta>` |

### `InitializeZetaPricing`

Discriminator `23d1b41df5c77d10` · data `InitializeZetaPricing` · accounts `InitializeZetaPricingInstructionAccounts`.

| Field  | Type                                                      |
| ------ | --------------------------------------------------------- |
| `args` | [`InitializeZetaPricingArgs`](#initializezetapricingargs) |

Required accounts: 6; extras go to `remaining`.

Fields of `InitializeZetaPricingInstructionAccounts`, in account order:

| #  | Field            | Type               |
| -- | ---------------- | ------------------ |
| 0  | `state`          | `Pubkey`           |
| 1  | `pricing`        | `Pubkey`           |
| 2  | `rent`           | `Pubkey`           |
| 3  | `system_program` | `Pubkey`           |
| 4  | `token_program`  | `Pubkey`           |
| 5  | `admin`          | `Pubkey`           |
| 6… | `remaining`      | `Vec<AccountMeta>` |

### `InitializeZetaReferralsRewardsWallet`

Discriminator `f5e5df780786f7f8` · data `InitializeZetaReferralsRewardsWallet` · accounts `InitializeZetaReferralsRewardsWalletInstructionAccounts`.

No data fields.

Required accounts: 7; extras go to `remaining`.

Fields of `InitializeZetaReferralsRewardsWalletInstructionAccounts`, in account order:

| #  | Field                      | Type               |
| -- | -------------------------- | ------------------ |
| 0  | `state`                    | `Pubkey`           |
| 1  | `referrals_rewards_wallet` | `Pubkey`           |
| 2  | `rent`                     | `Pubkey`           |
| 3  | `system_program`           | `Pubkey`           |
| 4  | `token_program`            | `Pubkey`           |
| 5  | `usdc_mint`                | `Pubkey`           |
| 6  | `admin`                    | `Pubkey`           |
| 7… | `remaining`                | `Vec<AccountMeta>` |

### `InitializeZetaState`

Discriminator `44274b8ebf925ede` · data `InitializeZetaState` · accounts `InitializeZetaStateInstructionAccounts`.

| Field  | Type                                          |
| ------ | --------------------------------------------- |
| `args` | [`InitializeStateArgs`](#initializestateargs) |

Required accounts: 12; extras go to `remaining`.

Fields of `InitializeZetaStateInstructionAccounts`, in account order:

| #   | Field                      | Type               |
| --- | -------------------------- | ------------------ |
| 0   | `state`                    | `Pubkey`           |
| 1   | `mint_authority`           | `Pubkey`           |
| 2   | `serum_authority`          | `Pubkey`           |
| 3   | `treasury_wallet`          | `Pubkey`           |
| 4   | `referrals_admin`          | `Pubkey`           |
| 5   | `referrals_rewards_wallet` | `Pubkey`           |
| 6   | `rent`                     | `Pubkey`           |
| 7   | `system_program`           | `Pubkey`           |
| 8   | `token_program`            | `Pubkey`           |
| 9   | `usdc_mint`                | `Pubkey`           |
| 10  | `admin`                    | `Pubkey`           |
| 11  | `secondary_admin`          | `Pubkey`           |
| 12… | `remaining`                | `Vec<AccountMeta>` |

### `InitializeZetaTreasuryWallet`

Discriminator `f939bb66b86825e7` · data `InitializeZetaTreasuryWallet` · accounts `InitializeZetaTreasuryWalletInstructionAccounts`.

No data fields.

Required accounts: 7; extras go to `remaining`.

Fields of `InitializeZetaTreasuryWalletInstructionAccounts`, in account order:

| #  | Field             | Type               |
| -- | ----------------- | ------------------ |
| 0  | `state`           | `Pubkey`           |
| 1  | `treasury_wallet` | `Pubkey`           |
| 2  | `rent`            | `Pubkey`           |
| 3  | `system_program`  | `Pubkey`           |
| 4  | `token_program`   | `Pubkey`           |
| 5  | `usdc_mint`       | `Pubkey`           |
| 6  | `admin`           | `Pubkey`           |
| 7… | `remaining`       | `Vec<AccountMeta>` |

### `Liquidate`

Discriminator `dfb3e27d302e274a` · data `Liquidate` · accounts `LiquidateInstructionAccounts`.

| Field  | Type  |
| ------ | ----- |
| `size` | `u64` |

Required accounts: 10; extras go to `remaining`.

Fields of `LiquidateInstructionAccounts`, in account order:

| #   | Field                       | Type               |
| --- | --------------------------- | ------------------ |
| 0   | `state`                     | `Pubkey`           |
| 1   | `liquidator`                | `Pubkey`           |
| 2   | `liquidator_margin_account` | `Pubkey`           |
| 3   | `greeks`                    | `Pubkey`           |
| 4   | `oracle`                    | `Pubkey`           |
| 5   | `oracle_backup_feed`        | `Pubkey`           |
| 6   | `oracle_backup_program`     | `Pubkey`           |
| 7   | `market`                    | `Pubkey`           |
| 8   | `zeta_group`                | `Pubkey`           |
| 9   | `liquidated_margin_account` | `Pubkey`           |
| 10… | `remaining`                 | `Vec<AccountMeta>` |

### `LiquidateV2`

Discriminator `0f56553702e1a1eb` · data `LiquidateV2` · accounts `LiquidateV2InstructionAccounts`.

| Field   | Type              |
| ------- | ----------------- |
| `size`  | `u64`             |
| `asset` | [`Asset`](#asset) |

Required accounts: 9; extras go to `remaining`.

Fields of `LiquidateV2InstructionAccounts`, in account order:

| #  | Field                   | Type               |
| -- | ----------------------- | ------------------ |
| 0  | `state`                 | `Pubkey`           |
| 1  | `liquidator`            | `Pubkey`           |
| 2  | `liquidator_account`    | `Pubkey`           |
| 3  | `pricing`               | `Pubkey`           |
| 4  | `oracle`                | `Pubkey`           |
| 5  | `oracle_backup_feed`    | `Pubkey`           |
| 6  | `oracle_backup_program` | `Pubkey`           |
| 7  | `market`                | `Pubkey`           |
| 8  | `liquidated_account`    | `Pubkey`           |
| 9… | `remaining`             | `Vec<AccountMeta>` |

### `MigrateToCrossMarginAccount`

Discriminator `9d356b68b8bd64dc` · data `MigrateToCrossMarginAccount` · accounts `MigrateToCrossMarginAccountInstructionAccounts`.

No data fields.

Required accounts: 3; extras go to `remaining`.

Fields of `MigrateToCrossMarginAccountInstructionAccounts`, in account order:

| #  | Field                  | Type               |
| -- | ---------------------- | ------------------ |
| 0  | `cross_margin_account` | `Pubkey`           |
| 1  | `pricing`              | `Pubkey`           |
| 2  | `authority`            | `Pubkey`           |
| 3… | `remaining`            | `Vec<AccountMeta>` |

### `OverrideExpiry`

Discriminator `81c575726c77cf88` · data `OverrideExpiry` · accounts `OverrideExpiryInstructionAccounts`.

| Field  | Type                                        |
| ------ | ------------------------------------------- |
| `args` | [`OverrideExpiryArgs`](#overrideexpiryargs) |

Required accounts: 3; extras go to `remaining`.

Fields of `OverrideExpiryInstructionAccounts`, in account order:

| #  | Field        | Type               |
| -- | ------------ | ------------------ |
| 0  | `state`      | `Pubkey`           |
| 1  | `admin`      | `Pubkey`           |
| 2  | `zeta_group` | `Pubkey`           |
| 3… | `remaining`  | `Vec<AccountMeta>` |

### `PlaceOrder`

Discriminator `33c29baf6d82606a` · data `PlaceOrder` · accounts `PlaceOrderInstructionAccounts`.

| Field             | Type            |
| ----------------- | --------------- |
| `price`           | `u64`           |
| `size`            | `u64`           |
| `side`            | [`Side`](#side) |
| `client_order_id` | `Option<u64>`   |

Required accounts: 26; extras go to `remaining`.

Fields of `PlaceOrderInstructionAccounts`, in account order:

| #   | Field                       | Type               |
| --- | --------------------------- | ------------------ |
| 0   | `state`                     | `Pubkey`           |
| 1   | `zeta_group`                | `Pubkey`           |
| 2   | `margin_account`            | `Pubkey`           |
| 3   | `authority`                 | `Pubkey`           |
| 4   | `dex_program`               | `Pubkey`           |
| 5   | `token_program`             | `Pubkey`           |
| 6   | `serum_authority`           | `Pubkey`           |
| 7   | `greeks`                    | `Pubkey`           |
| 8   | `open_orders`               | `Pubkey`           |
| 9   | `rent`                      | `Pubkey`           |
| 10  | `market`                    | `Pubkey`           |
| 11  | `request_queue`             | `Pubkey`           |
| 12  | `event_queue`               | `Pubkey`           |
| 13  | `bids`                      | `Pubkey`           |
| 14  | `asks`                      | `Pubkey`           |
| 15  | `order_payer_token_account` | `Pubkey`           |
| 16  | `coin_vault`                | `Pubkey`           |
| 17  | `pc_vault`                  | `Pubkey`           |
| 18  | `coin_wallet`               | `Pubkey`           |
| 19  | `pc_wallet`                 | `Pubkey`           |
| 20  | `oracle`                    | `Pubkey`           |
| 21  | `oracle_backup_feed`        | `Pubkey`           |
| 22  | `oracle_backup_program`     | `Pubkey`           |
| 23  | `market_node`               | `Pubkey`           |
| 24  | `market_mint`               | `Pubkey`           |
| 25  | `mint_authority`            | `Pubkey`           |
| 26… | `remaining`                 | `Vec<AccountMeta>` |

### `PlaceOrderV2`

Discriminator `e86f73c4ed8f3ecc` · data `PlaceOrderV2` · accounts `PlaceOrderV2InstructionAccounts`.

| Field             | Type                      |
| ----------------- | ------------------------- |
| `price`           | `u64`                     |
| `size`            | `u64`                     |
| `side`            | [`Side`](#side)           |
| `order_type`      | [`OrderType`](#ordertype) |
| `client_order_id` | `Option<u64>`             |

Required accounts: 26; extras go to `remaining`.

Fields of `PlaceOrderV2InstructionAccounts`, in account order:

| #   | Field                       | Type               |
| --- | --------------------------- | ------------------ |
| 0   | `state`                     | `Pubkey`           |
| 1   | `zeta_group`                | `Pubkey`           |
| 2   | `margin_account`            | `Pubkey`           |
| 3   | `authority`                 | `Pubkey`           |
| 4   | `dex_program`               | `Pubkey`           |
| 5   | `token_program`             | `Pubkey`           |
| 6   | `serum_authority`           | `Pubkey`           |
| 7   | `greeks`                    | `Pubkey`           |
| 8   | `open_orders`               | `Pubkey`           |
| 9   | `rent`                      | `Pubkey`           |
| 10  | `market`                    | `Pubkey`           |
| 11  | `request_queue`             | `Pubkey`           |
| 12  | `event_queue`               | `Pubkey`           |
| 13  | `bids`                      | `Pubkey`           |
| 14  | `asks`                      | `Pubkey`           |
| 15  | `order_payer_token_account` | `Pubkey`           |
| 16  | `coin_vault`                | `Pubkey`           |
| 17  | `pc_vault`                  | `Pubkey`           |
| 18  | `coin_wallet`               | `Pubkey`           |
| 19  | `pc_wallet`                 | `Pubkey`           |
| 20  | `oracle`                    | `Pubkey`           |
| 21  | `oracle_backup_feed`        | `Pubkey`           |
| 22  | `oracle_backup_program`     | `Pubkey`           |
| 23  | `market_node`               | `Pubkey`           |
| 24  | `market_mint`               | `Pubkey`           |
| 25  | `mint_authority`            | `Pubkey`           |
| 26… | `remaining`                 | `Vec<AccountMeta>` |

### `PlaceOrderV3`

Discriminator `925d0ea79f14063a` · data `PlaceOrderV3` · accounts `PlaceOrderV3InstructionAccounts`.

| Field             | Type                      |
| ----------------- | ------------------------- |
| `price`           | `u64`                     |
| `size`            | `u64`                     |
| `side`            | [`Side`](#side)           |
| `order_type`      | [`OrderType`](#ordertype) |
| `client_order_id` | `Option<u64>`             |
| `tag`             | `Option<String>`          |

Required accounts: 26; extras go to `remaining`.

Fields of `PlaceOrderV3InstructionAccounts`, in account order:

| #   | Field                       | Type               |
| --- | --------------------------- | ------------------ |
| 0   | `state`                     | `Pubkey`           |
| 1   | `zeta_group`                | `Pubkey`           |
| 2   | `margin_account`            | `Pubkey`           |
| 3   | `authority`                 | `Pubkey`           |
| 4   | `dex_program`               | `Pubkey`           |
| 5   | `token_program`             | `Pubkey`           |
| 6   | `serum_authority`           | `Pubkey`           |
| 7   | `greeks`                    | `Pubkey`           |
| 8   | `open_orders`               | `Pubkey`           |
| 9   | `rent`                      | `Pubkey`           |
| 10  | `market`                    | `Pubkey`           |
| 11  | `request_queue`             | `Pubkey`           |
| 12  | `event_queue`               | `Pubkey`           |
| 13  | `bids`                      | `Pubkey`           |
| 14  | `asks`                      | `Pubkey`           |
| 15  | `order_payer_token_account` | `Pubkey`           |
| 16  | `coin_vault`                | `Pubkey`           |
| 17  | `pc_vault`                  | `Pubkey`           |
| 18  | `coin_wallet`               | `Pubkey`           |
| 19  | `pc_wallet`                 | `Pubkey`           |
| 20  | `oracle`                    | `Pubkey`           |
| 21  | `oracle_backup_feed`        | `Pubkey`           |
| 22  | `oracle_backup_program`     | `Pubkey`           |
| 23  | `market_node`               | `Pubkey`           |
| 24  | `market_mint`               | `Pubkey`           |
| 25  | `mint_authority`            | `Pubkey`           |
| 26… | `remaining`                 | `Vec<AccountMeta>` |

### `PlaceOrderV4`

Discriminator `f3f8d58fb84f2949` · data `PlaceOrderV4` · accounts `PlaceOrderV4InstructionAccounts`.

| Field             | Type                      |
| ----------------- | ------------------------- |
| `price`           | `u64`                     |
| `size`            | `u64`                     |
| `side`            | [`Side`](#side)           |
| `order_type`      | [`OrderType`](#ordertype) |
| `client_order_id` | `Option<u64>`             |
| `tag`             | `Option<String>`          |
| `tif_offset`      | `Option<u16>`             |

Required accounts: 26; extras go to `remaining`.

Fields of `PlaceOrderV4InstructionAccounts`, in account order:

| #   | Field                       | Type               |
| --- | --------------------------- | ------------------ |
| 0   | `state`                     | `Pubkey`           |
| 1   | `zeta_group`                | `Pubkey`           |
| 2   | `margin_account`            | `Pubkey`           |
| 3   | `authority`                 | `Pubkey`           |
| 4   | `dex_program`               | `Pubkey`           |
| 5   | `token_program`             | `Pubkey`           |
| 6   | `serum_authority`           | `Pubkey`           |
| 7   | `greeks`                    | `Pubkey`           |
| 8   | `open_orders`               | `Pubkey`           |
| 9   | `rent`                      | `Pubkey`           |
| 10  | `market`                    | `Pubkey`           |
| 11  | `request_queue`             | `Pubkey`           |
| 12  | `event_queue`               | `Pubkey`           |
| 13  | `bids`                      | `Pubkey`           |
| 14  | `asks`                      | `Pubkey`           |
| 15  | `order_payer_token_account` | `Pubkey`           |
| 16  | `coin_vault`                | `Pubkey`           |
| 17  | `pc_vault`                  | `Pubkey`           |
| 18  | `coin_wallet`               | `Pubkey`           |
| 19  | `pc_wallet`                 | `Pubkey`           |
| 20  | `oracle`                    | `Pubkey`           |
| 21  | `oracle_backup_feed`        | `Pubkey`           |
| 22  | `oracle_backup_program`     | `Pubkey`           |
| 23  | `market_node`               | `Pubkey`           |
| 24  | `market_mint`               | `Pubkey`           |
| 25  | `mint_authority`            | `Pubkey`           |
| 26… | `remaining`                 | `Vec<AccountMeta>` |

### `PlacePerpOrder`

Discriminator `45a15dca787e4cb9` · data `PlacePerpOrder` · accounts `PlacePerpOrderInstructionAccounts`.

| Field             | Type                      |
| ----------------- | ------------------------- |
| `price`           | `u64`                     |
| `size`            | `u64`                     |
| `side`            | [`Side`](#side)           |
| `order_type`      | [`OrderType`](#ordertype) |
| `client_order_id` | `Option<u64>`             |
| `tag`             | `Option<String>`          |

Required accounts: 26; extras go to `remaining`.

Fields of `PlacePerpOrderInstructionAccounts`, in account order:

| #   | Field                       | Type               |
| --- | --------------------------- | ------------------ |
| 0   | `state`                     | `Pubkey`           |
| 1   | `zeta_group`                | `Pubkey`           |
| 2   | `margin_account`            | `Pubkey`           |
| 3   | `authority`                 | `Pubkey`           |
| 4   | `dex_program`               | `Pubkey`           |
| 5   | `token_program`             | `Pubkey`           |
| 6   | `serum_authority`           | `Pubkey`           |
| 7   | `greeks`                    | `Pubkey`           |
| 8   | `open_orders`               | `Pubkey`           |
| 9   | `rent`                      | `Pubkey`           |
| 10  | `market`                    | `Pubkey`           |
| 11  | `request_queue`             | `Pubkey`           |
| 12  | `event_queue`               | `Pubkey`           |
| 13  | `bids`                      | `Pubkey`           |
| 14  | `asks`                      | `Pubkey`           |
| 15  | `order_payer_token_account` | `Pubkey`           |
| 16  | `coin_vault`                | `Pubkey`           |
| 17  | `pc_vault`                  | `Pubkey`           |
| 18  | `coin_wallet`               | `Pubkey`           |
| 19  | `pc_wallet`                 | `Pubkey`           |
| 20  | `oracle`                    | `Pubkey`           |
| 21  | `oracle_backup_feed`        | `Pubkey`           |
| 22  | `oracle_backup_program`     | `Pubkey`           |
| 23  | `market_mint`               | `Pubkey`           |
| 24  | `mint_authority`            | `Pubkey`           |
| 25  | `perp_sync_queue`           | `Pubkey`           |
| 26… | `remaining`                 | `Vec<AccountMeta>` |

### `PlacePerpOrderV2`

Discriminator `cd5482b43f760acf` · data `PlacePerpOrderV2` · accounts `PlacePerpOrderV2InstructionAccounts`.

| Field             | Type                      |
| ----------------- | ------------------------- |
| `price`           | `u64`                     |
| `size`            | `u64`                     |
| `side`            | [`Side`](#side)           |
| `order_type`      | [`OrderType`](#ordertype) |
| `client_order_id` | `Option<u64>`             |
| `tag`             | `Option<String>`          |
| `tif_offset`      | `Option<u16>`             |

Required accounts: 26; extras go to `remaining`.

Fields of `PlacePerpOrderV2InstructionAccounts`, in account order:

| #   | Field                       | Type               |
| --- | --------------------------- | ------------------ |
| 0   | `state`                     | `Pubkey`           |
| 1   | `zeta_group`                | `Pubkey`           |
| 2   | `margin_account`            | `Pubkey`           |
| 3   | `authority`                 | `Pubkey`           |
| 4   | `dex_program`               | `Pubkey`           |
| 5   | `token_program`             | `Pubkey`           |
| 6   | `serum_authority`           | `Pubkey`           |
| 7   | `greeks`                    | `Pubkey`           |
| 8   | `open_orders`               | `Pubkey`           |
| 9   | `rent`                      | `Pubkey`           |
| 10  | `market`                    | `Pubkey`           |
| 11  | `request_queue`             | `Pubkey`           |
| 12  | `event_queue`               | `Pubkey`           |
| 13  | `bids`                      | `Pubkey`           |
| 14  | `asks`                      | `Pubkey`           |
| 15  | `order_payer_token_account` | `Pubkey`           |
| 16  | `coin_vault`                | `Pubkey`           |
| 17  | `pc_vault`                  | `Pubkey`           |
| 18  | `coin_wallet`               | `Pubkey`           |
| 19  | `pc_wallet`                 | `Pubkey`           |
| 20  | `oracle`                    | `Pubkey`           |
| 21  | `oracle_backup_feed`        | `Pubkey`           |
| 22  | `oracle_backup_program`     | `Pubkey`           |
| 23  | `market_mint`               | `Pubkey`           |
| 24  | `mint_authority`            | `Pubkey`           |
| 25  | `perp_sync_queue`           | `Pubkey`           |
| 26… | `remaining`                 | `Vec<AccountMeta>` |

### `PlacePerpOrderV3`

Discriminator `5bf660073516eae1` · data `PlacePerpOrderV3` · accounts `PlacePerpOrderV3InstructionAccounts`.

| Field             | Type                      |
| ----------------- | ------------------------- |
| `price`           | `u64`                     |
| `size`            | `u64`                     |
| `side`            | [`Side`](#side)           |
| `order_type`      | [`OrderType`](#ordertype) |
| `client_order_id` | `Option<u64>`             |
| `tag`             | `Option<String>`          |
| `tif_offset`      | `Option<u16>`             |
| `asset`           | [`Asset`](#asset)         |

Required accounts: 25; extras go to `remaining`.

Fields of `PlacePerpOrderV3InstructionAccounts`, in account order:

| #   | Field                       | Type               |
| --- | --------------------------- | ------------------ |
| 0   | `state`                     | `Pubkey`           |
| 1   | `pricing`                   | `Pubkey`           |
| 2   | `margin_account`            | `Pubkey`           |
| 3   | `authority`                 | `Pubkey`           |
| 4   | `dex_program`               | `Pubkey`           |
| 5   | `token_program`             | `Pubkey`           |
| 6   | `serum_authority`           | `Pubkey`           |
| 7   | `open_orders`               | `Pubkey`           |
| 8   | `rent`                      | `Pubkey`           |
| 9   | `market`                    | `Pubkey`           |
| 10  | `request_queue`             | `Pubkey`           |
| 11  | `event_queue`               | `Pubkey`           |
| 12  | `bids`                      | `Pubkey`           |
| 13  | `asks`                      | `Pubkey`           |
| 14  | `order_payer_token_account` | `Pubkey`           |
| 15  | `coin_vault`                | `Pubkey`           |
| 16  | `pc_vault`                  | `Pubkey`           |
| 17  | `coin_wallet`               | `Pubkey`           |
| 18  | `pc_wallet`                 | `Pubkey`           |
| 19  | `oracle`                    | `Pubkey`           |
| 20  | `oracle_backup_feed`        | `Pubkey`           |
| 21  | `oracle_backup_program`     | `Pubkey`           |
| 22  | `market_mint`               | `Pubkey`           |
| 23  | `mint_authority`            | `Pubkey`           |
| 24  | `perp_sync_queue`           | `Pubkey`           |
| 25… | `remaining`                 | `Vec<AccountMeta>` |

### `PositionMovement`

Discriminator `75104bf9b37fab93` · data `PositionMovement` · accounts `PositionMovementInstructionAccounts`.

| Field           | Type                                               |
| --------------- | -------------------------------------------------- |
| `movement_type` | [`MovementType`](#movementtype)                    |
| `movements`     | [`Vec<PositionMovementArg>`](#positionmovementarg) |

Required accounts: 9; extras go to `remaining`.

Fields of `PositionMovementInstructionAccounts`, in account order:

| #  | Field                   | Type               |
| -- | ----------------------- | ------------------ |
| 0  | `state`                 | `Pubkey`           |
| 1  | `zeta_group`            | `Pubkey`           |
| 2  | `margin_account`        | `Pubkey`           |
| 3  | `spread_account`        | `Pubkey`           |
| 4  | `authority`             | `Pubkey`           |
| 5  | `greeks`                | `Pubkey`           |
| 6  | `oracle`                | `Pubkey`           |
| 7  | `oracle_backup_feed`    | `Pubkey`           |
| 8  | `oracle_backup_program` | `Pubkey`           |
| 9… | `remaining`             | `Vec<AccountMeta>` |

### `PruneExpiredTifOrders`

Discriminator `18e3e2d45d1af2e6` · data `PruneExpiredTifOrders` · accounts `PruneExpiredTifOrdersInstructionAccounts`.

No data fields.

Required accounts: 7; extras go to `remaining`.

Fields of `PruneExpiredTifOrdersInstructionAccounts`, in account order:

| #  | Field             | Type               |
| -- | ----------------- | ------------------ |
| 0  | `dex_program`     | `Pubkey`           |
| 1  | `state`           | `Pubkey`           |
| 2  | `serum_authority` | `Pubkey`           |
| 3  | `market`          | `Pubkey`           |
| 4  | `bids`            | `Pubkey`           |
| 5  | `asks`            | `Pubkey`           |
| 6  | `event_queue`     | `Pubkey`           |
| 7… | `remaining`       | `Vec<AccountMeta>` |

### `RebalanceInsuranceVault`

Discriminator `0bc442eb3beddf6f` · data `RebalanceInsuranceVault` · accounts `RebalanceInsuranceVaultInstructionAccounts`.

No data fields.

Required accounts: 6; extras go to `remaining`.

Fields of `RebalanceInsuranceVaultInstructionAccounts`, in account order:

| #  | Field                     | Type               |
| -- | ------------------------- | ------------------ |
| 0  | `state`                   | `Pubkey`           |
| 1  | `zeta_vault`              | `Pubkey`           |
| 2  | `insurance_vault`         | `Pubkey`           |
| 3  | `treasury_wallet`         | `Pubkey`           |
| 4  | `socialized_loss_account` | `Pubkey`           |
| 5  | `token_program`           | `Pubkey`           |
| 6… | `remaining`               | `Vec<AccountMeta>` |

### `ReferUser`

Discriminator `39729accb921aa88` · data `ReferUser` · accounts `ReferUserInstructionAccounts`.

No data fields.

Required accounts: 4; extras go to `remaining`.

Fields of `ReferUserInstructionAccounts`, in account order:

| #  | Field              | Type               |
| -- | ------------------ | ------------------ |
| 0  | `user`             | `Pubkey`           |
| 1  | `referrer_account` | `Pubkey`           |
| 2  | `referral_account` | `Pubkey`           |
| 3  | `system_program`   | `Pubkey`           |
| 4… | `remaining`        | `Vec<AccountMeta>` |

### `ResetNumFlexUnderlyings`

Discriminator `3013fed1c8d3313d` · data `ResetNumFlexUnderlyings` · accounts `ResetNumFlexUnderlyingsInstructionAccounts`.

No data fields.

Required accounts: 2; extras go to `remaining`.

Fields of `ResetNumFlexUnderlyingsInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `state`     | `Pubkey`           |
| 1  | `admin`     | `Pubkey`           |
| 2… | `remaining` | `Vec<AccountMeta>` |

### `SetReferralsRewards`

Discriminator `3ee801124b074d9e` · data `SetReferralsRewards` · accounts `SetReferralsRewardsInstructionAccounts`.

| Field  | Type                                                       |
| ------ | ---------------------------------------------------------- |
| `args` | [`Vec<SetReferralsRewardsArgs>`](#setreferralsrewardsargs) |

Required accounts: 2; extras go to `remaining`.

Fields of `SetReferralsRewardsInstructionAccounts`, in account order:

| #  | Field             | Type               |
| -- | ----------------- | ------------------ |
| 0  | `state`           | `Pubkey`           |
| 1  | `referrals_admin` | `Pubkey`           |
| 2… | `remaining`       | `Vec<AccountMeta>` |

### `SettleDexFunds`

Discriminator `a5678e26d3a60ee2` · data `SettleDexFunds` · accounts `SettleDexFundsInstructionAccounts`.

No data fields.

Required accounts: 11; extras go to `remaining`.

Fields of `SettleDexFundsInstructionAccounts`, in account order:

| #   | Field              | Type               |
| --- | ------------------ | ------------------ |
| 0   | `state`            | `Pubkey`           |
| 1   | `market`           | `Pubkey`           |
| 2   | `zeta_base_vault`  | `Pubkey`           |
| 3   | `zeta_quote_vault` | `Pubkey`           |
| 4   | `dex_base_vault`   | `Pubkey`           |
| 5   | `dex_quote_vault`  | `Pubkey`           |
| 6   | `vault_owner`      | `Pubkey`           |
| 7   | `mint_authority`   | `Pubkey`           |
| 8   | `serum_authority`  | `Pubkey`           |
| 9   | `dex_program`      | `Pubkey`           |
| 10  | `token_program`    | `Pubkey`           |
| 11… | `remaining`        | `Vec<AccountMeta>` |

### `SettlePositionsHalted`

Discriminator `aa938ba31368a74d` · data `SettlePositionsHalted` · accounts `SettlePositionsHaltedInstructionAccounts`.

| Field   | Type              |
| ------- | ----------------- |
| `asset` | [`Asset`](#asset) |

Required accounts: 3; extras go to `remaining`.

Fields of `SettlePositionsHaltedInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `state`     | `Pubkey`           |
| 1  | `pricing`   | `Pubkey`           |
| 2  | `admin`     | `Pubkey`           |
| 3… | `remaining` | `Vec<AccountMeta>` |

### `ToggleMarketMaker`

Discriminator `cbf7549f68fd9450` · data `ToggleMarketMaker` · accounts `ToggleMarketMakerInstructionAccounts`.

| Field             | Type   |
| ----------------- | ------ |
| `is_market_maker` | `bool` |

Required accounts: 3; extras go to `remaining`.

Fields of `ToggleMarketMakerInstructionAccounts`, in account order:

| #  | Field            | Type               |
| -- | ---------------- | ------------------ |
| 0  | `state`          | `Pubkey`           |
| 1  | `admin`          | `Pubkey`           |
| 2  | `margin_account` | `Pubkey`           |
| 3… | `remaining`      | `Vec<AccountMeta>` |

### `ToggleZetaGroupPerpsOnly`

Discriminator `aa734d0ba19df7a9` · data `ToggleZetaGroupPerpsOnly` · accounts `ToggleZetaGroupPerpsOnlyInstructionAccounts`.

No data fields.

Required accounts: 3; extras go to `remaining`.

Fields of `ToggleZetaGroupPerpsOnlyInstructionAccounts`, in account order:

| #  | Field        | Type               |
| -- | ------------ | ------------------ |
| 0  | `state`      | `Pubkey`           |
| 1  | `zeta_group` | `Pubkey`           |
| 2  | `admin`      | `Pubkey`           |
| 3… | `remaining`  | `Vec<AccountMeta>` |

### `TransferExcessSpreadBalance`

Discriminator `acb80c0a346940d5` · data `TransferExcessSpreadBalance` · accounts `TransferExcessSpreadBalanceInstructionAccounts`.

No data fields.

Required accounts: 4; extras go to `remaining`.

Fields of `TransferExcessSpreadBalanceInstructionAccounts`, in account order:

| #  | Field            | Type               |
| -- | ---------------- | ------------------ |
| 0  | `zeta_group`     | `Pubkey`           |
| 1  | `margin_account` | `Pubkey`           |
| 2  | `spread_account` | `Pubkey`           |
| 3  | `authority`      | `Pubkey`           |
| 4… | `remaining`      | `Vec<AccountMeta>` |

### `TreasuryMovement`

Discriminator `0122f269d7d39d12` · data `TreasuryMovement` · accounts `TreasuryMovementInstructionAccounts`.

| Field                    | Type                                            |
| ------------------------ | ----------------------------------------------- |
| `treasury_movement_type` | [`TreasuryMovementType`](#treasurymovementtype) |
| `amount`                 | `u64`                                           |

Required accounts: 6; extras go to `remaining`.

Fields of `TreasuryMovementInstructionAccounts`, in account order:

| #  | Field                      | Type               |
| -- | -------------------------- | ------------------ |
| 0  | `state`                    | `Pubkey`           |
| 1  | `insurance_vault`          | `Pubkey`           |
| 2  | `treasury_wallet`          | `Pubkey`           |
| 3  | `referrals_rewards_wallet` | `Pubkey`           |
| 4  | `token_program`            | `Pubkey`           |
| 5  | `admin`                    | `Pubkey`           |
| 6… | `remaining`                | `Vec<AccountMeta>` |

### `Unhalt`

Discriminator `f98c1bd58082cf71` · data `Unhalt` · accounts `UnhaltInstructionAccounts`.

| Field   | Type              |
| ------- | ----------------- |
| `asset` | [`Asset`](#asset) |

Required accounts: 3; extras go to `remaining`.

Fields of `UnhaltInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `state`     | `Pubkey`           |
| 1  | `pricing`   | `Pubkey`           |
| 2  | `admin`     | `Pubkey`           |
| 3… | `remaining` | `Vec<AccountMeta>` |

### `UpdateAdmin`

Discriminator `a1b028d53cb8b3e4` · data `UpdateAdmin` · accounts `UpdateAdminInstructionAccounts`.

No data fields.

Required accounts: 3; extras go to `remaining`.

Fields of `UpdateAdminInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `state`     | `Pubkey`           |
| 1  | `admin`     | `Pubkey`           |
| 2  | `new_admin` | `Pubkey`           |
| 3… | `remaining` | `Vec<AccountMeta>` |

### `UpdateHaltState`

Discriminator `d72d35a2958a053f` · data `UpdateHaltState` · accounts `UpdateHaltStateInstructionAccounts`.

| Field  | Type                              |
| ------ | --------------------------------- |
| `args` | [`HaltStateArgs`](#haltstateargs) |

Required accounts: 2; extras go to `remaining`.

Fields of `UpdateHaltStateInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `state`     | `Pubkey`           |
| 1  | `admin`     | `Pubkey`           |
| 2… | `remaining` | `Vec<AccountMeta>` |

### `UpdateInterestRate`

Discriminator `4b08ff297b3b87ee` · data `UpdateInterestRate` · accounts `UpdateInterestRateInstructionAccounts`.

| Field  | Type                                                |
| ------ | --------------------------------------------------- |
| `args` | [`UpdateInterestRateArgs`](#updateinterestrateargs) |

Required accounts: 4; extras go to `remaining`.

Fields of `UpdateInterestRateInstructionAccounts`, in account order:

| #  | Field        | Type               |
| -- | ------------ | ------------------ |
| 0  | `state`      | `Pubkey`           |
| 1  | `greeks`     | `Pubkey`           |
| 2  | `zeta_group` | `Pubkey`           |
| 3  | `admin`      | `Pubkey`           |
| 4… | `remaining`  | `Vec<AccountMeta>` |

### `UpdateMarginParameters`

Discriminator `4532aec57bc448ec` · data `UpdateMarginParameters` · accounts `UpdateMarginParametersInstructionAccounts`.

| Field   | Type                                                        |
| ------- | ----------------------------------------------------------- |
| `args`  | [`UpdateMarginParametersArgs`](#updatemarginparametersargs) |
| `asset` | [`Asset`](#asset)                                           |

Required accounts: 3; extras go to `remaining`.

Fields of `UpdateMarginParametersInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `state`     | `Pubkey`           |
| 1  | `pricing`   | `Pubkey`           |
| 2  | `admin`     | `Pubkey`           |
| 3… | `remaining` | `Vec<AccountMeta>` |

### `UpdateOracle`

Discriminator `7029d112f8e2fcbc` · data `UpdateOracle` · accounts `UpdateOracleInstructionAccounts`.

No data fields.

Required accounts: 4; extras go to `remaining`.

Fields of `UpdateOracleInstructionAccounts`, in account order:

| #  | Field        | Type               |
| -- | ------------ | ------------------ |
| 0  | `state`      | `Pubkey`           |
| 1  | `zeta_group` | `Pubkey`           |
| 2  | `admin`      | `Pubkey`           |
| 3  | `oracle`     | `Pubkey`           |
| 4… | `remaining`  | `Vec<AccountMeta>` |

### `UpdateOracleBackupFeed`

Discriminator `e60921cae4d1b462` · data `UpdateOracleBackupFeed` · accounts `UpdateOracleBackupFeedInstructionAccounts`.

No data fields.

Required accounts: 4; extras go to `remaining`.

Fields of `UpdateOracleBackupFeedInstructionAccounts`, in account order:

| #  | Field        | Type               |
| -- | ------------ | ------------------ |
| 0  | `state`      | `Pubkey`           |
| 1  | `zeta_group` | `Pubkey`           |
| 2  | `admin`      | `Pubkey`           |
| 3  | `oracle`     | `Pubkey`           |
| 4… | `remaining`  | `Vec<AccountMeta>` |

### `UpdatePerpParameters`

Discriminator `5a87db2aa48661ae` · data `UpdatePerpParameters` · accounts `UpdatePerpParametersInstructionAccounts`.

| Field   | Type                                                    |
| ------- | ------------------------------------------------------- |
| `args`  | [`UpdatePerpParametersArgs`](#updateperpparametersargs) |
| `asset` | [`Asset`](#asset)                                       |

Required accounts: 3; extras go to `remaining`.

Fields of `UpdatePerpParametersInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `state`     | `Pubkey`           |
| 1  | `pricing`   | `Pubkey`           |
| 2  | `admin`     | `Pubkey`           |
| 3… | `remaining` | `Vec<AccountMeta>` |

### `UpdatePricingParameters`

Discriminator `697fd0863d3d71f7` · data `UpdatePricingParameters` · accounts `UpdatePricingParametersInstructionAccounts`.

| Field  | Type                                                          |
| ------ | ------------------------------------------------------------- |
| `args` | [`UpdatePricingParametersArgs`](#updatepricingparametersargs) |

Required accounts: 3; extras go to `remaining`.

Fields of `UpdatePricingParametersInstructionAccounts`, in account order:

| #  | Field        | Type               |
| -- | ------------ | ------------------ |
| 0  | `state`      | `Pubkey`           |
| 1  | `zeta_group` | `Pubkey`           |
| 2  | `admin`      | `Pubkey`           |
| 3… | `remaining`  | `Vec<AccountMeta>` |

### `UpdatePricingV2`

Discriminator `eb6d8aad0f2533f4` · data `UpdatePricingV2` · accounts `UpdatePricingV2InstructionAccounts`.

| Field   | Type              |
| ------- | ----------------- |
| `asset` | [`Asset`](#asset) |

Required accounts: 8; extras go to `remaining`.

Fields of `UpdatePricingV2InstructionAccounts`, in account order:

| #  | Field                   | Type               |
| -- | ----------------------- | ------------------ |
| 0  | `state`                 | `Pubkey`           |
| 1  | `pricing`               | `Pubkey`           |
| 2  | `oracle`                | `Pubkey`           |
| 3  | `oracle_backup_feed`    | `Pubkey`           |
| 4  | `oracle_backup_program` | `Pubkey`           |
| 5  | `perp_market`           | `Pubkey`           |
| 6  | `perp_bids`             | `Pubkey`           |
| 7  | `perp_asks`             | `Pubkey`           |
| 8… | `remaining`             | `Vec<AccountMeta>` |

### `UpdateReferralsAdmin`

Discriminator `49905c774a6a10c8` · data `UpdateReferralsAdmin` · accounts `UpdateReferralsAdminInstructionAccounts`.

No data fields.

Required accounts: 3; extras go to `remaining`.

Fields of `UpdateReferralsAdminInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `state`     | `Pubkey`           |
| 1  | `admin`     | `Pubkey`           |
| 2  | `new_admin` | `Pubkey`           |
| 3… | `remaining` | `Vec<AccountMeta>` |

### `UpdateSecondaryAdmin`

Discriminator `54e61a4b02b3afea` · data `UpdateSecondaryAdmin` · accounts `UpdateSecondaryAdminInstructionAccounts`.

No data fields.

Required accounts: 3; extras go to `remaining`.

Fields of `UpdateSecondaryAdminInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `state`     | `Pubkey`           |
| 1  | `admin`     | `Pubkey`           |
| 2  | `new_admin` | `Pubkey`           |
| 3… | `remaining` | `Vec<AccountMeta>` |

### `UpdateVolatility`

Discriminator `be6974dde5c6d053` · data `UpdateVolatility` · accounts `UpdateVolatilityInstructionAccounts`.

| Field  | Type                                            |
| ------ | ----------------------------------------------- |
| `args` | [`UpdateVolatilityArgs`](#updatevolatilityargs) |

Required accounts: 4; extras go to `remaining`.

Fields of `UpdateVolatilityInstructionAccounts`, in account order:

| #  | Field        | Type               |
| -- | ------------ | ------------------ |
| 0  | `state`      | `Pubkey`           |
| 1  | `greeks`     | `Pubkey`           |
| 2  | `zeta_group` | `Pubkey`           |
| 3  | `admin`      | `Pubkey`           |
| 4… | `remaining`  | `Vec<AccountMeta>` |

### `UpdateZetaGroupExpiryParameters`

Discriminator `11457968e1ce8cd7` · data `UpdateZetaGroupExpiryParameters` · accounts `UpdateZetaGroupExpiryParametersInstructionAccounts`.

| Field  | Type                                                      |
| ------ | --------------------------------------------------------- |
| `args` | [`UpdateZetaGroupExpiryArgs`](#updatezetagroupexpiryargs) |

Required accounts: 3; extras go to `remaining`.

Fields of `UpdateZetaGroupExpiryParametersInstructionAccounts`, in account order:

| #  | Field        | Type               |
| -- | ------------ | ------------------ |
| 0  | `state`      | `Pubkey`           |
| 1  | `zeta_group` | `Pubkey`           |
| 2  | `admin`      | `Pubkey`           |
| 3… | `remaining`  | `Vec<AccountMeta>` |

### `UpdateZetaGroupMarginParameters`

Discriminator `3cd07993f26a0bfe` · data `UpdateZetaGroupMarginParameters` · accounts `UpdateZetaGroupMarginParametersInstructionAccounts`.

| Field  | Type                                                        |
| ------ | ----------------------------------------------------------- |
| `args` | [`UpdateMarginParametersArgs`](#updatemarginparametersargs) |

Required accounts: 3; extras go to `remaining`.

Fields of `UpdateZetaGroupMarginParametersInstructionAccounts`, in account order:

| #  | Field        | Type               |
| -- | ------------ | ------------------ |
| 0  | `state`      | `Pubkey`           |
| 1  | `zeta_group` | `Pubkey`           |
| 2  | `admin`      | `Pubkey`           |
| 3… | `remaining`  | `Vec<AccountMeta>` |

### `UpdateZetaGroupPerpParameters`

Discriminator `48988c9ec35df71f` · data `UpdateZetaGroupPerpParameters` · accounts `UpdateZetaGroupPerpParametersInstructionAccounts`.

| Field  | Type                                                    |
| ------ | ------------------------------------------------------- |
| `args` | [`UpdatePerpParametersArgs`](#updateperpparametersargs) |

Required accounts: 3; extras go to `remaining`.

Fields of `UpdateZetaGroupPerpParametersInstructionAccounts`, in account order:

| #  | Field        | Type               |
| -- | ------------ | ------------------ |
| 0  | `state`      | `Pubkey`           |
| 1  | `zeta_group` | `Pubkey`           |
| 2  | `admin`      | `Pubkey`           |
| 3… | `remaining`  | `Vec<AccountMeta>` |

### `UpdateZetaPricingPubkeys`

Discriminator `a9dd17f8db7a8e9e` · data `UpdateZetaPricingPubkeys` · accounts `UpdateZetaPricingPubkeysInstructionAccounts`.

| Field  | Type                                                            |
| ------ | --------------------------------------------------------------- |
| `args` | [`UpdateZetaPricingPubkeysArgs`](#updatezetapricingpubkeysargs) |

Required accounts: 3; extras go to `remaining`.

Fields of `UpdateZetaPricingPubkeysInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `state`     | `Pubkey`           |
| 1  | `pricing`   | `Pubkey`           |
| 2  | `admin`     | `Pubkey`           |
| 3… | `remaining` | `Vec<AccountMeta>` |

### `UpdateZetaState`

Discriminator `68b614bb03a43c03` · data `UpdateZetaState` · accounts `UpdateZetaStateInstructionAccounts`.

| Field  | Type                                  |
| ------ | ------------------------------------- |
| `args` | [`UpdateStateArgs`](#updatestateargs) |

Required accounts: 2; extras go to `remaining`.

Fields of `UpdateZetaStateInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `state`     | `Pubkey`           |
| 1  | `admin`     | `Pubkey`           |
| 2… | `remaining` | `Vec<AccountMeta>` |

### `Withdraw`

Discriminator `b712469c946da122` · data `Withdraw` · accounts `WithdrawInstructionAccounts`.

| Field    | Type  |
| -------- | ----- |
| `amount` | `u64` |

Required accounts: 12; extras go to `remaining`.

Fields of `WithdrawInstructionAccounts`, in account order:

| #   | Field                     | Type               |
| --- | ------------------------- | ------------------ |
| 0   | `state`                   | `Pubkey`           |
| 1   | `zeta_group`              | `Pubkey`           |
| 2   | `vault`                   | `Pubkey`           |
| 3   | `margin_account`          | `Pubkey`           |
| 4   | `user_token_account`      | `Pubkey`           |
| 5   | `token_program`           | `Pubkey`           |
| 6   | `authority`               | `Pubkey`           |
| 7   | `greeks`                  | `Pubkey`           |
| 8   | `oracle`                  | `Pubkey`           |
| 9   | `oracle_backup_feed`      | `Pubkey`           |
| 10  | `oracle_backup_program`   | `Pubkey`           |
| 11  | `socialized_loss_account` | `Pubkey`           |
| 12… | `remaining`               | `Vec<AccountMeta>` |

### `WithdrawInsuranceVault`

Discriminator `11fad52dac7551e1` · data `WithdrawInsuranceVault` · accounts `WithdrawInsuranceVaultInstructionAccounts`.

| Field               | Type  |
| ------------------- | ----- |
| `percentage_amount` | `u64` |

Required accounts: 6; extras go to `remaining`.

Fields of `WithdrawInsuranceVaultInstructionAccounts`, in account order:

| #  | Field                       | Type               |
| -- | --------------------------- | ------------------ |
| 0  | `state`                     | `Pubkey`           |
| 1  | `insurance_vault`           | `Pubkey`           |
| 2  | `insurance_deposit_account` | `Pubkey`           |
| 3  | `user_token_account`        | `Pubkey`           |
| 4  | `authority`                 | `Pubkey`           |
| 5  | `token_program`             | `Pubkey`           |
| 6… | `remaining`                 | `Vec<AccountMeta>` |

### `WithdrawInsuranceVaultV2`

Discriminator `cb472c94e0f245a5` · data `WithdrawInsuranceVaultV2` · accounts `WithdrawInsuranceVaultV2InstructionAccounts`.

| Field               | Type  |
| ------------------- | ----- |
| `percentage_amount` | `u64` |

Required accounts: 7; extras go to `remaining`.

Fields of `WithdrawInsuranceVaultV2InstructionAccounts`, in account order:

| #  | Field                       | Type               |
| -- | --------------------------- | ------------------ |
| 0  | `state`                     | `Pubkey`           |
| 1  | `pricing`                   | `Pubkey`           |
| 2  | `insurance_vault`           | `Pubkey`           |
| 3  | `insurance_deposit_account` | `Pubkey`           |
| 4  | `user_token_account`        | `Pubkey`           |
| 5  | `authority`                 | `Pubkey`           |
| 6  | `token_program`             | `Pubkey`           |
| 7… | `remaining`                 | `Vec<AccountMeta>` |

### `WithdrawV2`

Discriminator `f250a300c4ddc2c2` · data `WithdrawV2` · accounts `WithdrawV2InstructionAccounts`.

| Field    | Type  |
| -------- | ----- |
| `amount` | `u64` |

Required accounts: 8; extras go to `remaining`.

Fields of `WithdrawV2InstructionAccounts`, in account order:

| #  | Field                     | Type               |
| -- | ------------------------- | ------------------ |
| 0  | `state`                   | `Pubkey`           |
| 1  | `pricing`                 | `Pubkey`           |
| 2  | `vault`                   | `Pubkey`           |
| 3  | `margin_account`          | `Pubkey`           |
| 4  | `user_token_account`      | `Pubkey`           |
| 5  | `token_program`           | `Pubkey`           |
| 6  | `authority`               | `Pubkey`           |
| 7  | `socialized_loss_account` | `Pubkey`           |
| 8… | `remaining`               | `Vec<AccountMeta>` |

### `CpiEvent`

Anchor self-CPI that carries one of the program's [events](#events). `data` is the `CpiEvent` enum.

Discriminator `e445a52e51cb9a1d` · data `CpiEvent` · accounts `CpiEventInstructionAccounts`.

Required accounts: 2; extras go to `remaining`.

Fields of `CpiEventInstructionAccounts`, in account order:

| #  | Field             | Type               |
| -- | ----------------- | ------------------ |
| 0  | `program`         | `Pubkey`           |
| 1  | `event_authority` | `Pubkey`           |
| 2… | `remaining`       | `Vec<AccountMeta>` |

## Accounts

Variants of `ZetaAccount`. Each wraps a boxed struct from `carbon_zeta_decoder::accounts::<module>`. `decode_account` only considers accounts owned by `PROGRAM_ID` and returns the first variant that matches.

### `CrossMarginAccount`

Discriminator `f25e8e8323f4931c` · `accounts::cross_margin_account::CrossMarginAccount`.

| Field                         | Type                                      |
| ----------------------------- | ----------------------------------------- |
| `authority`                   | `Pubkey`                                  |
| `delegated_pubkey`            | `Pubkey`                                  |
| `balance`                     | `u64`                                     |
| `subaccount_index`            | `u8`                                      |
| `nonce`                       | `u8`                                      |
| `force_cancel_flag`           | `bool`                                    |
| `account_type`                | [`MarginAccountType`](#marginaccounttype) |
| `open_orders_nonces`          | `[u8; 5]`                                 |
| `open_orders_nonces_padding`  | `[u8; 20]`                                |
| `rebalance_amount`            | `i64`                                     |
| `last_funding_deltas`         | [`[AnchorDecimal; 5]`](#anchordecimal)    |
| `last_funding_deltas_padding` | [`[AnchorDecimal; 20]`](#anchordecimal)   |
| `product_ledgers`             | [`[ProductLedger; 5]`](#productledger)    |
| `product_ledgers_padding`     | [`[ProductLedger; 20]`](#productledger)   |
| `padding`                     | `[u8; 2000]`                              |

### `CrossMarginAccountManager`

Discriminator `5ca21a433156fc05` · `accounts::cross_margin_account_manager::CrossMarginAccountManager`.

| Field       | Type                                                      |
| ----------- | --------------------------------------------------------- |
| `nonce`     | `u8`                                                      |
| `authority` | `Pubkey`                                                  |
| `accounts`  | [`[CrossMarginAccountInfo; 25]`](#crossmarginaccountinfo) |

### `CrossOpenOrdersMap`

Discriminator `c5185209520e309a` · `accounts::cross_open_orders_map::CrossOpenOrdersMap`.

| Field              | Type     |
| ------------------ | -------- |
| `user_key`         | `Pubkey` |
| `subaccount_index` | `u8`     |

### `Greeks`

Discriminator `f7d5aa9a2bf392fe` · `accounts::greeks::Greeks`.

| Field                                  | Type                                    |
| -------------------------------------- | --------------------------------------- |
| `nonce`                                | `u8`                                    |
| `mark_prices`                          | `[u64; 46]`                             |
| `mark_prices_padding`                  | `[u64; 91]`                             |
| `perp_mark_price`                      | `u64`                                   |
| `product_greeks`                       | [`[ProductGreeks; 22]`](#productgreeks) |
| `product_greeks_padding`               | [`[ProductGreeks; 44]`](#productgreeks) |
| `update_timestamp`                     | `[u64; 2]`                              |
| `update_timestamp_padding`             | `[u64; 4]`                              |
| `retreat_expiration_timestamp`         | `[u64; 2]`                              |
| `retreat_expiration_timestamp_padding` | `[u64; 4]`                              |
| `interest_rate`                        | `[i64; 2]`                              |
| `interest_rate_padding`                | `[i64; 4]`                              |
| `nodes`                                | `[u64; 5]`                              |
| `volatility`                           | `[u64; 10]`                             |
| `volatility_padding`                   | `[u64; 20]`                             |
| `node_keys`                            | `[Pubkey; 138]`                         |
| `halt_force_pricing`                   | `[bool; 6]`                             |
| `perp_update_timestamp`                | `u64`                                   |
| `perp_funding_delta`                   | [`AnchorDecimal`](#anchordecimal)       |
| `perp_latest_funding_rate`             | [`AnchorDecimal`](#anchordecimal)       |
| `perp_latest_midpoint`                 | `u64`                                   |
| `padding`                              | `[u8; 1593]`                            |

### `InsuranceDepositAccount`

Discriminator `b6a1fc657ba1cdb8` · `accounts::insurance_deposit_account::InsuranceDepositAccount`.

| Field    | Type  |
| -------- | ----- |
| `nonce`  | `u8`  |
| `amount` | `u64` |

### `MarginAccount`

Discriminator `85dcadd5b3d32bee` · `accounts::margin_account::MarginAccount`.

| Field                     | Type                                      |
| ------------------------- | ----------------------------------------- |
| `authority`               | `Pubkey`                                  |
| `nonce`                   | `u8`                                      |
| `balance`                 | `u64`                                     |
| `force_cancel_flag`       | `bool`                                    |
| `open_orders_nonce`       | `[u8; 138]`                               |
| `series_expiry`           | `[u64; 5]`                                |
| `series_expiry_padding`   | `u64`                                     |
| `product_ledgers`         | [`[ProductLedger; 46]`](#productledger)   |
| `product_ledgers_padding` | [`[ProductLedger; 91]`](#productledger)   |
| `perp_product_ledger`     | [`ProductLedger`](#productledger)         |
| `rebalance_amount`        | `i64`                                     |
| `asset`                   | [`Asset`](#asset)                         |
| `account_type`            | [`MarginAccountType`](#marginaccounttype) |
| `last_funding_delta`      | [`AnchorDecimal`](#anchordecimal)         |
| `delegated_pubkey`        | `Pubkey`                                  |
| `padding`                 | `[u8; 338]`                               |

### `MarketIndexes`

Discriminator `6fcd6992db895217` · `accounts::market_indexes::MarketIndexes`.

| Field         | Type        |
| ------------- | ----------- |
| `nonce`       | `u8`        |
| `initialized` | `bool`      |
| `indexes`     | `[u8; 138]` |

### `MarketNode`

Discriminator `1c52153b968d3c7c` · `accounts::market_node::MarketNode`.

| Field             | Type       |
| ----------------- | ---------- |
| `index`           | `u8`       |
| `nonce`           | `u8`       |
| `node_updates`    | `[i64; 5]` |
| `interest_update` | `i64`      |

### `OpenOrdersMap`

Discriminator `fa7eac0a761e03a8` · `accounts::open_orders_map::OpenOrdersMap`.

| Field      | Type     |
| ---------- | -------- |
| `user_key` | `Pubkey` |

### `PerpSyncQueue`

Discriminator `5c37389de6b8ab42` · `accounts::perp_sync_queue::PerpSyncQueue`.

| Field    | Type                                     |
| -------- | ---------------------------------------- |
| `nonce`  | `u8`                                     |
| `head`   | `u16`                                    |
| `length` | `u16`                                    |
| `queue`  | [`[AnchorDecimal; 600]`](#anchordecimal) |

### `Pricing`

Discriminator `be7bd2b68f0b9888` · `accounts::pricing::Pricing`.

| Field                            | Type                                          |
| -------------------------------- | --------------------------------------------- |
| `nonce`                          | `u8`                                          |
| `mark_prices`                    | `[u64; 5]`                                    |
| `mark_prices_padding`            | `[u64; 20]`                                   |
| `update_timestamps`              | `[u64; 5]`                                    |
| `update_timestamps_padding`      | `[u64; 20]`                                   |
| `funding_deltas`                 | [`[AnchorDecimal; 5]`](#anchordecimal)        |
| `funding_deltas_padding`         | [`[AnchorDecimal; 20]`](#anchordecimal)       |
| `latest_funding_rates`           | [`[AnchorDecimal; 5]`](#anchordecimal)        |
| `latest_funding_rates_padding`   | [`[AnchorDecimal; 20]`](#anchordecimal)       |
| `latest_midpoints`               | `[u64; 5]`                                    |
| `latest_midpoints_padding`       | `[u64; 20]`                                   |
| `oracles`                        | `[Pubkey; 5]`                                 |
| `oracles_padding`                | `[Pubkey; 20]`                                |
| `oracle_backup_feeds`            | `[Pubkey; 5]`                                 |
| `oracle_backup_feeds_padding`    | `[Pubkey; 20]`                                |
| `markets`                        | `[Pubkey; 5]`                                 |
| `markets_padding`                | `[Pubkey; 20]`                                |
| `perp_sync_queues`               | `[Pubkey; 5]`                                 |
| `perp_sync_queues_padding`       | `[Pubkey; 20]`                                |
| `perp_parameters`                | [`[PerpParameters; 5]`](#perpparameters)      |
| `perp_parameters_padding`        | [`[PerpParameters; 20]`](#perpparameters)     |
| `margin_parameters`              | [`[MarginParameters; 5]`](#marginparameters)  |
| `margin_parameters_padding`      | [`[MarginParameters; 20]`](#marginparameters) |
| `products`                       | [`[Product; 5]`](#product)                    |
| `products_padding`               | [`[Product; 20]`](#product)                   |
| `zeta_group_keys`                | `[Pubkey; 5]`                                 |
| `zeta_group_keys_padding`        | `[Pubkey; 20]`                                |
| `total_insurance_vault_deposits` | `u64`                                         |
| `last_withdraw_timestamp`        | `u64`                                         |
| `net_outflow_sum`                | `i64`                                         |
| `halt_force_pricing`             | `[bool; 5]`                                   |
| `halt_force_pricing_padding`     | `[bool; 20]`                                  |
| `padding`                        | `[u8; 2707]`                                  |

### `ReferralAccount`

Discriminator `eda2504ec4e95b02` · `accounts::referral_account::ReferralAccount`.

| Field             | Type     |
| ----------------- | -------- |
| `nonce`           | `u8`     |
| `referrer`        | `Pubkey` |
| `user`            | `Pubkey` |
| `timestamp`       | `u64`    |
| `pending_rewards` | `u64`    |
| `claimed_rewards` | `u64`    |

### `ReferrerAccount`

Discriminator `3013a0364cdc4609` · `accounts::referrer_account::ReferrerAccount`.

| Field             | Type     |
| ----------------- | -------- |
| `nonce`           | `u8`     |
| `has_alias`       | `bool`   |
| `referrer`        | `Pubkey` |
| `pending_rewards` | `u64`    |
| `claimed_rewards` | `u64`    |

### `ReferrerAlias`

Discriminator `87659edc2697be3a` · `accounts::referrer_alias::ReferrerAlias`.

| Field      | Type       |
| ---------- | ---------- |
| `nonce`    | `u8`       |
| `alias`    | `[u8; 15]` |
| `referrer` | `Pubkey`   |

### `SettlementAccount`

Discriminator `512a686f7b5992b4` · `accounts::settlement_account::SettlementAccount`.

| Field              | Type        |
| ------------------ | ----------- |
| `settlement_price` | `u64`       |
| `strikes`          | `[u64; 23]` |

### `SocializedLossAccount`

Discriminator `41fe8deb3c546889` · `accounts::socialized_loss_account::SocializedLossAccount`.

| Field                 | Type  |
| --------------------- | ----- |
| `nonce`               | `u8`  |
| `overbankrupt_amount` | `u64` |

### `SpreadAccount`

Discriminator `3982fc88a7b12fa2` · `accounts::spread_account::SpreadAccount`.

| Field                   | Type                          |
| ----------------------- | ----------------------------- |
| `authority`             | `Pubkey`                      |
| `nonce`                 | `u8`                          |
| `balance`               | `u64`                         |
| `series_expiry`         | `[u64; 5]`                    |
| `series_expiry_padding` | `u64`                         |
| `positions`             | [`[Position; 46]`](#position) |
| `positions_padding`     | [`[Position; 92]`](#position) |
| `asset`                 | [`Asset`](#asset)             |
| `padding`               | `[u8; 262]`                   |

### `State`

Discriminator `d8926b5e684bb6b1` · `accounts::state::State`.

| Field                                        | Type                                |
| -------------------------------------------- | ----------------------------------- |
| `admin`                                      | `Pubkey`                            |
| `state_nonce`                                | `u8`                                |
| `serum_nonce`                                | `u8`                                |
| `mint_auth_nonce`                            | `u8`                                |
| `num_underlyings`                            | `u8`                                |
| `num_flex_underlyings`                       | `u8`                                |
| `null`                                       | `[u8; 7]`                           |
| `strike_initialization_threshold_seconds`    | `u32`                               |
| `pricing_frequency_seconds`                  | `u32`                               |
| `liquidator_liquidation_percentage`          | `u32`                               |
| `insurance_vault_liquidation_percentage`     | `u32`                               |
| `native_d1_trade_fee_percentage`             | `u64`                               |
| `native_d1_underlying_fee_percentage`        | `u64`                               |
| `native_whitelist_underlying_fee_percentage` | `u64`                               |
| `native_deposit_limit`                       | `u64`                               |
| `expiration_threshold_seconds`               | `u32`                               |
| `position_movement_fee_bps`                  | `u8`                                |
| `margin_concession_percentage`               | `u8`                                |
| `treasury_wallet_nonce`                      | `u8`                                |
| `native_option_trade_fee_percentage`         | `u64`                               |
| `native_option_underlying_fee_percentage`    | `u64`                               |
| `referrals_admin`                            | `Pubkey`                            |
| `referrals_rewards_wallet_nonce`             | `u8`                                |
| `max_perp_delta_age`                         | `u16`                               |
| `secondary_admin`                            | `Pubkey`                            |
| `vault_nonce`                                | `u8`                                |
| `insurance_vault_nonce`                      | `u8`                                |
| `deprecated_total_insurance_vault_deposits`  | `u64`                               |
| `native_withdraw_limit`                      | `u64`                               |
| `withdraw_limit_epoch_seconds`               | `u32`                               |
| `native_open_interest_limit`                 | `u64`                               |
| `halt_states`                                | [`[HaltStateV2; 5]`](#haltstatev2)  |
| `halt_states_padding`                        | [`[HaltStateV2; 20]`](#haltstatev2) |
| `padding`                                    | `[u8; 338]`                         |

### `Underlying`

Discriminator `ce80984d70a40d02` · `accounts::underlying::Underlying`.

| Field  | Type     |
| ------ | -------- |
| `mint` | `Pubkey` |

### `WhitelistDepositAccount`

Discriminator `6e02d95144ae78d9` · `accounts::whitelist_deposit_account::WhitelistDepositAccount`.

| Field      | Type     |
| ---------- | -------- |
| `nonce`    | `u8`     |
| `user_key` | `Pubkey` |

### `WhitelistInsuranceAccount`

Discriminator `0a68c0cb813c2802` · `accounts::whitelist_insurance_account::WhitelistInsuranceAccount`.

| Field      | Type     |
| ---------- | -------- |
| `nonce`    | `u8`     |
| `user_key` | `Pubkey` |

### `WhitelistTradingFeesAccount`

Discriminator `db27bda689f354ef` · `accounts::whitelist_trading_fees_account::WhitelistTradingFeesAccount`.

| Field      | Type     |
| ---------- | -------- |
| `nonce`    | `u8`     |
| `user_key` | `Pubkey` |

### `ZetaGroup`

Discriminator `7911d26b6deb0e0c` · `accounts::zeta_group::ZetaGroup`.

| Field                          | Type                                      |
| ------------------------------ | ----------------------------------------- |
| `nonce`                        | `u8`                                      |
| `nonce_padding`                | `[u8; 2]`                                 |
| `front_expiry_index`           | `u8`                                      |
| `halt_state`                   | [`HaltState`](#haltstate)                 |
| `underlying_mint`              | `Pubkey`                                  |
| `oracle`                       | `Pubkey`                                  |
| `greeks`                       | `Pubkey`                                  |
| `pricing_parameters`           | [`PricingParameters`](#pricingparameters) |
| `margin_parameters`            | [`MarginParameters`](#marginparameters)   |
| `margin_parameters_padding`    | `[u8; 104]`                               |
| `products`                     | [`[Product; 46]`](#product)               |
| `products_padding`             | [`[Product; 91]`](#product)               |
| `perp`                         | [`Product`](#product)                     |
| `expiry_series`                | [`[ExpirySeries; 2]`](#expiryseries)      |
| `expiry_series_padding`        | [`[ExpirySeries; 4]`](#expiryseries)      |
| `deprecated_padding`           | `[u8; 8]`                                 |
| `asset`                        | [`Asset`](#asset)                         |
| `expiry_interval_seconds`      | `u32`                                     |
| `new_expiry_threshold_seconds` | `u32`                                     |
| `perp_parameters`              | [`PerpParameters`](#perpparameters)       |
| `perp_sync_queue`              | `Pubkey`                                  |
| `oracle_backup_feed`           | `Pubkey`                                  |
| `perps_only`                   | `bool`                                    |
| `flex_underlying`              | `bool`                                    |
| `padding`                      | `[u8; 964]`                               |

## Events

Variants of `instructions::CpiEvent`, decoded from the `CpiEvent` instruction. Each wraps a struct from `carbon_zeta_decoder::events::<module>`. The discriminator is the 8-byte event discriminator that follows the `e445a52e51cb9a1d` CPI-event tag.

### `TradeEvent`

Discriminator `bddb7fd34ee661ee` · `events::trade_event::TradeEventEvent`.

| Field             | Type     |
| ----------------- | -------- |
| `margin_account`  | `Pubkey` |
| `index`           | `u8`     |
| `size`            | `u64`    |
| `cost_of_trades`  | `u64`    |
| `is_bid`          | `bool`   |
| `client_order_id` | `u64`    |
| `order_id`        | `u128`   |

### `TradeEventV2`

Discriminator `128ed28bb27bcb75` · `events::trade_event_v2::TradeEventV2Event`.

| Field             | Type     |
| ----------------- | -------- |
| `margin_account`  | `Pubkey` |
| `index`           | `u8`     |
| `size`            | `u64`    |
| `cost_of_trades`  | `u64`    |
| `is_bid`          | `bool`   |
| `client_order_id` | `u64`    |
| `order_id`        | `u128`   |
| `asset`           | `u8`     |
| `user`            | `Pubkey` |
| `is_taker`        | `bool`   |
| `sequence_number` | `u64`    |

### `TradeEventV3`

Discriminator `72a23b2154866c3e` · `events::trade_event_v3::TradeEventV3Event`.

| Field             | Type              |
| ----------------- | ----------------- |
| `margin_account`  | `Pubkey`          |
| `index`           | `u8`              |
| `size`            | `u64`             |
| `cost_of_trades`  | `u64`             |
| `is_bid`          | `bool`            |
| `client_order_id` | `u64`             |
| `order_id`        | `u128`            |
| `asset`           | [`Asset`](#asset) |
| `user`            | `Pubkey`          |
| `is_taker`        | `bool`            |
| `sequence_number` | `u64`             |

### `PositionMovementEvent`

Discriminator `44b90d941ce3655f` · `events::position_movement_event::PositionMovementEventEvent`.

| Field                    | Type  |
| ------------------------ | ----- |
| `net_balance_transfer`   | `i64` |
| `margin_account_balance` | `u64` |
| `spread_account_balance` | `u64` |
| `movement_fees`          | `u64` |

### `PlaceOrderEvent`

Discriminator `41bf195b1bfcc028` · `events::place_order_event::PlaceOrderEventEvent`.

| Field          | Type   |
| -------------- | ------ |
| `fee`          | `u64`  |
| `oracle_price` | `u64`  |
| `order_id`     | `u128` |
| `expiry_ts`    | `u64`  |

### `LiquidationEvent`

Discriminator `030d155dad884890` · `events::liquidation_event::LiquidationEventEvent`.

| Field                          | Type              |
| ------------------------------ | ----------------- |
| `liquidator_reward`            | `u64`             |
| `insurance_reward`             | `u64`             |
| `cost_of_trades`               | `u64`             |
| `size`                         | `i64`             |
| `remaining_liquidatee_balance` | `u64`             |
| `remaining_liquidator_balance` | `u64`             |
| `mark_price`                   | `u64`             |
| `underlying_price`             | `u64`             |
| `liquidatee`                   | `Pubkey`          |
| `liquidator`                   | `Pubkey`          |
| `asset`                        | [`Asset`](#asset) |

### `OrderCompleteEvent`

Discriminator `1a64c4ea5d799fdf` · `events::order_complete_event::OrderCompleteEventEvent`.

| Field                 | Type                                      |
| --------------------- | ----------------------------------------- |
| `margin_account`      | `Pubkey`                                  |
| `user`                | `Pubkey`                                  |
| `asset`               | [`Asset`](#asset)                         |
| `market_index`        | `u8`                                      |
| `side`                | [`Side`](#side)                           |
| `unfilled_size`       | `u64`                                     |
| `order_id`            | `u128`                                    |
| `client_order_id`     | `u64`                                     |
| `order_complete_type` | [`OrderCompleteType`](#ordercompletetype) |

### `ApplyFundingEvent`

Discriminator `7fca0fb7c8c0040c` · `events::apply_funding_event::ApplyFundingEventEvent`.

| Field               | Type              |
| ------------------- | ----------------- |
| `margin_account`    | `Pubkey`          |
| `user`              | `Pubkey`          |
| `asset`             | [`Asset`](#asset) |
| `balance_change`    | `i64`             |
| `remaining_balance` | `u64`             |
| `funding_rate`      | `i64`             |
| `oracle_price`      | `u64`             |

## Types

Types used by the instructions, accounts and events above, exported from `carbon_zeta_decoder::types`.

### `AnchorDecimal`

Struct `types::AnchorDecimal`.

| Field   | Type  |
| ------- | ----- |
| `flags` | `u32` |
| `hi`    | `u32` |
| `lo`    | `u32` |
| `mid`   | `u32` |

### `ApplyFundingEvent`

Struct `types::ApplyFundingEvent`. Same fields as the [`ApplyFundingEvent`](#applyfundingevent) event.

### `Asset`

Enum `types::Asset`.

| Variant     |
| ----------- |
| `SOL`       |
| `BTC`       |
| `ETH`       |
| `APT`       |
| `ARB`       |
| `UNDEFINED` |

### `CrossMarginAccountInfo`

Struct `types::CrossMarginAccountInfo`.

| Field         | Type       |
| ------------- | ---------- |
| `initialized` | `bool`     |
| `name`        | `[u8; 10]` |

### `ExpireSeriesOverrideArgs`

Struct `types::ExpireSeriesOverrideArgs`.

| Field              | Type  |
| ------------------ | ----- |
| `settlement_nonce` | `u8`  |
| `settlement_price` | `u64` |

### `ExpirySeries`

Struct `types::ExpirySeries`.

| Field       | Type       |
| ----------- | ---------- |
| `active_ts` | `u64`      |
| `expiry_ts` | `u64`      |
| `dirty`     | `bool`     |
| `padding`   | `[u8; 15]` |

### `ExpirySeriesStatus`

Enum `types::ExpirySeriesStatus`.

| Variant         |
| --------------- |
| `Uninitialized` |
| `Initialized`   |
| `Live`          |
| `Expired`       |
| `ExpiredDirty`  |

### `HaltArgs`

Struct `types::HaltArgs`.

| Field         | Type       |
| ------------- | ---------- |
| `spot_prices` | `[u64; 5]` |
| `timestamp`   | `u64`      |

### `HaltState`

Struct `types::HaltState`.

| Field                          | Type         |
| ------------------------------ | ------------ |
| `halted`                       | `bool`       |
| `spot_price`                   | `u64`        |
| `timestamp`                    | `u64`        |
| `mark_prices_set`              | `[bool; 2]`  |
| `mark_prices_set_padding`      | `[bool; 3]`  |
| `perp_mark_price_set`          | `bool`       |
| `market_nodes_cleaned`         | `[bool; 2]`  |
| `market_nodes_cleaned_padding` | `[bool; 4]`  |
| `market_cleaned`               | `[bool; 46]` |
| `market_cleaned_padding`       | `[bool; 91]` |
| `perp_market_cleaned`          | `bool`       |

### `HaltStateArgs`

Struct `types::HaltStateArgs`.

| Field        | Type              |
| ------------ | ----------------- |
| `asset`      | [`Asset`](#asset) |
| `spot_price` | `u64`             |
| `timestamp`  | `u64`             |

### `HaltStateV2`

Struct `types::HaltStateV2`.

| Field            | Type   |
| ---------------- | ------ |
| `halted`         | `bool` |
| `timestamp`      | `u64`  |
| `spot_price`     | `u64`  |
| `market_cleaned` | `bool` |

### `InitializeMarketArgs`

Struct `types::InitializeMarketArgs`.

| Field                    | Type              |
| ------------------------ | ----------------- |
| `asset`                  | [`Asset`](#asset) |
| `market_nonce`           | `u8`              |
| `base_mint_nonce`        | `u8`              |
| `quote_mint_nonce`       | `u8`              |
| `zeta_base_vault_nonce`  | `u8`              |
| `zeta_quote_vault_nonce` | `u8`              |
| `dex_base_vault_nonce`   | `u8`              |
| `dex_quote_vault_nonce`  | `u8`              |
| `vault_signer_nonce`     | `u64`             |

### `InitializeMarketNodeArgs`

Struct `types::InitializeMarketNodeArgs`.

| Field   | Type |
| ------- | ---- |
| `nonce` | `u8` |
| `index` | `u8` |

### `InitializeStateArgs`

Struct `types::InitializeStateArgs`.

| Field                                        | Type  |
| -------------------------------------------- | ----- |
| `state_nonce`                                | `u8`  |
| `serum_nonce`                                | `u8`  |
| `mint_auth_nonce`                            | `u8`  |
| `strike_initialization_threshold_seconds`    | `u32` |
| `pricing_frequency_seconds`                  | `u32` |
| `liquidator_liquidation_percentage`          | `u32` |
| `insurance_vault_liquidation_percentage`     | `u32` |
| `native_d1_trade_fee_percentage`             | `u64` |
| `native_d1_underlying_fee_percentage`        | `u64` |
| `native_option_trade_fee_percentage`         | `u64` |
| `native_option_underlying_fee_percentage`    | `u64` |
| `native_whitelist_underlying_fee_percentage` | `u64` |
| `native_deposit_limit`                       | `u64` |
| `expiration_threshold_seconds`               | `u32` |
| `position_movement_fee_bps`                  | `u8`  |
| `margin_concession_percentage`               | `u8`  |
| `max_perp_delta_age_seconds`                 | `u16` |
| `native_withdraw_limit`                      | `u64` |
| `withdraw_limit_epoch_seconds`               | `u32` |
| `native_open_interest_limit`                 | `u64` |

### `InitializeZetaGroupArgs`

Struct `types::InitializeZetaGroupArgs`.

| Field                           | Type                      |
| ------------------------------- | ------------------------- |
| `perps_only`                    | `bool`                    |
| `flex_underlying`               | `bool`                    |
| `asset_override`                | [`Option<Asset>`](#asset) |
| `zeta_group_nonce`              | `u8`                      |
| `underlying_nonce`              | `u8`                      |
| `greeks_nonce`                  | `u8`                      |
| `vault_nonce`                   | `u8`                      |
| `insurance_vault_nonce`         | `u8`                      |
| `socialized_loss_account_nonce` | `u8`                      |
| `perp_sync_queue_nonce`         | `u8`                      |
| `interest_rate`                 | `i64`                     |
| `volatility`                    | `[u64; 5]`                |
| `option_trade_normalizer`       | `u64`                     |
| `future_trade_normalizer`       | `u64`                     |
| `max_volatility_retreat`        | `u64`                     |
| `max_interest_retreat`          | `u64`                     |
| `max_delta`                     | `u64`                     |
| `min_delta`                     | `u64`                     |
| `min_interest_rate`             | `i64`                     |
| `max_interest_rate`             | `i64`                     |
| `min_volatility`                | `u64`                     |
| `max_volatility`                | `u64`                     |
| `future_margin_initial`         | `u64`                     |
| `future_margin_maintenance`     | `u64`                     |
| `expiry_interval_seconds`       | `u32`                     |
| `new_expiry_threshold_seconds`  | `u32`                     |
| `min_funding_rate_percent`      | `i64`                     |
| `max_funding_rate_percent`      | `i64`                     |
| `perp_impact_cash_delta`        | `u64`                     |

### `InitializeZetaPricingArgs`

Struct `types::InitializeZetaPricingArgs`.

| Field                      | Type  |
| -------------------------- | ----- |
| `min_funding_rate_percent` | `i64` |
| `max_funding_rate_percent` | `i64` |
| `perp_impact_cash_delta`   | `u64` |
| `margin_initial`           | `u64` |
| `margin_maintenance`       | `u64` |
| `pricing_nonce`            | `u8`  |

### `Kind`

Enum `types::Kind`.

| Variant         |
| --------------- |
| `Uninitialized` |
| `Call`          |
| `Put`           |
| `Future`        |
| `Perp`          |

### `LiquidationEvent`

Struct `types::LiquidationEvent`. Same fields as the [`LiquidationEvent`](#liquidationevent) event.

### `MarginAccountType`

Enum `types::MarginAccountType`.

| Variant       |
| ------------- |
| `Normal`      |
| `MarketMaker` |

### `MarginParameters`

Struct `types::MarginParameters`.

| Field                       | Type  |
| --------------------------- | ----- |
| `future_margin_initial`     | `u64` |
| `future_margin_maintenance` | `u64` |

### `MarginRequirement`

Enum `types::MarginRequirement`.

| Variant                      |
| ---------------------------- |
| `Initial`                    |
| `Maintenance`                |
| `MaintenanceIncludingOrders` |
| `MarketMakerConcession`      |

### `MovementType`

Enum `types::MovementType`.

| Variant     |
| ----------- |
| `Undefined` |
| `Lock`      |
| `Unlock`    |

### `OrderCompleteEvent`

Struct `types::OrderCompleteEvent`. Same fields as the [`OrderCompleteEvent`](#ordercompleteevent) event.

### `OrderCompleteType`

Enum `types::OrderCompleteType`.

| Variant  |
| -------- |
| `Cancel` |
| `Fill`   |
| `Booted` |

### `OrderState`

Struct `types::OrderState`.

| Field            | Type       |
| ---------------- | ---------- |
| `closing_orders` | `u64`      |
| `opening_orders` | `[u64; 2]` |

### `OrderType`

Enum `types::OrderType`.

| Variant             |
| ------------------- |
| `Limit`             |
| `PostOnly`          |
| `FillOrKill`        |
| `ImmediateOrCancel` |
| `PostOnlySlide`     |

### `OverrideExpiryArgs`

Struct `types::OverrideExpiryArgs`.

| Field          | Type  |
| -------------- | ----- |
| `expiry_index` | `u8`  |
| `active_ts`    | `u64` |
| `expiry_ts`    | `u64` |

### `PerpParameters`

Struct `types::PerpParameters`.

| Field                      | Type  |
| -------------------------- | ----- |
| `min_funding_rate_percent` | `i64` |
| `max_funding_rate_percent` | `i64` |
| `impact_cash_delta`        | `u64` |

### `PlaceOrderEvent`

Struct `types::PlaceOrderEvent`. Same fields as the [`PlaceOrderEvent`](#placeorderevent) event.

### `PlaceOrderType`

Enum `types::PlaceOrderType`.

| Variant          |
| ---------------- |
| `PlaceOrder`     |
| `PlacePerpOrder` |

### `Position`

Struct `types::Position`.

| Field            | Type  |
| ---------------- | ----- |
| `size`           | `i64` |
| `cost_of_trades` | `u64` |

### `PositionMovementArg`

Struct `types::PositionMovementArg`.

| Field   | Type  |
| ------- | ----- |
| `index` | `u8`  |
| `size`  | `i64` |

### `PositionMovementEvent`

Struct `types::PositionMovementEvent`. Same fields as the [`PositionMovementEvent`](#positionmovementevent) event.

### `PricingParameters`

Struct `types::PricingParameters`.

| Field                     | Type                              |
| ------------------------- | --------------------------------- |
| `option_trade_normalizer` | [`AnchorDecimal`](#anchordecimal) |
| `future_trade_normalizer` | [`AnchorDecimal`](#anchordecimal) |
| `max_volatility_retreat`  | [`AnchorDecimal`](#anchordecimal) |
| `max_interest_retreat`    | [`AnchorDecimal`](#anchordecimal) |
| `max_delta`               | `u64`                             |
| `min_delta`               | `u64`                             |
| `min_volatility`          | `u64`                             |
| `max_volatility`          | `u64`                             |
| `min_interest_rate`       | `i64`                             |
| `max_interest_rate`       | `i64`                             |

### `Product`

Struct `types::Product`.

| Field    | Type                |
| -------- | ------------------- |
| `market` | `Pubkey`            |
| `strike` | [`Strike`](#strike) |
| `dirty`  | `bool`              |
| `kind`   | [`Kind`](#kind)     |

### `ProductGreeks`

Struct `types::ProductGreeks`.

| Field        | Type                              |
| ------------ | --------------------------------- |
| `delta`      | `u64`                             |
| `vega`       | [`AnchorDecimal`](#anchordecimal) |
| `volatility` | [`AnchorDecimal`](#anchordecimal) |

### `ProductLedger`

Struct `types::ProductLedger`.

| Field         | Type                        |
| ------------- | --------------------------- |
| `position`    | [`Position`](#position)     |
| `order_state` | [`OrderState`](#orderstate) |

### `SetReferralsRewardsArgs`

Struct `types::SetReferralsRewardsArgs`.

| Field                   | Type     |
| ----------------------- | -------- |
| `referrals_account_key` | `Pubkey` |
| `pending_rewards`       | `u64`    |
| `overwrite`             | `bool`   |

### `Side`

Enum `types::Side`.

| Variant         |
| --------------- |
| `Uninitialized` |
| `Bid`           |
| `Ask`           |

### `Strike`

Struct `types::Strike`.

| Field    | Type   |
| -------- | ------ |
| `is_set` | `bool` |
| `value`  | `u64`  |

### `TradeEvent`

Struct `types::TradeEvent`. Same fields as the [`TradeEvent`](#tradeevent) event.

### `TradeEventV2`

Struct `types::TradeEventV2`. Same fields as the [`TradeEventV2`](#tradeeventv2) event.

### `TradeEventV3`

Struct `types::TradeEventV3`. Same fields as the [`TradeEventV3`](#tradeeventv3) event.

### `TraitType`

Enum `types::TraitType`.

| Variant              |
| -------------------- |
| `MarginAccount`      |
| `CrossMarginAccount` |

### `TreasuryMovementType`

Enum `types::TreasuryMovementType`.

| Variant                          |
| -------------------------------- |
| `Undefined`                      |
| `ToTreasuryFromInsurance`        |
| `ToInsuranceFromTreasury`        |
| `ToTreasuryFromReferralsRewards` |
| `ToReferralsRewardsFromTreasury` |

### `UpdateGreeksArgs`

Struct `types::UpdateGreeksArgs`.

| Field        | Type  |
| ------------ | ----- |
| `index`      | `u8`  |
| `theo`       | `u64` |
| `delta`      | `u32` |
| `gamma`      | `u32` |
| `volatility` | `u32` |

### `UpdateInterestRateArgs`

Struct `types::UpdateInterestRateArgs`.

| Field           | Type  |
| --------------- | ----- |
| `expiry_index`  | `u8`  |
| `interest_rate` | `i64` |

### `UpdateMarginParametersArgs`

Struct `types::UpdateMarginParametersArgs`.

| Field                       | Type  |
| --------------------------- | ----- |
| `future_margin_initial`     | `u64` |
| `future_margin_maintenance` | `u64` |

### `UpdatePerpParametersArgs`

Struct `types::UpdatePerpParametersArgs`.

| Field                      | Type  |
| -------------------------- | ----- |
| `min_funding_rate_percent` | `i64` |
| `max_funding_rate_percent` | `i64` |
| `perp_impact_cash_delta`   | `u64` |

### `UpdatePricingParametersArgs`

Struct `types::UpdatePricingParametersArgs`.

| Field                     | Type  |
| ------------------------- | ----- |
| `option_trade_normalizer` | `u64` |
| `future_trade_normalizer` | `u64` |
| `max_volatility_retreat`  | `u64` |
| `max_interest_retreat`    | `u64` |
| `min_delta`               | `u64` |
| `max_delta`               | `u64` |
| `min_interest_rate`       | `i64` |
| `max_interest_rate`       | `i64` |
| `min_volatility`          | `u64` |
| `max_volatility`          | `u64` |

### `UpdateStateArgs`

Struct `types::UpdateStateArgs`.

| Field                                        | Type  |
| -------------------------------------------- | ----- |
| `strike_initialization_threshold_seconds`    | `u32` |
| `pricing_frequency_seconds`                  | `u32` |
| `liquidator_liquidation_percentage`          | `u32` |
| `insurance_vault_liquidation_percentage`     | `u32` |
| `native_d1_trade_fee_percentage`             | `u64` |
| `native_d1_underlying_fee_percentage`        | `u64` |
| `native_option_trade_fee_percentage`         | `u64` |
| `native_option_underlying_fee_percentage`    | `u64` |
| `native_whitelist_underlying_fee_percentage` | `u64` |
| `native_deposit_limit`                       | `u64` |
| `expiration_threshold_seconds`               | `u32` |
| `position_movement_fee_bps`                  | `u8`  |
| `margin_concession_percentage`               | `u8`  |
| `max_perp_delta_age_seconds`                 | `u16` |
| `native_withdraw_limit`                      | `u64` |
| `withdraw_limit_epoch_seconds`               | `u32` |
| `native_open_interest_limit`                 | `u64` |

### `UpdateVolatilityArgs`

Struct `types::UpdateVolatilityArgs`.

| Field          | Type       |
| -------------- | ---------- |
| `expiry_index` | `u8`       |
| `volatility`   | `[u64; 5]` |

### `UpdateZetaGroupExpiryArgs`

Struct `types::UpdateZetaGroupExpiryArgs`.

| Field                          | Type  |
| ------------------------------ | ----- |
| `expiry_interval_seconds`      | `u32` |
| `new_expiry_threshold_seconds` | `u32` |

### `UpdateZetaPricingPubkeysArgs`

Struct `types::UpdateZetaPricingPubkeysArgs`.

| Field                | Type              |
| -------------------- | ----------------- |
| `asset`              | [`Asset`](#asset) |
| `oracle`             | `Pubkey`          |
| `oracle_backup_feed` | `Pubkey`          |
| `market`             | `Pubkey`          |
| `perp_sync_queue`    | `Pubkey`          |
| `zeta_group_key`     | `Pubkey`          |

### `ValidationType`

Enum `types::ValidationType`.

| Variant      |
| ------------ |
| `Place`      |
| `Cancel`     |
| `OpenOrders` |

---

Carbon 2.0.0 documentation · Web: https://carbon.sevenlabs.org/decoders/zeta · Last updated 2026-11-09 · Index of all pages: https://carbon.sevenlabs.org/llms.txt
