{
  "address": "BNySR58kNhV646LGVERkyxD4DMk7puamJ1DDpbXMHhpW",
  "metadata": {
    "name": "rwa_venue",
    "version": "0.1.0",
    "spec": "0.1.0",
    "description": "Market-maker venue: primary and secondary market for one RWA asset"
  },
  "instructions": [
    {
      "name": "buy_from",
      "docs": [
        "Buy `amount` from a maker at its ask.",
        "",
        "Both legs move directly between investor and maker (I1). The maker's stock moves because",
        "it has delegated its own token account to this venue — the same shape as the EVM",
        "approval, and the delegated amount IS the depth a client reads."
      ],
      "discriminator": [
        120,
        122,
        110,
        168,
        178,
        43,
        121,
        17
      ],
      "accounts": [
        {
          "name": "investor",
          "signer": true
        },
        {
          "name": "venue",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  101,
                  110,
                  117,
                  101
                ]
              },
              {
                "kind": "account",
                "path": "venue.rwa_mint",
                "account": "Venue"
              }
            ]
          }
        },
        {
          "name": "approval",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  109,
                  97,
                  107,
                  101,
                  114,
                  95,
                  97,
                  112,
                  112,
                  114,
                  111,
                  118,
                  97,
                  108
                ]
              },
              {
                "kind": "account",
                "path": "maker_state.maker",
                "account": "MakerState"
              }
            ]
          }
        },
        {
          "name": "maker_state",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  109,
                  97,
                  107,
                  101,
                  114
                ]
              },
              {
                "kind": "account",
                "path": "venue"
              },
              {
                "kind": "account",
                "path": "maker_state.maker",
                "account": "MakerState"
              }
            ]
          }
        },
        {
          "name": "asset"
        },
        {
          "name": "rwa_mint"
        },
        {
          "name": "payout_mint"
        },
        {
          "name": "maker_rwa_ata",
          "writable": true
        },
        {
          "name": "maker_payout_ata",
          "writable": true
        },
        {
          "name": "investor_rwa_ata",
          "writable": true
        },
        {
          "name": "investor_payout_ata",
          "writable": true
        },
        {
          "name": "treasury_payout_ata",
          "writable": true
        },
        {
          "name": "rwa_token_program"
        },
        {
          "name": "payout_token_program"
        }
      ],
      "args": [
        {
          "name": "amount",
          "type": "u64"
        },
        {
          "name": "max_cost",
          "type": "u64"
        }
      ]
    },
    {
      "name": "claim_redeem",
      "docs": [
        "Pay a queued redemption once the float allows.",
        "",
        "Permissionless BEFORE the auto-return window: the payout is fixed and goes only to the",
        "maker, so calling it is pure benefit and the maker need not be online. AFTER the window",
        "the maker holds a choice between the locked price and its stock (I13), and that choice is",
        "worth something whenever the price has moved — so only the maker may resolve it, or",
        "anyone could settle at a stale price to deny it.",
        "Pay a queued redemption at its locked price.",
        "",
        "Phase 1, before auto_return_window: anyone. The payout is fixed and the destination is",
        "bound to the maker, so calling is pure benefit and the maker need not be online.",
        "",
        "Phase 2, between the windows: the maker alone, same price. There is NO cancel here —",
        "see resolve_redeem for why the choice was removed rather than reserved."
      ],
      "discriminator": [
        125,
        14,
        137,
        237,
        160,
        63,
        225,
        226
      ],
      "accounts": [
        {
          "name": "caller",
          "docs": [
            "Anyone before the auto-return window; only the maker after it (I13)."
          ],
          "signer": true
        },
        {
          "name": "venue",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  101,
                  110,
                  117,
                  101
                ]
              },
              {
                "kind": "account",
                "path": "venue.rwa_mint",
                "account": "Venue"
              }
            ]
          }
        },
        {
          "name": "redemption",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  114,
                  101,
                  100,
                  101,
                  109,
                  112,
                  116,
                  105,
                  111,
                  110
                ]
              },
              {
                "kind": "account",
                "path": "venue"
              },
              {
                "kind": "account",
                "path": "redemption.index",
                "account": "Redemption"
              }
            ]
          }
        },
        {
          "name": "maker_state",
          "docs": [
            "The maker's record, so resolving frees its one queue slot. Seeded on the REDEMPTION's",
            "maker, not the caller: both of these instructions are permissionless."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  109,
                  97,
                  107,
                  101,
                  114
                ]
              },
              {
                "kind": "account",
                "path": "venue"
              },
              {
                "kind": "account",
                "path": "redemption.maker",
                "account": "Redemption"
              }
            ]
          }
        },
        {
          "name": "asset"
        },
        {
          "name": "rwa_mint"
        },
        {
          "name": "meta",
          "docs": [
            "Read-only: the asset's TokenMeta, which carries the LIVE payout denomination. The",
            "venue's own `payout_mint` is a snapshot taken at init; only this can disagree with it."
          ],
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  109,
                  101,
                  116,
                  97
                ]
              },
              {
                "kind": "account",
                "path": "venue.rwa_mint",
                "account": "Venue"
              }
            ],
            "program": {
              "kind": "const",
              "value": [
                113,
                171,
                40,
                163,
                170,
                246,
                110,
                27,
                186,
                10,
                11,
                75,
                97,
                138,
                197,
                88,
                115,
                241,
                208,
                65,
                38,
                70,
                73,
                244,
                126,
                46,
                230,
                163,
                54,
                150,
                249,
                158
              ]
            }
          }
        },
        {
          "name": "payout_mint"
        },
        {
          "name": "vault",
          "writable": true
        },
        {
          "name": "vault_state",
          "docs": [
            "The vault's own account, for its owed-cash total. `available_float` must exclude cash a",
            "deferred payout already owes a maker, or the next head is paid with it twice."
          ],
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  97,
                  117,
                  108,
                  116
                ]
              },
              {
                "kind": "account",
                "path": "venue.rwa_mint",
                "account": "Venue"
              }
            ],
            "program": {
              "kind": "account",
              "path": "vault_program"
            }
          }
        },
        {
          "name": "venue_allowance",
          "docs": [
            "PINNED BY SEEDS — see Resolve.venue_allowance (R4-8)."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  101,
                  110,
                  117,
                  101,
                  95,
                  97,
                  108,
                  108,
                  111,
                  119,
                  97,
                  110,
                  99,
                  101
                ]
              },
              {
                "kind": "account",
                "path": "venue.rwa_mint",
                "account": "Venue"
              },
              {
                "kind": "account",
                "path": "venue"
              }
            ],
            "program": {
              "kind": "account",
              "path": "vault_program"
            }
          }
        },
        {
          "name": "vault_payout_ata",
          "writable": true
        },
        {
          "name": "maker_payout_ata",
          "writable": true
        },
        {
          "name": "treasury_payout_ata",
          "writable": true
        },
        {
          "name": "payout_token_program"
        },
        {
          "name": "vault_program",
          "address": "A5SYMN5DGKWo8oPwDgWUxCZHZA7TaCkLbguSrLiWc91"
        }
      ],
      "args": []
    },
    {
      "name": "create",
      "docs": [
        "Deliver cash, receive stock the vault already holds.",
        "",
        "I1 holds by construction: cash goes maker -> vault and maker -> treasury directly, and",
        "stock goes vault -> maker through the vault's capped allowance. The venue is a signer,",
        "never a holder."
      ],
      "discriminator": [
        24,
        30,
        200,
        40,
        5,
        28,
        7,
        119
      ],
      "accounts": [
        {
          "name": "maker",
          "signer": true
        },
        {
          "name": "venue",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  101,
                  110,
                  117,
                  101
                ]
              },
              {
                "kind": "account",
                "path": "venue.rwa_mint",
                "account": "Venue"
              }
            ]
          }
        },
        {
          "name": "approval",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  109,
                  97,
                  107,
                  101,
                  114,
                  95,
                  97,
                  112,
                  112,
                  114,
                  111,
                  118,
                  97,
                  108
                ]
              },
              {
                "kind": "account",
                "path": "maker"
              }
            ]
          }
        },
        {
          "name": "maker_state",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  109,
                  97,
                  107,
                  101,
                  114
                ]
              },
              {
                "kind": "account",
                "path": "venue"
              },
              {
                "kind": "account",
                "path": "maker"
              }
            ]
          }
        },
        {
          "name": "asset"
        },
        {
          "name": "rwa_mint"
        },
        {
          "name": "meta",
          "docs": [
            "Read-only: the asset's TokenMeta, which carries the LIVE payout denomination (I11)."
          ],
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  109,
                  101,
                  116,
                  97
                ]
              },
              {
                "kind": "account",
                "path": "venue.rwa_mint",
                "account": "Venue"
              }
            ],
            "program": {
              "kind": "const",
              "value": [
                113,
                171,
                40,
                163,
                170,
                246,
                110,
                27,
                186,
                10,
                11,
                75,
                97,
                138,
                197,
                88,
                115,
                241,
                208,
                65,
                38,
                70,
                73,
                244,
                126,
                46,
                230,
                163,
                54,
                150,
                249,
                158
              ]
            }
          }
        },
        {
          "name": "payout_mint"
        },
        {
          "name": "vault",
          "writable": true
        },
        {
          "name": "venue_allowance",
          "writable": true
        },
        {
          "name": "vault_rwa_ata",
          "writable": true
        },
        {
          "name": "vault_payout_ata",
          "writable": true
        },
        {
          "name": "maker_rwa_ata",
          "writable": true
        },
        {
          "name": "maker_payout_ata",
          "writable": true
        },
        {
          "name": "treasury_payout_ata",
          "writable": true
        },
        {
          "name": "rwa_token_program"
        },
        {
          "name": "payout_token_program"
        },
        {
          "name": "vault_program",
          "address": "A5SYMN5DGKWo8oPwDgWUxCZHZA7TaCkLbguSrLiWc91"
        }
      ],
      "args": [
        {
          "name": "cash_in",
          "type": "u64"
        },
        {
          "name": "min_stock_out",
          "type": "u64"
        }
      ]
    },
    {
      "name": "init_config",
      "docs": [
        "Bind this program to its governing authority. Once, by the program's upgrade authority.",
        "",
        "Gated exactly as every sibling program is. Without this it is first-caller-wins, which",
        "moves the vulnerability from the per-asset PDAs up to the global one — the C-1..C-5",
        "finding this repo already fixed elsewhere, and which I had left open here."
      ],
      "discriminator": [
        23,
        235,
        115,
        232,
        168,
        96,
        1,
        231
      ],
      "accounts": [
        {
          "name": "payer",
          "writable": true,
          "signer": true
        },
        {
          "name": "upgrade_authority",
          "docs": [
            "Must be this program's current upgrade authority."
          ],
          "signer": true
        },
        {
          "name": "program_data"
        },
        {
          "name": "config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  99,
                  111,
                  110,
                  102,
                  105,
                  103
                ]
              }
            ]
          }
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "authority",
          "type": "pubkey"
        },
        {
          "name": "operator",
          "type": "pubkey"
        }
      ]
    },
    {
      "name": "init_venue",
      "docs": [
        "Create the venue for one asset. Operator or authority, like create_asset."
      ],
      "discriminator": [
        24,
        45,
        244,
        165,
        75,
        228,
        217,
        38
      ],
      "accounts": [
        {
          "name": "venue_link",
          "docs": [
            "rwa_market's VenueLink, which must already name THIS program (R4-5b).",
            "",
            "Onboarding into a half-wired system is the dangerous state, and neither half fails",
            "loudly: a venue the Market does not know about lets its own makers sell there, which is",
            "the whole of I16, and `rwa_exit` resolves venues through this same link, so a wind-down",
            "would open straight over the queue. Checked here rather than left to a runbook because",
            "the failure is silent in both directions."
          ],
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  101,
                  110,
                  117,
                  101,
                  95,
                  112,
                  114,
                  111,
                  103,
                  114,
                  97,
                  109
                ]
              }
            ],
            "program": {
              "kind": "const",
              "value": [
                221,
                159,
                24,
                192,
                16,
                176,
                255,
                9,
                119,
                197,
                127,
                62,
                29,
                18,
                21,
                45,
                59,
                235,
                199,
                95,
                185,
                250,
                187,
                236,
                205,
                182,
                96,
                187,
                160,
                214,
                11,
                217
              ]
            }
          }
        },
        {
          "name": "payer",
          "writable": true,
          "signer": true
        },
        {
          "name": "config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  99,
                  111,
                  110,
                  102,
                  105,
                  103
                ]
              }
            ]
          }
        },
        {
          "name": "authority",
          "signer": true
        },
        {
          "name": "rwa_mint"
        },
        {
          "name": "payout_mint",
          "docs": [
            "Must be the payout mint the MARKET already records for this asset. Taking it from the",
            "caller unchecked let a venue be wired to a currency the vault does not hold, which only",
            "surfaced at the first creation — and there was no way to correct it afterwards."
          ]
        },
        {
          "name": "meta",
          "docs": [
            "The TOKEN's record of the payout denomination, which must agree with the MARKET's.",
            "",
            "Both are checked because they can disagree: `rwa_token::set_payout_token` moves this one",
            "and nothing propagates it to `Asset.payout_mint`. A venue wired while they disagree would",
            "snapshot one of them and then measure I11 against the other for the rest of its life."
          ],
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  109,
                  101,
                  116,
                  97
                ]
              },
              {
                "kind": "account",
                "path": "rwa_mint"
              }
            ],
            "program": {
              "kind": "const",
              "value": [
                113,
                171,
                40,
                163,
                170,
                246,
                110,
                27,
                186,
                10,
                11,
                75,
                97,
                138,
                197,
                88,
                115,
                241,
                208,
                65,
                38,
                70,
                73,
                244,
                126,
                46,
                230,
                163,
                54,
                150,
                249,
                158
              ]
            }
          }
        },
        {
          "name": "vault",
          "docs": [
            "pointed at an arbitrary account. rwa_vault re-validates on every draw regardless."
          ],
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  97,
                  117,
                  108,
                  116
                ]
              },
              {
                "kind": "account",
                "path": "rwa_mint"
              }
            ],
            "program": {
              "kind": "const",
              "value": [
                2,
                83,
                63,
                125,
                82,
                182,
                161,
                213,
                51,
                11,
                144,
                0,
                4,
                205,
                229,
                204,
                206,
                22,
                81,
                184,
                73,
                87,
                95,
                118,
                163,
                58,
                17,
                36,
                119,
                74,
                169,
                116
              ]
            }
          }
        },
        {
          "name": "asset"
        },
        {
          "name": "treasury"
        },
        {
          "name": "venue",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  101,
                  110,
                  117,
                  101
                ]
              },
              {
                "kind": "account",
                "path": "rwa_mint"
              }
            ]
          }
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "p",
          "type": {
            "defined": {
              "name": "VenueParams"
            }
          }
        }
      ]
    },
    {
      "name": "request_redeem",
      "docs": [
        "Deliver stock back, be owed cash up to the vault's free float.",
        "",
        "Stock reaches the vault in this instruction (I6) and the price is LOCKED here (I5), so a",
        "maker waiting in the queue is not also taking a market position it did not choose. The",
        "cash leg is float-limited rather than promised: the exposure behind it, NAV moving",
        "between request and settlement, is the one thing here no fee can cover.",
        "",
        "This instruction QUEUES only. Where the EVM venue settles in the same call when the",
        "float allows, a client here bundles request_redeem and claim_redeem into one transaction",
        "— which is idiomatic on Solana and keeps the payment accounts out of this context.",
        "Queuing is the normal case, not an error: it is what stops a redemption forcing a sale."
      ],
      "discriminator": [
        105,
        49,
        44,
        38,
        207,
        241,
        33,
        173
      ],
      "accounts": [
        {
          "name": "maker",
          "writable": true,
          "signer": true
        },
        {
          "name": "venue",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  101,
                  110,
                  117,
                  101
                ]
              },
              {
                "kind": "account",
                "path": "venue.rwa_mint",
                "account": "Venue"
              }
            ]
          }
        },
        {
          "name": "approval",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  109,
                  97,
                  107,
                  101,
                  114,
                  95,
                  97,
                  112,
                  112,
                  114,
                  111,
                  118,
                  97,
                  108
                ]
              },
              {
                "kind": "account",
                "path": "maker"
              }
            ]
          }
        },
        {
          "name": "maker_state",
          "docs": [
            "`mut`: requesting TAKES this maker's one queue slot. Anchor only serialises accounts",
            "marked `mut`, so without it the write is made to the in-memory copy and discarded on",
            "exit — silently, with a successful transaction and an unchanged flag."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  109,
                  97,
                  107,
                  101,
                  114
                ]
              },
              {
                "kind": "account",
                "path": "venue"
              },
              {
                "kind": "account",
                "path": "maker"
              }
            ]
          }
        },
        {
          "name": "asset"
        },
        {
          "name": "redemption",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  114,
                  101,
                  100,
                  101,
                  109,
                  112,
                  116,
                  105,
                  111,
                  110
                ]
              },
              {
                "kind": "account",
                "path": "venue"
              },
              {
                "kind": "arg",
                "path": "index"
              }
            ]
          }
        },
        {
          "name": "rwa_mint"
        },
        {
          "name": "meta",
          "docs": [
            "Needed only for its decimals, to price the maker's min_payout bound against the price",
            "actually struck here. BOXED like the rest: this context was already close to the",
            "4096-byte SBF frame, and an unboxed Mint is what tips it into an access violation.",
            "Read-only: the asset's TokenMeta, which carries the LIVE payout denomination (I11)."
          ],
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  109,
                  101,
                  116,
                  97
                ]
              },
              {
                "kind": "account",
                "path": "venue.rwa_mint",
                "account": "Venue"
              }
            ],
            "program": {
              "kind": "const",
              "value": [
                113,
                171,
                40,
                163,
                170,
                246,
                110,
                27,
                186,
                10,
                11,
                75,
                97,
                138,
                197,
                88,
                115,
                241,
                208,
                65,
                38,
                70,
                73,
                244,
                126,
                46,
                230,
                163,
                54,
                150,
                249,
                158
              ]
            }
          }
        },
        {
          "name": "payout_mint"
        },
        {
          "name": "maker_rwa_ata",
          "writable": true
        },
        {
          "name": "vault_rwa_ata",
          "writable": true
        },
        {
          "name": "vault"
        },
        {
          "name": "vault_account",
          "writable": true
        },
        {
          "name": "venue_allowance",
          "docs": [
            "PINNED BY SEEDS, not just by its `venue` field (R4-8). The field check alone accepts any",
            "allowance account governance has ever created for this venue — including one for a",
            "different mint — and on the flat/fallen return branch nothing re-reads it afterwards, so",
            "a stray allowance with payout 0 would let anyone drive a maker into a stock return it",
            "never asked for. The canonical address is the only one that can be passed now."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  101,
                  110,
                  117,
                  101,
                  95,
                  97,
                  108,
                  108,
                  111,
                  119,
                  97,
                  110,
                  99,
                  101
                ]
              },
              {
                "kind": "account",
                "path": "venue.rwa_mint",
                "account": "Venue"
              },
              {
                "kind": "account",
                "path": "venue"
              }
            ],
            "program": {
              "kind": "account",
              "path": "vault_program"
            }
          }
        },
        {
          "name": "vault_program",
          "address": "A5SYMN5DGKWo8oPwDgWUxCZHZA7TaCkLbguSrLiWc91"
        },
        {
          "name": "rwa_token_program"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "index",
          "type": "u64"
        },
        {
          "name": "amount",
          "type": "u64"
        },
        {
          "name": "min_payout",
          "type": "u64"
        },
        {
          "name": "deadline",
          "type": "i64"
        }
      ]
    },
    {
      "name": "resolve_redeem",
      "docs": [
        "After force_resolve_window, settle a redemption one way or the other.",
        "",
        "The only thing here a maker can rely on without our cooperation, which is the point:",
        "settlement timing is a commercial promise, and the maker's protection must not also",
        "depend on us choosing to honour it. What the maker does NOT get is a say in WHICH",
        "outcome it receives.",
        "",
        "THE FLOAT DECIDES, NOT THE CALLER. If it covers the draw the maker is paid at its locked",
        "price; if it does not, the stock goes back. Callable by anyone including the maker, and",
        "the outcome is identical whoever calls — which is what removes the option rather than",
        "capping it. Every redemption resolves the same way however the price has moved, so the",
        "maker never chooses after the fact: it keeps the locked price as downside protection and",
        "loses the upside.",
        "",
        "This is also why there is no cancel in phase 2 even when the float is short: a maker can",
        "MAKE the float short on purpose, then take back stock that has risen. The cost of an",
        "unpaid issuer is now a bounded wait, and then its stock without anyone's permission.",
        "",
        "The stock return draws the vault's RETURN CREDIT, never the creation allowance, so it",
        "cannot be switched off by leaving that allowance unfunded."
      ],
      "discriminator": [
        87,
        159,
        17,
        115,
        73,
        79,
        42,
        253
      ],
      "accounts": [
        {
          "name": "caller",
          "docs": [
            "Anyone, including the maker. The outcome does not depend on who calls.",
            "`mut` because the caller funds the rent for the owed-balance account on first use."
          ],
          "writable": true,
          "signer": true
        },
        {
          "name": "venue",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  101,
                  110,
                  117,
                  101
                ]
              },
              {
                "kind": "account",
                "path": "venue.rwa_mint",
                "account": "Venue"
              }
            ]
          }
        },
        {
          "name": "redemption",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  114,
                  101,
                  100,
                  101,
                  109,
                  112,
                  116,
                  105,
                  111,
                  110
                ]
              },
              {
                "kind": "account",
                "path": "venue"
              },
              {
                "kind": "account",
                "path": "redemption.index",
                "account": "Redemption"
              }
            ]
          }
        },
        {
          "name": "maker_state",
          "docs": [
            "The maker's record, so resolving frees its one queue slot. Seeded on the REDEMPTION's",
            "maker, not the caller: both of these instructions are permissionless."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  109,
                  97,
                  107,
                  101,
                  114
                ]
              },
              {
                "kind": "account",
                "path": "venue"
              },
              {
                "kind": "account",
                "path": "redemption.maker",
                "account": "Redemption"
              }
            ]
          }
        },
        {
          "name": "rwa_mint"
        },
        {
          "name": "meta",
          "docs": [
            "Read-only: the asset's TokenMeta, which carries the LIVE payout denomination. The",
            "venue's own `payout_mint` is a snapshot taken at init; only this can disagree with it."
          ],
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  109,
                  101,
                  116,
                  97
                ]
              },
              {
                "kind": "account",
                "path": "venue.rwa_mint",
                "account": "Venue"
              }
            ],
            "program": {
              "kind": "const",
              "value": [
                113,
                171,
                40,
                163,
                170,
                246,
                110,
                27,
                186,
                10,
                11,
                75,
                97,
                138,
                197,
                88,
                115,
                241,
                208,
                65,
                38,
                70,
                73,
                244,
                126,
                46,
                230,
                163,
                54,
                150,
                249,
                158
              ]
            }
          }
        },
        {
          "name": "payout_mint"
        },
        {
          "name": "vault",
          "writable": true
        },
        {
          "name": "vault_state",
          "docs": [
            "The vault's own account, for its owed-cash total. `available_float` must exclude cash a",
            "deferred payout already owes a maker, or the next head is paid with it twice.",
            "`mut`: `credit_owed_payment` writes `total_owed_payment` on this account through the",
            "CPI below. It worked without the flag only because `vault` above aliases the same",
            "address and carries the write lock — which is not something to rely on (R4-8)."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  97,
                  117,
                  108,
                  116
                ]
              },
              {
                "kind": "account",
                "path": "venue.rwa_mint",
                "account": "Venue"
              }
            ],
            "program": {
              "kind": "account",
              "path": "vault_program"
            }
          }
        },
        {
          "name": "venue_allowance",
          "docs": [
            "PINNED BY SEEDS, not just by its `venue` field (R4-8). The field check alone accepts any",
            "allowance account governance has ever created for this venue — including one for a",
            "different mint — and on the flat/fallen return branch nothing re-reads it afterwards, so",
            "a stray allowance with payout 0 would let anyone drive a maker into a stock return it",
            "never asked for. The canonical address is the only one that can be passed now."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  101,
                  110,
                  117,
                  101,
                  95,
                  97,
                  108,
                  108,
                  111,
                  119,
                  97,
                  110,
                  99,
                  101
                ]
              },
              {
                "kind": "account",
                "path": "venue.rwa_mint",
                "account": "Venue"
              },
              {
                "kind": "account",
                "path": "venue"
              }
            ],
            "program": {
              "kind": "account",
              "path": "vault_program"
            }
          }
        },
        {
          "name": "asset",
          "docs": [
            "The market asset, for the LIVE price the phase-3 return cap is measured against."
          ]
        },
        {
          "name": "owed",
          "docs": [
            "Where a resolution records what it owes. init_if_needed because the first resolution for",
            "a given maker is the one that creates it, and resolution must never fail for want of an",
            "account someone forgot to make."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  111,
                  119,
                  101,
                  100
                ]
              },
              {
                "kind": "account",
                "path": "venue"
              },
              {
                "kind": "account",
                "path": "redemption.maker",
                "account": "Redemption"
              }
            ]
          }
        },
        {
          "name": "owed_treasury",
          "docs": [
            "The treasury's own owed balance, for the deferred protocol fee. Same account type and",
            "the same `withdraw_owed` delivers it, so the fee is not a special case anywhere.",
            "",
            "OPTIONAL, and this is the only shape that works. A maker MAY be the treasury, and then",
            "this derives to the same address as `owed` — two `init_if_needed` handles on one",
            "account. On the first resolution that account does not exist yet: `owed` allocates and",
            "zeroes it, Anchor writes the discriminator only at exit, and the second handle then",
            "reads a zeroed discriminator and fails with AccountDiscriminatorMismatch. So in that",
            "case the caller passes None and the fee is credited into `owed` instead.",
            "",
            "Pass None when `redemption.maker == venue.treasury`, and Some otherwise; the handler",
            "checks both directions. Getting it wrong aborts, which is the same as getting any other",
            "account wrong — avoidable by any caller, and resolution is permissionless, so it cannot",
            "be used to freeze a head."
          ],
          "writable": true,
          "optional": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  111,
                  119,
                  101,
                  100
                ]
              },
              {
                "kind": "account",
                "path": "venue"
              },
              {
                "kind": "account",
                "path": "venue.treasury",
                "account": "Venue"
              }
            ]
          }
        },
        {
          "name": "vault_rwa_ata",
          "writable": true
        },
        {
          "name": "vault_payout_ata",
          "writable": true
        },
        {
          "name": "rwa_token_program"
        },
        {
          "name": "payout_token_program"
        },
        {
          "name": "vault_program",
          "address": "A5SYMN5DGKWo8oPwDgWUxCZHZA7TaCkLbguSrLiWc91"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "_index",
          "type": "u64"
        }
      ]
    },
    {
      "name": "sell_to",
      "docs": [
        "Sell `amount` to a maker at its bid."
      ],
      "discriminator": [
        154,
        78,
        189,
        231,
        17,
        188,
        43,
        153
      ],
      "accounts": [
        {
          "name": "investor",
          "signer": true
        },
        {
          "name": "venue",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  101,
                  110,
                  117,
                  101
                ]
              },
              {
                "kind": "account",
                "path": "venue.rwa_mint",
                "account": "Venue"
              }
            ]
          }
        },
        {
          "name": "approval",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  109,
                  97,
                  107,
                  101,
                  114,
                  95,
                  97,
                  112,
                  112,
                  114,
                  111,
                  118,
                  97,
                  108
                ]
              },
              {
                "kind": "account",
                "path": "maker_state.maker",
                "account": "MakerState"
              }
            ]
          }
        },
        {
          "name": "maker_state",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  109,
                  97,
                  107,
                  101,
                  114
                ]
              },
              {
                "kind": "account",
                "path": "venue"
              },
              {
                "kind": "account",
                "path": "maker_state.maker",
                "account": "MakerState"
              }
            ]
          }
        },
        {
          "name": "asset"
        },
        {
          "name": "rwa_mint"
        },
        {
          "name": "payout_mint"
        },
        {
          "name": "maker_rwa_ata",
          "writable": true
        },
        {
          "name": "maker_payout_ata",
          "writable": true
        },
        {
          "name": "investor_rwa_ata",
          "writable": true
        },
        {
          "name": "investor_payout_ata",
          "writable": true
        },
        {
          "name": "treasury_payout_ata",
          "writable": true
        },
        {
          "name": "rwa_token_program"
        },
        {
          "name": "payout_token_program"
        }
      ],
      "args": [
        {
          "name": "amount",
          "type": "u64"
        },
        {
          "name": "min_payout",
          "type": "u64"
        }
      ]
    },
    {
      "name": "set_config_authority",
      "discriminator": [
        16,
        200,
        212,
        18,
        95,
        43,
        107,
        89
      ],
      "accounts": [
        {
          "name": "signer",
          "signer": true
        },
        {
          "name": "config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  99,
                  111,
                  110,
                  102,
                  105,
                  103
                ]
              }
            ]
          }
        }
      ],
      "args": [
        {
          "name": "authority",
          "type": "pubkey"
        },
        {
          "name": "operator",
          "type": "pubkey"
        }
      ]
    },
    {
      "name": "set_maker",
      "docs": [
        "Per-asset activation (I9, second gate)."
      ],
      "discriminator": [
        175,
        137,
        230,
        154,
        116,
        202,
        92,
        124
      ],
      "accounts": [
        {
          "name": "venue_link",
          "docs": [
            "call is onboarding rather than standing a maker down (R5-1).",
            "",
            "Onboarding into a half-wired system is the dangerous state, and neither half fails",
            "loudly: a venue the Market does not know about lets its own makers sell there, which is",
            "the whole of I16, and `rwa_exit` resolves venues through this same link, so a wind-down",
            "would open straight over the queue.",
            "",
            "But STANDING A MAKER DOWN must work whatever the wiring says. As an Anchor constraint",
            "this applied to both directions, so once the link was re-pointed governance could no",
            "longer de-approve or deactivate anyone — the off switch became hostage to exactly the",
            "state it exists to get out of. Base already had this right (`if (approved)` in",
            "VenueFactory). Unchecked so the account may legitimately be stale on the removal path;",
            "`require_wired` does the seeds, owner and target checks on the other."
          ]
        },
        {
          "name": "payer",
          "writable": true,
          "signer": true
        },
        {
          "name": "config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  99,
                  111,
                  110,
                  102,
                  105,
                  103
                ]
              }
            ]
          }
        },
        {
          "name": "authority",
          "signer": true
        },
        {
          "name": "venue",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  101,
                  110,
                  117,
                  101
                ]
              },
              {
                "kind": "account",
                "path": "venue.rwa_mint",
                "account": "Venue"
              }
            ]
          }
        },
        {
          "name": "maker"
        },
        {
          "name": "maker_state",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  109,
                  97,
                  107,
                  101,
                  114
                ]
              },
              {
                "kind": "account",
                "path": "venue"
              },
              {
                "kind": "account",
                "path": "maker"
              }
            ]
          }
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "active",
          "type": "bool"
        }
      ]
    },
    {
      "name": "set_maker_approval",
      "docs": [
        "Firm-level approval (I9, first gate). Global: revoking stops the firm on every asset."
      ],
      "discriminator": [
        144,
        193,
        81,
        226,
        232,
        16,
        52,
        99
      ],
      "accounts": [
        {
          "name": "venue_link",
          "docs": [
            "call is onboarding rather than standing a maker down (R5-1).",
            "",
            "Onboarding into a half-wired system is the dangerous state, and neither half fails",
            "loudly: a venue the Market does not know about lets its own makers sell there, which is",
            "the whole of I16, and `rwa_exit` resolves venues through this same link, so a wind-down",
            "would open straight over the queue.",
            "",
            "But STANDING A MAKER DOWN must work whatever the wiring says. As an Anchor constraint",
            "this applied to both directions, so once the link was re-pointed governance could no",
            "longer de-approve or deactivate anyone — the off switch became hostage to exactly the",
            "state it exists to get out of. Base already had this right (`if (approved)` in",
            "VenueFactory). Unchecked so the account may legitimately be stale on the removal path;",
            "`require_wired` does the seeds, owner and target checks on the other."
          ]
        },
        {
          "name": "payer",
          "writable": true,
          "signer": true
        },
        {
          "name": "config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  99,
                  111,
                  110,
                  102,
                  105,
                  103
                ]
              }
            ]
          }
        },
        {
          "name": "authority",
          "signer": true
        },
        {
          "name": "maker"
        },
        {
          "name": "approval",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  109,
                  97,
                  107,
                  101,
                  114,
                  95,
                  97,
                  112,
                  112,
                  114,
                  111,
                  118,
                  97,
                  108
                ]
              },
              {
                "kind": "account",
                "path": "maker"
              }
            ]
          }
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "approved",
          "type": "bool"
        }
      ]
    },
    {
      "name": "set_params",
      "discriminator": [
        27,
        234,
        178,
        52,
        147,
        2,
        187,
        141
      ],
      "accounts": [
        {
          "name": "config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  99,
                  111,
                  110,
                  102,
                  105,
                  103
                ]
              }
            ]
          }
        },
        {
          "name": "authority",
          "signer": true
        },
        {
          "name": "venue",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  101,
                  110,
                  117,
                  101
                ]
              },
              {
                "kind": "account",
                "path": "venue.rwa_mint",
                "account": "Venue"
              }
            ]
          }
        }
      ],
      "args": [
        {
          "name": "p",
          "type": {
            "defined": {
              "name": "VenueParams"
            }
          }
        }
      ]
    },
    {
      "name": "set_paused",
      "discriminator": [
        91,
        60,
        125,
        192,
        176,
        225,
        166,
        218
      ],
      "accounts": [
        {
          "name": "config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  99,
                  111,
                  110,
                  102,
                  105,
                  103
                ]
              }
            ]
          }
        },
        {
          "name": "authority",
          "signer": true
        },
        {
          "name": "venue",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  101,
                  110,
                  117,
                  101
                ]
              },
              {
                "kind": "account",
                "path": "venue.rwa_mint",
                "account": "Venue"
              }
            ]
          }
        }
      ],
      "args": [
        {
          "name": "paused",
          "type": "bool"
        }
      ]
    },
    {
      "name": "set_quote",
      "docs": [
        "Publish a two-sided quote, as SPREADS either side of the market's price.",
        "",
        "Spreads, not prices, so a quote tracks accrual by itself. A fixed price on an instrument",
        "gaining ~0.04%/day is stale within hours and the maker is picked off on whichever side",
        "has drifted. A maker requotes to change its spread or its validity, not to follow the",
        "market."
      ],
      "discriminator": [
        59,
        95,
        185,
        175,
        67,
        228,
        200,
        29
      ],
      "accounts": [
        {
          "name": "maker",
          "signer": true
        },
        {
          "name": "venue",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  101,
                  110,
                  117,
                  101
                ]
              },
              {
                "kind": "account",
                "path": "venue.rwa_mint",
                "account": "Venue"
              }
            ]
          }
        },
        {
          "name": "approval",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  109,
                  97,
                  107,
                  101,
                  114,
                  95,
                  97,
                  112,
                  112,
                  114,
                  111,
                  118,
                  97,
                  108
                ]
              },
              {
                "kind": "account",
                "path": "maker"
              }
            ]
          }
        },
        {
          "name": "maker_state",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  109,
                  97,
                  107,
                  101,
                  114
                ]
              },
              {
                "kind": "account",
                "path": "venue"
              },
              {
                "kind": "account",
                "path": "maker"
              }
            ]
          }
        }
      ],
      "args": [
        {
          "name": "bid_spread_bps",
          "type": "u16"
        },
        {
          "name": "ask_spread_bps",
          "type": "u16"
        },
        {
          "name": "valid_until",
          "type": "i64"
        }
      ]
    },
    {
      "name": "set_treasury",
      "docs": [
        "Move where protocol fees are paid. Parity with `VenueFactory.setVenueTreasury`.",
        "",
        "Every cash path constrains `treasury_payout_ata.owner` to this key, so without a setter",
        "a compromised or retired treasury could only be replaced by redeploying the venue — and",
        "a venue cannot be redeployed for one asset without stranding its queue. Taken as an",
        "argument rather than an account because only the key is stored; the ATA is supplied per",
        "transaction and checked against it."
      ],
      "discriminator": [
        57,
        97,
        196,
        95,
        195,
        206,
        106,
        136
      ],
      "accounts": [
        {
          "name": "config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  99,
                  111,
                  110,
                  102,
                  105,
                  103
                ]
              }
            ]
          }
        },
        {
          "name": "authority",
          "signer": true
        },
        {
          "name": "venue",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  101,
                  110,
                  117,
                  101
                ]
              },
              {
                "kind": "account",
                "path": "venue.rwa_mint",
                "account": "Venue"
              }
            ]
          }
        }
      ],
      "args": [
        {
          "name": "treasury",
          "type": "pubkey"
        }
      ]
    },
    {
      "name": "withdraw_owed",
      "docs": [
        "Deliver whatever a resolution recorded but did not move — stock, cash, or both.",
        "",
        "PERMISSIONLESS, and it always pays the maker, never the caller. Two reasons.",
        "",
        "It is pure benefit to the maker, exactly as a phase-1 claim is, so a maker that is",
        "offline is not thereby owed nothing.",
        "",
        "More importantly, rwa_exit pays holders and excludes the vault, so stock still owed at",
        "exit would be swept with the residue. Anyone can push it out beforehand. Note what this",
        "deliberately is NOT: flatness does not test owed == 0. Making exit wait on a delivery",
        "the maker can refuse would hand back the veto over exit that this design removes.",
        "",
        "Failing here is harmless and correct — nothing depends on it, so a caller whose transfer",
        "still fails simply tries again."
      ],
      "discriminator": [
        110,
        222,
        234,
        254,
        112,
        86,
        192,
        66
      ],
      "accounts": [
        {
          "name": "caller",
          "signer": true
        },
        {
          "name": "venue",
          "docs": [
            "`mut` because delivering stock discharges `total_owed_stock`, which gates the wind-down."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  101,
                  110,
                  117,
                  101
                ]
              },
              {
                "kind": "account",
                "path": "venue.rwa_mint",
                "account": "Venue"
              }
            ]
          }
        },
        {
          "name": "owed",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  111,
                  119,
                  101,
                  100
                ]
              },
              {
                "kind": "account",
                "path": "venue"
              },
              {
                "kind": "account",
                "path": "owed.maker",
                "account": "OwedBalance"
              }
            ]
          }
        },
        {
          "name": "rwa_mint"
        },
        {
          "name": "payout_mint"
        },
        {
          "name": "vault",
          "writable": true
        },
        {
          "name": "vault_state",
          "docs": [
            "The vault's own account, for the owed-cash fence this instruction discharges."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  97,
                  117,
                  108,
                  116
                ]
              },
              {
                "kind": "account",
                "path": "venue.rwa_mint",
                "account": "Venue"
              }
            ],
            "program": {
              "kind": "account",
              "path": "vault_program"
            }
          }
        },
        {
          "name": "venue_allowance",
          "docs": [
            "PINNED BY SEEDS, not just by its `venue` field (R4-8). The field check alone accepts any",
            "allowance account governance has ever created for this venue — including one for a",
            "different mint — and on the flat/fallen return branch nothing re-reads it afterwards, so",
            "a stray allowance with payout 0 would let anyone drive a maker into a stock return it",
            "never asked for. The canonical address is the only one that can be passed now."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  101,
                  110,
                  117,
                  101,
                  95,
                  97,
                  108,
                  108,
                  111,
                  119,
                  97,
                  110,
                  99,
                  101
                ]
              },
              {
                "kind": "account",
                "path": "venue.rwa_mint",
                "account": "Venue"
              },
              {
                "kind": "account",
                "path": "venue"
              }
            ],
            "program": {
              "kind": "account",
              "path": "vault_program"
            }
          }
        },
        {
          "name": "vault_rwa_ata",
          "writable": true
        },
        {
          "name": "vault_payout_ata",
          "writable": true
        },
        {
          "name": "maker_rwa_ata",
          "docs": [
            "Destinations are pinned to the OWED MAKER, not to the caller. This instruction is",
            "permissionless, so without that it would be a licence to redirect someone else's money."
          ],
          "writable": true
        },
        {
          "name": "maker_payout_ata",
          "writable": true
        },
        {
          "name": "rwa_token_program"
        },
        {
          "name": "payout_token_program"
        },
        {
          "name": "vault_program",
          "address": "A5SYMN5DGKWo8oPwDgWUxCZHZA7TaCkLbguSrLiWc91"
        }
      ],
      "args": []
    },
    {
      "name": "withdraw_owed_cash",
      "docs": [
        "Deliver ONLY the cash leg. See `withdraw_owed_stock`."
      ],
      "discriminator": [
        72,
        113,
        77,
        43,
        107,
        18,
        166,
        225
      ],
      "accounts": [
        {
          "name": "caller",
          "signer": true
        },
        {
          "name": "venue",
          "docs": [
            "`mut` because delivering stock discharges `total_owed_stock`, which gates the wind-down."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  101,
                  110,
                  117,
                  101
                ]
              },
              {
                "kind": "account",
                "path": "venue.rwa_mint",
                "account": "Venue"
              }
            ]
          }
        },
        {
          "name": "owed",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  111,
                  119,
                  101,
                  100
                ]
              },
              {
                "kind": "account",
                "path": "venue"
              },
              {
                "kind": "account",
                "path": "owed.maker",
                "account": "OwedBalance"
              }
            ]
          }
        },
        {
          "name": "rwa_mint"
        },
        {
          "name": "payout_mint"
        },
        {
          "name": "vault",
          "writable": true
        },
        {
          "name": "vault_state",
          "docs": [
            "The vault's own account, for the owed-cash fence this instruction discharges."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  97,
                  117,
                  108,
                  116
                ]
              },
              {
                "kind": "account",
                "path": "venue.rwa_mint",
                "account": "Venue"
              }
            ],
            "program": {
              "kind": "account",
              "path": "vault_program"
            }
          }
        },
        {
          "name": "venue_allowance",
          "docs": [
            "PINNED BY SEEDS, not just by its `venue` field (R4-8). The field check alone accepts any",
            "allowance account governance has ever created for this venue — including one for a",
            "different mint — and on the flat/fallen return branch nothing re-reads it afterwards, so",
            "a stray allowance with payout 0 would let anyone drive a maker into a stock return it",
            "never asked for. The canonical address is the only one that can be passed now."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  101,
                  110,
                  117,
                  101,
                  95,
                  97,
                  108,
                  108,
                  111,
                  119,
                  97,
                  110,
                  99,
                  101
                ]
              },
              {
                "kind": "account",
                "path": "venue.rwa_mint",
                "account": "Venue"
              },
              {
                "kind": "account",
                "path": "venue"
              }
            ],
            "program": {
              "kind": "account",
              "path": "vault_program"
            }
          }
        },
        {
          "name": "vault_rwa_ata",
          "writable": true
        },
        {
          "name": "vault_payout_ata",
          "writable": true
        },
        {
          "name": "maker_rwa_ata",
          "docs": [
            "Destinations are pinned to the OWED MAKER, not to the caller. This instruction is",
            "permissionless, so without that it would be a licence to redirect someone else's money."
          ],
          "writable": true
        },
        {
          "name": "maker_payout_ata",
          "writable": true
        },
        {
          "name": "rwa_token_program"
        },
        {
          "name": "payout_token_program"
        },
        {
          "name": "vault_program",
          "address": "A5SYMN5DGKWo8oPwDgWUxCZHZA7TaCkLbguSrLiWc91"
        }
      ],
      "args": []
    },
    {
      "name": "withdraw_owed_stock",
      "docs": [
        "Deliver ONLY the stock leg. Same guarantees as `withdraw_owed`.",
        "",
        "The legs are separately callable because they fail for unrelated reasons, and one must",
        "not hold the other hostage (R3-7d). A frozen or closed RWA account must not stop a maker",
        "collecting its cash, and — because a wind-down now waits for owed stock to be delivered",
        "— whoever opens one must be able to push the stock out without the cash leg's problems."
      ],
      "discriminator": [
        46,
        21,
        194,
        39,
        1,
        180,
        79,
        110
      ],
      "accounts": [
        {
          "name": "caller",
          "signer": true
        },
        {
          "name": "venue",
          "docs": [
            "`mut` because delivering stock discharges `total_owed_stock`, which gates the wind-down."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  101,
                  110,
                  117,
                  101
                ]
              },
              {
                "kind": "account",
                "path": "venue.rwa_mint",
                "account": "Venue"
              }
            ]
          }
        },
        {
          "name": "owed",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  111,
                  119,
                  101,
                  100
                ]
              },
              {
                "kind": "account",
                "path": "venue"
              },
              {
                "kind": "account",
                "path": "owed.maker",
                "account": "OwedBalance"
              }
            ]
          }
        },
        {
          "name": "rwa_mint"
        },
        {
          "name": "payout_mint"
        },
        {
          "name": "vault",
          "writable": true
        },
        {
          "name": "vault_state",
          "docs": [
            "The vault's own account, for the owed-cash fence this instruction discharges."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  97,
                  117,
                  108,
                  116
                ]
              },
              {
                "kind": "account",
                "path": "venue.rwa_mint",
                "account": "Venue"
              }
            ],
            "program": {
              "kind": "account",
              "path": "vault_program"
            }
          }
        },
        {
          "name": "venue_allowance",
          "docs": [
            "PINNED BY SEEDS, not just by its `venue` field (R4-8). The field check alone accepts any",
            "allowance account governance has ever created for this venue — including one for a",
            "different mint — and on the flat/fallen return branch nothing re-reads it afterwards, so",
            "a stray allowance with payout 0 would let anyone drive a maker into a stock return it",
            "never asked for. The canonical address is the only one that can be passed now."
          ],
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  118,
                  101,
                  110,
                  117,
                  101,
                  95,
                  97,
                  108,
                  108,
                  111,
                  119,
                  97,
                  110,
                  99,
                  101
                ]
              },
              {
                "kind": "account",
                "path": "venue.rwa_mint",
                "account": "Venue"
              },
              {
                "kind": "account",
                "path": "venue"
              }
            ],
            "program": {
              "kind": "account",
              "path": "vault_program"
            }
          }
        },
        {
          "name": "vault_rwa_ata",
          "writable": true
        },
        {
          "name": "vault_payout_ata",
          "writable": true
        },
        {
          "name": "maker_rwa_ata",
          "docs": [
            "Destinations are pinned to the OWED MAKER, not to the caller. This instruction is",
            "permissionless, so without that it would be a licence to redirect someone else's money."
          ],
          "writable": true
        },
        {
          "name": "maker_payout_ata",
          "writable": true
        },
        {
          "name": "rwa_token_program"
        },
        {
          "name": "payout_token_program"
        },
        {
          "name": "vault_program",
          "address": "A5SYMN5DGKWo8oPwDgWUxCZHZA7TaCkLbguSrLiWc91"
        }
      ],
      "args": []
    }
  ],
  "accounts": [
    {
      "name": "Asset",
      "discriminator": [
        234,
        180,
        241,
        252,
        139,
        224,
        160,
        8
      ]
    },
    {
      "name": "Config",
      "discriminator": [
        155,
        12,
        170,
        224,
        30,
        250,
        204,
        130
      ]
    },
    {
      "name": "MakerApproval",
      "discriminator": [
        90,
        133,
        93,
        147,
        212,
        29,
        5,
        191
      ]
    },
    {
      "name": "MakerState",
      "discriminator": [
        153,
        108,
        123,
        198,
        57,
        171,
        75,
        12
      ]
    },
    {
      "name": "OwedBalance",
      "discriminator": [
        154,
        254,
        0,
        51,
        56,
        237,
        127,
        176
      ]
    },
    {
      "name": "Redemption",
      "discriminator": [
        112,
        75,
        232,
        189,
        22,
        114,
        156,
        203
      ]
    },
    {
      "name": "TokenMeta",
      "discriminator": [
        130,
        87,
        174,
        35,
        21,
        44,
        92,
        19
      ]
    },
    {
      "name": "Vault",
      "discriminator": [
        211,
        8,
        232,
        43,
        2,
        152,
        117,
        119
      ]
    },
    {
      "name": "Venue",
      "discriminator": [
        8,
        155,
        85,
        226,
        234,
        173,
        42,
        242
      ]
    },
    {
      "name": "VenueAllowance",
      "discriminator": [
        91,
        148,
        10,
        78,
        228,
        123,
        45,
        64
      ]
    },
    {
      "name": "VenueLink",
      "discriminator": [
        197,
        70,
        34,
        152,
        183,
        67,
        68,
        38
      ]
    }
  ],
  "events": [
    {
      "name": "Created",
      "discriminator": [
        65,
        254,
        68,
        245,
        102,
        148,
        244,
        76
      ]
    },
    {
      "name": "OwedWithdrawn",
      "discriminator": [
        5,
        182,
        86,
        222,
        137,
        212,
        104,
        229
      ]
    },
    {
      "name": "QuoteSet",
      "discriminator": [
        216,
        112,
        83,
        84,
        181,
        53,
        176,
        105
      ]
    },
    {
      "name": "RedemptionCancelled",
      "discriminator": [
        22,
        106,
        118,
        26,
        83,
        110,
        71,
        174
      ]
    },
    {
      "name": "RedemptionPaid",
      "discriminator": [
        56,
        163,
        25,
        104,
        151,
        22,
        248,
        180
      ]
    },
    {
      "name": "RedemptionRequested",
      "discriminator": [
        245,
        155,
        98,
        131,
        210,
        25,
        137,
        146
      ]
    },
    {
      "name": "Traded",
      "discriminator": [
        225,
        202,
        73,
        175,
        147,
        43,
        160,
        150
      ]
    },
    {
      "name": "VenueCreated",
      "discriminator": [
        43,
        254,
        195,
        223,
        129,
        54,
        53,
        83
      ]
    }
  ],
  "errors": [
    {
      "code": 6000,
      "name": "Unauthorized",
      "msg": "caller is not permitted"
    },
    {
      "code": 6001,
      "name": "NotAnActiveMaker",
      "msg": "maker is not approved and active for this asset"
    },
    {
      "code": 6002,
      "name": "InvalidAmount",
      "msg": "amount is zero or rounds to zero"
    },
    {
      "code": 6003,
      "name": "AssetNotTradeable",
      "msg": "asset is not tradeable"
    },
    {
      "code": 6004,
      "name": "DailyCapExceeded",
      "msg": "per-maker daily creation cap exceeded"
    },
    {
      "code": 6005,
      "name": "SlippageExceeded",
      "msg": "result is worse than the caller's bound"
    },
    {
      "code": 6006,
      "name": "DeadlineExpired",
      "msg": "request deadline has passed"
    },
    {
      "code": 6007,
      "name": "NotAtQueueHead",
      "msg": "not the head of the redemption queue"
    },
    {
      "code": 6008,
      "name": "NothingOwed",
      "msg": "nothing is owed to this maker"
    },
    {
      "code": 6009,
      "name": "Paused",
      "msg": "venue is paused"
    },
    {
      "code": 6010,
      "name": "QuoteTooWide",
      "msg": "quote is wider than permitted"
    },
    {
      "code": 6011,
      "name": "WrongAsset",
      "msg": "account does not belong to this venue"
    },
    {
      "code": 6012,
      "name": "InvalidParams",
      "msg": "parameter out of range"
    },
    {
      "code": 6013,
      "name": "MathOverflow",
      "msg": "arithmetic overflow"
    },
    {
      "code": 6014,
      "name": "AlreadyResolved",
      "msg": "redemption is already paid or cancelled"
    },
    {
      "code": 6015,
      "name": "NotYourRedemption",
      "msg": "only the maker may resolve this redemption"
    },
    {
      "code": 6016,
      "name": "UseResolve",
      "msg": "past the force-resolve window; call resolve_redeem"
    },
    {
      "code": 6017,
      "name": "TooEarlyToResolve",
      "msg": "the force-resolve window has not elapsed"
    },
    {
      "code": 6018,
      "name": "InsufficientFloat",
      "msg": "vault float does not cover this payout"
    },
    {
      "code": 6019,
      "name": "QuoteExpired",
      "msg": "quote has expired"
    },
    {
      "code": 6020,
      "name": "ValidityTooLong",
      "msg": "quote validity exceeds the cap"
    },
    {
      "code": 6021,
      "name": "WrongDestination",
      "msg": "token account does not belong to the party it must"
    },
    {
      "code": 6022,
      "name": "AlreadyQueued",
      "msg": "this maker already has a redemption in the queue; one at a time"
    },
    {
      "code": 6023,
      "name": "NotWiredToMarket",
      "msg": "rwa_market's venue link does not name this program; wire it before onboarding"
    }
  ],
  "types": [
    {
      "name": "Asset",
      "docs": [
        "LAYOUT IS READ BY BYTE OFFSET OUTSIDE THIS PROGRAM. price_cents @168, rate_bps @226,",
        "checkpoint_price_scaled @230, checkpoint_at @246, maturity_ts @262 are hardcoded in",
        "solana/scripts/price-feed-job.js (the Switchboard feed a lending market prices from) and in",
        "ge-onchain-frontend utils/solana/rwaMarket.js (displayed prices and quotes). Append only. A",
        "reordered or inserted field yields a plausible wrong price, not an error, in both places."
      ],
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "mint",
            "type": "pubkey"
          },
          {
            "name": "vault",
            "type": "pubkey"
          },
          {
            "name": "payout_mint",
            "type": "pubkey"
          },
          {
            "name": "admin",
            "type": "pubkey"
          },
          {
            "name": "price_updater",
            "type": "pubkey"
          },
          {
            "name": "price_cents",
            "type": "u64"
          },
          {
            "name": "fee_bps",
            "type": "u16"
          },
          {
            "name": "is_active",
            "type": "bool"
          },
          {
            "name": "max_per_tx",
            "type": "u64"
          },
          {
            "name": "max_per_user",
            "type": "u64"
          },
          {
            "name": "bump",
            "type": "u8"
          },
          {
            "name": "last_price_update_ts",
            "docs": [
              "When `set_price` last ran. 0 = never (a freshly listed asset's first update is free)."
            ],
            "type": "i64"
          },
          {
            "name": "window_start_ts",
            "docs": [
              "Start of the current rate-limit window, and the price it opened at. Total movement away",
              "from the anchor is what the window cap bounds; the window re-anchors once it expires."
            ],
            "type": "i64"
          },
          {
            "name": "window_anchor_cents",
            "type": "u64"
          },
          {
            "name": "min_update_interval_secs",
            "docs": [
              "Per-asset overrides. 0 = use the module default."
            ],
            "type": "u32"
          },
          {
            "name": "max_window_deviation_bps",
            "type": "u16"
          },
          {
            "name": "rate_bps",
            "docs": [
              "Annual accrual rate in bps, signed (negative = amortising down). 0 = no accrual."
            ],
            "type": "i32"
          },
          {
            "name": "checkpoint_price_scaled",
            "docs": [
              "Checkpoint price at cents x ACCRUAL_SCALE. See C-10 on base_payout."
            ],
            "type": "u128"
          },
          {
            "name": "checkpoint_at",
            "docs": [
              "When the checkpoint was taken. Accrual runs from here. 0 = never checkpointed."
            ],
            "type": "i64"
          },
          {
            "name": "last_rate_update_ts",
            "docs": [
              "When set_rate last ran. 0 = never."
            ],
            "type": "i64"
          },
          {
            "name": "maturity_ts",
            "docs": [
              "Cached maturity, read from TokenMeta by set_rate. 0 = no maturity. Cached so the C-6",
              "clamp costs nothing on the trading path; safe because maturity_date is write-once."
            ],
            "type": "i64"
          },
          {
            "name": "allowance_spent_bps",
            "docs": [
              "Allowance used by price updates, in bps of the price before each update, summed."
            ],
            "type": "u16"
          },
          {
            "name": "allowance_at",
            "docs": [
              "When allowance_spent_bps was last written (unix seconds). 0 = never: full allowance."
            ],
            "type": "u32"
          }
        ]
      }
    },
    {
      "name": "Config",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "authority",
            "type": "pubkey"
          },
          {
            "name": "operator",
            "type": "pubkey"
          },
          {
            "name": "bump",
            "type": "u8"
          }
        ]
      }
    },
    {
      "name": "Created",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "venue",
            "type": "pubkey"
          },
          {
            "name": "maker",
            "type": "pubkey"
          },
          {
            "name": "cash_in",
            "type": "u64"
          },
          {
            "name": "stock_out",
            "type": "u64"
          },
          {
            "name": "price_scaled",
            "type": "u128"
          }
        ]
      }
    },
    {
      "name": "MakerApproval",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "maker",
            "type": "pubkey"
          },
          {
            "name": "approved",
            "type": "bool"
          },
          {
            "name": "bump",
            "type": "u8"
          }
        ]
      }
    },
    {
      "name": "MakerState",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "venue",
            "type": "pubkey"
          },
          {
            "name": "maker",
            "type": "pubkey"
          },
          {
            "name": "active",
            "type": "bool"
          },
          {
            "name": "created_on_day",
            "type": "u64"
          },
          {
            "name": "day",
            "type": "i64"
          },
          {
            "name": "bid_spread_bps",
            "type": "u16"
          },
          {
            "name": "ask_spread_bps",
            "type": "u16"
          },
          {
            "name": "quote_expiry",
            "type": "i64"
          },
          {
            "name": "bump",
            "type": "u8"
          },
          {
            "name": "has_queued_redemption",
            "docs": [
              "Whether this maker has a redemption in the queue that is neither paid nor returned.",
              "",
              "ONE AT A TIME, per maker per venue (user decision, 2026-10-08). A maker could otherwise",
              "fill the queue with its own requests and, under strict FIFO, decide the order everyone",
              "else is paid in — while each extra request eats float the first one is waiting for.",
              "",
              "Cleared where the HEAD ADVANCES, not where tokens are delivered: an owed balance",
              "waiting on `withdraw_owed` must not count as queued, or a leg nobody cranks would block",
              "that maker from ever redeeming again. Taken from the reserve, so the size is unchanged."
            ],
            "type": "bool"
          }
        ]
      }
    },
    {
      "name": "OwedBalance",
      "docs": [
        "What a resolution owes a maker but has not delivered.",
        "",
        "THE REASON THIS EXISTS IS A CHAIN DIFFERENCE, not a design preference. The EVM venue wraps",
        "each settlement leg in try/catch so a failed transfer becomes a recorded debt and the queue",
        "head still advances. Solana has no equivalent: a failed CPI aborts the whole instruction, so",
        "there is nothing to catch. Under strict FIFO a resolution that can abort is a queue that can",
        "freeze for ever, and an asset that can never reach a flat venue to exit through.",
        "",
        "So `resolve_redeem` moves NOTHING. It is bookkeeping only — mark, credit here, advance the",
        "head — which makes it unable to fail for any transfer reason, by construction rather than by",
        "catching. `withdraw_owed` moves the assets afterwards and may fail freely, because nothing",
        "depends on it. `claim_redeem` still pays directly: that is the happy path, and a claim that",
        "fails simply leaves the entry queued for phase 3."
      ],
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "venue",
            "type": "pubkey"
          },
          {
            "name": "maker",
            "type": "pubkey"
          },
          {
            "name": "stock",
            "type": "u64"
          },
          {
            "name": "cash",
            "type": "u64"
          },
          {
            "name": "bump",
            "type": "u8"
          }
        ]
      }
    },
    {
      "name": "OwedWithdrawn",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "venue",
            "type": "pubkey"
          },
          {
            "name": "maker",
            "type": "pubkey"
          },
          {
            "name": "stock",
            "type": "u64"
          },
          {
            "name": "cash",
            "type": "u64"
          }
        ]
      }
    },
    {
      "name": "QuoteSet",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "venue",
            "type": "pubkey"
          },
          {
            "name": "maker",
            "type": "pubkey"
          },
          {
            "name": "bid_spread_bps",
            "type": "u16"
          },
          {
            "name": "ask_spread_bps",
            "type": "u16"
          },
          {
            "name": "valid_until",
            "type": "i64"
          }
        ]
      }
    },
    {
      "name": "Redemption",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "venue",
            "type": "pubkey"
          },
          {
            "name": "index",
            "docs": [
              "Its own position in the venue's queue. Stored so the PDA seed can be rebuilt from the",
              "account rather than passed in and trusted."
            ],
            "type": "u64"
          },
          {
            "name": "maker",
            "type": "pubkey"
          },
          {
            "name": "amount",
            "type": "u64"
          },
          {
            "name": "locked_price_scaled",
            "docs": [
              "The price at request time. Never re-read (I5)."
            ],
            "type": "u128"
          },
          {
            "name": "requested_at",
            "type": "i64"
          },
          {
            "name": "redemption_fee_bps",
            "docs": [
              "Fees LOCKED with the price. Reading them at settlement let governance change a maker's",
              "payout after it had already delivered its stock and could no longer withdraw."
            ],
            "type": "u16"
          },
          {
            "name": "protocol_fee_bps",
            "type": "u16"
          },
          {
            "name": "min_payout",
            "docs": [
              "Least net cash the maker accepted, checked ONCE when the request was made. Kept for the",
              "record: it is part of what the maker agreed to, not an input to settlement."
            ],
            "type": "u64"
          },
          {
            "name": "exclusive_from",
            "docs": [
              "When phase 2 opens and when phase 3 does, FIXED here at request time. Read live, these",
              "would let governance extend a wait the maker has already begun and cannot leave — a",
              "window is part of the deal struck when the stock was handed over."
            ],
            "type": "i64"
          },
          {
            "name": "force_at",
            "type": "i64"
          },
          {
            "name": "paid",
            "type": "bool"
          },
          {
            "name": "cancelled",
            "type": "bool"
          },
          {
            "name": "bump",
            "type": "u8"
          }
        ]
      }
    },
    {
      "name": "RedemptionCancelled",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "venue",
            "type": "pubkey"
          },
          {
            "name": "maker",
            "type": "pubkey"
          },
          {
            "name": "amount",
            "type": "u64"
          }
        ]
      }
    },
    {
      "name": "RedemptionPaid",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "venue",
            "type": "pubkey"
          },
          {
            "name": "maker",
            "type": "pubkey"
          },
          {
            "name": "amount",
            "type": "u64"
          },
          {
            "name": "payout",
            "type": "u64"
          }
        ]
      }
    },
    {
      "name": "RedemptionRequested",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "venue",
            "type": "pubkey"
          },
          {
            "name": "index",
            "type": "u64"
          },
          {
            "name": "maker",
            "type": "pubkey"
          },
          {
            "name": "amount",
            "type": "u64"
          },
          {
            "name": "price_scaled",
            "type": "u128"
          }
        ]
      }
    },
    {
      "name": "TokenMeta",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "mint",
            "type": "pubkey"
          },
          {
            "name": "admin",
            "type": "pubkey"
          },
          {
            "name": "minter",
            "type": "pubkey"
          },
          {
            "name": "automation",
            "type": "pubkey"
          },
          {
            "name": "vault",
            "type": "pubkey"
          },
          {
            "name": "payout_token",
            "type": "pubkey"
          },
          {
            "name": "name",
            "type": "string"
          },
          {
            "name": "symbol",
            "type": "string"
          },
          {
            "name": "issuer",
            "type": "string"
          },
          {
            "name": "deal_url",
            "type": "string"
          },
          {
            "name": "investment_type",
            "type": "u8"
          },
          {
            "name": "investment_category",
            "type": "u8"
          },
          {
            "name": "payout_frequency",
            "type": "u8"
          },
          {
            "name": "token_entity_type",
            "type": "u8"
          },
          {
            "name": "interest_rate_bps",
            "type": "u16"
          },
          {
            "name": "maturity_date",
            "type": "i64"
          },
          {
            "name": "tenor_days",
            "type": "u32"
          },
          {
            "name": "decimals",
            "type": "u8"
          },
          {
            "name": "bump",
            "type": "u8"
          },
          {
            "name": "max_supply",
            "docs": [
              "Hard ceiling on total minted supply, in smallest units. 0 = uncapped.",
              "",
              "Appended after `bump` deliberately: MAX_SIZE already over-allocates by 64 bytes,",
              "and account data is zero-initialised, so meta accounts created before this field",
              "existed deserialise it as 0 (uncapped) rather than failing. No migration needed —",
              "call `set_max_supply` to arm the cap on an existing asset."
            ],
            "type": "u64"
          }
        ]
      }
    },
    {
      "name": "Traded",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "venue",
            "type": "pubkey"
          },
          {
            "name": "maker",
            "type": "pubkey"
          },
          {
            "name": "counterparty",
            "type": "pubkey"
          },
          {
            "name": "amount",
            "type": "u64"
          },
          {
            "name": "cash",
            "type": "u64"
          },
          {
            "name": "fee",
            "type": "u64"
          },
          {
            "name": "is_buy",
            "type": "bool"
          }
        ]
      }
    },
    {
      "name": "Vault",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "mint",
            "type": "pubkey"
          },
          {
            "name": "owner",
            "type": "pubkey"
          },
          {
            "name": "bump",
            "type": "u8"
          },
          {
            "name": "total_return_credit",
            "docs": [
              "Stock owed back to makers across ALL venues on this vault — the ring-fence floor.",
              "",
              "Per-venue `return_credit` on the allowance PDA cannot guard a withdrawal, because a",
              "withdrawal is not made in any venue's name and the vault cannot enumerate allowances.",
              "This is the number every path that releases stock has to respect, and it is the exact",
              "counterpart of VaultUpgradeable.totalReturnCredit on Base.",
              "",
              "Accounts created before this field existed are 73 bytes and must be grown by",
              "`migrate_vault` before they can be read. See that instruction."
            ],
            "type": "u64"
          },
          {
            "name": "market_program",
            "docs": [
              "The rwa_market deployment allowed to draw inventory for retail buys.",
              "",
              "Stored, never compiled in. `rwa_market` depends on this program, so depending back is a",
              "cycle cargo refuses — and a hardcoded id is a wire the compiler cannot check, which is",
              "the same mistake as a hardcoded venue id. Zero means no market is configured and",
              "`market_draw_stock` refuses outright, which fails CLOSED."
            ],
            "type": "pubkey"
          },
          {
            "name": "total_owed_payment",
            "docs": [
              "Cash a venue owes a maker but has not yet delivered — the payment-side ring-fence floor.",
              "",
              "The exact counterpart of `total_return_credit` on the stock side, and of",
              "VaultUpgradeable.totalOwedPayment on Base. A deferred payout leaves the cNGN sitting in",
              "this vault, and cash already spoken for must stop behaving like free cash: otherwise the",
              "next redemption's float includes money promised to the last one and the vault pays the",
              "same cNGN twice."
            ],
            "type": "u64"
          }
        ]
      }
    },
    {
      "name": "Venue",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "rwa_mint",
            "type": "pubkey"
          },
          {
            "name": "payout_mint",
            "type": "pubkey"
          },
          {
            "name": "vault",
            "type": "pubkey"
          },
          {
            "name": "asset",
            "type": "pubkey"
          },
          {
            "name": "treasury",
            "type": "pubkey"
          },
          {
            "name": "params",
            "type": {
              "defined": {
                "name": "VenueParams"
              }
            }
          },
          {
            "name": "paused",
            "type": "bool"
          },
          {
            "name": "pending_redemption",
            "type": "u64"
          },
          {
            "name": "redemption_count",
            "type": "u64"
          },
          {
            "name": "queue_head",
            "docs": [
              "Index of the oldest redemption not yet paid or returned — the queue's head.",
              "",
              "Redemptions resolve STRICTLY in request order, so this is just \"the next index to",
              "resolve\" and moves by exactly one per resolution. A request that cannot settle while",
              "something older waits is queued rather than paid out of turn, which is what stops a",
              "maker draining the float with a fresh request to starve its own older one."
            ],
            "type": "u64"
          },
          {
            "name": "total_owed_stock",
            "docs": [
              "Stock a resolution recorded as owed and `withdraw_owed` has not yet delivered.",
              "",
              "Exists so flatness can be answered in O(1): the wind-down pauses the token and the exit",
              "excludes the vault, so stock still sitting here when an exit opens can never be",
              "delivered afterwards (R3-4). Taken from the reserve, so the account size is unchanged."
            ],
            "type": "u64"
          },
          {
            "name": "bump",
            "type": "u8"
          }
        ]
      }
    },
    {
      "name": "VenueAllowance",
      "docs": [
        "A venue's remaining budget against one vault. Seeds [\"venue_allowance\", mint, venue]."
      ],
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "vault_mint",
            "type": "pubkey"
          },
          {
            "name": "venue",
            "type": "pubkey"
          },
          {
            "name": "stock_remaining",
            "docs": [
              "RWA smallest units the venue may still draw."
            ],
            "type": "u64"
          },
          {
            "name": "payout_remaining",
            "docs": [
              "Payout-token smallest units the venue may still draw."
            ],
            "type": "u64"
          },
          {
            "name": "return_credit",
            "docs": [
              "RWA units this vault owes BACK to the venue's makers.",
              "",
              "Separate from stock_remaining on purpose. That is a BUDGET and may be spent to zero or",
              "revoked; this is a DEBT, credited when a maker delivers stock into a redemption queue",
              "and consumed when that redemption is paid for. Returning what someone already delivered",
              "is not a grant, and funding it from the creation allowance made the maker's backstop",
              "depend on the issuer keeping that allowance topped up — which contradicts the single",
              "promise the backstop exists to make.",
              "",
              "Not settable by the owner: set_venue_allowance leaves it alone."
            ],
            "type": "u64"
          },
          {
            "name": "owed_payment",
            "docs": [
              "Payout-token units this vault owes a venue's makers for payouts already DECIDED.",
              "",
              "The cash twin of `return_credit`, and separate from `payout_remaining` for exactly the",
              "same reason: a budget may be lowered or revoked, a debt may not. The budget is charged",
              "when the payout is RECORDED (`credit_owed_payment`), and delivery draws this instead —",
              "so lowering the allowance afterwards cannot strand money the vault has already set",
              "aside, and two resolutions cannot each commit the same budget (R3-1)."
            ],
            "type": "u64"
          },
          {
            "name": "revoked",
            "docs": [
              "The issuer's OFF SWITCH, mirroring `VaultUpgradeable.isAuthorisedVenue` (R3-1).",
              "",
              "Revoking stops the venue taking on NEW obligations — `credit_return`, so no new",
              "redemption may be queued — and touches nothing it has already taken on. Both debts stay",
              "drawable, so a maker already in the queue is never stranded by it.",
              "",
              "Separate from zeroing the budgets, which is a different statement: a zero allowance",
              "means \"fund nothing more\", and a queued redemption then resolves to a stock return",
              "rather than cash. Revocation means \"take on nothing more\" and is the stronger of the two."
            ],
            "type": "bool"
          },
          {
            "name": "bump",
            "type": "u8"
          }
        ]
      }
    },
    {
      "name": "VenueCreated",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "venue",
            "type": "pubkey"
          },
          {
            "name": "rwa_mint",
            "type": "pubkey"
          },
          {
            "name": "vault",
            "type": "pubkey"
          }
        ]
      }
    },
    {
      "name": "VenueLink",
      "docs": [
        "The rwa_venue deployment this market defers to. See `set_venue_program`."
      ],
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "venue_program",
            "type": "pubkey"
          },
          {
            "name": "bump",
            "type": "u8"
          }
        ]
      }
    },
    {
      "name": "VenueParams",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "creation_fee_bps",
            "type": "u16"
          },
          {
            "name": "redemption_fee_bps",
            "type": "u16"
          },
          {
            "name": "protocol_fee_bps",
            "type": "u16"
          },
          {
            "name": "trade_fee_bps",
            "type": "u16"
          },
          {
            "name": "max_quote_spread_bps",
            "type": "u16"
          },
          {
            "name": "hard_band_bps",
            "type": "u16"
          },
          {
            "name": "retail_reserve",
            "type": "u64"
          },
          {
            "name": "daily_creation_cap",
            "type": "u64"
          },
          {
            "name": "min_depth",
            "type": "u64"
          },
          {
            "name": "auto_return_window",
            "type": "i64"
          },
          {
            "name": "force_resolve_window",
            "docs": [
              "After this, a queued redemption becomes anyone's to settle again. Must exceed",
              "auto_return_window — see the three phases in claim_redeem."
            ],
            "type": "i64"
          },
          {
            "name": "quote_validity",
            "type": "i64"
          }
        ]
      }
    }
  ]
}