{
  "address": "jupgfSgfuAXv4B6R2Uxu85Z1qdzgju79s6MfZekN6XS",
  "metadata": {
    "name": "flashloan",
    "version": "0.1.0",
    "spec": "0.1.0",
    "description": "Created with Anchor"
  },
  "instructions": [
    {
      "name": "activate_protocol",
      "discriminator": [230, 235, 188, 19, 120, 91, 11, 94],
      "accounts": [
        {
          "name": "authority",
          "signer": true
        },
        {
          "name": "flashloan_admin",
          "writable": true
        }
      ],
      "args": []
    },
    {
      "name": "flashloan_borrow",
      "discriminator": [103, 19, 78, 24, 240, 9, 135, 63],
      "accounts": [
        {
          "name": "signer",
          "writable": true,
          "signer": true
        },
        {
          "name": "flashloan_admin",
          "writable": true
        },
        {
          "name": "signer_borrow_token_account",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "account",
                "path": "signer"
              },
              {
                "kind": "account",
                "path": "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": "mint"
        },
        {
          "name": "flashloan_token_reserves_liquidity",
          "writable": true
        },
        {
          "name": "flashloan_borrow_position_on_liquidity",
          "writable": true
        },
        {
          "name": "rate_model"
        },
        {
          "name": "vault",
          "writable": true
        },
        {
          "name": "liquidity"
        },
        {
          "name": "liquidity_program",
          "relations": ["flashloan_admin"]
        },
        {
          "name": "token_program"
        },
        {
          "name": "associated_token_program",
          "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        },
        {
          "name": "instruction_sysvar",
          "address": "Sysvar1nstructions1111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "amount",
          "type": "u64"
        }
      ]
    },
    {
      "name": "flashloan_payback",
      "discriminator": [213, 47, 153, 137, 84, 243, 94, 232],
      "accounts": [
        {
          "name": "signer",
          "writable": true,
          "signer": true
        },
        {
          "name": "flashloan_admin",
          "writable": true
        },
        {
          "name": "signer_borrow_token_account",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "account",
                "path": "signer"
              },
              {
                "kind": "account",
                "path": "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": "mint"
        },
        {
          "name": "flashloan_token_reserves_liquidity",
          "writable": true
        },
        {
          "name": "flashloan_borrow_position_on_liquidity",
          "writable": true
        },
        {
          "name": "rate_model"
        },
        {
          "name": "vault",
          "writable": true
        },
        {
          "name": "liquidity"
        },
        {
          "name": "liquidity_program",
          "relations": ["flashloan_admin"]
        },
        {
          "name": "token_program"
        },
        {
          "name": "associated_token_program",
          "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        },
        {
          "name": "instruction_sysvar",
          "address": "Sysvar1nstructions1111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "amount",
          "type": "u64"
        }
      ]
    },
    {
      "name": "init_flashloan_admin",
      "discriminator": [185, 117, 154, 56, 95, 12, 187, 139],
      "accounts": [
        {
          "name": "signer",
          "writable": true,
          "signer": true
        },
        {
          "name": "flashloan_admin",
          "writable": true,
          "pda": {
            "seeds": [
              {
                "kind": "const",
                "value": [
                  102, 108, 97, 115, 104, 108, 111, 97, 110, 95, 97, 100, 109,
                  105, 110
                ]
              }
            ]
          }
        },
        {
          "name": "system_program",
          "address": "11111111111111111111111111111111"
        }
      ],
      "args": [
        {
          "name": "authority",
          "type": "pubkey"
        },
        {
          "name": "flashloan_fee",
          "type": "u16"
        },
        {
          "name": "liquidity_program",
          "type": "pubkey"
        }
      ]
    },
    {
      "name": "pause_protocol",
      "discriminator": [144, 95, 0, 107, 119, 39, 248, 141],
      "accounts": [
        {
          "name": "authority",
          "signer": true
        },
        {
          "name": "flashloan_admin",
          "writable": true
        }
      ],
      "args": []
    },
    {
      "name": "set_flashloan_fee",
      "discriminator": [120, 248, 221, 70, 84, 216, 0, 149],
      "accounts": [
        {
          "name": "authority",
          "signer": true
        },
        {
          "name": "flashloan_admin",
          "writable": true
        }
      ],
      "args": [
        {
          "name": "flashloan_fee",
          "type": "u16"
        }
      ]
    },
    {
      "name": "update_authority",
      "discriminator": [32, 46, 64, 28, 149, 75, 243, 88],
      "accounts": [
        {
          "name": "authority",
          "signer": true
        },
        {
          "name": "flashloan_admin",
          "writable": true
        }
      ],
      "args": [
        {
          "name": "new_authority",
          "type": "pubkey"
        }
      ]
    }
  ],
  "accounts": [
    {
      "name": "FlashloanAdmin",
      "discriminator": [162, 161, 45, 28, 131, 91, 202, 88]
    }
  ],
  "events": [
    {
      "name": "ActivateProtocol",
      "discriminator": [70, 178, 173, 151, 180, 166, 68, 102]
    },
    {
      "name": "LogUpdateAuthority",
      "discriminator": [150, 152, 157, 143, 6, 135, 193, 101]
    },
    {
      "name": "PauseProtocol",
      "discriminator": [66, 229, 166, 147, 152, 13, 42, 29]
    },
    {
      "name": "SetFlashloanFee",
      "discriminator": [112, 164, 66, 251, 191, 56, 0, 47]
    }
  ],
  "errors": [
    {
      "code": 6000,
      "name": "FlashloanInvalidAuthority",
      "msg": "FLASHLOAN_INVALID_AUTHORITY"
    },
    {
      "code": 6001,
      "name": "FlashloanFeeTooHigh",
      "msg": "FLASHLOAN_FEE_TOO_HIGH"
    },
    {
      "code": 6002,
      "name": "FlashloanInvalidParams",
      "msg": "FLASHLOAN_INVALID_PARAMS"
    },
    {
      "code": 6003,
      "name": "FlashloanAlreadyActive",
      "msg": "FLASHLOAN_ALREADY_ACTIVE"
    },
    {
      "code": 6004,
      "name": "FlashloanAlreadyInactive",
      "msg": "FLASHLOAN_ALREADY_INACTIVE"
    },
    {
      "code": 6005,
      "name": "FlashloanCpiToLiquidityFailed",
      "msg": "FLASHLOAN_CPI_TO_LIQUIDITY_FAILED"
    },
    {
      "code": 6006,
      "name": "FlashloanNotAllowedInThisSlot",
      "msg": "FLASHLOAN_NOT_ALLOWED_IN_THIS_SLOT"
    },
    {
      "code": 6007,
      "name": "FlashloanInvalidInstructionSysvar",
      "msg": "FLASHLOAN_INVALID_INSTRUCTION_SYSVAR"
    },
    {
      "code": 6008,
      "name": "FlashloanInvalidInstructionData",
      "msg": "FLASHLOAN_INVALID_INSTRUCTION_DATA"
    },
    {
      "code": 6009,
      "name": "FlashloanPaybackNotFound",
      "msg": "FLASHLOAN_PAYBACK_NOT_FOUND"
    },
    {
      "code": 6010,
      "name": "FlashloanInvalidInstruction",
      "msg": "FLASHLOAN_INVALID_INSTRUCTION"
    },
    {
      "code": 6011,
      "name": "FlashloanPaused",
      "msg": "FLASHLOAN_PAUSED"
    },
    {
      "code": 6012,
      "name": "FlashloanCPICallNotAllowed",
      "msg": "FLASHLOAN_CPICALL_NOT_ALLOWED"
    },
    {
      "code": 6013,
      "name": "FlashloanMultiplePaybacksFound",
      "msg": "FLASHLOAN_MULTIPLE_PAYBACKS_FOUND"
    }
  ],
  "types": [
    {
      "name": "ActivateProtocol",
      "type": {
        "kind": "struct",
        "fields": []
      }
    },
    {
      "name": "FlashloanAdmin",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "authority",
            "type": "pubkey"
          },
          {
            "name": "liquidity_program",
            "type": "pubkey"
          },
          {
            "name": "status",
            "type": "bool"
          },
          {
            "name": "flashloan_fee",
            "type": "u16"
          },
          {
            "name": "flashloan_timestamp",
            "type": "u64"
          },
          {
            "name": "is_flashloan_active",
            "type": "bool"
          },
          {
            "name": "active_flashloan_amount",
            "type": "u64"
          },
          {
            "name": "bump",
            "type": "u8"
          }
        ]
      }
    },
    {
      "name": "LogUpdateAuthority",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "new_authority",
            "type": "pubkey"
          }
        ]
      }
    },
    {
      "name": "PauseProtocol",
      "type": {
        "kind": "struct",
        "fields": []
      }
    },
    {
      "name": "SetFlashloanFee",
      "type": {
        "kind": "struct",
        "fields": [
          {
            "name": "flashloan_fee",
            "type": "u16"
          }
        ]
      }
    }
  ]
}
