{
  "address": "BJZ2V2tZKZaS4dyhGfkuFJi8skib48dyyqnvwyLbAaP",
  "metadata": {
    "name": "still",
    "version": "0.1.0",
    "spec": "0.1.0",
    "description": "Still: fixed-term USDC loans against memes and tokenised stocks on Solana, with no oracle and no liquidation"
  },
  "instructions": [
    {
      "name": "accept_admin",
      "discriminator": [
        112,
        42,
        45,
        90,
        116,
        181,
        13,
        170
      ],
      "accounts": [
        {
          "name": "next",
          "signer": true
        },
        {
          "name": "config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  99,
                  111,
                  110,
                  102,
                  105,
                  103
                ]
              }
            ]
          }
        }
      ],
      "args": []
    },
    {
      "name": "activate_rules",
      "discriminator": [
        48,
        211,
        190,
        188,
        120,
        92,
        142,
        188
      ],
      "accounts": [
        {
          "name": "vault",
          "writable": true
        }
      ],
      "args": []
    },
    {
      "name": "activate_slot",
      "discriminator": [
        19,
        48,
        240,
        71,
        176,
        163,
        250,
        50
      ],
      "accounts": [
        {
          "name": "vault",
          "writable": true
        }
      ],
      "args": [
        {
          "name": "index",
          "type": "u8"
        }
      ]
    },
    {
      "name": "cancel",
      "docs": [
        "Take a listing off the market. The borrower can do it any time before funding; anyone can once the listing",
        "window has passed. The collateral goes back to the borrower."
      ],
      "discriminator": [
        232,
        219,
        223,
        41,
        219,
        236,
        220,
        190
      ],
      "accounts": [
        {
          "name": "caller",
          "writable": true,
          "signer": true
        },
        {
          "name": "loan",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  108,
                  111,
                  97,
                  110
                ]
              },
              {
                "kind": "account",
                "path": "loan.id",
                "account": "Loan"
              }
            ]
          }
        },
        {
          "name": "borrower",
          "writable": true,
          "relations": [
            "loan"
          ]
        },
        {
          "name": "mint",
          "relations": [
            "loan"
          ]
        },
        {
          "name": "escrow",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "account",
                "path": "loan"
              },
              {
                "kind": "account",
                "path": "collateral_token_program"
              },
              {
                "kind": "account",
                "path": "mint"
              }
            ],
            "program": {
              "kind": "const",
              "value": [
                140,
                151,
                37,
                143,
                78,
                36,
                137,
                241,
                187,
                61,
                16,
                41,
                20,
                142,
                13,
                131,
                11,
                90,
                19,
                153,
                218,
                255,
                16,
                132,
                4,
                142,
                123,
                216,
                219,
                233,
                248,
                89
              ]
            }
          }
        },
        {
          "name": "borrower_tokens",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "account",
                "path": "borrower"
              },
              {
                "kind": "account",
                "path": "collateral_token_program"
              },
              {
                "kind": "account",
                "path": "mint"
              }
            ],
            "program": {
              "kind": "const",
              "value": [
                140,
                151,
                37,
                143,
                78,
                36,
                137,
                241,
                187,
                61,
                16,
                41,
                20,
                142,
                13,
                131,
                11,
                90,
                19,
                153,
                218,
                255,
                16,
                132,
                4,
                142,
                123,
                216,
                219,
                233,
                248,
                89
              ]
            }
          }
        },
        {
          "name": "collateral_token_program"
        },
        {
          "name": "associated_token_program",
          "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": []
    },
    {
      "name": "claim",
      "docs": [
        "A wallet lender takes the collateral once the term is over and the cap was not paid."
      ],
      "discriminator": [
        62,
        198,
        214,
        193,
        213,
        159,
        108,
        210
      ],
      "accounts": [
        {
          "name": "lender",
          "writable": true,
          "signer": true,
          "relations": [
            "loan"
          ]
        },
        {
          "name": "loan",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  108,
                  111,
                  97,
                  110
                ]
              },
              {
                "kind": "account",
                "path": "loan.id",
                "account": "Loan"
              }
            ]
          }
        },
        {
          "name": "borrower",
          "writable": true,
          "relations": [
            "loan"
          ]
        },
        {
          "name": "mint",
          "relations": [
            "loan"
          ]
        },
        {
          "name": "escrow",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "account",
                "path": "loan"
              },
              {
                "kind": "account",
                "path": "collateral_token_program"
              },
              {
                "kind": "account",
                "path": "mint"
              }
            ],
            "program": {
              "kind": "const",
              "value": [
                140,
                151,
                37,
                143,
                78,
                36,
                137,
                241,
                187,
                61,
                16,
                41,
                20,
                142,
                13,
                131,
                11,
                90,
                19,
                153,
                218,
                255,
                16,
                132,
                4,
                142,
                123,
                216,
                219,
                233,
                248,
                89
              ]
            }
          }
        },
        {
          "name": "lender_tokens",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "account",
                "path": "lender"
              },
              {
                "kind": "account",
                "path": "collateral_token_program"
              },
              {
                "kind": "account",
                "path": "mint"
              }
            ],
            "program": {
              "kind": "const",
              "value": [
                140,
                151,
                37,
                143,
                78,
                36,
                137,
                241,
                187,
                61,
                16,
                41,
                20,
                142,
                13,
                131,
                11,
                90,
                19,
                153,
                218,
                255,
                16,
                132,
                4,
                142,
                123,
                216,
                219,
                233,
                248,
                89
              ]
            }
          }
        },
        {
          "name": "collateral_token_program"
        },
        {
          "name": "associated_token_program",
          "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": []
    },
    {
      "name": "claim_recovery",
      "docs": [
        "Take this position's part of a slot's recovered collateral."
      ],
      "discriminator": [
        60,
        85,
        49,
        148,
        254,
        62,
        210,
        222
      ],
      "accounts": [
        {
          "name": "owner",
          "writable": true,
          "signer": true
        },
        {
          "name": "vault"
        },
        {
          "name": "position",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112,
                  111,
                  115,
                  105,
                  116,
                  105,
                  111,
                  110
                ]
              },
              {
                "kind": "account",
                "path": "vault"
              },
              {
                "kind": "account",
                "path": "owner"
              }
            ]
          }
        },
        {
          "name": "mint"
        },
        {
          "name": "vault_tokens",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "account",
                "path": "vault"
              },
              {
                "kind": "account",
                "path": "collateral_token_program"
              },
              {
                "kind": "account",
                "path": "mint"
              }
            ],
            "program": {
              "kind": "const",
              "value": [
                140,
                151,
                37,
                143,
                78,
                36,
                137,
                241,
                187,
                61,
                16,
                41,
                20,
                142,
                13,
                131,
                11,
                90,
                19,
                153,
                218,
                255,
                16,
                132,
                4,
                142,
                123,
                216,
                219,
                233,
                248,
                89
              ]
            }
          }
        },
        {
          "name": "owner_tokens",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "account",
                "path": "owner"
              },
              {
                "kind": "account",
                "path": "collateral_token_program"
              },
              {
                "kind": "account",
                "path": "mint"
              }
            ],
            "program": {
              "kind": "const",
              "value": [
                140,
                151,
                37,
                143,
                78,
                36,
                137,
                241,
                187,
                61,
                16,
                41,
                20,
                142,
                13,
                131,
                11,
                90,
                19,
                153,
                218,
                255,
                16,
                132,
                4,
                142,
                123,
                216,
                219,
                233,
                248,
                89
              ]
            }
          }
        },
        {
          "name": "collateral_token_program"
        },
        {
          "name": "associated_token_program",
          "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "index",
          "type": "u8"
        }
      ]
    },
    {
      "name": "collect",
      "docs": [
        "A wallet lender collects a repayment."
      ],
      "discriminator": [
        208,
        47,
        194,
        155,
        17,
        98,
        82,
        236
      ],
      "accounts": [
        {
          "name": "lender",
          "writable": true,
          "signer": true,
          "relations": [
            "loan"
          ]
        },
        {
          "name": "loan",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  108,
                  111,
                  97,
                  110
                ]
              },
              {
                "kind": "account",
                "path": "loan.id",
                "account": "Loan"
              }
            ]
          }
        },
        {
          "name": "lend_mint"
        },
        {
          "name": "repay_escrow",
          "writable": true
        },
        {
          "name": "lender_usdc",
          "writable": true
        },
        {
          "name": "lend_token_program"
        }
      ],
      "args": []
    },
    {
      "name": "create_vault",
      "discriminator": [
        29,
        237,
        247,
        208,
        193,
        82,
        54,
        135
      ],
      "accounts": [
        {
          "name": "admin",
          "writable": true,
          "signer": true,
          "relations": [
            "config"
          ]
        },
        {
          "name": "config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  99,
                  111,
                  110,
                  102,
                  105,
                  103
                ]
              }
            ]
          }
        },
        {
          "name": "vault",
          "writable": true
        },
        {
          "name": "lend_mint",
          "relations": [
            "config"
          ]
        },
        {
          "name": "vault_cash",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "account",
                "path": "vault"
              },
              {
                "kind": "account",
                "path": "lend_token_program"
              },
              {
                "kind": "account",
                "path": "lend_mint"
              }
            ],
            "program": {
              "kind": "const",
              "value": [
                140,
                151,
                37,
                143,
                78,
                36,
                137,
                241,
                187,
                61,
                16,
                41,
                20,
                142,
                13,
                131,
                11,
                90,
                19,
                153,
                218,
                255,
                16,
                132,
                4,
                142,
                123,
                216,
                219,
                233,
                248,
                89
              ]
            }
          }
        },
        {
          "name": "fee_recipient"
        },
        {
          "name": "lend_token_program"
        },
        {
          "name": "associated_token_program",
          "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "args",
          "type": {
            "defined": {
              "name": "VaultArgs"
            }
          }
        }
      ]
    },
    {
      "name": "deposit",
      "docs": [
        "Deposit USDC for vault shares at the current share price."
      ],
      "discriminator": [
        242,
        35,
        198,
        137,
        82,
        225,
        242,
        182
      ],
      "accounts": [
        {
          "name": "owner",
          "writable": true,
          "signer": true
        },
        {
          "name": "vault",
          "writable": true
        },
        {
          "name": "position",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112,
                  111,
                  115,
                  105,
                  116,
                  105,
                  111,
                  110
                ]
              },
              {
                "kind": "account",
                "path": "vault"
              },
              {
                "kind": "account",
                "path": "owner"
              }
            ]
          }
        },
        {
          "name": "lend_mint"
        },
        {
          "name": "owner_usdc",
          "writable": true
        },
        {
          "name": "vault_cash",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "account",
                "path": "vault"
              },
              {
                "kind": "account",
                "path": "lend_token_program"
              },
              {
                "kind": "account",
                "path": "lend_mint"
              }
            ],
            "program": {
              "kind": "const",
              "value": [
                140,
                151,
                37,
                143,
                78,
                36,
                137,
                241,
                187,
                61,
                16,
                41,
                20,
                142,
                13,
                131,
                11,
                90,
                19,
                153,
                218,
                255,
                16,
                132,
                4,
                142,
                123,
                216,
                219,
                233,
                248,
                89
              ]
            }
          }
        },
        {
          "name": "lend_token_program"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "amount",
          "type": "u64"
        }
      ]
    },
    {
      "name": "fund_direct",
      "docs": [
        "A wallet funds the whole ask. The borrower receives the ask less the origination fee; the repayment, if it",
        "comes, waits in the loan's own USDC account for the lender to collect."
      ],
      "discriminator": [
        179,
        213,
        239,
        155,
        186,
        249,
        144,
        242
      ],
      "accounts": [
        {
          "name": "lender",
          "writable": true,
          "signer": true
        },
        {
          "name": "config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  99,
                  111,
                  110,
                  102,
                  105,
                  103
                ]
              }
            ]
          }
        },
        {
          "name": "loan",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  108,
                  111,
                  97,
                  110
                ]
              },
              {
                "kind": "account",
                "path": "loan.id",
                "account": "Loan"
              }
            ]
          }
        },
        {
          "name": "lend_mint",
          "relations": [
            "config"
          ]
        },
        {
          "name": "lender_usdc",
          "writable": true
        },
        {
          "name": "borrower",
          "relations": [
            "loan"
          ]
        },
        {
          "name": "borrower_usdc",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "account",
                "path": "borrower"
              },
              {
                "kind": "account",
                "path": "lend_token_program"
              },
              {
                "kind": "account",
                "path": "lend_mint"
              }
            ],
            "program": {
              "kind": "const",
              "value": [
                140,
                151,
                37,
                143,
                78,
                36,
                137,
                241,
                187,
                61,
                16,
                41,
                20,
                142,
                13,
                131,
                11,
                90,
                19,
                153,
                218,
                255,
                16,
                132,
                4,
                142,
                123,
                216,
                219,
                233,
                248,
                89
              ]
            }
          }
        },
        {
          "name": "repay_escrow",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "account",
                "path": "loan"
              },
              {
                "kind": "account",
                "path": "lend_token_program"
              },
              {
                "kind": "account",
                "path": "lend_mint"
              }
            ],
            "program": {
              "kind": "const",
              "value": [
                140,
                151,
                37,
                143,
                78,
                36,
                137,
                241,
                187,
                61,
                16,
                41,
                20,
                142,
                13,
                131,
                11,
                90,
                19,
                153,
                218,
                255,
                16,
                132,
                4,
                142,
                123,
                216,
                219,
                233,
                248,
                89
              ]
            }
          }
        },
        {
          "name": "buyback",
          "writable": true,
          "relations": [
            "config"
          ]
        },
        {
          "name": "treasury",
          "writable": true,
          "relations": [
            "config"
          ]
        },
        {
          "name": "lend_token_program"
        },
        {
          "name": "associated_token_program",
          "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": []
    },
    {
      "name": "fund_vault",
      "docs": [
        "A vault funds the whole ask, signed by its funder key, only if the listing meets every published rule."
      ],
      "discriminator": [
        26,
        33,
        207,
        242,
        119,
        108,
        134,
        73
      ],
      "accounts": [
        {
          "name": "funder",
          "writable": true,
          "signer": true
        },
        {
          "name": "config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  99,
                  111,
                  110,
                  102,
                  105,
                  103
                ]
              }
            ]
          }
        },
        {
          "name": "loan",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  108,
                  111,
                  97,
                  110
                ]
              },
              {
                "kind": "account",
                "path": "loan.id",
                "account": "Loan"
              }
            ]
          }
        },
        {
          "name": "vault",
          "writable": true
        },
        {
          "name": "lend_mint",
          "relations": [
            "config"
          ]
        },
        {
          "name": "vault_cash",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "account",
                "path": "vault"
              },
              {
                "kind": "account",
                "path": "lend_token_program"
              },
              {
                "kind": "account",
                "path": "lend_mint"
              }
            ],
            "program": {
              "kind": "const",
              "value": [
                140,
                151,
                37,
                143,
                78,
                36,
                137,
                241,
                187,
                61,
                16,
                41,
                20,
                142,
                13,
                131,
                11,
                90,
                19,
                153,
                218,
                255,
                16,
                132,
                4,
                142,
                123,
                216,
                219,
                233,
                248,
                89
              ]
            }
          }
        },
        {
          "name": "borrower",
          "relations": [
            "loan"
          ]
        },
        {
          "name": "borrower_usdc",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "account",
                "path": "borrower"
              },
              {
                "kind": "account",
                "path": "lend_token_program"
              },
              {
                "kind": "account",
                "path": "lend_mint"
              }
            ],
            "program": {
              "kind": "const",
              "value": [
                140,
                151,
                37,
                143,
                78,
                36,
                137,
                241,
                187,
                61,
                16,
                41,
                20,
                142,
                13,
                131,
                11,
                90,
                19,
                153,
                218,
                255,
                16,
                132,
                4,
                142,
                123,
                216,
                219,
                233,
                248,
                89
              ]
            }
          }
        },
        {
          "name": "buyback",
          "writable": true,
          "relations": [
            "config"
          ]
        },
        {
          "name": "treasury",
          "writable": true,
          "relations": [
            "config"
          ]
        },
        {
          "name": "lend_token_program"
        },
        {
          "name": "associated_token_program",
          "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": []
    },
    {
      "name": "initialize",
      "discriminator": [
        175,
        175,
        109,
        31,
        13,
        152,
        155,
        237
      ],
      "accounts": [
        {
          "name": "admin",
          "writable": true,
          "signer": true
        },
        {
          "name": "program",
          "docs": [
            "only the program's upgrade authority may initialize, so no one can race the deploy and claim the config"
          ],
          "address": "BJZ2V2tZKZaS4dyhGfkuFJi8skib48dyyqnvwyLbAaP"
        },
        {
          "name": "program_data"
        },
        {
          "name": "config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  99,
                  111,
                  110,
                  102,
                  105,
                  103
                ]
              }
            ]
          }
        },
        {
          "name": "lend_mint"
        },
        {
          "name": "buyback"
        },
        {
          "name": "treasury"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "args",
          "type": {
            "defined": {
              "name": "ParamsArgs"
            }
          }
        }
      ]
    },
    {
      "name": "list",
      "docs": [
        "Put a bag in escrow and offer it: `ask` USDC now for `cap` USDC to take it back, any time before `term_secs`",
        "after funding. Open to lenders for the config's listing window."
      ],
      "discriminator": [
        54,
        174,
        193,
        67,
        17,
        41,
        132,
        38
      ],
      "accounts": [
        {
          "name": "borrower",
          "writable": true,
          "signer": true
        },
        {
          "name": "config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  99,
                  111,
                  110,
                  102,
                  105,
                  103
                ]
              }
            ]
          }
        },
        {
          "name": "collateral",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  99,
                  111,
                  108,
                  108,
                  97,
                  116,
                  101,
                  114,
                  97,
                  108
                ]
              },
              {
                "kind": "account",
                "path": "mint"
              }
            ]
          }
        },
        {
          "name": "mint",
          "relations": [
            "collateral"
          ]
        },
        {
          "name": "borrower_tokens",
          "writable": true
        },
        {
          "name": "loan",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  108,
                  111,
                  97,
                  110
                ]
              },
              {
                "kind": "account",
                "path": "config.next_loan_id",
                "account": "Config"
              }
            ]
          }
        },
        {
          "name": "escrow",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "account",
                "path": "loan"
              },
              {
                "kind": "account",
                "path": "collateral_token_program"
              },
              {
                "kind": "account",
                "path": "mint"
              }
            ],
            "program": {
              "kind": "const",
              "value": [
                140,
                151,
                37,
                143,
                78,
                36,
                137,
                241,
                187,
                61,
                16,
                41,
                20,
                142,
                13,
                131,
                11,
                90,
                19,
                153,
                218,
                255,
                16,
                132,
                4,
                142,
                123,
                216,
                219,
                233,
                248,
                89
              ]
            }
          }
        },
        {
          "name": "holder_tokens",
          "optional": true
        },
        {
          "name": "collateral_token_program"
        },
        {
          "name": "associated_token_program",
          "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "amount",
          "type": "u64"
        },
        {
          "name": "ask",
          "type": "u64"
        },
        {
          "name": "cap",
          "type": "u64"
        },
        {
          "name": "term_secs",
          "type": "i64"
        }
      ]
    },
    {
      "name": "propose_admin",
      "discriminator": [
        121,
        214,
        199,
        212,
        87,
        39,
        117,
        234
      ],
      "accounts": [
        {
          "name": "admin",
          "signer": true,
          "relations": [
            "config"
          ]
        },
        {
          "name": "config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  99,
                  111,
                  110,
                  102,
                  105,
                  103
                ]
              }
            ]
          }
        }
      ],
      "args": [
        {
          "name": "next",
          "type": "pubkey"
        }
      ]
    },
    {
      "name": "reclaim",
      "docs": [
        "Take the collateral back after paying the cap."
      ],
      "discriminator": [
        44,
        177,
        236,
        249,
        145,
        109,
        163,
        186
      ],
      "accounts": [
        {
          "name": "borrower",
          "writable": true,
          "signer": true,
          "relations": [
            "loan"
          ]
        },
        {
          "name": "loan",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  108,
                  111,
                  97,
                  110
                ]
              },
              {
                "kind": "account",
                "path": "loan.id",
                "account": "Loan"
              }
            ]
          }
        },
        {
          "name": "mint",
          "relations": [
            "loan"
          ]
        },
        {
          "name": "escrow",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "account",
                "path": "loan"
              },
              {
                "kind": "account",
                "path": "collateral_token_program"
              },
              {
                "kind": "account",
                "path": "mint"
              }
            ],
            "program": {
              "kind": "const",
              "value": [
                140,
                151,
                37,
                143,
                78,
                36,
                137,
                241,
                187,
                61,
                16,
                41,
                20,
                142,
                13,
                131,
                11,
                90,
                19,
                153,
                218,
                255,
                16,
                132,
                4,
                142,
                123,
                216,
                219,
                233,
                248,
                89
              ]
            }
          }
        },
        {
          "name": "borrower_tokens",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "account",
                "path": "borrower"
              },
              {
                "kind": "account",
                "path": "collateral_token_program"
              },
              {
                "kind": "account",
                "path": "mint"
              }
            ],
            "program": {
              "kind": "const",
              "value": [
                140,
                151,
                37,
                143,
                78,
                36,
                137,
                241,
                187,
                61,
                16,
                41,
                20,
                142,
                13,
                131,
                11,
                90,
                19,
                153,
                218,
                255,
                16,
                132,
                4,
                142,
                123,
                216,
                219,
                233,
                248,
                89
              ]
            }
          }
        },
        {
          "name": "collateral_token_program"
        },
        {
          "name": "associated_token_program",
          "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": []
    },
    {
      "name": "repay",
      "docs": [
        "Pay the cap before the end of the term. The collateral is then the borrower's to take back with `reclaim`,",
        "in the same transaction or any time later."
      ],
      "discriminator": [
        234,
        103,
        67,
        82,
        208,
        234,
        219,
        166
      ],
      "accounts": [
        {
          "name": "borrower",
          "signer": true,
          "relations": [
            "loan"
          ]
        },
        {
          "name": "loan",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  108,
                  111,
                  97,
                  110
                ]
              },
              {
                "kind": "account",
                "path": "loan.id",
                "account": "Loan"
              }
            ]
          }
        },
        {
          "name": "config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  99,
                  111,
                  110,
                  102,
                  105,
                  103
                ]
              }
            ]
          }
        },
        {
          "name": "lend_mint",
          "relations": [
            "config"
          ]
        },
        {
          "name": "borrower_usdc",
          "writable": true
        },
        {
          "name": "lender_account",
          "writable": true,
          "relations": [
            "loan"
          ]
        },
        {
          "name": "vault",
          "writable": true,
          "optional": true
        },
        {
          "name": "lend_token_program"
        }
      ],
      "args": []
    },
    {
      "name": "set_collateral",
      "docs": [
        "Admit a mint as collateral, or stop new listings against it. Mints that take a fee on transfer, cannot move,",
        "or freeze new accounts by default are refused."
      ],
      "discriminator": [
        78,
        238,
        107,
        150,
        31,
        244,
        158,
        27
      ],
      "accounts": [
        {
          "name": "admin",
          "writable": true,
          "signer": true,
          "relations": [
            "config"
          ]
        },
        {
          "name": "config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  99,
                  111,
                  110,
                  102,
                  105,
                  103
                ]
              }
            ]
          }
        },
        {
          "name": "mint"
        },
        {
          "name": "collateral",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  99,
                  111,
                  108,
                  108,
                  97,
                  116,
                  101,
                  114,
                  97,
                  108
                ]
              },
              {
                "kind": "account",
                "path": "mint"
              }
            ]
          }
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "lane",
          "type": "u8"
        },
        {
          "name": "enabled",
          "type": "bool"
        }
      ]
    },
    {
      "name": "set_destinations",
      "discriminator": [
        223,
        230,
        41,
        237,
        76,
        161,
        176,
        194
      ],
      "accounts": [
        {
          "name": "admin",
          "signer": true,
          "relations": [
            "config"
          ]
        },
        {
          "name": "config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  99,
                  111,
                  110,
                  102,
                  105,
                  103
                ]
              }
            ]
          }
        },
        {
          "name": "buyback"
        },
        {
          "name": "treasury"
        }
      ],
      "args": []
    },
    {
      "name": "set_holder_perk",
      "docs": [
        "Holding at least `holder_min` of the token when listing lowers that loan's origination fee to `holder_fee_bps`."
      ],
      "discriminator": [
        255,
        114,
        169,
        164,
        0,
        170,
        175,
        37
      ],
      "accounts": [
        {
          "name": "admin",
          "signer": true,
          "relations": [
            "config"
          ]
        },
        {
          "name": "config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  99,
                  111,
                  110,
                  102,
                  105,
                  103
                ]
              }
            ]
          }
        },
        {
          "name": "holder_mint"
        }
      ],
      "args": [
        {
          "name": "holder_min",
          "type": "u64"
        },
        {
          "name": "holder_fee_bps",
          "type": "u16"
        }
      ]
    },
    {
      "name": "set_line",
      "docs": [
        "The funder posts how much the vault lends per unit of a slot's collateral, never above the manager's cap,",
        "good until `until` (at most MAX_LINE_TTL_SECS ahead). A stale line funds nothing."
      ],
      "discriminator": [
        54,
        39,
        64,
        230,
        212,
        23,
        245,
        215
      ],
      "accounts": [
        {
          "name": "funder",
          "signer": true
        },
        {
          "name": "vault",
          "writable": true
        }
      ],
      "args": [
        {
          "name": "index",
          "type": "u8"
        },
        {
          "name": "line",
          "type": "u64"
        },
        {
          "name": "until",
          "type": "i64"
        }
      ]
    },
    {
      "name": "set_params",
      "discriminator": [
        27,
        234,
        178,
        52,
        147,
        2,
        187,
        141
      ],
      "accounts": [
        {
          "name": "admin",
          "signer": true,
          "relations": [
            "config"
          ]
        },
        {
          "name": "config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  99,
                  111,
                  110,
                  102,
                  105,
                  103
                ]
              }
            ]
          }
        }
      ],
      "args": [
        {
          "name": "args",
          "type": {
            "defined": {
              "name": "ParamsArgs"
            }
          }
        }
      ]
    },
    {
      "name": "set_paused",
      "docs": [
        "Stops new listings and fundings. Everything already listed or running keeps every exit."
      ],
      "discriminator": [
        91,
        60,
        125,
        192,
        176,
        225,
        166,
        218
      ],
      "accounts": [
        {
          "name": "admin",
          "signer": true,
          "relations": [
            "config"
          ]
        },
        {
          "name": "config",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  99,
                  111,
                  110,
                  102,
                  105,
                  103
                ]
              }
            ]
          }
        }
      ],
      "args": [
        {
          "name": "paused",
          "type": "bool"
        }
      ]
    },
    {
      "name": "set_rules",
      "docs": [
        "Tighter rules apply at once. Looser ones wait RULE_DELAY_SECS in public and then anyone can activate them, unless",
        "the vault has no depositors yet, when there is nobody to protect and every rule applies at once."
      ],
      "discriminator": [
        66,
        148,
        196,
        43,
        232,
        210,
        174,
        169
      ],
      "accounts": [
        {
          "name": "manager",
          "signer": true
        },
        {
          "name": "vault",
          "writable": true
        }
      ],
      "args": [
        {
          "name": "rules",
          "type": {
            "defined": {
              "name": "Rules"
            }
          }
        }
      ]
    },
    {
      "name": "set_slot",
      "docs": [
        "Give a slot a collateral mint, or change the most its line may be. Lowering applies at once (and pulls the",
        "line down with it); raising, including a new mint's first cap, waits RULE_DELAY_SECS, unless the vault has no",
        "depositors yet."
      ],
      "discriminator": [
        73,
        171,
        243,
        34,
        66,
        195,
        254,
        218
      ],
      "accounts": [
        {
          "name": "manager",
          "signer": true
        },
        {
          "name": "vault",
          "writable": true
        },
        {
          "name": "collateral",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  99,
                  111,
                  108,
                  108,
                  97,
                  116,
                  101,
                  114,
                  97,
                  108
                ]
              },
              {
                "kind": "account",
                "path": "mint"
              }
            ]
          }
        },
        {
          "name": "mint",
          "relations": [
            "collateral"
          ]
        }
      ],
      "args": [
        {
          "name": "index",
          "type": "u8"
        },
        {
          "name": "line_cap",
          "type": "u64"
        }
      ]
    },
    {
      "name": "set_vault_flags",
      "discriminator": [
        92,
        73,
        20,
        208,
        48,
        9,
        81,
        180
      ],
      "accounts": [
        {
          "name": "manager",
          "signer": true
        },
        {
          "name": "vault",
          "writable": true
        }
      ],
      "args": [
        {
          "name": "funding_open",
          "type": "bool"
        },
        {
          "name": "paused",
          "type": "bool"
        }
      ]
    },
    {
      "name": "set_vault_keys",
      "discriminator": [
        74,
        40,
        55,
        34,
        146,
        163,
        220,
        171
      ],
      "accounts": [
        {
          "name": "manager",
          "signer": true
        },
        {
          "name": "vault",
          "writable": true
        },
        {
          "name": "fee_recipient"
        }
      ],
      "args": [
        {
          "name": "funder",
          "type": "pubkey"
        }
      ]
    },
    {
      "name": "settle_default",
      "docs": [
        "Write off an unpaid vault loan once its term is over. Anyone can. It leaves the share price at once, and its",
        "collateral is credited to the shares that held it at this moment, claimable in kind. The books never wait on the",
        "collateral: an issuer can pause or freeze an xStock, and a frozen escrow must not stop the vault's deposits,",
        "withdrawals and loans. The bag itself moves into the vault with `sweep_default`, whenever it can move."
      ],
      "discriminator": [
        246,
        228,
        125,
        180,
        94,
        53,
        233,
        137
      ],
      "accounts": [
        {
          "name": "caller",
          "signer": true
        },
        {
          "name": "loan",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  108,
                  111,
                  97,
                  110
                ]
              },
              {
                "kind": "account",
                "path": "loan.id",
                "account": "Loan"
              }
            ]
          }
        },
        {
          "name": "vault",
          "writable": true
        }
      ],
      "args": []
    },
    {
      "name": "settle_repaid",
      "docs": [
        "Book a repaid vault loan once its term is over. Anyone can. Its principal and return go to the vault's cash",
        "and the performance fee is paid; the return was already counted in the share price over the term."
      ],
      "discriminator": [
        149,
        111,
        234,
        126,
        119,
        83,
        30,
        84
      ],
      "accounts": [
        {
          "name": "caller",
          "signer": true
        },
        {
          "name": "config",
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  99,
                  111,
                  110,
                  102,
                  105,
                  103
                ]
              }
            ]
          }
        },
        {
          "name": "loan",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  108,
                  111,
                  97,
                  110
                ]
              },
              {
                "kind": "account",
                "path": "loan.id",
                "account": "Loan"
              }
            ]
          }
        },
        {
          "name": "vault",
          "writable": true
        },
        {
          "name": "lend_mint",
          "relations": [
            "config"
          ]
        },
        {
          "name": "vault_cash",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "account",
                "path": "vault"
              },
              {
                "kind": "account",
                "path": "lend_token_program"
              },
              {
                "kind": "account",
                "path": "lend_mint"
              }
            ],
            "program": {
              "kind": "const",
              "value": [
                140,
                151,
                37,
                143,
                78,
                36,
                137,
                241,
                187,
                61,
                16,
                41,
                20,
                142,
                13,
                131,
                11,
                90,
                19,
                153,
                218,
                255,
                16,
                132,
                4,
                142,
                123,
                216,
                219,
                233,
                248,
                89
              ]
            }
          }
        },
        {
          "name": "treasury",
          "writable": true,
          "relations": [
            "config"
          ]
        },
        {
          "name": "fee_recipient",
          "writable": true
        },
        {
          "name": "lend_token_program"
        }
      ],
      "args": []
    },
    {
      "name": "sweep_default",
      "docs": [
        "Move a written-off loan's collateral from its escrow into the vault, where its holders of record claim it.",
        "Anyone can, once the bag can move; until then the claims wait and nothing else does."
      ],
      "discriminator": [
        67,
        12,
        75,
        197,
        106,
        85,
        8,
        9
      ],
      "accounts": [
        {
          "name": "caller",
          "writable": true,
          "signer": true
        },
        {
          "name": "loan",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  108,
                  111,
                  97,
                  110
                ]
              },
              {
                "kind": "account",
                "path": "loan.id",
                "account": "Loan"
              }
            ]
          }
        },
        {
          "name": "vault"
        },
        {
          "name": "borrower",
          "writable": true,
          "relations": [
            "loan"
          ]
        },
        {
          "name": "mint",
          "relations": [
            "loan"
          ]
        },
        {
          "name": "escrow",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "account",
                "path": "loan"
              },
              {
                "kind": "account",
                "path": "collateral_token_program"
              },
              {
                "kind": "account",
                "path": "mint"
              }
            ],
            "program": {
              "kind": "const",
              "value": [
                140,
                151,
                37,
                143,
                78,
                36,
                137,
                241,
                187,
                61,
                16,
                41,
                20,
                142,
                13,
                131,
                11,
                90,
                19,
                153,
                218,
                255,
                16,
                132,
                4,
                142,
                123,
                216,
                219,
                233,
                248,
                89
              ]
            }
          }
        },
        {
          "name": "vault_tokens",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "account",
                "path": "vault"
              },
              {
                "kind": "account",
                "path": "collateral_token_program"
              },
              {
                "kind": "account",
                "path": "mint"
              }
            ],
            "program": {
              "kind": "const",
              "value": [
                140,
                151,
                37,
                143,
                78,
                36,
                137,
                241,
                187,
                61,
                16,
                41,
                20,
                142,
                13,
                131,
                11,
                90,
                19,
                153,
                218,
                255,
                16,
                132,
                4,
                142,
                123,
                216,
                219,
                233,
                248,
                89
              ]
            }
          }
        },
        {
          "name": "collateral_token_program"
        },
        {
          "name": "associated_token_program",
          "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": []
    },
    {
      "name": "withdraw",
      "docs": [
        "Redeem shares for USDC at the current share price, paid at once from the vault's free cash."
      ],
      "discriminator": [
        183,
        18,
        70,
        156,
        148,
        109,
        161,
        34
      ],
      "accounts": [
        {
          "name": "owner",
          "signer": true
        },
        {
          "name": "vault",
          "writable": true
        },
        {
          "name": "position",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  112,
                  111,
                  115,
                  105,
                  116,
                  105,
                  111,
                  110
                ]
              },
              {
                "kind": "account",
                "path": "vault"
              },
              {
                "kind": "account",
                "path": "owner"
              }
            ]
          }
        },
        {
          "name": "lend_mint"
        },
        {
          "name": "owner_usdc",
          "writable": true
        },
        {
          "name": "vault_cash",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "account",
                "path": "vault"
              },
              {
                "kind": "account",
                "path": "lend_token_program"
              },
              {
                "kind": "account",
                "path": "lend_mint"
              }
            ],
            "program": {
              "kind": "const",
              "value": [
                140,
                151,
                37,
                143,
                78,
                36,
                137,
                241,
                187,
                61,
                16,
                41,
                20,
                142,
                13,
                131,
                11,
                90,
                19,
                153,
                218,
                255,
                16,
                132,
                4,
                142,
                123,
                216,
                219,
                233,
                248,
                89
              ]
            }
          }
        },
        {
          "name": "lend_token_program"
        }
      ],
      "args": [
        {
          "name": "shares",
          "type": "u64"
        }
      ]
    }
  ],
  "accounts": [
    {
      "name": "Collateral",
      "discriminator": [
        123,
        130,
        234,
        63,
        255,
        240,
        255,
        92
      ]
    },
    {
      "name": "Config",
      "discriminator": [
        155,
        12,
        170,
        224,
        30,
        250,
        204,
        130
      ]
    },
    {
      "name": "Loan",
      "discriminator": [
        20,
        195,
        70,
        117,
        165,
        227,
        182,
        1
      ]
    },
    {
      "name": "Position",
      "discriminator": [
        170,
        188,
        143,
        228,
        122,
        64,
        247,
        208
      ]
    },
    {
      "name": "Vault",
      "discriminator": [
        211,
        8,
        232,
        43,
        2,
        152,
        117,
        119
      ]
    }
  ],
  "events": [
    {
      "name": "AdminChanged",
      "discriminator": [
        232,
        34,
        31,
        226,
        62,
        18,
        19,
        114
      ]
    },
    {
      "name": "Cancelled",
      "discriminator": [
        136,
        23,
        42,
        65,
        143,
        233,
        234,
        46
      ]
    },
    {
      "name": "Claimed",
      "discriminator": [
        217,
        192,
        123,
        72,
        108,
        150,
        248,
        33
      ]
    },
    {
      "name": "CollateralChanged",
      "discriminator": [
        172,
        114,
        48,
        57,
        98,
        83,
        95,
        157
      ]
    },
    {
      "name": "Collected",
      "discriminator": [
        67,
        109,
        138,
        167,
        168,
        239,
        2,
        207
      ]
    },
    {
      "name": "Deposited",
      "discriminator": [
        111,
        141,
        26,
        45,
        161,
        35,
        100,
        57
      ]
    },
    {
      "name": "DestinationsChanged",
      "discriminator": [
        77,
        28,
        69,
        187,
        160,
        111,
        33,
        80
      ]
    },
    {
      "name": "Funded",
      "discriminator": [
        67,
        84,
        56,
        88,
        192,
        12,
        201,
        177
      ]
    },
    {
      "name": "HolderPerkChanged",
      "discriminator": [
        106,
        133,
        127,
        152,
        111,
        40,
        16,
        237
      ]
    },
    {
      "name": "LineSet",
      "discriminator": [
        195,
        25,
        150,
        138,
        242,
        112,
        82,
        157
      ]
    },
    {
      "name": "Listed",
      "discriminator": [
        243,
        173,
        136,
        195,
        125,
        241,
        12,
        99
      ]
    },
    {
      "name": "ParamsChanged",
      "discriminator": [
        174,
        49,
        9,
        64,
        58,
        171,
        241,
        24
      ]
    },
    {
      "name": "PausedChanged",
      "discriminator": [
        12,
        10,
        153,
        247,
        60,
        115,
        137,
        69
      ]
    },
    {
      "name": "Reclaimed",
      "discriminator": [
        230,
        25,
        32,
        135,
        40,
        167,
        137,
        130
      ]
    },
    {
      "name": "RecoveryClaimed",
      "discriminator": [
        29,
        59,
        99,
        47,
        106,
        248,
        125,
        116
      ]
    },
    {
      "name": "Repaid",
      "discriminator": [
        38,
        248,
        231,
        7,
        150,
        164,
        172,
        23
      ]
    },
    {
      "name": "RulesChanged",
      "discriminator": [
        246,
        127,
        52,
        2,
        91,
        27,
        175,
        157
      ]
    },
    {
      "name": "Settled",
      "discriminator": [
        232,
        210,
        40,
        17,
        142,
        124,
        145,
        238
      ]
    },
    {
      "name": "SlotChanged",
      "discriminator": [
        82,
        155,
        34,
        141,
        230,
        99,
        186,
        221
      ]
    },
    {
      "name": "Swept",
      "discriminator": [
        254,
        138,
        9,
        198,
        192,
        61,
        165,
        135
      ]
    },
    {
      "name": "VaultCreated",
      "discriminator": [
        117,
        25,
        120,
        254,
        75,
        236,
        78,
        115
      ]
    },
    {
      "name": "VaultFlags",
      "discriminator": [
        241,
        100,
        31,
        191,
        37,
        245,
        244,
        176
      ]
    },
    {
      "name": "VaultKeys",
      "discriminator": [
        130,
        227,
        27,
        226,
        203,
        93,
        207,
        126
      ]
    },
    {
      "name": "Withdrew",
      "discriminator": [
        15,
        125,
        249,
        65,
        130,
        86,
        20,
        166
      ]
    }
  ],
  "errors": [
    {
      "code": 6000,
      "name": "NotUpgradeAuthority",
      "msg": "only the program's upgrade authority can initialize"
    },
    {
      "code": 6001,
      "name": "NotAdmin",
      "msg": "not the admin"
    },
    {
      "code": 6002,
      "name": "NotManager",
      "msg": "not the vault's manager"
    },
    {
      "code": 6003,
      "name": "NotFunder",
      "msg": "not the vault's funder"
    },
    {
      "code": 6004,
      "name": "BadParams",
      "msg": "parameter out of bounds"
    },
    {
      "code": 6005,
      "name": "Paused",
      "msg": "new listings and fundings are paused"
    },
    {
      "code": 6006,
      "name": "UnsupportedMint",
      "msg": "this mint is not accepted as collateral"
    },
    {
      "code": 6007,
      "name": "CollateralClosed",
      "msg": "this collateral is closed to new listings"
    },
    {
      "code": 6008,
      "name": "BadTerms",
      "msg": "amount, ask and cap must be positive and the cap above the ask"
    },
    {
      "code": 6009,
      "name": "BadTerm",
      "msg": "term outside the allowed range"
    },
    {
      "code": 6010,
      "name": "WrongState",
      "msg": "the loan is not in a state that allows this"
    },
    {
      "code": 6011,
      "name": "NotYours",
      "msg": "only the borrower, or anyone after the listing window"
    },
    {
      "code": 6012,
      "name": "TermOver",
      "msg": "the term is over: the cap can no longer be paid"
    },
    {
      "code": 6013,
      "name": "TermRunning",
      "msg": "the term is still running"
    },
    {
      "code": 6014,
      "name": "WrongVault",
      "msg": "wrong vault for this loan"
    },
    {
      "code": 6015,
      "name": "VaultClosed",
      "msg": "the vault is closed to new loans"
    },
    {
      "code": 6016,
      "name": "SettleFirst",
      "msg": "an expired loan must be settled first"
    },
    {
      "code": 6017,
      "name": "NotInVault",
      "msg": "the vault does not lend against this collateral"
    },
    {
      "code": 6018,
      "name": "LineStale",
      "msg": "the vault's line for this collateral is stale"
    },
    {
      "code": 6019,
      "name": "OverLine",
      "msg": "the ask is above the vault's line for this much collateral"
    },
    {
      "code": 6020,
      "name": "BelowFloor",
      "msg": "the fixed cost is below the vault's floor"
    },
    {
      "code": 6021,
      "name": "OverMaxLoan",
      "msg": "the ask is above the vault's most per loan"
    },
    {
      "code": 6022,
      "name": "OverTokenShare",
      "msg": "the vault already lends its most against this collateral"
    },
    {
      "code": 6023,
      "name": "NoCash",
      "msg": "the vault does not have the cash"
    },
    {
      "code": 6024,
      "name": "BelowBuffer",
      "msg": "the loan would take the vault under its buffer"
    },
    {
      "code": 6025,
      "name": "VaultFull",
      "msg": "the vault holds its most loans"
    },
    {
      "code": 6026,
      "name": "SlotTaken",
      "msg": "slot holds another mint"
    },
    {
      "code": 6027,
      "name": "NotYet",
      "msg": "nothing is pending, or not yet"
    },
    {
      "code": 6028,
      "name": "OverLineCap",
      "msg": "the line is above the manager's cap"
    },
    {
      "code": 6029,
      "name": "BelowMinimum",
      "msg": "below the minimum"
    },
    {
      "code": 6030,
      "name": "BadAmount",
      "msg": "bad amount"
    },
    {
      "code": 6031,
      "name": "LastHolder",
      "msg": "the last holder cannot leave while loans are open"
    },
    {
      "code": 6032,
      "name": "NothingOwed",
      "msg": "nothing owed"
    },
    {
      "code": 6033,
      "name": "Overflow",
      "msg": "arithmetic overflow"
    }
  ],
  "types": [
    {
      "name": "AdminChanged",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "admin",
            "type": "pubkey"
          }
        ]
      }
    },
    {
      "name": "Cancelled",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "id",
            "type": "u64"
          }
        ]
      }
    },
    {
      "name": "Claimed",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "id",
            "type": "u64"
          },
          {
            "name": "lender",
            "type": "pubkey"
          }
        ]
      }
    },
    {
      "name": "Collateral",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "mint",
            "type": "pubkey"
          },
          {
            "name": "token_program",
            "type": "pubkey"
          },
          {
            "name": "decimals",
            "type": "u8"
          },
          {
            "name": "lane",
            "docs": [
              "0 stocks, 1 memes, 2 Solana tokens"
            ],
            "type": "u8"
          },
          {
            "name": "enabled",
            "type": "bool"
          },
          {
            "name": "bump",
            "type": "u8"
          }
        ]
      }
    },
    {
      "name": "CollateralChanged",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "mint",
            "type": "pubkey"
          },
          {
            "name": "lane",
            "type": "u8"
          },
          {
            "name": "enabled",
            "type": "bool"
          }
        ]
      }
    },
    {
      "name": "Collected",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "id",
            "type": "u64"
          },
          {
            "name": "amount",
            "type": "u64"
          }
        ]
      }
    },
    {
      "name": "Config",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "admin",
            "type": "pubkey"
          },
          {
            "name": "pending_admin",
            "type": "pubkey"
          },
          {
            "name": "lend_mint",
            "type": "pubkey"
          },
          {
            "name": "buyback",
            "type": "pubkey"
          },
          {
            "name": "treasury",
            "type": "pubkey"
          },
          {
            "name": "fee_bps",
            "type": "u16"
          },
          {
            "name": "buyback_share_bps",
            "type": "u16"
          },
          {
            "name": "perf_cut_bps",
            "type": "u16"
          },
          {
            "name": "holder_mint",
            "type": "pubkey"
          },
          {
            "name": "holder_min",
            "type": "u64"
          },
          {
            "name": "holder_fee_bps",
            "type": "u16"
          },
          {
            "name": "listing_secs",
            "type": "i64"
          },
          {
            "name": "min_term_secs",
            "type": "i64"
          },
          {
            "name": "max_term_secs",
            "type": "i64"
          },
          {
            "name": "paused",
            "type": "bool"
          },
          {
            "name": "next_loan_id",
            "type": "u64"
          },
          {
            "name": "loans_funded",
            "type": "u64"
          },
          {
            "name": "volume",
            "type": "u64"
          },
          {
            "name": "fees",
            "type": "u64"
          },
          {
            "name": "to_buyback",
            "type": "u64"
          },
          {
            "name": "bump",
            "type": "u8"
          }
        ]
      }
    },
    {
      "name": "Deposited",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "vault",
            "type": "pubkey"
          },
          {
            "name": "owner",
            "type": "pubkey"
          },
          {
            "name": "amount",
            "type": "u64"
          },
          {
            "name": "shares",
            "type": "u64"
          }
        ]
      }
    },
    {
      "name": "DestinationsChanged",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "buyback",
            "type": "pubkey"
          },
          {
            "name": "treasury",
            "type": "pubkey"
          }
        ]
      }
    },
    {
      "name": "Entry",
      "serialization": "bytemuck",
      "repr": {
        "kind": "c"
      },
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "loan",
            "type": "pubkey"
          },
          {
            "name": "principal",
            "type": "u64"
          },
          {
            "name": "ret",
            "docs": [
              "the depositors' part of the fixed cost, after the performance fee"
            ],
            "type": "u64"
          },
          {
            "name": "start",
            "type": "i64"
          },
          {
            "name": "end",
            "type": "i64"
          },
          {
            "name": "slot",
            "type": "u8"
          },
          {
            "name": "used",
            "type": "u8"
          },
          {
            "name": "repaid",
            "type": "u8"
          },
          {
            "name": "_pad",
            "type": {
              "array": [
                "u8",
                5
              ]
            }
          }
        ]
      }
    },
    {
      "name": "Funded",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "id",
            "type": "u64"
          },
          {
            "name": "lender",
            "type": "pubkey"
          },
          {
            "name": "kind",
            "type": "u8"
          },
          {
            "name": "ask",
            "type": "u64"
          },
          {
            "name": "fee",
            "type": "u64"
          },
          {
            "name": "to_buyback",
            "type": "u64"
          },
          {
            "name": "expires_at",
            "type": "i64"
          }
        ]
      }
    },
    {
      "name": "HolderPerkChanged",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "mint",
            "type": "pubkey"
          },
          {
            "name": "min",
            "type": "u64"
          },
          {
            "name": "fee_bps",
            "type": "u16"
          }
        ]
      }
    },
    {
      "name": "LineSet",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "vault",
            "type": "pubkey"
          },
          {
            "name": "index",
            "type": "u8"
          },
          {
            "name": "line",
            "type": "u64"
          },
          {
            "name": "until",
            "type": "i64"
          }
        ]
      }
    },
    {
      "name": "Listed",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "id",
            "type": "u64"
          },
          {
            "name": "borrower",
            "type": "pubkey"
          },
          {
            "name": "mint",
            "type": "pubkey"
          },
          {
            "name": "amount",
            "type": "u64"
          },
          {
            "name": "ask",
            "type": "u64"
          },
          {
            "name": "cap",
            "type": "u64"
          },
          {
            "name": "term_secs",
            "type": "i64"
          },
          {
            "name": "fee_bps",
            "type": "u16"
          },
          {
            "name": "listing_until",
            "type": "i64"
          }
        ]
      }
    },
    {
      "name": "Loan",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "id",
            "type": "u64"
          },
          {
            "name": "borrower",
            "type": "pubkey"
          },
          {
            "name": "mint",
            "type": "pubkey"
          },
          {
            "name": "amount",
            "type": "u64"
          },
          {
            "name": "ask",
            "type": "u64"
          },
          {
            "name": "cap",
            "type": "u64"
          },
          {
            "name": "term_secs",
            "type": "i64"
          },
          {
            "name": "fee_bps",
            "type": "u16"
          },
          {
            "name": "listed_at",
            "type": "i64"
          },
          {
            "name": "listing_until",
            "type": "i64"
          },
          {
            "name": "state",
            "type": "u8"
          },
          {
            "name": "lender_kind",
            "type": "u8"
          },
          {
            "name": "lender",
            "type": "pubkey"
          },
          {
            "name": "lender_account",
            "docs": [
              "where the cap goes: the loan's own USDC account for a wallet lender, the vault's cash for a vault"
            ],
            "type": "pubkey"
          },
          {
            "name": "funded_at",
            "type": "i64"
          },
          {
            "name": "expires_at",
            "type": "i64"
          },
          {
            "name": "repaid_at",
            "type": "i64"
          },
          {
            "name": "fee",
            "type": "u64"
          },
          {
            "name": "vault_ret",
            "type": "u64"
          },
          {
            "name": "collateral_out",
            "type": "bool"
          },
          {
            "name": "cash_out",
            "type": "bool"
          },
          {
            "name": "bump",
            "type": "u8"
          }
        ]
      }
    },
    {
      "name": "ParamsArgs",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "fee_bps",
            "type": "u16"
          },
          {
            "name": "buyback_share_bps",
            "type": "u16"
          },
          {
            "name": "perf_cut_bps",
            "type": "u16"
          },
          {
            "name": "listing_secs",
            "type": "i64"
          },
          {
            "name": "min_term_secs",
            "type": "i64"
          },
          {
            "name": "max_term_secs",
            "type": "i64"
          }
        ]
      }
    },
    {
      "name": "ParamsChanged",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "fee_bps",
            "type": "u16"
          },
          {
            "name": "buyback_share_bps",
            "type": "u16"
          },
          {
            "name": "perf_cut_bps",
            "type": "u16"
          },
          {
            "name": "listing_secs",
            "type": "i64"
          },
          {
            "name": "min_term_secs",
            "type": "i64"
          },
          {
            "name": "max_term_secs",
            "type": "i64"
          }
        ]
      }
    },
    {
      "name": "PausedChanged",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "paused",
            "type": "bool"
          }
        ]
      }
    },
    {
      "name": "Position",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "vault",
            "type": "pubkey"
          },
          {
            "name": "owner",
            "type": "pubkey"
          },
          {
            "name": "shares",
            "type": "u64"
          },
          {
            "name": "checkpoints",
            "type": {
              "array": [
                "u128",
                16
              ]
            }
          },
          {
            "name": "owed",
            "type": {
              "array": [
                "u64",
                16
              ]
            }
          },
          {
            "name": "deposited",
            "type": "u64"
          },
          {
            "name": "withdrawn",
            "type": "u64"
          },
          {
            "name": "bump",
            "type": "u8"
          }
        ]
      }
    },
    {
      "name": "Reclaimed",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "id",
            "type": "u64"
          }
        ]
      }
    },
    {
      "name": "RecoveryClaimed",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "vault",
            "type": "pubkey"
          },
          {
            "name": "owner",
            "type": "pubkey"
          },
          {
            "name": "mint",
            "type": "pubkey"
          },
          {
            "name": "amount",
            "type": "u64"
          }
        ]
      }
    },
    {
      "name": "Repaid",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "id",
            "type": "u64"
          },
          {
            "name": "cap",
            "type": "u64"
          }
        ]
      }
    },
    {
      "name": "Rules",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "min_apr_bps",
            "type": "u16"
          },
          {
            "name": "max_per_loan",
            "type": "u64"
          },
          {
            "name": "max_token_bps",
            "type": "u16"
          },
          {
            "name": "buffer_bps",
            "type": "u16"
          }
        ]
      }
    },
    {
      "name": "RulesChanged",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "vault",
            "type": "pubkey"
          },
          {
            "name": "min_apr_bps",
            "type": "u16"
          },
          {
            "name": "max_per_loan",
            "type": "u64"
          },
          {
            "name": "max_token_bps",
            "type": "u16"
          },
          {
            "name": "buffer_bps",
            "type": "u16"
          },
          {
            "name": "pending_mask",
            "type": "u8"
          },
          {
            "name": "pending_at",
            "type": "i64"
          }
        ]
      }
    },
    {
      "name": "Settled",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "id",
            "type": "u64"
          },
          {
            "name": "vault",
            "type": "pubkey"
          },
          {
            "name": "repaid",
            "type": "bool"
          },
          {
            "name": "ret",
            "type": "u64"
          },
          {
            "name": "perf",
            "type": "u64"
          }
        ]
      }
    },
    {
      "name": "Slot",
      "serialization": "bytemuck",
      "repr": {
        "kind": "c"
      },
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "mint",
            "type": "pubkey"
          },
          {
            "name": "line_cap",
            "type": "u64"
          },
          {
            "name": "pending_line_cap",
            "type": "u64"
          },
          {
            "name": "line_cap_at",
            "type": "i64"
          },
          {
            "name": "line",
            "type": "u64"
          },
          {
            "name": "line_until",
            "type": "i64"
          },
          {
            "name": "principal",
            "type": "u64"
          },
          {
            "name": "recovered",
            "type": "u64"
          },
          {
            "name": "index",
            "docs": [
              "u128 little-endian: recovered collateral per share, scaled by INDEX_SCALE"
            ],
            "type": {
              "array": [
                "u8",
                16
              ]
            }
          }
        ]
      }
    },
    {
      "name": "SlotChanged",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "vault",
            "type": "pubkey"
          },
          {
            "name": "index",
            "type": "u8"
          },
          {
            "name": "mint",
            "type": "pubkey"
          },
          {
            "name": "line_cap",
            "type": "u64"
          },
          {
            "name": "pending_line_cap",
            "type": "u64"
          },
          {
            "name": "line_cap_at",
            "type": "i64"
          }
        ]
      }
    },
    {
      "name": "Swept",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "id",
            "type": "u64"
          },
          {
            "name": "vault",
            "type": "pubkey"
          }
        ]
      }
    },
    {
      "name": "Vault",
      "serialization": "bytemuck",
      "repr": {
        "kind": "c"
      },
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "manager",
            "type": "pubkey"
          },
          {
            "name": "funder",
            "type": "pubkey"
          },
          {
            "name": "fee_recipient",
            "type": "pubkey"
          },
          {
            "name": "lend_mint",
            "type": "pubkey"
          },
          {
            "name": "name",
            "type": {
              "array": [
                "u8",
                32
              ]
            }
          },
          {
            "name": "total_shares",
            "type": "u64"
          },
          {
            "name": "cash",
            "type": "u64"
          },
          {
            "name": "principal_out",
            "type": "u64"
          },
          {
            "name": "max_term_secs",
            "type": "i64"
          },
          {
            "name": "created_at",
            "type": "i64"
          },
          {
            "name": "loans_funded",
            "type": "u64"
          },
          {
            "name": "earned",
            "type": "u64"
          },
          {
            "name": "written_off",
            "type": "u64"
          },
          {
            "name": "max_per_loan",
            "type": "u64"
          },
          {
            "name": "pending_max_per_loan",
            "type": "u64"
          },
          {
            "name": "pending_at",
            "type": "i64"
          },
          {
            "name": "perf_fee_bps",
            "type": "u16"
          },
          {
            "name": "min_apr_bps",
            "type": "u16"
          },
          {
            "name": "max_token_bps",
            "type": "u16"
          },
          {
            "name": "buffer_bps",
            "type": "u16"
          },
          {
            "name": "pending_min_apr_bps",
            "type": "u16"
          },
          {
            "name": "pending_max_token_bps",
            "type": "u16"
          },
          {
            "name": "pending_buffer_bps",
            "type": "u16"
          },
          {
            "name": "funding_open",
            "type": "u8"
          },
          {
            "name": "paused",
            "type": "u8"
          },
          {
            "name": "pending_mask",
            "type": "u8"
          },
          {
            "name": "bump",
            "type": "u8"
          },
          {
            "name": "_pad",
            "type": {
              "array": [
                "u8",
                6
              ]
            }
          },
          {
            "name": "slots",
            "type": {
              "array": [
                {
                  "defined": {
                    "name": "Slot"
                  }
                },
                16
              ]
            }
          },
          {
            "name": "loans",
            "type": {
              "array": [
                {
                  "defined": {
                    "name": "Entry"
                  }
                },
                64
              ]
            }
          }
        ]
      }
    },
    {
      "name": "VaultArgs",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "name",
            "type": {
              "array": [
                "u8",
                32
              ]
            }
          },
          {
            "name": "manager",
            "type": "pubkey"
          },
          {
            "name": "funder",
            "type": "pubkey"
          },
          {
            "name": "perf_fee_bps",
            "type": "u16"
          },
          {
            "name": "max_term_secs",
            "type": "i64"
          },
          {
            "name": "rules",
            "type": {
              "defined": {
                "name": "Rules"
              }
            }
          }
        ]
      }
    },
    {
      "name": "VaultCreated",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "vault",
            "type": "pubkey"
          },
          {
            "name": "manager",
            "type": "pubkey"
          },
          {
            "name": "funder",
            "type": "pubkey"
          },
          {
            "name": "perf_fee_bps",
            "type": "u16"
          },
          {
            "name": "max_term_secs",
            "type": "i64"
          }
        ]
      }
    },
    {
      "name": "VaultFlags",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "vault",
            "type": "pubkey"
          },
          {
            "name": "funding_open",
            "type": "bool"
          },
          {
            "name": "paused",
            "type": "bool"
          }
        ]
      }
    },
    {
      "name": "VaultKeys",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "vault",
            "type": "pubkey"
          },
          {
            "name": "funder",
            "type": "pubkey"
          },
          {
            "name": "fee_recipient",
            "type": "pubkey"
          }
        ]
      }
    },
    {
      "name": "Withdrew",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "vault",
            "type": "pubkey"
          },
          {
            "name": "owner",
            "type": "pubkey"
          },
          {
            "name": "amount",
            "type": "u64"
          },
          {
            "name": "shares",
            "type": "u64"
          }
        ]
      }
    }
  ]
}