{
  "address": "GYy4kM6GHhpgLCUscuABbzkD2ZbJ2fneYryaZ6Ch7fFU",
  "metadata": {
    "name": "privacy_pool",
    "version": "0.1.0",
    "spec": "0.1.0",
    "description": "Veilo - Privacy Layer on Solana"
  },
  "instructions": [
    {
      "name": "add_merkle_tree",
      "discriminator": [199, 97, 38, 35, 140, 113, 187, 30],
      "accounts": [
        {
          "name": "config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 99, 111, 110, 102, 105,
                  103, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "note_tree",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 110, 111, 116, 101, 95,
                  116, 114, 101, 101, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "tree_id"
              }
            ]
          }
        },
        {
          "name": "relayer",
          "docs": [
            "Relayer who can add trees (must be registered in config.relayers)"
          ],
          "writable": true,
          "signer": true
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "_mint_address",
          "type": "pubkey"
        },
        {
          "name": "tree_id",
          "type": "u16"
        }
      ]
    },
    {
      "name": "add_position_relayer",
      "docs": ["Add a whitelisted relayer to the position pool."],
      "discriminator": [9, 251, 142, 65, 102, 181, 222, 159],
      "accounts": [
        {
          "name": "config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 111, 115, 105, 116, 105, 111, 110, 95, 99, 111, 110, 102,
                  105, 103, 95, 118, 49
                ]
              }
            ]
          }
        },
        {
          "name": "authority",
          "signer": true,
          "relations": ["config"]
        }
      ],
      "args": [
        {
          "name": "new_relayer",
          "type": "pubkey"
        }
      ]
    },
    {
      "name": "add_relayer",
      "discriminator": [184, 240, 94, 199, 19, 71, 21, 192],
      "accounts": [
        {
          "name": "config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 99, 111, 110, 102, 105,
                  103, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "admin",
          "docs": [
            "has_one = admin ensures this matches config.admin.",
            "When using Squads, the vault PDA signs after multisig approval."
          ],
          "signer": true,
          "relations": ["config"]
        }
      ],
      "args": [
        {
          "name": "_mint_address",
          "type": "pubkey"
        },
        {
          "name": "new_relayer",
          "type": "pubkey"
        }
      ]
    },
    {
      "name": "close_position",
      "docs": [
        "Close a private stock/meme position.",
        "Proves ownership of a position note in the position tree, withdraws stock",
        "from the vault, swaps stock → USDC via Jupiter, and inserts USDC output",
        "notes into the USDC pool Merkle tree."
      ],
      "discriminator": [123, 134, 81, 0, 49, 68, 98, 98],
      "accounts": [
        {
          "name": "position_config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 111, 115, 105, 116, 105, 111, 110, 95, 99, 111, 110, 102,
                  105, 103, 95, 118, 49
                ]
              }
            ]
          }
        },
        {
          "name": "position_tree",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 111, 115, 105, 116, 105, 111, 110, 95, 116, 114, 101,
                  101, 95, 118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "position_tree_id"
              }
            ]
          }
        },
        {
          "name": "position_pda",
          "docs": [
            "PositionPDA — closed at end of instruction; rent returned to relayer"
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 111, 115, 105, 116, 105, 111, 110, 95, 112, 100, 97, 95,
                  118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "position_pda_key"
              }
            ]
          }
        },
        {
          "name": "position_nullifier_marker_0",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 111, 115, 105, 116, 105, 111, 110, 95, 110, 117, 108,
                  108, 105, 102, 105, 101, 114, 95, 118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "source_mint"
              },
              {
                "kind": "arg",
                "path": "input_nullifier_0"
              }
            ]
          }
        },
        {
          "name": "position_nullifier_marker_1",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 111, 115, 105, 116, 105, 111, 110, 95, 110, 117, 108,
                  108, 105, 102, 105, 101, 114, 95, 118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "source_mint"
              },
              {
                "kind": "arg",
                "path": "input_nullifier_1"
              }
            ]
          }
        },
        {
          "name": "position_vault_record",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 111, 115, 105, 116, 105, 111, 110, 95, 118, 97, 117, 108,
                  116, 95, 118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "source_mint"
              }
            ]
          }
        },
        {
          "name": "position_vault_pda",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 111, 115, 105, 116, 105, 111, 110, 95, 118, 97, 117, 108,
                  116, 95, 116, 111, 107, 101, 110, 95, 118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "source_mint"
              }
            ]
          }
        },
        {
          "name": "position_vault_ata",
          "writable": true
        },
        {
          "name": "usdc_config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 99, 111, 110, 102, 105,
                  103, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "dest_mint"
              }
            ]
          }
        },
        {
          "name": "usdc_vault",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 118, 97, 117, 108, 116,
                  95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "dest_mint"
              }
            ]
          }
        },
        {
          "name": "usdc_tree",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 110, 111, 116, 101, 95,
                  116, 114, 101, 101, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "dest_mint"
              },
              {
                "kind": "arg",
                "path": "usdc_tree_id"
              }
            ]
          }
        },
        {
          "name": "usdc_vault_token_account",
          "writable": true
        },
        {
          "name": "usdc_mint_account",
          "docs": ["USDC mint — for executor dest ATA creation"]
        },
        {
          "name": "executor",
          "docs": [
            "System-owned executor PDA — signs swap CPIs and holds native SOL for DEX protocol fees",
            "(e.g. Pump.fun). Carries no Anchor data; validated by seeds only."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 111, 115, 105, 116, 105, 111, 110, 95, 101, 120, 101, 99,
                  117, 116, 111, 114
                ]
              },
              {
                "kind": "arg",
                "path": "source_mint"
              },
              {
                "kind": "arg",
                "path": "dest_mint"
              },
              {
                "kind": "arg",
                "path": "input_nullifier_0"
              },
              {
                "kind": "account",
                "path": "relayer"
              }
            ]
          }
        },
        {
          "name": "executor_source_token",
          "writable": true
        },
        {
          "name": "executor_dest_token",
          "docs": ["Executor's USDC token account (always legacy SPL)"],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "account",
                "path": "executor"
              },
              {
                "kind": "const",
                "value": [
                  6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206,
                  235, 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140,
                  245, 133, 126, 255, 0, 169
                ]
              },
              {
                "kind": "account",
                "path": "usdc_mint_account"
              }
            ],
            "program": {
              "kind": "const",
              "value": [
                140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
                13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
                219, 233, 248, 89
              ]
            }
          }
        },
        {
          "name": "source_mint_info"
        },
        {
          "name": "claimant",
          "docs": [
            "Ephemeral key committed in the open_position ZK proof via ext_data.claimant.",
            "Must sign to prove ownership — prevents a malicious relayer from closing a",
            "victim's PositionPDA using a proof generated for a different position."
          ],
          "signer": true
        },
        {
          "name": "relayer",
          "writable": true,
          "signer": true
        },
        {
          "name": "relayer_usdc_token",
          "docs": ["Relayer's USDC token account for swap fee"],
          "writable": true
        },
        {
          "name": "swap_program"
        },
        {
          "name": "jupiter_event_authority"
        },
        {
          "name": "token_program",
          "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
        },
        {
          "name": "token_2022_program"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        },
        {
          "name": "associated_token_program",
          "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
        }
      ],
      "args": [
        {
          "name": "position_tree_id",
          "type": "u16"
        },
        {
          "name": "source_mint",
          "type": "pubkey"
        },
        {
          "name": "input_nullifier_0",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "input_nullifier_1",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "usdc_tree_id",
          "type": "u16"
        },
        {
          "name": "dest_mint",
          "type": "pubkey"
        },
        {
          "name": "position_pda_key",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "proof",
          "type": {
            "defined": {
              "name": "SwapProof"
            }
          }
        },
        {
          "name": "position_root",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "output_commitment_0",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "output_commitment_1",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "swap_params",
          "type": {
            "defined": {
              "name": "SwapParams"
            }
          }
        },
        {
          "name": "swap_amount",
          "type": "u64"
        },
        {
          "name": "swap_data",
          "type": "bytes"
        },
        {
          "name": "ext_data",
          "type": {
            "defined": {
              "name": "ExtData"
            }
          }
        },
        {
          "name": "note_ciphers",
          "type": {
            "option": {
              "defined": {
                "name": "NoteCiphers"
              }
            }
          }
        }
      ]
    },
    {
      "name": "close_position_to_sol",
      "docs": [
        "Close a position MEME→SOL via Jupiter (staged-legs cosigner sell) → deposit SOL into the SOL pool."
      ],
      "discriminator": [63, 8, 138, 69, 186, 149, 182, 192],
      "accounts": [
        {
          "name": "position_config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 111, 115, 105, 116, 105, 111, 110, 95, 99, 111, 110, 102,
                  105, 103, 95, 118, 49
                ]
              }
            ]
          }
        },
        {
          "name": "position_tree",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 111, 115, 105, 116, 105, 111, 110, 95, 116, 114, 101,
                  101, 95, 118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "position_tree_id"
              }
            ]
          }
        },
        {
          "name": "position_pda",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 111, 115, 105, 116, 105, 111, 110, 95, 112, 100, 97, 95,
                  118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "position_pda_key"
              }
            ]
          }
        },
        {
          "name": "position_nullifier_marker_0",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 111, 115, 105, 116, 105, 111, 110, 95, 110, 117, 108,
                  108, 105, 102, 105, 101, 114, 95, 118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "source_mint"
              },
              {
                "kind": "arg",
                "path": "input_nullifier_0"
              }
            ]
          }
        },
        {
          "name": "position_nullifier_marker_1",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 111, 115, 105, 116, 105, 111, 110, 95, 110, 117, 108,
                  108, 105, 102, 105, 101, 114, 95, 118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "source_mint"
              },
              {
                "kind": "arg",
                "path": "input_nullifier_1"
              }
            ]
          }
        },
        {
          "name": "position_vault_record",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 111, 115, 105, 116, 105, 111, 110, 95, 118, 97, 117, 108,
                  116, 95, 118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "source_mint"
              }
            ]
          }
        },
        {
          "name": "position_vault_pda",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 111, 115, 105, 116, 105, 111, 110, 95, 118, 97, 117, 108,
                  116, 95, 116, 111, 107, 101, 110, 95, 118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "source_mint"
              }
            ]
          }
        },
        {
          "name": "position_vault_ata",
          "writable": true
        },
        {
          "name": "sol_config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 99, 111, 110, 102, 105,
                  103, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "dest_mint"
              }
            ]
          }
        },
        {
          "name": "sol_vault",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 118, 97, 117, 108, 116,
                  95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "dest_mint"
              }
            ]
          }
        },
        {
          "name": "sol_tree",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 110, 111, 116, 101, 95,
                  116, 114, 101, 101, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "dest_mint"
              },
              {
                "kind": "arg",
                "path": "sol_tree_id"
              }
            ]
          }
        },
        {
          "name": "executor",
          "docs": [
            "System-owned executor PDA — funds the cosigner and holds the position's MEME ATA for the sell."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 111, 115, 105, 116, 105, 111, 110, 95, 101, 120, 101, 99,
                  117, 116, 111, 114
                ]
              },
              {
                "kind": "arg",
                "path": "source_mint"
              },
              {
                "kind": "arg",
                "path": "dest_mint"
              },
              {
                "kind": "arg",
                "path": "input_nullifier_0"
              },
              {
                "kind": "account",
                "path": "relayer"
              }
            ]
          }
        },
        {
          "name": "executor_source_token",
          "writable": true
        },
        {
          "name": "source_mint_info"
        },
        {
          "name": "claimant",
          "docs": [
            "Ephemeral key committed in the open_position ZK proof via ext_data.claimant.",
            "Must sign to prove ownership — prevents a malicious relayer from closing a",
            "victim's PositionPDA using a proof generated for a different position."
          ],
          "signer": true
        },
        {
          "name": "relayer",
          "writable": true,
          "signer": true
        },
        {
          "name": "swap_program"
        },
        {
          "name": "jupiter_event_authority"
        },
        {
          "name": "token_program",
          "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
        },
        {
          "name": "token_2022_program"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        },
        {
          "name": "associated_token_program",
          "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
        }
      ],
      "args": [
        {
          "name": "position_tree_id",
          "type": "u16"
        },
        {
          "name": "source_mint",
          "type": "pubkey"
        },
        {
          "name": "input_nullifier_0",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "input_nullifier_1",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "sol_tree_id",
          "type": "u16"
        },
        {
          "name": "dest_mint",
          "type": "pubkey"
        },
        {
          "name": "position_pda_key",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "proof",
          "type": {
            "defined": {
              "name": "SwapProof"
            }
          }
        },
        {
          "name": "position_root",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "output_commitment_0",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "output_commitment_1",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "swap_params",
          "type": {
            "defined": {
              "name": "SwapParams"
            }
          }
        },
        {
          "name": "swap_amount",
          "type": "u64"
        },
        {
          "name": "swap_data",
          "type": "bytes"
        },
        {
          "name": "ext_data",
          "type": {
            "defined": {
              "name": "ExtData"
            }
          }
        },
        {
          "name": "note_ciphers",
          "type": {
            "option": {
              "defined": {
                "name": "NoteCiphers"
              }
            }
          }
        }
      ]
    },
    {
      "name": "close_swap_legs",
      "docs": [
        "Reclaim the rent from a staged Jupiter-legs buffer after `open_position`."
      ],
      "discriminator": [47, 54, 73, 179, 147, 102, 49, 222],
      "accounts": [
        {
          "name": "buffer",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  115, 119, 97, 112, 95, 108, 101, 103, 115, 95, 118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "input_nullifier_0"
              }
            ]
          }
        },
        {
          "name": "owner",
          "relations": ["buffer"]
        },
        {
          "name": "relayer",
          "writable": true,
          "signer": true
        }
      ],
      "args": [
        {
          "name": "_input_nullifier_0",
          "type": {
            "array": ["u8", 32]
          }
        }
      ]
    },
    {
      "name": "ephemeral_deposit",
      "docs": [
        "Deposit proceeds from the ephemeral wallet back into the pool, minting fresh private",
        "notes. The ephemeral keypair co-signs (it is the ATA authority)."
      ],
      "discriminator": [24, 126, 203, 241, 127, 217, 109, 91],
      "accounts": [
        {
          "name": "config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 99, 111, 110, 102, 105,
                  103, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "global_config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  103, 108, 111, 98, 97, 108, 95, 99, 111, 110, 102, 105, 103,
                  95, 118, 49
                ]
              }
            ]
          }
        },
        {
          "name": "vault",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 118, 97, 117, 108, 116,
                  95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "input_tree",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 110, 111, 116, 101, 95,
                  116, 114, 101, 101, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "input_tree_id"
              }
            ]
          }
        },
        {
          "name": "output_tree",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 110, 111, 116, 101, 95,
                  116, 114, 101, 101, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "output_tree_id"
              }
            ]
          }
        },
        {
          "name": "nullifiers",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 110, 117, 108, 108, 105,
                  102, 105, 101, 114, 115, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "nullifier_marker_0",
          "docs": [
            "init_if_needed: deposit circuit uses dummy zero nullifiers shared across all deposits."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  110, 117, 108, 108, 105, 102, 105, 101, 114, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "input_nullifier_0"
              }
            ]
          }
        },
        {
          "name": "nullifier_marker_1",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  110, 117, 108, 108, 105, 102, 105, 101, 114, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "input_nullifier_1"
              }
            ]
          }
        },
        {
          "name": "relayer",
          "writable": true,
          "signer": true
        },
        {
          "name": "claimant",
          "docs": [
            "Ephemeral keypair — co-signs as USDC ATA authority. Must match ext_data.claimant."
          ],
          "signer": true
        },
        {
          "name": "prediction_slot",
          "docs": [
            "Per-deposit slot — claimant binding + cumulative reissue audit counter.",
            "in the handler AFTER the ZK proof (mirrors the ephemeral-ATA check) so cheaper",
            "validations and the proof run first."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 101, 100, 105, 99, 116, 105, 111, 110, 95, 115, 108,
                  111, 116, 95, 118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "withdrawal_id"
              }
            ]
          }
        },
        {
          "name": "ephemeral_token_account",
          "docs": ["Ephemeral wallet's USDC ATA — source of proceeds."],
          "writable": true
        },
        {
          "name": "vault_token_account",
          "docs": ["Vault's USDC ATA — destination for swept proceeds."],
          "writable": true
        },
        {
          "name": "relayer_token_account",
          "docs": ["Relayer's ATA for the reissue fee (unused when fee = 0)."],
          "writable": true
        },
        {
          "name": "token_program",
          "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "root",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "input_tree_id",
          "type": "u16"
        },
        {
          "name": "output_tree_id",
          "type": "u16"
        },
        {
          "name": "reissue_amount",
          "type": "u64"
        },
        {
          "name": "ext_data_hash",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "mint_address",
          "type": "pubkey"
        },
        {
          "name": "input_nullifier_0",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "input_nullifier_1",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "output_commitment_0",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "output_commitment_1",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "withdrawal_id",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "deadline",
          "type": "i64"
        },
        {
          "name": "ext_data",
          "type": {
            "defined": {
              "name": "ExtData"
            }
          }
        },
        {
          "name": "proof",
          "type": {
            "defined": {
              "name": "TransactionProof"
            }
          }
        },
        {
          "name": "note_ciphers",
          "type": {
            "option": {
              "defined": {
                "name": "NoteCiphers"
              }
            }
          }
        }
      ]
    },
    {
      "name": "ephemeral_withdraw",
      "docs": [
        "Withdraw private notes to an ephemeral wallet whose key is committed in the proof."
      ],
      "discriminator": [191, 176, 2, 224, 216, 20, 131, 35],
      "accounts": [
        {
          "name": "config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 99, 111, 110, 102, 105,
                  103, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "global_config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  103, 108, 111, 98, 97, 108, 95, 99, 111, 110, 102, 105, 103,
                  95, 118, 49
                ]
              }
            ]
          }
        },
        {
          "name": "vault",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 118, 97, 117, 108, 116,
                  95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "input_tree",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 110, 111, 116, 101, 95,
                  116, 114, 101, 101, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "input_tree_id"
              }
            ]
          }
        },
        {
          "name": "output_tree",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 110, 111, 116, 101, 95,
                  116, 114, 101, 101, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "output_tree_id"
              }
            ]
          }
        },
        {
          "name": "nullifiers",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 110, 117, 108, 108, 105,
                  102, 105, 101, 114, 115, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "nullifier_marker_0",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  110, 117, 108, 108, 105, 102, 105, 101, 114, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "input_nullifier_0"
              }
            ]
          }
        },
        {
          "name": "nullifier_marker_1",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  110, 117, 108, 108, 105, 102, 105, 101, 114, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "input_nullifier_1"
              }
            ]
          }
        },
        {
          "name": "relayer",
          "writable": true,
          "signer": true
        },
        {
          "name": "prediction_slot",
          "docs": [
            "Per-deposit slot — records staked amount + claimant for reissue reconciliation."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 101, 100, 105, 99, 116, 105, 111, 110, 95, 115, 108,
                  111, 116, 95, 118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "withdrawal_id"
              }
            ]
          }
        },
        {
          "name": "vault_token_account",
          "docs": ["Vault's USDC ATA — source of funds."],
          "writable": true
        },
        {
          "name": "ephemeral_wallet",
          "docs": ["Ephemeral wallet — receives the SOL fee funding."],
          "writable": true
        },
        {
          "name": "ephemeral_token_account",
          "docs": [
            "Ephemeral wallet's USDC ATA — receives the USDC deposit.",
            "Must be pre-created by the relayer before this instruction."
          ],
          "writable": true
        },
        {
          "name": "relayer_token_account",
          "docs": ["Relayer's USDC ATA — receives the protocol fee."],
          "writable": true
        },
        {
          "name": "token_program",
          "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "root",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "input_tree_id",
          "type": "u16"
        },
        {
          "name": "output_tree_id",
          "type": "u16"
        },
        {
          "name": "deposit_amount",
          "type": "u64"
        },
        {
          "name": "ext_data_hash",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "mint_address",
          "type": "pubkey"
        },
        {
          "name": "claimant",
          "type": "pubkey"
        },
        {
          "name": "input_nullifier_0",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "input_nullifier_1",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "output_commitment_0",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "output_commitment_1",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "withdrawal_id",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "deadline",
          "type": "i64"
        },
        {
          "name": "ext_data",
          "type": {
            "defined": {
              "name": "ExtData"
            }
          }
        },
        {
          "name": "proof",
          "type": {
            "defined": {
              "name": "TransactionProof"
            }
          }
        },
        {
          "name": "note_ciphers",
          "type": {
            "option": {
              "defined": {
                "name": "NoteCiphers"
              }
            }
          }
        },
        {
          "name": "sol_funding",
          "type": "u64"
        }
      ]
    },
    {
      "name": "fund_native_jperp_open",
      "docs": [
        "ZK-verified USDC withdrawal → executor PDA funded →",
        "`createIncreasePositionMarketRequest` CPI (atomic).",
        "",
        "Fund step for native SOL pool jperp opens.",
        "Must immediately precede `jperp_open_position` in the same transaction."
      ],
      "discriminator": [181, 199, 126, 255, 135, 70, 56, 108],
      "accounts": [
        {
          "name": "vault",
          "docs": ["Source vault (native SOL pool — holds raw lamports)."],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 118, 97, 117, 108, 116,
                  95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "source_config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 99, 111, 110, 102, 105,
                  103, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "executor",
          "docs": [
            "Executor PDA — system-owned, no data; validated by the following jperp_open_position."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  106, 112, 101, 114, 112, 95, 101, 120, 101, 99, 117, 116, 111,
                  114
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "claimant"
              },
              {
                "kind": "arg",
                "path": "withdrawal_id"
              }
            ]
          }
        },
        {
          "name": "executor_wsol_ata",
          "docs": [
            "Executor's WSOL ATA — created here, funded with deposit_amount lamports from vault."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "account",
                "path": "executor"
              },
              {
                "kind": "const",
                "value": [
                  6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206,
                  235, 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140,
                  245, 133, 126, 255, 0, 169
                ]
              },
              {
                "kind": "account",
                "path": "wsol_mint"
              }
            ],
            "program": {
              "kind": "const",
              "value": [
                140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
                13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
                219, 233, 248, 89
              ]
            }
          }
        },
        {
          "name": "wsol_mint",
          "docs": ["WSOL mint (So11111…1112)."],
          "address": "So11111111111111111111111111111111111111112"
        },
        {
          "name": "relayer",
          "writable": true,
          "signer": true
        },
        {
          "name": "instructions_sysvar",
          "address": "Sysvar1nstructions1111111111111111111111111"
        },
        {
          "name": "token_program",
          "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        },
        {
          "name": "associated_token_program",
          "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
        }
      ],
      "args": [
        {
          "name": "mint_address",
          "type": "pubkey"
        },
        {
          "name": "claimant",
          "type": "pubkey"
        },
        {
          "name": "withdrawal_id",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "deposit_amount",
          "type": "u64"
        }
      ]
    },
    {
      "name": "fund_native_open_position",
      "docs": [
        "Pre-fund a native-SOL open_position: debits the SOL vault, credits the executor's WSOL ATA",
        "(`to_executor_native=false`) or native lamports (`true`). Must run as a separate instruction",
        "before open_position (raw lamport move can't share an instruction with a CPI)."
      ],
      "discriminator": [186, 172, 135, 253, 139, 117, 208, 75],
      "accounts": [
        {
          "name": "executor",
          "writable": true
        },
        {
          "name": "executor_source_token",
          "docs": [
            "Executor's WSOL ATA — created and funded for AMM routes (to_executor_native=false)."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "account",
                "path": "executor"
              },
              {
                "kind": "const",
                "value": [
                  6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206,
                  235, 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140,
                  245, 133, 126, 255, 0, 169
                ]
              },
              {
                "kind": "account",
                "path": "source_mint_account"
              }
            ],
            "program": {
              "kind": "const",
              "value": [
                140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
                13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
                219, 233, 248, 89
              ]
            }
          }
        },
        {
          "name": "source_vault",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 118, 97, 117, 108, 116,
                  95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "source_mint"
              }
            ]
          }
        },
        {
          "name": "source_config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 99, 111, 110, 102, 105,
                  103, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "source_mint"
              }
            ]
          }
        },
        {
          "name": "source_mint_account"
        },
        {
          "name": "relayer",
          "writable": true,
          "signer": true
        },
        {
          "name": "instructions_sysvar",
          "address": "Sysvar1nstructions1111111111111111111111111"
        },
        {
          "name": "token_program",
          "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        },
        {
          "name": "associated_token_program",
          "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
        }
      ],
      "args": [
        {
          "name": "source_mint",
          "type": "pubkey"
        },
        {
          "name": "swap_amount",
          "type": "u64"
        },
        {
          "name": "to_executor_native",
          "type": "bool"
        }
      ]
    },
    {
      "name": "fund_native_source",
      "docs": [
        "Option B: Create executor PDA + WSOL ATA and transfer swap_amount from vault.",
        "Must be invoked as the FIRST instruction in an atomic transaction whose SECOND",
        "instruction is `transact_swap`.  Both instructions are sent together so that",
        "failure in `transact_swap` reverts the vault debit atomically.",
        "",
        "Only for native SOL source pools.  SPL-source swaps use `transact_swap` directly."
      ],
      "discriminator": [247, 142, 43, 167, 56, 52, 137, 118],
      "accounts": [
        {
          "name": "executor",
          "docs": [
            "Executor PDA — created here, validated in the following transact_swap instruction."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  115, 119, 97, 112, 95, 101, 120, 101, 99, 117, 116, 111, 114
                ]
              },
              {
                "kind": "arg",
                "path": "source_mint"
              },
              {
                "kind": "arg",
                "path": "dest_mint"
              },
              {
                "kind": "arg",
                "path": "input_nullifier_0"
              },
              {
                "kind": "account",
                "path": "relayer"
              }
            ]
          }
        },
        {
          "name": "executor_source_token",
          "docs": [
            "Executor's WSOL ATA — created here, funded with swap_amount from source vault.",
            "This is executor_source_token for the following transact_swap instruction."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "account",
                "path": "executor"
              },
              {
                "kind": "const",
                "value": [
                  6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206,
                  235, 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140,
                  245, 133, 126, 255, 0, 169
                ]
              },
              {
                "kind": "account",
                "path": "source_mint_account"
              }
            ],
            "program": {
              "kind": "const",
              "value": [
                140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
                13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
                219, 233, 248, 89
              ]
            }
          }
        },
        {
          "name": "source_vault",
          "docs": [
            "Source vault PDA (native SOL pool — program-owned, stores raw lamports)."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 118, 97, 117, 108, 116,
                  95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "source_mint"
              }
            ]
          }
        },
        {
          "name": "source_config",
          "docs": [
            "Source pool config — checked for vault_bump and relayer authorisation."
          ],
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 99, 111, 110, 102, 105,
                  103, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "source_mint"
              }
            ]
          }
        },
        {
          "name": "source_mint_account",
          "docs": [
            "WSOL mint (So111…1112) — required for executor_source_token ATA constraint.",
            "Must equal effective_mint(source_mint), i.e., source_mint must be native SOL."
          ]
        },
        {
          "name": "relayer",
          "docs": [
            "Relayer — pays rent for created accounts, must be whitelisted in source pool."
          ],
          "writable": true,
          "signer": true
        },
        {
          "name": "instructions_sysvar",
          "docs": [
            "with a `transact_swap` call in the same transaction; a standalone call",
            "is rejected."
          ],
          "address": "Sysvar1nstructions1111111111111111111111111"
        },
        {
          "name": "token_program",
          "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        },
        {
          "name": "associated_token_program",
          "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
        }
      ],
      "args": [
        {
          "name": "source_mint",
          "type": "pubkey"
        },
        {
          "name": "dest_mint",
          "type": "pubkey"
        },
        {
          "name": "input_nullifier_0",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "swap_amount",
          "type": "u64"
        }
      ]
    },
    {
      "name": "init_position_pool",
      "docs": [
        "Initialize the cross-mint position pool and first Merkle tree.",
        "Admin-only, called once."
      ],
      "discriminator": [161, 3, 246, 180, 10, 248, 100, 77],
      "accounts": [
        {
          "name": "config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 111, 115, 105, 116, 105, 111, 110, 95, 99, 111, 110, 102,
                  105, 103, 95, 118, 49
                ]
              }
            ]
          }
        },
        {
          "name": "tree",
          "docs": ["Initial position Merkle tree (tree_id = 0)"],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 111, 115, 105, 116, 105, 111, 110, 95, 116, 114, 101,
                  101, 95, 118, 49
                ]
              },
              {
                "kind": "const",
                "value": [0, 0]
              }
            ]
          }
        },
        {
          "name": "global_config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  103, 108, 111, 98, 97, 108, 95, 99, 111, 110, 102, 105, 103,
                  95, 118, 49
                ]
              }
            ]
          }
        },
        {
          "name": "admin",
          "signer": true
        },
        {
          "name": "payer",
          "writable": true,
          "signer": true
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "min_swap_fee",
          "type": "u64"
        },
        {
          "name": "swap_fee_bps",
          "type": "u16"
        }
      ]
    },
    {
      "name": "initialize",
      "discriminator": [175, 175, 109, 31, 13, 152, 155, 237],
      "accounts": [
        {
          "name": "config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 99, 111, 110, 102, 105,
                  103, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "vault",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 118, 97, 117, 108, 116,
                  95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "note_tree",
          "docs": ["Initial tree (tree_id = 0)"],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 110, 111, 116, 101, 95,
                  116, 114, 101, 101, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "const",
                "value": [0, 0]
              }
            ]
          }
        },
        {
          "name": "nullifiers",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 110, 117, 108, 108, 105,
                  102, 105, 101, 114, 115, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "global_config",
          "docs": [
            "Global protocol config — constrains pool creation to the protocol authority.",
            "The `admin` signer must match `global_config.admin`, ensuring only the",
            "protocol authority (or its Squads delegate) can initialize new pools.",
            "Authority can be rotated on-chain via `update_global_config` without a redeploy."
          ],
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  103, 108, 111, 98, 97, 108, 95, 99, 111, 110, 102, 105, 103,
                  95, 118, 49
                ]
              }
            ]
          }
        },
        {
          "name": "admin",
          "docs": [
            "Must equal global_config.admin — enforced by the constraint above."
          ],
          "signer": true
        },
        {
          "name": "payer",
          "docs": [
            "Transaction fee payer (can be anyone, separate from admin authority)"
          ],
          "writable": true,
          "signer": true
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "fee_bps",
          "type": "u16"
        },
        {
          "name": "mint_address",
          "type": "pubkey"
        },
        {
          "name": "min_deposit_amount",
          "type": {
            "option": "u64"
          }
        },
        {
          "name": "max_deposit_amount",
          "type": {
            "option": "u64"
          }
        },
        {
          "name": "min_withdraw_amount",
          "type": {
            "option": "u64"
          }
        },
        {
          "name": "max_withdraw_amount",
          "type": {
            "option": "u64"
          }
        }
      ]
    },
    {
      "name": "initialize_global_config",
      "discriminator": [113, 216, 122, 131, 225, 209, 22, 55],
      "accounts": [
        {
          "name": "global_config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  103, 108, 111, 98, 97, 108, 95, 99, 111, 110, 102, 105, 103,
                  95, 118, 49
                ]
              }
            ]
          }
        },
        {
          "name": "admin",
          "docs": ["When using Squads multisig, this should be the vault PDA."],
          "signer": true
        },
        {
          "name": "payer",
          "docs": [
            "Transaction fee payer (can be anyone, separate from admin authority)"
          ],
          "writable": true,
          "signer": true
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": []
    },
    {
      "name": "jperp_cancel_trigger",
      "docs": [
        "Cancel a pending TP/SL trigger and reclaim its ~0.0051 SOL rent.",
        "",
        "CPIs Jupiter's `closePositionRequest2` on the owner-cancel path (executor",
        "signs as `owner`, keeper slot = program id / None), then sweeps the",
        "refunded rent back to the relayer. Call this for any trigger that will",
        "never fire — see `jupiter_perp::jperp_cancel_trigger` for the full flow."
      ],
      "discriminator": [41, 158, 228, 69, 179, 125, 140, 113],
      "accounts": [
        {
          "name": "config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 99, 111, 110, 102, 105,
                  103, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "jperp_slot",
          "docs": [
            "Per-deposit slot — read to validate the claimant co-signer."
          ],
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  106, 112, 101, 114, 112, 95, 115, 108, 111, 116, 95, 118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "withdrawal_id"
              }
            ]
          }
        },
        {
          "name": "claimant",
          "docs": [
            "Ephemeral claim key — must match jperp_slot.claimant_pubkey.",
            "Co-signing ensures only the position owner can cancel a trigger."
          ],
          "signer": true
        },
        {
          "name": "executor",
          "docs": [
            "Executor PDA — signs the Jupiter `closePositionRequest2` CPI as `owner`.",
            "Must be `mut`: Jupiter refunds the closed request's rent here."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  106, 112, 101, 114, 112, 95, 101, 120, 101, 99, 117, 116, 111,
                  114
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "account",
                "path": "claimant"
              },
              {
                "kind": "arg",
                "path": "withdrawal_id"
              }
            ]
          }
        },
        {
          "name": "executor_token_account",
          "docs": [
            "Executor's collateral ATA = Jupiter's `ownerAta` (receives any request-ATA dust)."
          ],
          "writable": true
        },
        {
          "name": "relayer",
          "writable": true,
          "signer": true
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "mint_address",
          "type": "pubkey"
        },
        {
          "name": "withdrawal_id",
          "type": {
            "array": ["u8", 32]
          }
        }
      ]
    },
    {
      "name": "jperp_close_position",
      "docs": [
        "Create a market close (full or partial) on an open Jupiter Perps position.",
        "",
        "Calls `createDecreasePositionRequest2` with `Market` request type.",
        "Jupiter's keeper executes the close; proceeds arrive at the executor's",
        "receiving ATA and can then be re-minted via `jperp_reissue_notes`.",
        "",
        "See `jupiter_perp::jperp_close_position` for full documentation."
      ],
      "discriminator": [125, 115, 87, 93, 57, 77, 38, 167],
      "accounts": [
        {
          "name": "config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 99, 111, 110, 102, 105,
                  103, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "jperp_slot",
          "docs": [
            "Per-deposit slot — read to validate the claimant co-signer."
          ],
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  106, 112, 101, 114, 112, 95, 115, 108, 111, 116, 95, 118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "withdrawal_id"
              }
            ]
          }
        },
        {
          "name": "claimant",
          "docs": [
            "Ephemeral claim key — must match jperp_slot.claimant_pubkey.",
            "Co-signing ensures only the position owner can close the position."
          ],
          "signer": true
        },
        {
          "name": "executor",
          "docs": [
            "Executor PDA — signs the Jupiter Perps CPI and funds the positionRequest rent.",
            "Must be `mut` + system-owned (see JperpSetTpsl)."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  106, 112, 101, 114, 112, 95, 101, 120, 101, 99, 117, 116, 111,
                  114
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "account",
                "path": "claimant"
              },
              {
                "kind": "arg",
                "path": "withdrawal_id"
              }
            ]
          }
        },
        {
          "name": "executor_token_account",
          "docs": [
            "Executor's receiving ATA — proceeds land here after keeper settles."
          ],
          "writable": true
        },
        {
          "name": "relayer",
          "writable": true,
          "signer": true
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "mint_address",
          "type": "pubkey"
        },
        {
          "name": "withdrawal_id",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "collateral_usd_delta",
          "type": "u64"
        },
        {
          "name": "size_usd_delta",
          "type": "u64"
        },
        {
          "name": "entire_position",
          "type": "bool"
        },
        {
          "name": "price_slippage",
          "type": "u64"
        },
        {
          "name": "counter",
          "type": "u64"
        }
      ]
    },
    {
      "name": "jperp_open_position",
      "docs": [
        "The executor PDA becomes the Jupiter Perps position owner; the user's",
        "wallet never appears on-chain. Jupiter's keeper settles the request.",
        "",
        "See `jupiter_perp::jperp_open_position` for full documentation."
      ],
      "discriminator": [115, 245, 185, 220, 121, 57, 231, 147],
      "accounts": [
        {
          "name": "config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 99, 111, 110, 102, 105,
                  103, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "global_config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  103, 108, 111, 98, 97, 108, 95, 99, 111, 110, 102, 105, 103,
                  95, 118, 49
                ]
              }
            ]
          }
        },
        {
          "name": "vault",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 118, 97, 117, 108, 116,
                  95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "input_tree",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 110, 111, 116, 101, 95,
                  116, 114, 101, 101, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "input_tree_id"
              }
            ]
          }
        },
        {
          "name": "output_tree",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 110, 111, 116, 101, 95,
                  116, 114, 101, 101, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "output_tree_id"
              }
            ]
          }
        },
        {
          "name": "nullifiers",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 110, 117, 108, 108, 105,
                  102, 105, 101, 114, 115, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "nullifier_marker_0",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  110, 117, 108, 108, 105, 102, 105, 101, 114, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "input_nullifier_0"
              }
            ]
          }
        },
        {
          "name": "nullifier_marker_1",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  110, 117, 108, 108, 105, 102, 105, 101, 114, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "input_nullifier_1"
              }
            ]
          }
        },
        {
          "name": "relayer",
          "writable": true,
          "signer": true
        },
        {
          "name": "vault_token_account",
          "docs": [
            "Vault's collateral ATA — source of funds; vault transfers to executor."
          ],
          "writable": true
        },
        {
          "name": "executor",
          "docs": [
            "Executor PDA — signs all Jupiter Perps CPIs as the position owner.",
            "",
            "MUST be a SYSTEM-OWNED PDA (no Anchor data): Jupiter's",
            "`createIncreasePositionMarketRequest` funds the positionRequest rent via",
            "`system_program::transfer(from = executor)`, which Solana rejects if the",
            "source carries data. The handler funds it with SOL before the CPI."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  106, 112, 101, 114, 112, 95, 101, 120, 101, 99, 117, 116, 111,
                  114
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "claimant"
              },
              {
                "kind": "arg",
                "path": "withdrawal_id"
              }
            ]
          }
        },
        {
          "name": "executor_token_account",
          "docs": [
            "Executor's collateral ATA — receives tokens from vault; fundingAccount for Jupiter."
          ],
          "writable": true
        },
        {
          "name": "relayer_token_account",
          "docs": ["Relayer's ATA for the fee payment."],
          "writable": true
        },
        {
          "name": "jperp_slot",
          "docs": [
            "Per-deposit slot — tracks deposited amount and claimant for anti-theft protection."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  106, 112, 101, 114, 112, 95, 115, 108, 111, 116, 95, 118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "withdrawal_id"
              }
            ]
          }
        },
        {
          "name": "token_program",
          "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "root",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "input_tree_id",
          "type": "u16"
        },
        {
          "name": "output_tree_id",
          "type": "u16"
        },
        {
          "name": "deposit_amount",
          "type": "u64"
        },
        {
          "name": "ext_data_hash",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "mint_address",
          "type": "pubkey"
        },
        {
          "name": "claimant",
          "type": "pubkey"
        },
        {
          "name": "input_nullifier_0",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "input_nullifier_1",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "output_commitment_0",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "output_commitment_1",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "withdrawal_id",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "deadline",
          "type": "i64"
        },
        {
          "name": "ext_data",
          "type": {
            "defined": {
              "name": "ExtData"
            }
          }
        },
        {
          "name": "proof",
          "type": {
            "defined": {
              "name": "TransactionProof"
            }
          }
        },
        {
          "name": "note_ciphers",
          "type": {
            "option": {
              "defined": {
                "name": "NoteCiphers"
              }
            }
          }
        },
        {
          "name": "size_usd_delta",
          "type": "u64"
        },
        {
          "name": "collateral_token_delta",
          "type": "u64"
        },
        {
          "name": "side",
          "type": "u8"
        },
        {
          "name": "price_slippage",
          "type": "u64"
        },
        {
          "name": "counter",
          "type": "u64"
        }
      ]
    },
    {
      "name": "jperp_recover_native",
      "docs": [
        "Recover collateral stranded in the executor by a keeper-cancelled native-SOL open,",
        "backing the user's note directly from the executor's lamports (zero relayer float).",
        "See `jupiter_perp::jperp_recover_native`."
      ],
      "discriminator": [243, 248, 23, 137, 78, 209, 56, 239],
      "accounts": [
        {
          "name": "config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 99, 111, 110, 102, 105,
                  103, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "global_config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  103, 108, 111, 98, 97, 108, 95, 99, 111, 110, 102, 105, 103,
                  95, 118, 49
                ]
              }
            ]
          }
        },
        {
          "name": "vault",
          "docs": [
            "Native-SOL vault — destination for the recovered collateral (mut: receives lamports)."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 118, 97, 117, 108, 116,
                  95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "input_tree",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 110, 111, 116, 101, 95,
                  116, 114, 101, 101, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "input_tree_id"
              }
            ]
          }
        },
        {
          "name": "output_tree",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 110, 111, 116, 101, 95,
                  116, 114, 101, 101, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "output_tree_id"
              }
            ]
          }
        },
        {
          "name": "nullifiers",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 110, 117, 108, 108, 105,
                  102, 105, 101, 114, 115, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "nullifier_marker_0",
          "docs": [
            "init_if_needed: deposit circuit reuses dummy zero-value witnesses (mirrors reissue)."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  110, 117, 108, 108, 105, 102, 105, 101, 114, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "input_nullifier_0"
              }
            ]
          }
        },
        {
          "name": "nullifier_marker_1",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  110, 117, 108, 108, 105, 102, 105, 101, 114, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "input_nullifier_1"
              }
            ]
          }
        },
        {
          "name": "relayer",
          "writable": true,
          "signer": true
        },
        {
          "name": "jperp_slot",
          "docs": [
            "Per-deposit slot — checked for the claimant co-signer; reissued counter bumped."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  106, 112, 101, 114, 112, 95, 115, 108, 111, 116, 95, 118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "withdrawal_id"
              }
            ]
          }
        },
        {
          "name": "claimant",
          "docs": [
            "Ephemeral claim key — must match jperp_slot.claimant_pubkey (anti-theft)."
          ],
          "signer": true
        },
        {
          "name": "executor",
          "docs": [
            "Executor PDA — system-owned; signs the `executor → vault` transfer and the rent sweep.",
            "`mut` so its lamports can be moved."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  106, 112, 101, 114, 112, 95, 101, 120, 101, 99, 117, 116, 111,
                  114
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "account",
                "path": "claimant"
              },
              {
                "kind": "arg",
                "path": "withdrawal_id"
              }
            ]
          }
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "root",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "input_tree_id",
          "type": "u16"
        },
        {
          "name": "output_tree_id",
          "type": "u16"
        },
        {
          "name": "recover_amount",
          "type": "u64"
        },
        {
          "name": "ext_data_hash",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "mint_address",
          "type": "pubkey"
        },
        {
          "name": "input_nullifier_0",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "input_nullifier_1",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "output_commitment_0",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "output_commitment_1",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "withdrawal_id",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "deadline",
          "type": "i64"
        },
        {
          "name": "ext_data",
          "type": {
            "defined": {
              "name": "ExtData"
            }
          }
        },
        {
          "name": "proof",
          "type": {
            "defined": {
              "name": "TransactionProof"
            }
          }
        },
        {
          "name": "note_ciphers",
          "type": {
            "option": {
              "defined": {
                "name": "NoteCiphers"
              }
            }
          }
        }
      ]
    },
    {
      "name": "jperp_reissue_notes",
      "docs": [
        "Transfer settled proceeds from executor ATA → vault, then ZK-deposit",
        "to re-mint private notes.",
        "",
        "The claimant (ephemeral key from the original deposit) must co-sign to",
        "prevent relayer theft. Supports partial reissues across multiple calls;",
        "reissued totals may exceed the original deposit when the position profits,",
        "since each reissue is backed by real USDC moved into the vault.",
        "",
        "See `jupiter_perp::jperp_reissue_notes` for full documentation."
      ],
      "discriminator": [204, 117, 42, 141, 93, 221, 1, 11],
      "accounts": [
        {
          "name": "config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 99, 111, 110, 102, 105,
                  103, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "global_config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  103, 108, 111, 98, 97, 108, 95, 99, 111, 110, 102, 105, 103,
                  95, 118, 49
                ]
              }
            ]
          }
        },
        {
          "name": "vault",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 118, 97, 117, 108, 116,
                  95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "input_tree",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 110, 111, 116, 101, 95,
                  116, 114, 101, 101, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "input_tree_id"
              }
            ]
          }
        },
        {
          "name": "output_tree",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 110, 111, 116, 101, 95,
                  116, 114, 101, 101, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "output_tree_id"
              }
            ]
          }
        },
        {
          "name": "nullifiers",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 110, 117, 108, 108, 105,
                  102, 105, 101, 114, 115, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "nullifier_marker_0",
          "docs": [
            "init_if_needed: deposit circuit reuses dummy zero-value witnesses."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  110, 117, 108, 108, 105, 102, 105, 101, 114, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "input_nullifier_0"
              }
            ]
          }
        },
        {
          "name": "nullifier_marker_1",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  110, 117, 108, 108, 105, 102, 105, 101, 114, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "input_nullifier_1"
              }
            ]
          }
        },
        {
          "name": "relayer",
          "writable": true,
          "signer": true
        },
        {
          "name": "jperp_slot",
          "docs": [
            "Per-deposit slot — checked for claimant + slot cap enforcement."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  106, 112, 101, 114, 112, 95, 115, 108, 111, 116, 95, 118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "withdrawal_id"
              }
            ]
          }
        },
        {
          "name": "claimant",
          "docs": [
            "Ephemeral claim key — must match jperp_slot.claimant_pubkey."
          ],
          "signer": true
        },
        {
          "name": "executor",
          "docs": [
            "Executor PDA — authority on the executor_token_account.",
            "`mut` so its residual SOL can be swept back to the relayer at the end of the reissue."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  106, 112, 101, 114, 112, 95, 101, 120, 101, 99, 117, 116, 111,
                  114
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "account",
                "path": "claimant"
              },
              {
                "kind": "arg",
                "path": "withdrawal_id"
              }
            ]
          }
        },
        {
          "name": "executor_token_account",
          "docs": [
            "Executor's collateral ATA — source of settled USDC proceeds."
          ],
          "writable": true
        },
        {
          "name": "vault_token_account",
          "docs": ["Vault's collateral ATA — destination for reissued tokens."],
          "writable": true
        },
        {
          "name": "relayer_token_account",
          "docs": [
            "Relayer's ATA for the reissue fee (SPL pools only; unused when fee = 0)."
          ],
          "writable": true
        },
        {
          "name": "token_program",
          "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "root",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "input_tree_id",
          "type": "u16"
        },
        {
          "name": "output_tree_id",
          "type": "u16"
        },
        {
          "name": "reissue_amount",
          "type": "u64"
        },
        {
          "name": "ext_data_hash",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "mint_address",
          "type": "pubkey"
        },
        {
          "name": "input_nullifier_0",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "input_nullifier_1",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "output_commitment_0",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "output_commitment_1",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "withdrawal_id",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "deadline",
          "type": "i64"
        },
        {
          "name": "ext_data",
          "type": {
            "defined": {
              "name": "ExtData"
            }
          }
        },
        {
          "name": "proof",
          "type": {
            "defined": {
              "name": "TransactionProof"
            }
          }
        },
        {
          "name": "note_ciphers",
          "type": {
            "option": {
              "defined": {
                "name": "NoteCiphers"
              }
            }
          }
        }
      ]
    },
    {
      "name": "jperp_set_tpsl",
      "docs": [
        "Create a TP or SL trigger on an open Jupiter Perps position.",
        "",
        "Calls `createDecreasePositionRequest2` with `Trigger` request type.",
        "Multiple triggers can coexist by using different `counter` values.",
        "",
        "See `jupiter_perp::jperp_set_tpsl` for full documentation."
      ],
      "discriminator": [177, 53, 238, 176, 9, 61, 4, 154],
      "accounts": [
        {
          "name": "config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 99, 111, 110, 102, 105,
                  103, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "jperp_slot",
          "docs": [
            "Per-deposit slot — read to validate the claimant co-signer."
          ],
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  106, 112, 101, 114, 112, 95, 115, 108, 111, 116, 95, 118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "withdrawal_id"
              }
            ]
          }
        },
        {
          "name": "claimant",
          "docs": [
            "Ephemeral claim key — must match jperp_slot.claimant_pubkey.",
            "Co-signing ensures only the position owner can set TP/SL."
          ],
          "signer": true
        },
        {
          "name": "executor",
          "docs": [
            "Executor PDA — signs the Jupiter Perps CPI and funds the positionRequest rent.",
            "Must be `mut` + system-owned: Jupiter funds the new positionRequest via",
            "`system_program::transfer(from = executor)`. The handler tops it up with SOL."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  106, 112, 101, 114, 112, 95, 101, 120, 101, 99, 117, 116, 111,
                  114
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "account",
                "path": "claimant"
              },
              {
                "kind": "arg",
                "path": "withdrawal_id"
              }
            ]
          }
        },
        {
          "name": "executor_token_account",
          "docs": [
            "Executor's receiving ATA for close proceeds (desiredMint = collateral token)."
          ],
          "writable": true
        },
        {
          "name": "relayer",
          "writable": true,
          "signer": true
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "mint_address",
          "type": "pubkey"
        },
        {
          "name": "withdrawal_id",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "collateral_usd_delta",
          "type": "u64"
        },
        {
          "name": "size_usd_delta",
          "type": "u64"
        },
        {
          "name": "trigger_price",
          "type": "u64"
        },
        {
          "name": "trigger_above_threshold",
          "type": "bool"
        },
        {
          "name": "entire_position",
          "type": "bool"
        },
        {
          "name": "counter",
          "type": "u64"
        }
      ]
    },
    {
      "name": "jperp_update_tpsl",
      "docs": [
        "Update the trigger price or size on a pending TP/SL request.",
        "",
        "Calls `updateDecreasePositionRequest2`. The positionRequest PDA to update",
        "must be passed as remaining_accounts[4].",
        "",
        "See `jupiter_perp::jperp_update_tpsl` for full documentation."
      ],
      "discriminator": [49, 52, 46, 218, 112, 121, 89, 239],
      "accounts": [
        {
          "name": "config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 99, 111, 110, 102, 105,
                  103, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "jperp_slot",
          "docs": [
            "Per-deposit slot — read to validate the claimant co-signer."
          ],
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  106, 112, 101, 114, 112, 95, 115, 108, 111, 116, 95, 118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "withdrawal_id"
              }
            ]
          }
        },
        {
          "name": "claimant",
          "docs": [
            "Ephemeral claim key — must match jperp_slot.claimant_pubkey.",
            "Co-signing ensures only the position owner can update TP/SL."
          ],
          "signer": true
        },
        {
          "name": "executor",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  106, 112, 101, 114, 112, 95, 101, 120, 101, 99, 117, 116, 111,
                  114
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "account",
                "path": "claimant"
              },
              {
                "kind": "arg",
                "path": "withdrawal_id"
              }
            ]
          }
        },
        {
          "name": "relayer",
          "writable": true,
          "signer": true
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "mint_address",
          "type": "pubkey"
        },
        {
          "name": "withdrawal_id",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "size_usd_delta",
          "type": "u64"
        },
        {
          "name": "trigger_price",
          "type": "u64"
        }
      ]
    },
    {
      "name": "merge_positions",
      "docs": [
        "Merge two position notes of the same mint into one.",
        "",
        "Uses the existing transaction circuit (publicAmount=0): both inputs are real",
        "position notes; output[0] is the merged note (sum of amounts); output[1] is",
        "the zero change note. No vault token movement — only Merkle tree updates."
      ],
      "discriminator": [115, 76, 72, 172, 120, 248, 70, 208],
      "accounts": [
        {
          "name": "position_config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 111, 115, 105, 116, 105, 111, 110, 95, 99, 111, 110, 102,
                  105, 103, 95, 118, 49
                ]
              }
            ]
          }
        },
        {
          "name": "input_tree",
          "docs": ["Input tree — validated against the provided position_root"],
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 111, 115, 105, 116, 105, 111, 110, 95, 116, 114, 101,
                  101, 95, 118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "input_tree_id"
              }
            ]
          }
        },
        {
          "name": "output_tree",
          "docs": ["Output tree — receives both merged output commitments"],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 111, 115, 105, 116, 105, 111, 110, 95, 116, 114, 101,
                  101, 95, 118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "output_tree_id"
              }
            ]
          }
        },
        {
          "name": "position_pda_0",
          "docs": ["First input PositionPDA — closed at end, rent → relayer."],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 111, 115, 105, 116, 105, 111, 110, 95, 112, 100, 97, 95,
                  118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "position_pda_key_0"
              }
            ]
          }
        },
        {
          "name": "position_pda_1",
          "docs": [
            "Second input PositionPDA — closed at end, rent → relayer.",
            "has_one = claimant: both input positions are owned by the co-signing claimant."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 111, 115, 105, 116, 105, 111, 110, 95, 112, 100, 97, 95,
                  118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "position_pda_key_1"
              }
            ]
          }
        },
        {
          "name": "new_position_pda",
          "docs": ["Merged output PositionPDA — created here"],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 111, 115, 105, 116, 105, 111, 110, 95, 112, 100, 97, 95,
                  118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "new_position_pda_key"
              }
            ]
          }
        },
        {
          "name": "position_nullifier_marker_0",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 111, 115, 105, 116, 105, 111, 110, 95, 110, 117, 108,
                  108, 105, 102, 105, 101, 114, 95, 118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "mint"
              },
              {
                "kind": "arg",
                "path": "input_nullifier_0"
              }
            ]
          }
        },
        {
          "name": "position_nullifier_marker_1",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 111, 115, 105, 116, 105, 111, 110, 95, 110, 117, 108,
                  108, 105, 102, 105, 101, 114, 95, 118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "mint"
              },
              {
                "kind": "arg",
                "path": "input_nullifier_1"
              }
            ]
          }
        },
        {
          "name": "position_vault_record",
          "docs": [
            "Per-mint vault record — position_count decremented by net 1"
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 111, 115, 105, 116, 105, 111, 110, 95, 118, 97, 117, 108,
                  116, 95, 118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "mint"
              }
            ]
          }
        },
        {
          "name": "claimant",
          "docs": [
            "Must co-sign to prove ownership of both input PositionPDAs."
          ],
          "signer": true,
          "relations": ["position_pda_0", "position_pda_1"]
        },
        {
          "name": "relayer",
          "writable": true,
          "signer": true
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "input_tree_id",
          "type": "u16"
        },
        {
          "name": "mint",
          "type": "pubkey"
        },
        {
          "name": "input_nullifier_0",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "input_nullifier_1",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "output_tree_id",
          "type": "u16"
        },
        {
          "name": "position_pda_key_0",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "position_pda_key_1",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "new_position_pda_key",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "proof",
          "type": {
            "defined": {
              "name": "TransactionProof"
            }
          }
        },
        {
          "name": "position_root",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "output_commitment_0",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "output_commitment_1",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "ext_data",
          "type": {
            "defined": {
              "name": "ExtData"
            }
          }
        },
        {
          "name": "merged_amount",
          "type": "u64"
        }
      ]
    },
    {
      "name": "open_position",
      "docs": [
        "Open a private stock/meme position.",
        "Spends USDC notes from the source pool, swaps USDC → stock via Jupiter,",
        "deposits stock into a per-mint position vault, inserts position note into",
        "the position Merkle tree, and creates a PositionPDA recoverable from the",
        "user's wallet key."
      ],
      "discriminator": [135, 128, 47, 77, 15, 152, 240, 49],
      "accounts": [
        {
          "name": "source_config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 99, 111, 110, 102, 105,
                  103, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "source_mint"
              }
            ]
          }
        },
        {
          "name": "global_config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  103, 108, 111, 98, 97, 108, 95, 99, 111, 110, 102, 105, 103,
                  95, 118, 49
                ]
              }
            ]
          }
        },
        {
          "name": "source_vault",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 118, 97, 117, 108, 116,
                  95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "source_mint"
              }
            ]
          }
        },
        {
          "name": "source_tree",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 110, 111, 116, 101, 95,
                  116, 114, 101, 101, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "source_mint"
              },
              {
                "kind": "arg",
                "path": "source_tree_id"
              }
            ]
          }
        },
        {
          "name": "source_nullifiers",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 110, 117, 108, 108, 105,
                  102, 105, 101, 114, 115, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "source_mint"
              }
            ]
          }
        },
        {
          "name": "source_nullifier_marker_0",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  110, 117, 108, 108, 105, 102, 105, 101, 114, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "source_mint"
              },
              {
                "kind": "arg",
                "path": "input_nullifier_0"
              }
            ]
          }
        },
        {
          "name": "source_nullifier_marker_1",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  110, 117, 108, 108, 105, 102, 105, 101, 114, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "source_mint"
              },
              {
                "kind": "arg",
                "path": "input_nullifier_1"
              }
            ]
          }
        },
        {
          "name": "source_vault_token_account",
          "writable": true
        },
        {
          "name": "source_mint_account",
          "docs": ["Source mint account (USDC) — for executor ATA creation"]
        },
        {
          "name": "position_config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 111, 115, 105, 116, 105, 111, 110, 95, 99, 111, 110, 102,
                  105, 103, 95, 118, 49
                ]
              }
            ]
          }
        },
        {
          "name": "position_tree",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 111, 115, 105, 116, 105, 111, 110, 95, 116, 114, 101,
                  101, 95, 118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "position_tree_id"
              }
            ]
          }
        },
        {
          "name": "position_vault_record",
          "docs": [
            "Per-mint vault record — lazy-created on first deposit of this mint"
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 111, 115, 105, 116, 105, 111, 110, 95, 118, 97, 117, 108,
                  116, 95, 118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "dest_mint"
              }
            ]
          }
        },
        {
          "name": "position_vault_pda",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 111, 115, 105, 116, 105, 111, 110, 95, 118, 97, 117, 108,
                  116, 95, 116, 111, 107, 101, 110, 95, 118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "dest_mint"
              }
            ]
          }
        },
        {
          "name": "position_vault_ata",
          "writable": true
        },
        {
          "name": "position_pda",
          "docs": ["Per-position PDA keyed by poseidon(position_secret_n)"],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 111, 115, 105, 116, 105, 111, 110, 95, 112, 100, 97, 95,
                  118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "position_pda_key"
              }
            ]
          }
        },
        {
          "name": "executor",
          "docs": [
            "System-owned executor PDA — signs swap CPIs and holds native SOL for DEX protocol fees",
            "(e.g. Pump.fun pays its fee via system transfer from the signer, which a data-carrying",
            "account is forbidden to do). Carries no Anchor data; validated by seeds only."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 111, 115, 105, 116, 105, 111, 110, 95, 101, 120, 101, 99,
                  117, 116, 111, 114
                ]
              },
              {
                "kind": "arg",
                "path": "source_mint"
              },
              {
                "kind": "arg",
                "path": "dest_mint"
              },
              {
                "kind": "arg",
                "path": "input_nullifier_0"
              },
              {
                "kind": "account",
                "path": "relayer"
              }
            ]
          }
        },
        {
          "name": "executor_source_token",
          "docs": ["Executor's source token ATA (USDC — always legacy SPL)"],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "account",
                "path": "executor"
              },
              {
                "kind": "const",
                "value": [
                  6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206,
                  235, 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140,
                  245, 133, 126, 255, 0, 169
                ]
              },
              {
                "kind": "account",
                "path": "source_mint_account"
              }
            ],
            "program": {
              "kind": "const",
              "value": [
                140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
                13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
                219, 233, 248, 89
              ]
            }
          }
        },
        {
          "name": "executor_dest_token",
          "writable": true
        },
        {
          "name": "dest_mint_info"
        },
        {
          "name": "relayer",
          "writable": true,
          "signer": true
        },
        {
          "name": "relayer_dest_token",
          "writable": true
        },
        {
          "name": "swap_program"
        },
        {
          "name": "jupiter_event_authority"
        },
        {
          "name": "token_program",
          "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
        },
        {
          "name": "token_2022_program"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        },
        {
          "name": "associated_token_program",
          "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
        }
      ],
      "args": [
        {
          "name": "source_tree_id",
          "type": "u16"
        },
        {
          "name": "source_mint",
          "type": "pubkey"
        },
        {
          "name": "input_nullifier_0",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "input_nullifier_1",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "position_tree_id",
          "type": "u16"
        },
        {
          "name": "dest_mint",
          "type": "pubkey"
        },
        {
          "name": "position_pda_key",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "proof",
          "type": {
            "defined": {
              "name": "SwapProof"
            }
          }
        },
        {
          "name": "source_root",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "output_commitment_0",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "output_commitment_1",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "swap_params",
          "type": {
            "defined": {
              "name": "SwapParams"
            }
          }
        },
        {
          "name": "swap_amount",
          "type": "u64"
        },
        {
          "name": "swap_data",
          "type": "bytes"
        },
        {
          "name": "ext_data",
          "type": {
            "defined": {
              "name": "ExtData"
            }
          }
        },
        {
          "name": "note_ciphers",
          "type": {
            "option": {
              "defined": {
                "name": "NoteCiphers"
              }
            }
          }
        }
      ]
    },
    {
      "name": "phoenix_cancel_conditional_order",
      "docs": [
        "**Cancel a conditional order from the collection by slot index.**",
        "",
        "`conditional_order_index`: 1–191, the slot index assigned at placement.",
        "`disable_first`: cancel the SL (lessTrigger) leg.",
        "`disable_second`: cancel the TP (greaterTrigger) leg.",
        "",
        "See `phoenix::phoenix_cancel_conditional_order` for full documentation."
      ],
      "discriminator": [177, 46, 151, 9, 129, 216, 125, 240],
      "accounts": [
        {
          "name": "config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 99, 111, 110, 102, 105,
                  103, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "executor",
          "docs": [
            "Executor PDA — signs as traderWallet (readonly signer) in the Phoenix CPI."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 104, 111, 101, 110, 105, 120, 95, 101, 120, 101, 99, 117,
                  116, 111, 114
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "claimant"
              }
            ]
          }
        },
        {
          "name": "relayer",
          "writable": true,
          "signer": true
        },
        {
          "name": "claimant_signer",
          "docs": [
            "Ephemeral claim key must co-sign so only the depositor can drive their executor."
          ],
          "signer": true
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "mint_address",
          "type": "pubkey"
        },
        {
          "name": "claimant",
          "type": "pubkey"
        },
        {
          "name": "conditional_order_index",
          "type": "u8"
        },
        {
          "name": "disable_first",
          "type": "bool"
        },
        {
          "name": "disable_second",
          "type": "bool"
        }
      ]
    },
    {
      "name": "phoenix_cancel_orders",
      "docs": [
        "Cancel all open orders for the vault's Phoenix trader account.",
        "",
        "See `phoenix::phoenix_cancel_orders` for full documentation."
      ],
      "discriminator": [29, 144, 12, 190, 214, 75, 0, 42],
      "accounts": [
        {
          "name": "config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 99, 111, 110, 102, 105,
                  103, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "executor",
          "docs": ["Executor PDA — signs the Phoenix CPI."],
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 104, 111, 101, 110, 105, 120, 95, 101, 120, 101, 99, 117,
                  116, 111, 114
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "claimant"
              }
            ]
          }
        },
        {
          "name": "relayer",
          "writable": true,
          "signer": true
        },
        {
          "name": "claimant_signer",
          "docs": [
            "Ephemeral claim key must co-sign so only the depositor can drive their executor."
          ],
          "signer": true
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "mint_address",
          "type": "pubkey"
        },
        {
          "name": "claimant",
          "type": "pubkey"
        }
      ]
    },
    {
      "name": "phoenix_cancel_orders_by_id",
      "docs": [
        "**Cancel specific resting Phoenix orders by their FIFO order IDs.**",
        "",
        "`price_in_ticks` and `sequence_numbers` must have the same length (1..=100).",
        "Each pair `(price_in_ticks[i], sequence_numbers[i])` identifies a resting order.",
        "",
        "See `phoenix::phoenix_cancel_orders_by_id` for full documentation."
      ],
      "discriminator": [131, 221, 237, 139, 89, 212, 18, 185],
      "accounts": [
        {
          "name": "config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 99, 111, 110, 102, 105,
                  103, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "executor",
          "docs": ["Executor PDA — signs the Phoenix CPI."],
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 104, 111, 101, 110, 105, 120, 95, 101, 120, 101, 99, 117,
                  116, 111, 114
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "claimant"
              }
            ]
          }
        },
        {
          "name": "relayer",
          "writable": true,
          "signer": true
        },
        {
          "name": "claimant_signer",
          "docs": [
            "Ephemeral claim key must co-sign so only the depositor can drive their executor."
          ],
          "signer": true
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "mint_address",
          "type": "pubkey"
        },
        {
          "name": "claimant",
          "type": "pubkey"
        },
        {
          "name": "price_in_ticks",
          "type": {
            "vec": "u64"
          }
        },
        {
          "name": "sequence_numbers",
          "type": {
            "vec": "u64"
          }
        }
      ]
    },
    {
      "name": "phoenix_close_position",
      "docs": [
        "**Place a market close/reduce order — risk management before withdrawal.**",
        "",
        "Must be called before `phoenix_queue_withdraw` if an open position",
        "consumes more margin than the free `traderQuoteLotCollateral`. Only",
        "`place_market_order` data is accepted (immediate execution).",
        "",
        "See `phoenix::phoenix_close_position` for full documentation."
      ],
      "discriminator": [99, 164, 145, 20, 22, 209, 77, 82],
      "accounts": [
        {
          "name": "config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 99, 111, 110, 102, 105,
                  103, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "executor",
          "docs": ["Executor PDA — signs the Phoenix CPI."],
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 104, 111, 101, 110, 105, 120, 95, 101, 120, 101, 99, 117,
                  116, 111, 114
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "claimant"
              }
            ]
          }
        },
        {
          "name": "relayer",
          "writable": true,
          "signer": true
        },
        {
          "name": "claimant_signer",
          "docs": [
            "Ephemeral claim key must co-sign so only the depositor can drive their executor."
          ],
          "signer": true
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "mint_address",
          "type": "pubkey"
        },
        {
          "name": "claimant",
          "type": "pubkey"
        },
        {
          "name": "order_data",
          "type": "bytes"
        }
      ]
    },
    {
      "name": "phoenix_create_conditional_orders_account",
      "docs": [
        "**Initialize the conditional-orders collection account for the executor PDA.**",
        "",
        "Must be called once (idempotent) before using `phoenix_place_position_conditional_order`.",
        "`capacity`: maximum concurrent conditional orders (default: 8).",
        "",
        "See `phoenix::phoenix_create_conditional_orders_account` for full documentation."
      ],
      "discriminator": [59, 199, 15, 105, 155, 208, 27, 203],
      "accounts": [
        {
          "name": "config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 99, 111, 110, 102, 105,
                  103, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "executor",
          "docs": [
            "Executor PDA — identified as traderWallet in the Phoenix CPI (non-signer for account creation)."
          ],
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 104, 111, 101, 110, 105, 120, 95, 101, 120, 101, 99, 117,
                  116, 111, 114
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "claimant"
              }
            ]
          }
        },
        {
          "name": "relayer",
          "writable": true,
          "signer": true
        },
        {
          "name": "claimant_signer",
          "docs": [
            "Ephemeral claim key must co-sign so only the depositor can drive their executor."
          ],
          "signer": true
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "mint_address",
          "type": "pubkey"
        },
        {
          "name": "claimant",
          "type": "pubkey"
        },
        {
          "name": "capacity",
          "type": "u8"
        }
      ]
    },
    {
      "name": "phoenix_deposit_from_pool",
      "docs": [
        "ZK-verified USDC withdrawal from pool → Phoenix Eternal `depositFunds` CPI.",
        "",
        "Atomically burns private USDC notes and deposits the amount into the",
        "executor's Phoenix Eternal perpetual trading account. Output change notes",
        "are inserted into the Merkle tree in the same transaction.",
        "",
        "`ext_data.recipient` **must** equal the executor PDA (enforced on-chain and",
        "committed in the ZK proof).",
        "",
        "See `phoenix::phoenix_deposit_from_pool` for full documentation."
      ],
      "discriminator": [81, 22, 78, 77, 17, 190, 208, 143],
      "accounts": [
        {
          "name": "config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 99, 111, 110, 102, 105,
                  103, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "global_config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  103, 108, 111, 98, 97, 108, 95, 99, 111, 110, 102, 105, 103,
                  95, 118, 49
                ]
              }
            ]
          }
        },
        {
          "name": "vault",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 118, 97, 117, 108, 116,
                  95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "input_tree",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 110, 111, 116, 101, 95,
                  116, 114, 101, 101, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "input_tree_id"
              }
            ]
          }
        },
        {
          "name": "output_tree",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 110, 111, 116, 101, 95,
                  116, 114, 101, 101, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "output_tree_id"
              }
            ]
          }
        },
        {
          "name": "nullifiers",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 110, 117, 108, 108, 105,
                  102, 105, 101, 114, 115, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "nullifier_marker_0",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  110, 117, 108, 108, 105, 102, 105, 101, 114, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "input_nullifier_0"
              }
            ]
          }
        },
        {
          "name": "nullifier_marker_1",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  110, 117, 108, 108, 105, 102, 105, 101, 114, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "input_nullifier_1"
              }
            ]
          }
        },
        {
          "name": "relayer",
          "writable": true,
          "signer": true
        },
        {
          "name": "vault_token_account",
          "docs": [
            "Vault's USDC ATA — source of funds; vault SPL-transfers to executor first."
          ],
          "writable": true
        },
        {
          "name": "executor",
          "docs": [
            "Executor PDA — signs all EMBER and Phoenix CPIs on behalf of the pool."
          ],
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 104, 111, 101, 110, 105, 120, 95, 101, 120, 101, 99, 117,
                  116, 111, 114
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "claimant"
              }
            ]
          }
        },
        {
          "name": "executor_token_account",
          "docs": [
            "Executor's USDC ATA — receives USDC from vault; EMBER pulls from here."
          ],
          "writable": true
        },
        {
          "name": "relayer_token_account",
          "docs": ["Relayer's USDC ATA — receives the relayer fee."],
          "writable": true
        },
        {
          "name": "phoenix_slot",
          "docs": [
            "Per-deposit slot — created here and consumed across the exit flow.",
            "Caps per-user withdrawals and records the claim key for anti-theft protection."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 104, 111, 101, 110, 105, 120, 95, 115, 108, 111, 116, 95,
                  118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "claimant"
              },
              {
                "kind": "arg",
                "path": "withdrawal_id"
              }
            ]
          }
        },
        {
          "name": "token_program",
          "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "root",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "input_tree_id",
          "type": "u16"
        },
        {
          "name": "output_tree_id",
          "type": "u16"
        },
        {
          "name": "deposit_amount",
          "type": "u64"
        },
        {
          "name": "ext_data_hash",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "mint_address",
          "type": "pubkey"
        },
        {
          "name": "claimant",
          "type": "pubkey"
        },
        {
          "name": "input_nullifier_0",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "input_nullifier_1",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "output_commitment_0",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "output_commitment_1",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "withdrawal_id",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "deadline",
          "type": "i64"
        },
        {
          "name": "ext_data",
          "type": {
            "defined": {
              "name": "ExtData"
            }
          }
        },
        {
          "name": "proof",
          "type": {
            "defined": {
              "name": "TransactionProof"
            }
          }
        },
        {
          "name": "note_ciphers",
          "type": {
            "option": {
              "defined": {
                "name": "NoteCiphers"
              }
            }
          }
        }
      ]
    },
    {
      "name": "phoenix_ember_unwrap",
      "docs": [
        "**Crank withdraw queue + convert vault's PhUSD back to USDC via EMBER (step 2 of exit flow).**",
        "",
        "Atomically cranks Phoenix's `consumeWithdrawQueue` (flushes PhUSD to executor ATA),",
        "then calls EMBER `withdraw` to burn PhUSD and return USDC to the vault.",
        "",
        "See `phoenix::phoenix_ember_unwrap` for full documentation."
      ],
      "discriminator": [43, 81, 122, 205, 123, 195, 148, 73],
      "accounts": [
        {
          "name": "config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 99, 111, 110, 102, 105,
                  103, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "vault",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 118, 97, 117, 108, 116,
                  95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "executor",
          "docs": [
            "Executor PDA — signs the EMBER withdraw CPI and the USDC transfer to vault."
          ],
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 104, 111, 101, 110, 105, 120, 95, 101, 120, 101, 99, 117,
                  116, 111, 114
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "claimant"
              }
            ]
          }
        },
        {
          "name": "executor_ph_usd_ata",
          "docs": ["Executor's PhUSD ATA — source of PhUSD to burn via EMBER."],
          "writable": true
        },
        {
          "name": "executor_token_account",
          "docs": [
            "Executor's USDC ATA — receives USDC from EMBER, then sends to vault."
          ],
          "writable": true
        },
        {
          "name": "vault_token_account",
          "docs": [
            "Vault's USDC ATA — final destination for USDC returned from Phoenix."
          ],
          "writable": true
        },
        {
          "name": "relayer",
          "writable": true,
          "signer": true
        },
        {
          "name": "pending_reissue",
          "docs": [
            "Per-exit escrow — accumulates USDC amount returned from Phoenix so",
            "`phoenix_reissue_notes` can verify and consume exactly that amount.",
            "Seeds include `withdrawal_id` to isolate concurrent exits per user."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 104, 111, 101, 110, 105, 120, 95, 112, 101, 110, 100,
                  105, 110, 103, 95, 118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "claimant"
              },
              {
                "kind": "arg",
                "path": "withdrawal_id"
              }
            ]
          }
        },
        {
          "name": "phoenix_slot",
          "docs": [
            "Per-deposit slot — read here to enforce ember_unwrap cannot exceed slot.amount.",
            "deserialized and cap-checked after basic pre-validations."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 104, 111, 101, 110, 105, 120, 95, 115, 108, 111, 116, 95,
                  118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "claimant"
              },
              {
                "kind": "arg",
                "path": "withdrawal_id"
              }
            ]
          }
        },
        {
          "name": "token_program",
          "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "mint_address",
          "type": "pubkey"
        },
        {
          "name": "claimant",
          "type": "pubkey"
        },
        {
          "name": "withdrawal_id",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "amount",
          "type": "u64"
        }
      ]
    },
    {
      "name": "phoenix_ember_wrap",
      "docs": [
        "**Wrap executor USDC → PhUSD 1:1 via EMBER deposit CPI.**",
        "",
        "The executor holds USDC (received from vault) and wraps it to PhUSD,",
        "ready for `phoenix_deposit_from_pool`.",
        "",
        "See `phoenix::phoenix_ember_wrap` for full documentation."
      ],
      "discriminator": [49, 142, 162, 77, 185, 59, 220, 249],
      "accounts": [
        {
          "name": "config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 99, 111, 110, 102, 105,
                  103, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "executor",
          "docs": ["Executor PDA — signs the EMBER deposit CPI."],
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 104, 111, 101, 110, 105, 120, 95, 101, 120, 101, 99, 117,
                  116, 111, 114
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "claimant"
              }
            ]
          }
        },
        {
          "name": "executor_token_account",
          "docs": [
            "Executor's USDC ATA — source of USDC; EMBER pulls from here."
          ],
          "writable": true
        },
        {
          "name": "executor_ph_usd_ata",
          "docs": [
            "Executor's PhUSD ATA — destination for PhUSD minted by EMBER."
          ],
          "writable": true
        },
        {
          "name": "relayer",
          "writable": true,
          "signer": true
        },
        {
          "name": "token_program",
          "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
        }
      ],
      "args": [
        {
          "name": "mint_address",
          "type": "pubkey"
        },
        {
          "name": "claimant",
          "type": "pubkey"
        },
        {
          "name": "amount",
          "type": "u64"
        }
      ]
    },
    {
      "name": "phoenix_place_limit_order_with_conditionals",
      "docs": [
        "**Atomically place a resting PostOnly limit order with attached TP/SL conditionals.**",
        "",
        "Solves the problem where `place_position_conditional_order` fails for resting",
        "limit orders (no position exists yet when the order is resting).",
        "",
        "See `phoenix::phoenix_place_limit_order_with_conditionals` for full documentation."
      ],
      "discriminator": [160, 34, 112, 4, 12, 95, 238, 60],
      "accounts": [
        {
          "name": "config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 99, 111, 110, 102, 105,
                  103, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "executor",
          "docs": [
            "Executor PDA — signs as traderWallet (readonly signer) in the Phoenix CPI."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 104, 111, 101, 110, 105, 120, 95, 101, 120, 101, 99, 117,
                  116, 111, 114
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "claimant"
              }
            ]
          }
        },
        {
          "name": "relayer",
          "writable": true,
          "signer": true
        },
        {
          "name": "claimant_signer",
          "docs": [
            "Ephemeral claim key must co-sign so only the depositor can drive their executor."
          ],
          "signer": true
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "mint_address",
          "type": "pubkey"
        },
        {
          "name": "claimant",
          "type": "pubkey"
        },
        {
          "name": "order_packet_bytes",
          "type": "bytes"
        },
        {
          "name": "slot",
          "type": "u64"
        },
        {
          "name": "has_greater",
          "type": "bool"
        },
        {
          "name": "greater_trigger_price",
          "type": "u64"
        },
        {
          "name": "greater_execution_price",
          "type": "u64"
        },
        {
          "name": "greater_trade_side",
          "type": "u8"
        },
        {
          "name": "greater_order_kind",
          "type": "u8"
        },
        {
          "name": "has_less",
          "type": "bool"
        },
        {
          "name": "less_trigger_price",
          "type": "u64"
        },
        {
          "name": "less_execution_price",
          "type": "u64"
        },
        {
          "name": "less_trade_side",
          "type": "u8"
        },
        {
          "name": "less_order_kind",
          "type": "u8"
        }
      ]
    },
    {
      "name": "phoenix_place_order",
      "docs": [
        "Place a market or limit order on Phoenix using the vault's trader account.",
        "",
        "`order_data` is the full Anchor-encoded instruction: discriminator (8 bytes)",
        "+ borsh-serialised `OrderPacket`. Only `placeMarketOrder` and `placeLimitOrder`",
        "discriminators are accepted.",
        "",
        "See `phoenix::phoenix_place_order` for full documentation."
      ],
      "discriminator": [147, 28, 207, 231, 182, 231, 17, 238],
      "accounts": [
        {
          "name": "config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 99, 111, 110, 102, 105,
                  103, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "executor",
          "docs": ["Executor PDA — signs the Phoenix CPI."],
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 104, 111, 101, 110, 105, 120, 95, 101, 120, 101, 99, 117,
                  116, 111, 114
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "claimant"
              }
            ]
          }
        },
        {
          "name": "relayer",
          "writable": true,
          "signer": true
        },
        {
          "name": "claimant_signer",
          "docs": [
            "Ephemeral claim key must co-sign so only the depositor can drive their executor."
          ],
          "signer": true
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "mint_address",
          "type": "pubkey"
        },
        {
          "name": "claimant",
          "type": "pubkey"
        },
        {
          "name": "order_data",
          "type": "bytes"
        },
        {
          "name": "transfer_amount",
          "type": {
            "option": "u64"
          }
        }
      ]
    },
    {
      "name": "phoenix_place_position_conditional_order",
      "docs": [
        "**Place an atomic bracket order (SL + TP) using the conditional-orders API.**",
        "",
        "Replaces two sequential `phoenix_place_stop_loss` calls with a single atomic instruction",
        "that avoids `PositionSequenceInvalidated` errors on mainnet.",
        "",
        "Set `has_greater = true` for a take-profit (TP) and `has_less = true` for a stop-loss (SL).",
        "`size_percent`: 1–100, percentage of position to close (use 100 for full close).",
        "",
        "See `phoenix::phoenix_place_position_conditional_order` for full documentation."
      ],
      "discriminator": [122, 157, 94, 180, 131, 76, 217, 92],
      "accounts": [
        {
          "name": "config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 99, 111, 110, 102, 105,
                  103, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "executor",
          "docs": [
            "Executor PDA — signs as traderWallet (readonly signer) in the Phoenix CPI."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 104, 111, 101, 110, 105, 120, 95, 101, 120, 101, 99, 117,
                  116, 111, 114
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "claimant"
              }
            ]
          }
        },
        {
          "name": "relayer",
          "writable": true,
          "signer": true
        },
        {
          "name": "claimant_signer",
          "docs": [
            "Ephemeral claim key must co-sign so only the depositor can drive their executor."
          ],
          "signer": true
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "mint_address",
          "type": "pubkey"
        },
        {
          "name": "claimant",
          "type": "pubkey"
        },
        {
          "name": "asset_id",
          "type": "u32"
        },
        {
          "name": "has_greater",
          "type": "bool"
        },
        {
          "name": "greater_trigger_price",
          "type": "u64"
        },
        {
          "name": "greater_execution_price",
          "type": "u64"
        },
        {
          "name": "greater_trade_side",
          "type": "u8"
        },
        {
          "name": "greater_order_kind",
          "type": "u8"
        },
        {
          "name": "has_less",
          "type": "bool"
        },
        {
          "name": "less_trigger_price",
          "type": "u64"
        },
        {
          "name": "less_execution_price",
          "type": "u64"
        },
        {
          "name": "less_trade_side",
          "type": "u8"
        },
        {
          "name": "less_order_kind",
          "type": "u8"
        },
        {
          "name": "size_percent",
          "type": "u8"
        }
      ]
    },
    {
      "name": "phoenix_queue_withdraw",
      "docs": [
        "Queue a USDC withdrawal from the vault's Phoenix account back to the vault ATA.",
        "",
        "After calling this, call `phoenix_ember_unwrap` (step 2, which atomically cranks",
        "the withdraw queue and converts PhUSD→USDC), then `phoenix_reissue_notes` (step 3).",
        "",
        "See `phoenix::phoenix_queue_withdraw` for full documentation."
      ],
      "discriminator": [166, 49, 239, 99, 201, 156, 112, 185],
      "accounts": [
        {
          "name": "config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 99, 111, 110, 102, 105,
                  103, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "executor",
          "docs": ["Executor PDA — signs the Phoenix withdrawFunds CPI."],
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 104, 111, 101, 110, 105, 120, 95, 101, 120, 101, 99, 117,
                  116, 111, 114
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "claimant"
              }
            ]
          }
        },
        {
          "name": "phoenix_slot",
          "docs": [
            "Per-deposit slot — enforces that withdrawal cannot exceed the deposit amount.",
            "deserialized and cap-checked after basic pre-validations."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 104, 111, 101, 110, 105, 120, 95, 115, 108, 111, 116, 95,
                  118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "claimant"
              },
              {
                "kind": "arg",
                "path": "withdrawal_id"
              }
            ]
          }
        },
        {
          "name": "claimant_signer",
          "docs": [
            "Claimant co-signer — only the depositor may raise the cap / drive the withdrawal."
          ],
          "signer": true
        },
        {
          "name": "relayer",
          "writable": true,
          "signer": true
        },
        {
          "name": "token_program",
          "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "mint_address",
          "type": "pubkey"
        },
        {
          "name": "claimant",
          "type": "pubkey"
        },
        {
          "name": "amount",
          "type": "u64"
        },
        {
          "name": "withdrawal_id",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "max_slot_amount",
          "type": {
            "option": "u64"
          }
        }
      ]
    },
    {
      "name": "phoenix_register_pool_trader",
      "docs": [
        "**Register the pool vault as a Phoenix Eternal trader (one-time setup).**",
        "",
        "Must be called once before `phoenix_deposit_from_pool` or",
        "`phoenix_place_order` can be used for a USDC pool.",
        "",
        "See `phoenix::phoenix_register_pool_trader` for full documentation."
      ],
      "discriminator": [117, 143, 6, 53, 72, 55, 26, 253],
      "accounts": [
        {
          "name": "config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 99, 111, 110, 102, 105,
                  103, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "executor",
          "docs": [
            "Executor PDA — created here on first call, then registered as the Phoenix Eternal trader wallet."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 104, 111, 101, 110, 105, 120, 95, 101, 120, 101, 99, 117,
                  116, 111, 114
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "claimant"
              }
            ]
          }
        },
        {
          "name": "payer",
          "writable": true,
          "signer": true
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "mint_address",
          "type": "pubkey"
        },
        {
          "name": "claimant",
          "type": "pubkey"
        },
        {
          "name": "margin_type",
          "type": "u8"
        }
      ]
    },
    {
      "name": "phoenix_reissue_notes",
      "docs": [
        "**Re-mint private notes after Phoenix exit — final step of the Phoenix round-trip.**",
        "",
        "`withdrawal_id` must match the one used in the preceding `phoenix_ember_unwrap`",
        "call so the correct per-exit `pending_reissue` PDA is found.",
        "",
        "See `phoenix::phoenix_reissue_notes` for full documentation."
      ],
      "discriminator": [78, 70, 25, 187, 42, 36, 49, 193],
      "accounts": [
        {
          "name": "config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 99, 111, 110, 102, 105,
                  103, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "global_config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  103, 108, 111, 98, 97, 108, 95, 99, 111, 110, 102, 105, 103,
                  95, 118, 49
                ]
              }
            ]
          }
        },
        {
          "name": "vault",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 118, 97, 117, 108, 116,
                  95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "input_tree",
          "docs": [
            "Input tree — for root validation of the dummy input notes (same as transact deposit)."
          ],
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 110, 111, 116, 101, 95,
                  116, 114, 101, 101, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "input_tree_id"
              }
            ]
          }
        },
        {
          "name": "output_tree",
          "docs": [
            "Output tree — where the new output commitments will be inserted."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 110, 111, 116, 101, 95,
                  116, 114, 101, 101, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "output_tree_id"
              }
            ]
          }
        },
        {
          "name": "nullifiers",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 110, 117, 108, 108, 105,
                  102, 105, 101, 114, 115, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "nullifier_marker_0",
          "docs": [
            "Dummy-input nullifier marker 0. init_if_needed: deposits reuse dummy witnesses."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  110, 117, 108, 108, 105, 102, 105, 101, 114, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "input_nullifier_0"
              }
            ]
          }
        },
        {
          "name": "nullifier_marker_1",
          "docs": [
            "Dummy-input nullifier marker 1. init_if_needed: deposits reuse dummy witnesses."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  110, 117, 108, 108, 105, 102, 105, 101, 114, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "input_nullifier_1"
              }
            ]
          }
        },
        {
          "name": "relayer",
          "docs": [
            "Authorized relayer — must be registered in config.relayers."
          ],
          "writable": true,
          "signer": true
        },
        {
          "name": "pending_reissue",
          "docs": [
            "Per-exit escrow — must match the `withdrawal_id` used in `phoenix_ember_unwrap`.",
            "Decremented by `amount` on success — binds reissues to the returned proceeds."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 104, 111, 101, 110, 105, 120, 95, 112, 101, 110, 100,
                  105, 110, 103, 95, 118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "account",
                "path": "claimant"
              },
              {
                "kind": "arg",
                "path": "withdrawal_id"
              }
            ]
          }
        },
        {
          "name": "phoenix_slot",
          "docs": [
            "Per-deposit slot — checked here to validate the claimant_pubkey."
          ],
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 104, 111, 101, 110, 105, 120, 95, 115, 108, 111, 116, 95,
                  118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "account",
                "path": "claimant"
              },
              {
                "kind": "arg",
                "path": "withdrawal_id"
              }
            ]
          }
        },
        {
          "name": "claimant",
          "docs": [
            "Ephemeral claim key — must match `phoenix_slot.claimant_pubkey`.",
            "The user co-signs this transaction to prove they own the exit proceeds."
          ],
          "signer": true
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "root",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "input_tree_id",
          "type": "u16"
        },
        {
          "name": "output_tree_id",
          "type": "u16"
        },
        {
          "name": "amount",
          "type": "u64"
        },
        {
          "name": "ext_data_hash",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "mint_address",
          "type": "pubkey"
        },
        {
          "name": "input_nullifier_0",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "input_nullifier_1",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "output_commitment_0",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "output_commitment_1",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "withdrawal_id",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "deadline",
          "type": "i64"
        },
        {
          "name": "ext_data",
          "type": {
            "defined": {
              "name": "ExtData"
            }
          }
        },
        {
          "name": "proof",
          "type": {
            "defined": {
              "name": "TransactionProof"
            }
          }
        },
        {
          "name": "note_ciphers",
          "type": {
            "option": {
              "defined": {
                "name": "NoteCiphers"
              }
            }
          }
        }
      ]
    },
    {
      "name": "phoenix_transfer_collateral",
      "docs": [
        "**Transfer collateral between Phoenix sub-accounts (cross ↔ isolated).**",
        "",
        "Moves `amount` PhUSD from `srcTraderAccount` to `dstTraderAccount`.",
        "Both accounts must be owned by the same executor PDA.",
        "Typically: cross sub-account → isolated sub-account before an isolated position.",
        "",
        "See `phoenix::phoenix_transfer_collateral` for full documentation."
      ],
      "discriminator": [134, 144, 151, 160, 172, 122, 63, 176],
      "accounts": [
        {
          "name": "config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 99, 111, 110, 102, 105,
                  103, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "executor",
          "docs": ["Executor PDA — signs the Phoenix transferCollateral CPI."],
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 104, 111, 101, 110, 105, 120, 95, 101, 120, 101, 99, 117,
                  116, 111, 114
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "claimant"
              }
            ]
          }
        },
        {
          "name": "relayer",
          "writable": true,
          "signer": true
        },
        {
          "name": "claimant_signer",
          "docs": [
            "Ephemeral claim key must co-sign so only the depositor can drive their executor."
          ],
          "signer": true
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "mint_address",
          "type": "pubkey"
        },
        {
          "name": "claimant",
          "type": "pubkey"
        },
        {
          "name": "amount",
          "type": "u64"
        }
      ]
    },
    {
      "name": "prediction_open",
      "docs": [
        "ZK withdrawal → ephemeral wallet funded for Jupiter Prediction trading.",
        "",
        "Nullifies USDC notes, routes funds to the ephemeral wallet's USDC ATA, and",
        "optionally funds the wallet with SOL for Jupiter API tx fees.  The actual",
        "Jupiter Prediction `CreateOrder` call is signed externally by the user with",
        "the ephemeral keypair after this instruction confirms.",
        "",
        "See `predictions::prediction_open` for full documentation."
      ],
      "discriminator": [57, 96, 27, 111, 7, 89, 111, 132],
      "accounts": [
        {
          "name": "config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 99, 111, 110, 102, 105,
                  103, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "global_config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  103, 108, 111, 98, 97, 108, 95, 99, 111, 110, 102, 105, 103,
                  95, 118, 49
                ]
              }
            ]
          }
        },
        {
          "name": "vault",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 118, 97, 117, 108, 116,
                  95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "input_tree",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 110, 111, 116, 101, 95,
                  116, 114, 101, 101, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "input_tree_id"
              }
            ]
          }
        },
        {
          "name": "output_tree",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 110, 111, 116, 101, 95,
                  116, 114, 101, 101, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "output_tree_id"
              }
            ]
          }
        },
        {
          "name": "nullifiers",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 110, 117, 108, 108, 105,
                  102, 105, 101, 114, 115, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "nullifier_marker_0",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  110, 117, 108, 108, 105, 102, 105, 101, 114, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "input_nullifier_0"
              }
            ]
          }
        },
        {
          "name": "nullifier_marker_1",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  110, 117, 108, 108, 105, 102, 105, 101, 114, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "input_nullifier_1"
              }
            ]
          }
        },
        {
          "name": "relayer",
          "writable": true,
          "signer": true
        },
        {
          "name": "prediction_slot",
          "docs": [
            "Per-deposit slot — records staked amount + claimant for reissue reconciliation."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 101, 100, 105, 99, 116, 105, 111, 110, 95, 115, 108,
                  111, 116, 95, 118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "withdrawal_id"
              }
            ]
          }
        },
        {
          "name": "vault_token_account",
          "docs": ["Vault's USDC ATA — source of funds."],
          "writable": true
        },
        {
          "name": "ephemeral_wallet",
          "docs": ["Ephemeral wallet — receives the SOL fee funding."],
          "writable": true
        },
        {
          "name": "ephemeral_token_account",
          "docs": [
            "Ephemeral wallet's USDC ATA — receives the USDC deposit.",
            "Must be pre-created by the relayer before this instruction."
          ],
          "writable": true
        },
        {
          "name": "relayer_token_account",
          "docs": ["Relayer's USDC ATA — receives the protocol fee."],
          "writable": true
        },
        {
          "name": "token_program",
          "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "root",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "input_tree_id",
          "type": "u16"
        },
        {
          "name": "output_tree_id",
          "type": "u16"
        },
        {
          "name": "deposit_amount",
          "type": "u64"
        },
        {
          "name": "ext_data_hash",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "mint_address",
          "type": "pubkey"
        },
        {
          "name": "claimant",
          "type": "pubkey"
        },
        {
          "name": "input_nullifier_0",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "input_nullifier_1",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "output_commitment_0",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "output_commitment_1",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "withdrawal_id",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "deadline",
          "type": "i64"
        },
        {
          "name": "ext_data",
          "type": {
            "defined": {
              "name": "ExtData"
            }
          }
        },
        {
          "name": "proof",
          "type": {
            "defined": {
              "name": "TransactionProof"
            }
          }
        },
        {
          "name": "note_ciphers",
          "type": {
            "option": {
              "defined": {
                "name": "NoteCiphers"
              }
            }
          }
        },
        {
          "name": "sol_funding",
          "type": "u64"
        }
      ]
    },
    {
      "name": "prediction_reissue",
      "docs": [
        "Sweep settled prediction proceeds from ephemeral wallet → pool vault.",
        "",
        "The ephemeral keypair must co-sign as it is the USDC ATA authority.",
        "Uses the deposit ZK circuit to mint new private USDC notes.",
        "The `reissue_amount` may exceed the original deposit (prediction winnings).",
        "",
        "See `predictions::prediction_reissue` for full documentation."
      ],
      "discriminator": [38, 127, 235, 89, 182, 174, 192, 37],
      "accounts": [
        {
          "name": "config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 99, 111, 110, 102, 105,
                  103, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "global_config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  103, 108, 111, 98, 97, 108, 95, 99, 111, 110, 102, 105, 103,
                  95, 118, 49
                ]
              }
            ]
          }
        },
        {
          "name": "vault",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 118, 97, 117, 108, 116,
                  95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "input_tree",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 110, 111, 116, 101, 95,
                  116, 114, 101, 101, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "input_tree_id"
              }
            ]
          }
        },
        {
          "name": "output_tree",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 110, 111, 116, 101, 95,
                  116, 114, 101, 101, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "output_tree_id"
              }
            ]
          }
        },
        {
          "name": "nullifiers",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 110, 117, 108, 108, 105,
                  102, 105, 101, 114, 115, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "nullifier_marker_0",
          "docs": [
            "init_if_needed: deposit circuit uses dummy zero nullifiers shared across all deposits."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  110, 117, 108, 108, 105, 102, 105, 101, 114, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "input_nullifier_0"
              }
            ]
          }
        },
        {
          "name": "nullifier_marker_1",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  110, 117, 108, 108, 105, 102, 105, 101, 114, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "input_nullifier_1"
              }
            ]
          }
        },
        {
          "name": "relayer",
          "writable": true,
          "signer": true
        },
        {
          "name": "claimant",
          "docs": [
            "Ephemeral keypair — co-signs as USDC ATA authority. Must match ext_data.claimant."
          ],
          "signer": true
        },
        {
          "name": "prediction_slot",
          "docs": [
            "Per-deposit slot — claimant binding + cumulative reissue audit counter.",
            "in the handler AFTER the ZK proof (mirrors the ephemeral-ATA check) so cheaper",
            "validations and the proof run first."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 101, 100, 105, 99, 116, 105, 111, 110, 95, 115, 108,
                  111, 116, 95, 118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "withdrawal_id"
              }
            ]
          }
        },
        {
          "name": "ephemeral_token_account",
          "docs": ["Ephemeral wallet's USDC ATA — source of proceeds."],
          "writable": true
        },
        {
          "name": "vault_token_account",
          "docs": ["Vault's USDC ATA — destination for swept proceeds."],
          "writable": true
        },
        {
          "name": "relayer_token_account",
          "docs": ["Relayer's ATA for the reissue fee (unused when fee = 0)."],
          "writable": true
        },
        {
          "name": "token_program",
          "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "root",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "input_tree_id",
          "type": "u16"
        },
        {
          "name": "output_tree_id",
          "type": "u16"
        },
        {
          "name": "reissue_amount",
          "type": "u64"
        },
        {
          "name": "ext_data_hash",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "mint_address",
          "type": "pubkey"
        },
        {
          "name": "input_nullifier_0",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "input_nullifier_1",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "output_commitment_0",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "output_commitment_1",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "withdrawal_id",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "deadline",
          "type": "i64"
        },
        {
          "name": "ext_data",
          "type": {
            "defined": {
              "name": "ExtData"
            }
          }
        },
        {
          "name": "proof",
          "type": {
            "defined": {
              "name": "TransactionProof"
            }
          }
        },
        {
          "name": "note_ciphers",
          "type": {
            "option": {
              "defined": {
                "name": "NoteCiphers"
              }
            }
          }
        }
      ]
    },
    {
      "name": "remove_position_relayer",
      "docs": ["Remove a whitelisted relayer from the position pool."],
      "discriminator": [245, 139, 136, 185, 100, 133, 92, 216],
      "accounts": [
        {
          "name": "config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 111, 115, 105, 116, 105, 111, 110, 95, 99, 111, 110, 102,
                  105, 103, 95, 118, 49
                ]
              }
            ]
          }
        },
        {
          "name": "authority",
          "signer": true,
          "relations": ["config"]
        }
      ],
      "args": [
        {
          "name": "relayer",
          "type": "pubkey"
        }
      ]
    },
    {
      "name": "remove_relayer",
      "discriminator": [154, 149, 161, 231, 69, 74, 136, 237],
      "accounts": [
        {
          "name": "config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 99, 111, 110, 102, 105,
                  103, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "admin",
          "docs": [
            "has_one = admin ensures this matches config.admin.",
            "When using Squads, the vault PDA signs after multisig approval."
          ],
          "signer": true,
          "relations": ["config"]
        }
      ],
      "args": [
        {
          "name": "_mint_address",
          "type": "pubkey"
        },
        {
          "name": "relayer",
          "type": "pubkey"
        }
      ]
    },
    {
      "name": "stage_swap_legs",
      "docs": [
        "Stage a Jupiter-legs swap blob in a buffer PDA so `open_position` can read it without",
        "carrying it in instruction data (which would overflow the 1232-byte tx limit alongside the",
        "ZK proof). Send before `open_position`; bound to the proof via `swap_data_hash`."
      ],
      "discriminator": [241, 245, 167, 217, 174, 205, 22, 188],
      "accounts": [
        {
          "name": "buffer",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  115, 119, 97, 112, 95, 108, 101, 103, 115, 95, 118, 49
                ]
              },
              {
                "kind": "arg",
                "path": "input_nullifier_0"
              }
            ]
          }
        },
        {
          "name": "relayer",
          "writable": true,
          "signer": true
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "input_nullifier_0",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "legs",
          "type": "bytes"
        }
      ]
    },
    {
      "name": "transact",
      "docs": [
        "Unified UTXO transaction instruction",
        "Circuit equation: sumIns + publicAmount = sumOuts",
        "Handles deposits (publicAmount > 0), withdrawals (publicAmount < 0), and transfers (publicAmount = 0)",
        "",
        "Cross-tree transactions:",
        "- input_tree_id: Tree containing input notes (for root validation)",
        "- output_tree_id: Tree for new output commitments",
        "- Can be the same tree or different trees",
        "- Allows withdrawals even when input tree is full (outputs go to new tree)"
      ],
      "discriminator": [217, 149, 130, 143, 221, 52, 252, 119],
      "accounts": [
        {
          "name": "config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 99, 111, 110, 102, 105,
                  103, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "global_config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  103, 108, 111, 98, 97, 108, 95, 99, 111, 110, 102, 105, 103,
                  95, 118, 49
                ]
              }
            ]
          }
        },
        {
          "name": "vault",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 118, 97, 117, 108, 116,
                  95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "input_tree",
          "docs": [
            "Input tree - where input notes came from (for root validation)"
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 110, 111, 116, 101, 95,
                  116, 114, 101, 101, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "input_tree_id"
              }
            ]
          }
        },
        {
          "name": "output_tree",
          "docs": [
            "Output tree - where new output commitments will be inserted"
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 110, 111, 116, 101, 95,
                  116, 114, 101, 101, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "output_tree_id"
              }
            ]
          }
        },
        {
          "name": "nullifiers",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 110, 117, 108, 108, 105,
                  102, 105, 101, 114, 115, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "nullifier_marker_0",
          "docs": [
            "Nullifier marker for input 0 — single-use, created here and never reusable.",
            "init (not init_if_needed) ensures the transaction fails if this PDA already exists,",
            "which means the nullifier has been seen before (reuse blocked at account resolution).",
            "NOTE: Nullifier markers are global (no tree_id) to prevent cross-tree reuse"
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  110, 117, 108, 108, 105, 102, 105, 101, 114, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "input_nullifier_0"
              }
            ]
          }
        },
        {
          "name": "nullifier_marker_1",
          "docs": [
            "Nullifier marker for input 1 — single-use, created here and never reusable.",
            "init (not init_if_needed) ensures the transaction fails if this PDA already exists,",
            "which means the nullifier has been seen before (reuse blocked at account resolution).",
            "NOTE: Nullifier markers are global (no tree_id) to prevent cross-tree reuse"
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  110, 117, 108, 108, 105, 102, 105, 101, 114, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              },
              {
                "kind": "arg",
                "path": "input_nullifier_1"
              }
            ]
          }
        },
        {
          "name": "relayer",
          "docs": ["Relayer who submits transaction (pays rent, receives fee)"],
          "writable": true,
          "signer": true
        },
        {
          "name": "recipient",
          "docs": [
            "Recipient (receives withdrawal amount if public_amount > 0)"
          ],
          "writable": true
        },
        {
          "name": "vault_token_account",
          "docs": ["Vault's token account (ATA for mint_address)"],
          "writable": true
        },
        {
          "name": "user_token_account",
          "docs": ["User's token account (for deposits)"],
          "writable": true
        },
        {
          "name": "recipient_token_account",
          "docs": ["Recipient's token account (for withdrawals)"],
          "writable": true
        },
        {
          "name": "relayer_token_account",
          "docs": ["Relayer's token account (for fees)"],
          "writable": true
        },
        {
          "name": "token_program",
          "docs": ["SPL Token program"]
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "root",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "input_tree_id",
          "type": "u16"
        },
        {
          "name": "output_tree_id",
          "type": "u16"
        },
        {
          "name": "public_amount",
          "type": "i64"
        },
        {
          "name": "ext_data_hash",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "mint_address",
          "type": "pubkey"
        },
        {
          "name": "input_nullifier_0",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "input_nullifier_1",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "output_commitment_0",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "output_commitment_1",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "deadline",
          "type": "i64"
        },
        {
          "name": "ext_data",
          "type": {
            "defined": {
              "name": "ExtData"
            }
          }
        },
        {
          "name": "proof",
          "type": {
            "defined": {
              "name": "TransactionProof"
            }
          }
        },
        {
          "name": "note_ciphers",
          "type": {
            "option": {
              "defined": {
                "name": "NoteCiphers"
              }
            }
          }
        }
      ]
    },
    {
      "name": "transact_swap",
      "docs": [
        "Atomic cross-pool private swap",
        "Consumes notes from source pool, swaps via Raydium CPMM (no Serum), creates notes in dest pool",
        "All in one transaction - see swap.rs for implementation details"
      ],
      "discriminator": [36, 133, 230, 184, 198, 10, 202, 249],
      "accounts": [
        {
          "name": "source_config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 99, 111, 110, 102, 105,
                  103, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "source_mint"
              }
            ]
          }
        },
        {
          "name": "global_config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  103, 108, 111, 98, 97, 108, 95, 99, 111, 110, 102, 105, 103,
                  95, 118, 49
                ]
              }
            ]
          }
        },
        {
          "name": "source_vault",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 118, 97, 117, 108, 116,
                  95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "source_mint"
              }
            ]
          }
        },
        {
          "name": "source_tree",
          "docs": ["Source tree - where input notes came from"],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 110, 111, 116, 101, 95,
                  116, 114, 101, 101, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "source_mint"
              },
              {
                "kind": "arg",
                "path": "source_tree_id"
              }
            ]
          }
        },
        {
          "name": "source_nullifiers",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 110, 117, 108, 108, 105,
                  102, 105, 101, 114, 115, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "source_mint"
              }
            ]
          }
        },
        {
          "name": "source_nullifier_marker_0",
          "docs": [
            "First nullifier marker for source pool",
            "NOTE: Nullifier markers are global (no tree_id) to prevent cross-tree reuse"
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  110, 117, 108, 108, 105, 102, 105, 101, 114, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "source_mint"
              },
              {
                "kind": "arg",
                "path": "input_nullifier_0"
              }
            ]
          }
        },
        {
          "name": "source_nullifier_marker_1",
          "docs": [
            "Second nullifier marker for source pool",
            "NOTE: Nullifier markers are global (no tree_id) to prevent cross-tree reuse"
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  110, 117, 108, 108, 105, 102, 105, 101, 114, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "source_mint"
              },
              {
                "kind": "arg",
                "path": "input_nullifier_1"
              }
            ]
          }
        },
        {
          "name": "source_vault_token_account",
          "docs": [
            "Source vault's token account",
            "For native SOL pools (mint_address == Pubkey::default), this may be unused — pass any mut account.",
            "For SPL pools, must be the canonical ATA of the source vault for the source mint."
          ],
          "writable": true
        },
        {
          "name": "source_mint_account",
          "docs": [
            "Source token mint — for native SOL pools, pass the WSOL (NATIVE_MINT) account.",
            "Must match effective_mint(source_mint) so executor ATAs are created with WSOL."
          ]
        },
        {
          "name": "dest_config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 99, 111, 110, 102, 105,
                  103, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "dest_mint"
              }
            ]
          }
        },
        {
          "name": "dest_vault",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 118, 97, 117, 108, 116,
                  95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "dest_mint"
              }
            ]
          }
        },
        {
          "name": "dest_tree",
          "docs": [
            "Destination tree - where output commitments will be inserted"
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 110, 111, 116, 101, 95,
                  116, 114, 101, 101, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "dest_mint"
              },
              {
                "kind": "arg",
                "path": "dest_tree_id"
              }
            ]
          }
        },
        {
          "name": "dest_vault_token_account",
          "docs": [
            "Destination vault's token account",
            "For native SOL pools (mint_address == Pubkey::default), may be unused — pass any mut account.",
            "For SPL pools, must be the canonical ATA of the dest vault for the dest mint."
          ],
          "writable": true
        },
        {
          "name": "dest_mint_account",
          "docs": [
            "Destination token mint — for native SOL pools, pass the WSOL (NATIVE_MINT) account.",
            "Must match effective_mint(dest_mint) so executor ATAs are created with WSOL."
          ]
        },
        {
          "name": "executor",
          "docs": [
            "Executor PDA - holds tokens during swap",
            "Seeds include source_mint, dest_mint, nullifier, AND relayer key to prevent front-running DoS",
            "Uses init_if_needed: for native SOL swaps the executor is pre-created by fund_native_source."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  115, 119, 97, 112, 95, 101, 120, 101, 99, 117, 116, 111, 114
                ]
              },
              {
                "kind": "arg",
                "path": "source_mint"
              },
              {
                "kind": "arg",
                "path": "dest_mint"
              },
              {
                "kind": "arg",
                "path": "input_nullifier_0"
              },
              {
                "kind": "account",
                "path": "relayer"
              }
            ]
          }
        },
        {
          "name": "executor_source_token",
          "docs": [
            "Executor's source token account (receives from source vault)",
            "Uses init_if_needed: pre-created by fund_native_source for native SOL swaps."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "account",
                "path": "executor"
              },
              {
                "kind": "const",
                "value": [
                  6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206,
                  235, 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140,
                  245, 133, 126, 255, 0, 169
                ]
              },
              {
                "kind": "account",
                "path": "source_mint_account"
              }
            ],
            "program": {
              "kind": "const",
              "value": [
                140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
                13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
                219, 233, 248, 89
              ]
            }
          }
        },
        {
          "name": "executor_dest_token",
          "docs": [
            "Executor's destination token account (receives swapped tokens)"
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "account",
                "path": "executor"
              },
              {
                "kind": "const",
                "value": [
                  6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206,
                  235, 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140,
                  245, 133, 126, 255, 0, 169
                ]
              },
              {
                "kind": "account",
                "path": "dest_mint_account"
              }
            ],
            "program": {
              "kind": "const",
              "value": [
                140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
                13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
                219, 233, 248, 89
              ]
            }
          }
        },
        {
          "name": "relayer",
          "docs": ["Relayer who submits transaction (pays rent, receives fee)"],
          "writable": true,
          "signer": true
        },
        {
          "name": "relayer_token_account",
          "docs": ["Relayer's token account for fees (dest token)"],
          "writable": true
        },
        {
          "name": "swap_program",
          "docs": ["Raydium Swap program (CPMM or AMM)"]
        },
        {
          "name": "jupiter_event_authority",
          "docs": ["Jupiter Event Authority (required for Jupiter V6 swaps)"]
        },
        {
          "name": "token_program",
          "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        },
        {
          "name": "associated_token_program",
          "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
        }
      ],
      "args": [
        {
          "name": "source_tree_id",
          "type": "u16"
        },
        {
          "name": "source_mint",
          "type": "pubkey"
        },
        {
          "name": "input_nullifier_0",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "input_nullifier_1",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "dest_tree_id",
          "type": "u16"
        },
        {
          "name": "dest_mint",
          "type": "pubkey"
        },
        {
          "name": "proof",
          "type": {
            "defined": {
              "name": "SwapProof"
            }
          }
        },
        {
          "name": "source_root",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "output_commitment_0",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "output_commitment_1",
          "type": {
            "array": ["u8", 32]
          }
        },
        {
          "name": "swap_params",
          "type": {
            "defined": {
              "name": "SwapParams"
            }
          }
        },
        {
          "name": "swap_amount",
          "type": "u64"
        },
        {
          "name": "swap_data",
          "type": "bytes"
        },
        {
          "name": "ext_data",
          "type": {
            "defined": {
              "name": "ExtData"
            }
          }
        },
        {
          "name": "note_ciphers",
          "type": {
            "option": {
              "defined": {
                "name": "NoteCiphers"
              }
            }
          }
        }
      ]
    },
    {
      "name": "update_global_config",
      "discriminator": [164, 84, 130, 189, 111, 58, 250, 200],
      "accounts": [
        {
          "name": "global_config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  103, 108, 111, 98, 97, 108, 95, 99, 111, 110, 102, 105, 103,
                  95, 118, 49
                ]
              }
            ]
          }
        },
        {
          "name": "admin",
          "docs": ["has_one = admin ensures this matches global_config.admin."],
          "signer": true,
          "relations": ["global_config"]
        }
      ],
      "args": []
    },
    {
      "name": "update_pool_config",
      "discriminator": [68, 236, 203, 122, 179, 62, 234, 252],
      "accounts": [
        {
          "name": "config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 114, 105, 118, 97, 99, 121, 95, 99, 111, 110, 102, 105,
                  103, 95, 118, 51
                ]
              },
              {
                "kind": "arg",
                "path": "mint_address"
              }
            ]
          }
        },
        {
          "name": "admin",
          "signer": true,
          "relations": ["config"]
        }
      ],
      "args": [
        {
          "name": "_mint_address",
          "type": "pubkey"
        },
        {
          "name": "min_deposit_amount",
          "type": {
            "option": "u64"
          }
        },
        {
          "name": "max_deposit_amount",
          "type": {
            "option": "u64"
          }
        },
        {
          "name": "min_withdraw_amount",
          "type": {
            "option": "u64"
          }
        },
        {
          "name": "max_withdraw_amount",
          "type": {
            "option": "u64"
          }
        },
        {
          "name": "fee_bps",
          "type": {
            "option": "u16"
          }
        },
        {
          "name": "min_withdrawal_fee",
          "type": {
            "option": "u64"
          }
        },
        {
          "name": "fee_error_margin_bps",
          "type": {
            "option": "u16"
          }
        },
        {
          "name": "min_swap_fee",
          "type": {
            "option": "u64"
          }
        },
        {
          "name": "swap_fee_bps",
          "type": {
            "option": "u16"
          }
        }
      ]
    },
    {
      "name": "update_position_pool",
      "docs": [
        "Update the position pool's swap fees (admin only). Pass `None` to leave a field unchanged."
      ],
      "discriminator": [104, 219, 180, 109, 95, 162, 235, 240],
      "accounts": [
        {
          "name": "config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112, 111, 115, 105, 116, 105, 111, 110, 95, 99, 111, 110, 102,
                  105, 103, 95, 118, 49
                ]
              }
            ]
          }
        },
        {
          "name": "authority",
          "signer": true,
          "relations": ["config"]
        }
      ],
      "args": [
        {
          "name": "min_swap_fee",
          "type": {
            "option": "u64"
          }
        },
        {
          "name": "swap_fee_bps",
          "type": {
            "option": "u16"
          }
        }
      ]
    }
  ],
  "accounts": [
    {
      "name": "GlobalConfig",
      "discriminator": [149, 8, 156, 202, 160, 252, 176, 217]
    },
    {
      "name": "JupiterPerpSlot",
      "discriminator": [46, 191, 19, 75, 34, 174, 215, 252]
    },
    {
      "name": "MerkleTreeAccount",
      "discriminator": [147, 200, 34, 248, 131, 187, 248, 253]
    },
    {
      "name": "NullifierMarker",
      "discriminator": [160, 124, 83, 42, 185, 14, 141, 101]
    },
    {
      "name": "NullifierSet",
      "discriminator": [251, 219, 17, 100, 208, 102, 127, 25]
    },
    {
      "name": "PhoenixExecutor",
      "discriminator": [134, 28, 35, 160, 66, 40, 126, 112]
    },
    {
      "name": "PhoenixPendingReissue",
      "discriminator": [237, 189, 169, 80, 66, 218, 59, 207]
    },
    {
      "name": "PhoenixSlot",
      "discriminator": [213, 163, 239, 20, 223, 65, 166, 53]
    },
    {
      "name": "PositionNullifierMarker",
      "discriminator": [43, 8, 5, 110, 214, 144, 240, 93]
    },
    {
      "name": "PositionPDA",
      "discriminator": [181, 147, 126, 231, 253, 181, 199, 118]
    },
    {
      "name": "PositionPoolConfig",
      "discriminator": [87, 52, 37, 241, 202, 67, 178, 51]
    },
    {
      "name": "PositionVaultRecord",
      "discriminator": [37, 64, 148, 129, 241, 13, 46, 52]
    },
    {
      "name": "PredictionSlot",
      "discriminator": [172, 230, 30, 85, 193, 249, 85, 94]
    },
    {
      "name": "PrivacyConfig",
      "discriminator": [165, 149, 218, 209, 148, 237, 242, 159]
    },
    {
      "name": "SwapExecutor",
      "discriminator": [28, 237, 82, 118, 158, 162, 39, 225]
    },
    {
      "name": "SwapLegsBuffer",
      "discriminator": [165, 155, 211, 48, 231, 14, 14, 24]
    },
    {
      "name": "Vault",
      "discriminator": [211, 8, 232, 43, 2, 152, 117, 119]
    }
  ],
  "events": [
    {
      "name": "CommitmentEvent",
      "discriminator": [89, 205, 140, 111, 36, 129, 217, 125]
    },
    {
      "name": "NullifierSpent",
      "discriminator": [166, 111, 130, 54, 212, 115, 152, 215]
    },
    {
      "name": "PhoenixDepositEvent",
      "discriminator": [51, 250, 77, 187, 80, 160, 193, 142]
    },
    {
      "name": "PhoenixReissueEvent",
      "discriminator": [129, 94, 231, 255, 43, 114, 144, 51]
    },
    {
      "name": "PhoenixTransferCollateralEvent",
      "discriminator": [150, 224, 8, 168, 13, 40, 171, 104]
    },
    {
      "name": "PredictionOpenEvent",
      "discriminator": [201, 112, 87, 251, 201, 121, 127, 218]
    },
    {
      "name": "PredictionReissueEvent",
      "discriminator": [103, 112, 58, 10, 128, 175, 14, 228]
    },
    {
      "name": "SwapExecutedEvent",
      "discriminator": [183, 28, 219, 210, 164, 184, 62, 12]
    }
  ],
  "errors": [
    {
      "code": 6000,
      "name": "Paused",
      "msg": "Pool is paused"
    },
    {
      "code": 6001,
      "name": "RelayerNotFound",
      "msg": "Relayer not found"
    },
    {
      "code": 6002,
      "name": "NoDenoms",
      "msg": "No denominations configured"
    },
    {
      "code": 6003,
      "name": "TooManyDenoms",
      "msg": "Too many denominations"
    },
    {
      "code": 6004,
      "name": "BadDenomIndex",
      "msg": "Bad denomination index"
    },
    {
      "code": 6005,
      "name": "MathOverflow",
      "msg": "Math overflow"
    },
    {
      "code": 6006,
      "name": "NullifierAlreadyUsed",
      "msg": "Nullifier already used"
    },
    {
      "code": 6007,
      "name": "NullifierTableFull",
      "msg": "Nullifier table is full"
    },
    {
      "code": 6008,
      "name": "UnknownRoot",
      "msg": "Unknown root"
    },
    {
      "code": 6009,
      "name": "RelayerNotAllowed",
      "msg": "Relayer not allowed"
    },
    {
      "code": 6010,
      "name": "InsufficientVaultBalance",
      "msg": "Vault balance too low"
    },
    {
      "code": 6011,
      "name": "TooManyRelayers",
      "msg": "Too many relayers"
    },
    {
      "code": 6012,
      "name": "InvalidProof",
      "msg": "Invalid proof encoding"
    },
    {
      "code": 6013,
      "name": "VerifyFailed",
      "msg": "Groth16 verification failed"
    },
    {
      "code": 6014,
      "name": "MerkleTreeFull",
      "msg": "Merkle tree is full - use a different tree_id or add a new tree with add_merkle_tree"
    },
    {
      "code": 6015,
      "name": "MerkleHashFailed",
      "msg": "Merkle hash failed"
    },
    {
      "code": 6016,
      "name": "InvalidExtData",
      "msg": "Invalid external data hash"
    },
    {
      "code": 6017,
      "name": "RecipientMismatch",
      "msg": "Recipient mismatch"
    },
    {
      "code": 6018,
      "name": "InvalidMintAddress",
      "msg": "Invalid mint address"
    },
    {
      "code": 6019,
      "name": "ExcessiveFee",
      "msg": "Excessive fee"
    },
    {
      "code": 6020,
      "name": "InsufficientFee",
      "msg": "Fee below minimum required for withdrawal"
    },
    {
      "code": 6021,
      "name": "ArithmeticOverflow",
      "msg": "Arithmetic overflow/underflow occurred"
    },
    {
      "code": 6022,
      "name": "InsufficientFundsForWithdrawal",
      "msg": "Insufficient funds for withdrawal (including rent exemption)"
    },
    {
      "code": 6023,
      "name": "InsufficientFundsForFee",
      "msg": "Insufficient funds for fee payment"
    },
    {
      "code": 6024,
      "name": "InvalidPublicAmount",
      "msg": "Invalid public amount data"
    },
    {
      "code": 6025,
      "name": "InvalidFeeAmount",
      "msg": "Invalid fee amount"
    },
    {
      "code": 6026,
      "name": "DuplicateNullifiers",
      "msg": "Duplicate nullifiers detected"
    },
    {
      "code": 6027,
      "name": "DuplicateCommitments",
      "msg": "Duplicate output commitments detected"
    },
    {
      "code": 6028,
      "name": "MissingTokenAccount",
      "msg": "Token account required for SPL token operations"
    },
    {
      "code": 6029,
      "name": "MissingTokenProgram",
      "msg": "Token program required for SPL token operations"
    },
    {
      "code": 6030,
      "name": "InvalidTokenAuthority",
      "msg": "Invalid token account authority"
    },
    {
      "code": 6031,
      "name": "RelayerMismatch",
      "msg": "Relayer account does not match ext_data.relayer"
    },
    {
      "code": 6032,
      "name": "RelayerTokenAccountMismatch",
      "msg": "Relayer token account not owned by ext_data.relayer"
    },
    {
      "code": 6033,
      "name": "RecipientTokenAccountMismatch",
      "msg": "Recipient token account not owned by ext_data.recipient"
    },
    {
      "code": 6034,
      "name": "DepositorTokenAccountMismatch",
      "msg": "Depositor token account not owned/delegated to relayer"
    },
    {
      "code": 6035,
      "name": "InvalidPrivateTransferFee",
      "msg": "Private transfer (public_amount == 0) must have fee == 0 and refund == 0"
    },
    {
      "code": 6036,
      "name": "DepositBelowMinimum",
      "msg": "Deposit amount below pool minimum"
    },
    {
      "code": 6037,
      "name": "DepositLimitExceeded",
      "msg": "Deposit amount exceeds pool maximum"
    },
    {
      "code": 6038,
      "name": "WithdrawalBelowMinimum",
      "msg": "Withdrawal amount below pool minimum"
    },
    {
      "code": 6039,
      "name": "WithdrawalLimitExceeded",
      "msg": "Withdrawal amount exceeds pool maximum"
    },
    {
      "code": 6040,
      "name": "InvalidPoolConfigRange",
      "msg": "Invalid PoolConfig range (min > max)"
    },
    {
      "code": 6041,
      "name": "ExcessiveFeeBps",
      "msg": "Fee basis points exceeds maximum (100 = 1%)"
    },
    {
      "code": 6042,
      "name": "ExcessiveFeeMargin",
      "msg": "Fee error margin exceeds maximum (5000 = 50%)"
    },
    {
      "code": 6043,
      "name": "UnauthorizedAdmin",
      "msg": "Only authorized admin can initialize"
    },
    {
      "code": 6044,
      "name": "Unauthorized",
      "msg": "Unauthorized: only admin or relayers can perform this action"
    },
    {
      "code": 6045,
      "name": "InvalidTreeId",
      "msg": "Invalid tree_id (tree does not exist or exceeds num_trees)"
    },
    {
      "code": 6046,
      "name": "TooManyTrees",
      "msg": "Maximum number of Merkle trees reached for this pool"
    },
    {
      "code": 6047,
      "name": "InvalidNullifiersForDeposit",
      "msg": "Deposits must use zero nullifiers (no notes consumed)"
    },
    {
      "code": 6048,
      "name": "ZeroNullifier",
      "msg": "Nullifier cannot be zero for withdrawals/transfers"
    },
    {
      "code": 6049,
      "name": "ZeroCommitment",
      "msg": "Output commitment cannot be zero"
    },
    {
      "code": 6050,
      "name": "InvalidTokenAccountOwner",
      "msg": "Token account must be owned by SPL Token Program"
    },
    {
      "code": 6051,
      "name": "VaultTokenAccountNotATA",
      "msg": "Vault token account must be the canonical Associated Token Account"
    },
    {
      "code": 6052,
      "name": "WithdrawalTooSmallForMinFee",
      "msg": "Withdrawal amount too small: max fee based on fee_bps would be less than min_withdrawal_fee"
    },
    {
      "code": 6053,
      "name": "InvalidNullifierMarkerForDeposit",
      "msg": "Nullifier marker account does not correspond to zero nullifier for deposits"
    },
    {
      "code": 6054,
      "name": "InsufficientDelegation",
      "msg": "Token account delegation amount insufficient for deposit"
    },
    {
      "code": 6055,
      "name": "InvalidSwapProgram",
      "msg": "Invalid swap program: must be Raydium CPMM or AMM"
    },
    {
      "code": 6056,
      "name": "InvalidRemainingAccounts",
      "msg": "Invalid remaining accounts: wrong count or ownership"
    },
    {
      "code": 6057,
      "name": "JupiterInsufficientAccounts",
      "msg": "Jupiter swap requires additional routing accounts"
    },
    {
      "code": 6058,
      "name": "JupiterInvalidInstruction",
      "msg": "Jupiter instruction data invalid or unsupported version"
    },
    {
      "code": 6059,
      "name": "InvalidSwapParams",
      "msg": "Swap params mints do not match instruction mints"
    },
    {
      "code": 6060,
      "name": "SwapLeftoverTokens",
      "msg": "Swap program left tokens in source account; potential amount_in manipulation"
    },
    {
      "code": 6061,
      "name": "MissingTransactSwapInstruction",
      "msg": "fund_native_source must be immediately followed by transact_swap in the same transaction"
    },
    {
      "code": 6062,
      "name": "DeadlineExpired",
      "msg": "Transaction deadline has expired"
    },
    {
      "code": 6063,
      "name": "PhoenixInvalidPool",
      "msg": "Phoenix integration requires a USDC pool (only USDC is accepted as Phoenix collateral)"
    },
    {
      "code": 6064,
      "name": "PhoenixRecipientMustBeVault",
      "msg": "Phoenix deposit: ext_data.recipient must equal the vault PDA"
    },
    {
      "code": 6065,
      "name": "PhoenixInvalidAccounts",
      "msg": "Phoenix CPI: insufficient or incorrect remaining_accounts"
    },
    {
      "code": 6066,
      "name": "PhoenixInvalidOrderData",
      "msg": "Phoenix order data is invalid or uses an unsupported instruction discriminator"
    },
    {
      "code": 6067,
      "name": "SlotOverdraft",
      "msg": "Phoenix slot cap exceeded: total unwrapped would exceed the amount queued for withdrawal via phoenix_queue_withdraw"
    },
    {
      "code": 6068,
      "name": "InvalidClaimant",
      "msg": "Reissue claimant key does not match the one committed at deposit time"
    },
    {
      "code": 6069,
      "name": "JperpInvalidAccounts",
      "msg": "Jupiter Perps CPI: insufficient or incorrect remaining_accounts"
    },
    {
      "code": 6070,
      "name": "JperpRecipientMustBeExecutor",
      "msg": "Jupiter Perps open: ext_data.recipient must equal the executor PDA"
    },
    {
      "code": 6071,
      "name": "JperpInvalidSide",
      "msg": "Jupiter Perps side must be 1 (Long) or 2 (Short)"
    },
    {
      "code": 6072,
      "name": "JperpCollateralMismatch",
      "msg": "Jupiter Perps open: collateral_token_delta must equal deposit_amount"
    },
    {
      "code": 6073,
      "name": "JperpSlotOverdraft",
      "msg": "Jupiter Perps slot cap: reissue amount would exceed original deposit"
    },
    {
      "code": 6074,
      "name": "PredictionRecipientMustBeClaimant",
      "msg": "Prediction open: ext_data.recipient must equal the ephemeral wallet (claimant)"
    },
    {
      "code": 6075,
      "name": "JperpRecoverRentExceeded",
      "msg": "Jupiter Perps recover: relayer rent sweep exceeds JPERP_RECOVER_RENT_CAP"
    },
    {
      "code": 6076,
      "name": "NonCanonicalFieldElement",
      "msg": "Field element is not in canonical form (>= BN254 Fr)"
    }
  ],
  "types": [
    {
      "name": "CommitmentEvent",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "commitment",
            "type": {
              "array": ["u8", 32]
            }
          },
          {
            "name": "leaf_index",
            "type": "u64"
          },
          {
            "name": "new_root",
            "type": {
              "array": ["u8", 32]
            }
          },
          {
            "name": "timestamp",
            "type": "i64"
          },
          {
            "name": "mint_address",
            "type": "pubkey"
          },
          {
            "name": "tree_id",
            "type": "u16"
          },
          {
            "name": "ephemeral_public_key",
            "docs": [
              "Ephemeral Curve25519 public key for ECDH — generated fresh per note"
            ],
            "type": {
              "array": ["u8", 32]
            }
          },
          {
            "name": "encrypted_blob",
            "docs": [
              "NaCl secretbox ciphertext of (blinding[32] || amount[8])",
              "Zero bytes when relayer passes None (tests / non-recovery mode)"
            ],
            "type": {
              "array": ["u8", 80]
            }
          },
          {
            "name": "view_tag",
            "docs": [
              "sha256(X25519SharedSecret)[0] — one-byte scan filter; 0 when None"
            ],
            "type": "u8"
          }
        ]
      }
    },
    {
      "name": "ExtData",
      "docs": [
        "External data that gets hashed into ext_data_hash",
        "These are public parameters that affect financial flows"
      ],
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "recipient",
            "docs": ["Who receives withdrawal"],
            "type": "pubkey"
          },
          {
            "name": "relayer",
            "docs": ["Who submits tx (gets fee)"],
            "type": "pubkey"
          },
          {
            "name": "fee",
            "docs": ["Fee to relayer in lamports"],
            "type": "u64"
          },
          {
            "name": "refund",
            "docs": ["Refund to user in lamports"],
            "type": "u64"
          },
          {
            "name": "claimant",
            "docs": [
              "Ephemeral claim key committed by the depositor at proof-generation time.",
              "By including this field in the Poseidon hash that is verified against the",
              "Groth16 public input `ext_data_hash`, the ZK proof cryptographically binds",
              "the claimant identity — a relayer cannot substitute their own key without",
              "invalidating the proof.  For non-Phoenix flows set to `Pubkey::default()`."
            ],
            "type": "pubkey"
          }
        ]
      }
    },
    {
      "name": "GlobalConfig",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "bump",
            "docs": ["PDA bump"],
            "type": "u8"
          },
          {
            "name": "admin",
            "docs": ["Admin who can configure global settings"],
            "type": "pubkey"
          }
        ]
      }
    },
    {
      "name": "JupiterPerpSlot",
      "docs": [
        "Per-deposit slot for Jupiter Perps — created at `jperp_open_position`,",
        "consumed across one or more `jperp_reissue_notes` calls.",
        "",
        "Enforces:",
        "1. Only the holder of `claimant_pubkey` (the ephemeral key committed in the ZK proof)",
        "can sign `jperp_reissue_notes`, preventing relayer theft.",
        "",
        "`reissued` is a cumulative audit counter of USDC re-minted across partial reissues.",
        "It is NOT an enforced ceiling: a winning position legitimately reissues more than was",
        "deposited, and each note minted is fully backed by the real USDC transferred into the",
        "vault during reissue (bounded by the executor ATA balance check).",
        "",
        "Seeds: [b\"jperp_slot_v1\", mint_address, withdrawal_id]"
      ],
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "amount",
            "docs": ["USDC deposited into the perp position via this slot."],
            "type": "u64"
          },
          {
            "name": "reissued",
            "docs": [
              "USDC already re-minted as private notes (cumulative across partial reissues)."
            ],
            "type": "u64"
          },
          {
            "name": "claimant_pubkey",
            "docs": [
              "Ephemeral keypair committed in the ZK proof at deposit time."
            ],
            "type": "pubkey"
          },
          {
            "name": "bump",
            "type": "u8"
          }
        ]
      }
    },
    {
      "name": "MerkleTreeAccount",
      "docs": [
        "Layout tests verify 9107 bytes total with 1-byte alignment. Breaking this corrupts all accounts."
      ],
      "serialization": "bytemuckunsafe",
      "repr": {
        "kind": "rust",
        "packed": true
      },
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "authority",
            "docs": ["Authority allowed to manage the tree (config admin)"],
            "type": "pubkey"
          },
          {
            "name": "height",
            "docs": ["Tree height (number of levels)"],
            "type": "u8"
          },
          {
            "name": "root_history_size",
            "docs": ["How many roots we track"],
            "type": "u16"
          },
          {
            "name": "next_index",
            "docs": ["Next leaf index"],
            "type": "u64"
          },
          {
            "name": "root_index",
            "docs": ["Index into root_history for the current root"],
            "type": "u64"
          },
          {
            "name": "root",
            "docs": ["Current root"],
            "type": {
              "array": ["u8", 32]
            }
          },
          {
            "name": "subtrees",
            "docs": ["Cached subtree values for each level"],
            "type": {
              "array": [
                {
                  "array": ["u8", 32]
                },
                22
              ]
            }
          },
          {
            "name": "root_history",
            "docs": ["Circular buffer of recent roots"],
            "type": {
              "array": [
                {
                  "array": ["u8", 32]
                },
                256
              ]
            }
          }
        ]
      }
    },
    {
      "name": "NoteCiphers",
      "docs": [
        "Encrypted note data passed by the relayer so users can recover funds",
        "from chain history alone if the off-chain note DB is lost.",
        "`ephemeral_public_key`: fresh Curve25519 pubkey for ECDH — reveals nothing",
        "`encrypted_blob`: NaCl secretbox of (blinding[32] || amount[8]); 40-byte",
        "plaintext → 80-byte ciphertext (24-byte nonce + 16-byte MAC)"
      ],
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "note0_ephemeral_key",
            "type": {
              "array": ["u8", 32]
            }
          },
          {
            "name": "note0_encrypted",
            "type": {
              "array": ["u8", 80]
            }
          },
          {
            "name": "note0_view_tag",
            "type": "u8"
          },
          {
            "name": "note1_ephemeral_key",
            "type": {
              "array": ["u8", 32]
            }
          },
          {
            "name": "note1_encrypted",
            "type": {
              "array": ["u8", 80]
            }
          },
          {
            "name": "note1_view_tag",
            "type": "u8"
          }
        ]
      }
    },
    {
      "name": "NullifierMarker",
      "docs": [
        "Per-nullifier PDA marker (created when nullifier is spent).",
        "The nullifier itself is encoded in the PDA seeds; metadata is emitted via events."
      ],
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "is_spent",
            "type": "bool"
          },
          {
            "name": "bump",
            "type": "u8"
          }
        ]
      }
    },
    {
      "name": "NullifierSet",
      "docs": [
        "Nullifier set metadata (actual nullifiers stored as individual PDAs)."
      ],
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "bump",
            "type": "u8"
          },
          {
            "name": "count",
            "type": "u32"
          }
        ]
      }
    },
    {
      "name": "NullifierSpent",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "nullifier",
            "type": {
              "array": ["u8", 32]
            }
          },
          {
            "name": "timestamp",
            "type": "i64"
          },
          {
            "name": "mint_address",
            "type": "pubkey"
          },
          {
            "name": "tree_id",
            "type": "u16"
          }
        ]
      }
    },
    {
      "name": "PhoenixDepositEvent",
      "docs": [
        "Emitted when private USDC notes are consumed and deposited into Phoenix."
      ],
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "deposit_amount",
            "docs": [
              "Amount deposited into Phoenix (lamports / token base units)"
            ],
            "type": "u64"
          },
          {
            "name": "relayer_fee",
            "docs": ["Relayer fee paid from vault ATA"],
            "type": "u64"
          },
          {
            "name": "mint_address",
            "docs": ["Token mint (always PHOENIX_REQUIRED_MINT)"],
            "type": "pubkey"
          },
          {
            "name": "timestamp",
            "type": "i64"
          }
        ]
      }
    },
    {
      "name": "PhoenixExecutor",
      "docs": [
        "Persistent executor PDA — the Phoenix Eternal trader wallet for a pool.",
        "",
        "Seeds: [b\"phoenix_executor\", mint_address]",
        "",
        "All Phoenix and EMBER CPIs are signed by the executor (not the vault).",
        "This confines the vault's signing authority to SPL token transfers only."
      ],
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "mint_address",
            "type": "pubkey"
          },
          {
            "name": "claimant",
            "docs": [
              "Ephemeral claimant key committed in the ZK proof at deposit time.",
              "Used as a PDA seed so each deposit gets its own isolated executor."
            ],
            "type": "pubkey"
          },
          {
            "name": "bump",
            "type": "u8"
          }
        ]
      }
    },
    {
      "name": "PhoenixPendingReissue",
      "docs": [
        "Tracks USDC proceeds from `phoenix_ember_unwrap` that have not yet been",
        "re-minted as private notes via `phoenix_reissue_notes`.",
        "",
        "Bookkeeping: the relayer can only reissue the exact amount",
        "that Phoenix returned. Each `phoenix_ember_unwrap` increments this; each",
        "`phoenix_reissue_notes` decrements it by the requested amount.",
        "",
        "Seeds: [b\"phoenix_pending_v1\", mint_address, claimant, withdrawal_id]"
      ],
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "bump",
            "type": "u8"
          },
          {
            "name": "claimant_pubkey",
            "docs": [
              "Claimant bound to this exit bucket. Mirrors the PhoenixSlot claimant."
            ],
            "type": "pubkey"
          },
          {
            "name": "amount",
            "docs": [
              "USDC (in token base units) available for reissuance. Zero after full reissue."
            ],
            "type": "u64"
          }
        ]
      }
    },
    {
      "name": "PhoenixReissueEvent",
      "docs": [
        "Emitted when private notes are re-issued from Phoenix-returned USDC.",
        "Step 4 (final) of the Phoenix exit flow."
      ],
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "amount",
            "docs": [
              "USDC amount backed by the newly minted notes (no token transfer — already in vault)"
            ],
            "type": "u64"
          },
          {
            "name": "mint_address",
            "docs": ["Token mint (always PHOENIX_REQUIRED_MINT)"],
            "type": "pubkey"
          },
          {
            "name": "timestamp",
            "type": "i64"
          }
        ]
      }
    },
    {
      "name": "PhoenixSlot",
      "docs": [
        "Per-deposit slot — created when USDC enters Phoenix, consumed across the exit flow.",
        "",
        "Enforces that a single deposit can only withdraw as much as it deposited, and that",
        "only the user who made the deposit (holding `claim_key`) can reclaim the proceeds.",
        "",
        "Seeds: [b\"phoenix_slot_v1\", mint_address, claimant, withdrawal_id]"
      ],
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "amount",
            "docs": [
              "Total USDC deposited into Phoenix via this slot (in token base units)."
            ],
            "type": "u64"
          },
          {
            "name": "withdrawn",
            "docs": [
              "USDC already queued for withdrawal from Phoenix for this slot.",
              "Invariant enforced at `phoenix_queue_withdraw`: `withdrawn <= amount`."
            ],
            "type": "u64"
          },
          {
            "name": "claimant_pubkey",
            "docs": [
              "Ephemeral keypair public key generated by the user at deposit time.",
              "Must be a signer of the `phoenix_reissue_notes` transaction.",
              "Required as co-signer so only the depositor can claim exit proceeds."
            ],
            "type": "pubkey"
          },
          {
            "name": "bump",
            "type": "u8"
          }
        ]
      }
    },
    {
      "name": "PhoenixTransferCollateralEvent",
      "docs": [
        "Emitted when collateral is transferred between Phoenix trader sub-accounts."
      ],
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "mint_address",
            "type": "pubkey"
          },
          {
            "name": "amount",
            "type": "u64"
          },
          {
            "name": "relayer",
            "type": "pubkey"
          },
          {
            "name": "timestamp",
            "type": "i64"
          }
        ]
      }
    },
    {
      "name": "PositionNullifierMarker",
      "docs": [
        "Per-nullifier marker for the position pool.",
        "",
        "Seeds: [b\"position_nullifier_v1\", mint, nullifier]",
        "No mint in seeds — the position pool is cross-mint."
      ],
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "is_spent",
            "type": "bool"
          },
          {
            "name": "bump",
            "type": "u8"
          }
        ]
      }
    },
    {
      "name": "PositionPDA",
      "docs": [
        "Per-position PDA keyed by poseidon(position_secret_n).",
        "The key is derived client-side from the wallet private key — always recoverable.",
        "",
        "Seeds: [b\"position_pda_v1\", position_pda_key]"
      ],
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "bump",
            "type": "u8"
          },
          {
            "name": "mint",
            "type": "pubkey"
          },
          {
            "name": "balance",
            "type": "u64"
          },
          {
            "name": "leaf_index",
            "type": "u64"
          },
          {
            "name": "tree_id",
            "type": "u16"
          },
          {
            "name": "is_active",
            "type": "bool"
          },
          {
            "name": "claimant",
            "docs": [
              "Ephemeral pubkey committed via ext_data.claimant in the open_position ZK proof.",
              "Must sign close_position / close_position_to_sol to prevent a whitelisted relayer",
              "from closing a victim's PDA using a different user's valid proof."
            ],
            "type": "pubkey"
          }
        ]
      }
    },
    {
      "name": "PositionPoolConfig",
      "docs": [
        "Global config for the cross-mint position pool (one pool for all tokens).",
        "",
        "Seeds: [b\"position_config_v1\"]"
      ],
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "bump",
            "type": "u8"
          },
          {
            "name": "authority",
            "type": "pubkey"
          },
          {
            "name": "num_relayers",
            "type": "u8"
          },
          {
            "name": "relayers",
            "type": {
              "array": ["pubkey", 16]
            }
          },
          {
            "name": "num_trees",
            "type": "u16"
          },
          {
            "name": "next_tree_index",
            "type": "u16"
          },
          {
            "name": "min_swap_fee",
            "type": "u64"
          },
          {
            "name": "swap_fee_bps",
            "type": "u16"
          }
        ]
      }
    },
    {
      "name": "PositionVaultRecord",
      "docs": [
        "Per-mint vault record. Lazy-created on first deposit of each mint.",
        "Stores the vault bump so the vault PDA can sign CPIs.",
        "",
        "Seeds: [b\"position_vault_v1\", mint]"
      ],
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "bump",
            "type": "u8"
          },
          {
            "name": "vault_bump",
            "type": "u8"
          },
          {
            "name": "mint",
            "type": "pubkey"
          },
          {
            "name": "is_token_2022",
            "type": "bool"
          },
          {
            "name": "total_balance",
            "type": "u64"
          },
          {
            "name": "position_count",
            "type": "u32"
          }
        ]
      }
    },
    {
      "name": "PredictionOpenEvent",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "deposit_amount",
            "type": "u64"
          },
          {
            "name": "mint_address",
            "type": "pubkey"
          },
          {
            "name": "claimant",
            "type": "pubkey"
          },
          {
            "name": "relayer",
            "type": "pubkey"
          },
          {
            "name": "timestamp",
            "type": "i64"
          }
        ]
      }
    },
    {
      "name": "PredictionReissueEvent",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "reissue_amount",
            "type": "u64"
          },
          {
            "name": "mint_address",
            "type": "pubkey"
          },
          {
            "name": "claimant",
            "type": "pubkey"
          },
          {
            "name": "relayer",
            "type": "pubkey"
          },
          {
            "name": "timestamp",
            "type": "i64"
          }
        ]
      }
    },
    {
      "name": "PredictionSlot",
      "docs": [
        "Per-deposit slot for Jupiter Predictions — created at `prediction_open`,",
        "consumed across one or more `prediction_reissue` calls. Mirrors `JupiterPerpSlot`.",
        "",
        "Enforces: only the holder of `claimant_pubkey` (the ephemeral key committed in the",
        "ZK proof) can sign `prediction_reissue`, preventing relayer theft. It also pairs every",
        "open to its reissue(s) on-chain (via `withdrawal_id` in the seeds) for reconciliation",
        "and blocks reissuing against a non-existent open.",
        "",
        "`reissued` is a cumulative audit counter of USDC re-minted across partial reissues —",
        "NOT an enforced ceiling, since a winning bet legitimately reissues more than was staked",
        "and each note minted is backed by the real USDC transferred into the vault.",
        "",
        "Seeds: [b\"prediction_slot_v1\", mint_address, withdrawal_id]"
      ],
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "amount",
            "docs": ["USDC staked into the prediction position via this slot."],
            "type": "u64"
          },
          {
            "name": "reissued",
            "docs": [
              "USDC already re-minted as private notes (cumulative across partial reissues)."
            ],
            "type": "u64"
          },
          {
            "name": "claimant_pubkey",
            "docs": [
              "Ephemeral keypair committed in the ZK proof at deposit time."
            ],
            "type": "pubkey"
          },
          {
            "name": "bump",
            "type": "u8"
          }
        ]
      }
    },
    {
      "name": "PrivacyConfig",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "bump",
            "docs": ["PDA bump for this config"],
            "type": "u8"
          },
          {
            "name": "vault_bump",
            "docs": ["PDA bump for vault"],
            "type": "u8"
          },
          {
            "name": "admin",
            "docs": ["Admin who can configure pool and relayers"],
            "type": "pubkey"
          },
          {
            "name": "fee_bps",
            "docs": ["Fee in basis points (0–10_000) for withdrawals"],
            "type": "u16"
          },
          {
            "name": "min_withdrawal_fee",
            "docs": [
              "Minimum fee for withdrawals (in lamports) to ensure relayer compensation"
            ],
            "type": "u64"
          },
          {
            "name": "fee_error_margin_bps",
            "docs": [
              "Fee error margin in basis points (e.g., 500 = 5%)",
              "Allows fee variance to prevent timing attacks where identical fees",
              "could correlate deposits/withdrawals"
            ],
            "type": "u16"
          },
          {
            "name": "total_tvl",
            "docs": ["Total value locked (all deposits combined)"],
            "type": "u64"
          },
          {
            "name": "mint_address",
            "docs": [
              "Token mint address (for now: SOL, future: multi-token support)"
            ],
            "type": "pubkey"
          },
          {
            "name": "min_deposit_amount",
            "docs": [
              "Minimum amount allowed per deposit (in lamports/token units)"
            ],
            "type": "u64"
          },
          {
            "name": "max_deposit_amount",
            "docs": [
              "Maximum amount allowed per deposit (in lamports/token units)"
            ],
            "type": "u64"
          },
          {
            "name": "min_withdraw_amount",
            "docs": [
              "Minimum amount allowed per withdrawal (in lamports/token units)"
            ],
            "type": "u64"
          },
          {
            "name": "max_withdraw_amount",
            "docs": [
              "Maximum amount allowed per withdrawal (in lamports/token units)"
            ],
            "type": "u64"
          },
          {
            "name": "num_relayers",
            "docs": ["Relayer registry"],
            "type": "u8"
          },
          {
            "name": "relayers",
            "type": {
              "array": ["pubkey", 16]
            }
          },
          {
            "name": "num_trees",
            "docs": ["Multi-tree support: number of active Merkle trees"],
            "type": "u16"
          },
          {
            "name": "next_tree_index",
            "docs": ["Suggested tree index for next deposit (round-robin)"],
            "type": "u16"
          },
          {
            "name": "min_swap_fee",
            "docs": [
              "Minimum swap fee in destination token units (e.g., 100000 = 0.1 USDC)",
              "Ensures relayer compensation for swap transactions"
            ],
            "type": "u64"
          },
          {
            "name": "swap_fee_bps",
            "docs": [
              "Swap fee in basis points (0-10_000) of swap output amount",
              "Used with min_swap_fee: actual fee must be >= max(min_swap_fee, output * swap_fee_bps / 10000)"
            ],
            "type": "u16"
          }
        ]
      }
    },
    {
      "name": "SwapExecutedEvent",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "source_mint",
            "type": "pubkey"
          },
          {
            "name": "dest_mint",
            "type": "pubkey"
          },
          {
            "name": "source_tree_id",
            "type": "u16"
          },
          {
            "name": "dest_tree_id",
            "type": "u16"
          },
          {
            "name": "nullifiers",
            "type": {
              "array": [
                {
                  "array": ["u8", 32]
                },
                2
              ]
            }
          },
          {
            "name": "commitments",
            "type": {
              "array": [
                {
                  "array": ["u8", 32]
                },
                2
              ]
            }
          },
          {
            "name": "timestamp",
            "type": "i64"
          }
        ]
      }
    },
    {
      "name": "SwapExecutor",
      "docs": [
        "Ephemeral PDA that holds tokens during swap, created and closed atomically"
      ],
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "source_mint",
            "type": "pubkey"
          },
          {
            "name": "dest_mint",
            "type": "pubkey"
          },
          {
            "name": "nullifier",
            "type": {
              "array": ["u8", 32]
            }
          },
          {
            "name": "bump",
            "type": "u8"
          },
          {
            "name": "swap_amount",
            "docs": [
              "Swap amount stored by fund_native_source for validation in transact_swap.",
              "Zero when executor was created directly in transact_swap (relayer-float path)."
            ],
            "type": "u64"
          },
          {
            "name": "is_prefunded",
            "docs": [
              "1 when executor was pre-funded by fund_native_source (vault already debited).",
              "0 for the single-instruction relayer-float path (backward compatible)."
            ],
            "type": "u8"
          },
          {
            "name": "relayer",
            "docs": [
              "Relayer who created this executor — only they may call reclaim_stale_executor."
            ],
            "type": "pubkey"
          }
        ]
      }
    },
    {
      "name": "SwapLegsBuffer",
      "docs": [
        "Staging buffer for a Jupiter-legs swap blob. The legs (Jupiter's setup/route/cleanup) are too",
        "large to carry in `open_position`'s instruction data alongside the ZK proof, so they're written",
        "here in a preceding instruction and read back. Bound to the proof via",
        "`swap_params.swap_data_hash == sha256(legs)`.",
        "",
        "Seeds: [b\"swap_legs_v1\", input_nullifier_0]"
      ],
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "bump",
            "type": "u8"
          },
          {
            "name": "owner",
            "type": "pubkey"
          },
          {
            "name": "nullifier",
            "type": {
              "array": ["u8", 32]
            }
          },
          {
            "name": "legs",
            "type": "bytes"
          }
        ]
      }
    },
    {
      "name": "SwapParams",
      "docs": [
        "Swap parameters committed to in the ZK proof.",
        "`source_mint` and `dest_mint` are passed as separate `transact_swap` args",
        "and supplied to `hash()` at call time."
      ],
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "min_amount_out",
            "type": "u64"
          },
          {
            "name": "deadline",
            "type": "i64"
          },
          {
            "name": "dest_amount",
            "docs": [
              "Amount of destination tokens the user commits to receiving.",
              "Included in swapParamsHash — cryptographically binds the ZK circuit's",
              "destAmount to the on-chain vault deposit."
            ],
            "type": "u64"
          },
          {
            "name": "swap_data_hash",
            "docs": [
              "SHA-256 hash of the raw swap instruction data (swap_data).",
              "Binds the exact DEX instruction bytes into the ZK proof so the relayer",
              "cannot substitute different swap_data (e.g. 0% slippage) after the user",
              "has generated their proof.  Set to [0u8;32] for CPMM/AMM swaps, which",
              "already enforce dex_min_out by direct instruction decoding."
            ],
            "type": {
              "array": ["u8", 32]
            }
          }
        ]
      }
    },
    {
      "name": "SwapProof",
      "docs": [
        "Proof for swap transaction circuit (2-in-2-out cross-pool UTXO model)"
      ],
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "proof_a",
            "type": {
              "array": ["u8", 64]
            }
          },
          {
            "name": "proof_b",
            "type": {
              "array": ["u8", 128]
            }
          },
          {
            "name": "proof_c",
            "type": {
              "array": ["u8", 64]
            }
          }
        ]
      }
    },
    {
      "name": "TransactionProof",
      "docs": [
        "Proof for new UTXO transaction circuit (same structure, different VK)"
      ],
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "proof_a",
            "type": {
              "array": ["u8", 64]
            }
          },
          {
            "name": "proof_b",
            "type": {
              "array": ["u8", 128]
            }
          },
          {
            "name": "proof_c",
            "type": {
              "array": ["u8", 64]
            }
          }
        ]
      }
    },
    {
      "name": "Vault",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "bump",
            "docs": ["PDA bump for this vault"],
            "type": "u8"
          }
        ]
      }
    }
  ]
}
