From 7538146377ca241f26b92088448ced46da5aeec5 Mon Sep 17 00:00:00 2001 From: y2kappa Date: Wed, 11 Sep 2024 22:31:20 +0100 Subject: [PATCH] init --- .env.localnet | 11 + .env.rust.mainnet-beta | 12 + .github/workflows/rust.yml | 57 + .gitignore | 28 + .lookuptable.mainnet-beta | 1 + .lookuptable.rust.mainnet-beta | 1 + .lookuptable.staging | 1 + .rustfmt.toml | 3 + Cargo.lock | 7810 +++++++++++++++++++++++++++++++ Cargo.toml | 10 + LICENSE | 21 + README.md | 16 + rust-toolchain.toml | 2 + terminator/.gitignore | 7 + terminator/Cargo.toml | 58 + terminator/src/accounts.rs | 236 + terminator/src/client.rs | 772 +++ terminator/src/config.rs | 133 + terminator/src/consts.rs | 13 + terminator/src/instructions.rs | 286 ++ terminator/src/jupiter.rs | 114 + terminator/src/liquidator.rs | 230 + terminator/src/lookup_tables.rs | 41 + terminator/src/macros.rs | 42 + terminator/src/main.rs | 793 ++++ terminator/src/math.rs | 207 + terminator/src/model.rs | 35 + terminator/src/operations.rs | 287 ++ terminator/src/px.rs | 33 + terminator/src/sysvars.rs | 15 + terminator/src/utils.rs | 22 + 31 files changed, 11297 insertions(+) create mode 100644 .env.localnet create mode 100644 .env.rust.mainnet-beta create mode 100644 .github/workflows/rust.yml create mode 100644 .gitignore create mode 100644 .lookuptable.mainnet-beta create mode 100644 .lookuptable.rust.mainnet-beta create mode 100644 .lookuptable.staging create mode 100644 .rustfmt.toml create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 LICENSE create mode 100644 README.md create mode 100644 rust-toolchain.toml create mode 100644 terminator/.gitignore create mode 100644 terminator/Cargo.toml create mode 100644 terminator/src/accounts.rs create mode 100644 terminator/src/client.rs create mode 100644 terminator/src/config.rs create mode 100644 terminator/src/consts.rs create mode 100644 terminator/src/instructions.rs create mode 100644 terminator/src/jupiter.rs create mode 100644 terminator/src/liquidator.rs create mode 100644 terminator/src/lookup_tables.rs create mode 100644 terminator/src/macros.rs create mode 100644 terminator/src/main.rs create mode 100644 terminator/src/math.rs create mode 100644 terminator/src/model.rs create mode 100644 terminator/src/operations.rs create mode 100644 terminator/src/px.rs create mode 100644 terminator/src/sysvars.rs create mode 100644 terminator/src/utils.rs diff --git a/.env.localnet b/.env.localnet new file mode 100644 index 0000000..cb0bbae --- /dev/null +++ b/.env.localnet @@ -0,0 +1,11 @@ +APP=production +RPC_ENDPOINT=http://127.0.0.1:8899 +SECRET_PATH=./liquidator-1702618174920-137832.json +BASE_TOKEN=SOL +MARKETS=HRD4EwVmvAsgiB9imVSBpwnartdcz4SaWYJWUzvNgR11 +TARGETS=WSOL:1000 +KAMINO_PROGRAM_ID=E6qbhrt4pFmCotNUSSEh6E5cRQCEJpMcd79Z56EG9KY +KAMINO_GLOBAL_CONFIG=GKnHiWh3RRrE1zsNzWxRkomymHc374TvJPSTv2wPeYdB +JLP_POOL=5BUwFW4nRbftYTDMbgxykoFWqWHPzahFSNAaaaJtVKsq +RAYDIUM_PROGRAM_ID=devi51mZmdwUJGU9hjN27vEz64Gps7uUefqxg27EAtH +SERVER=false diff --git a/.env.rust.mainnet-beta b/.env.rust.mainnet-beta new file mode 100644 index 0000000..6d10fbe --- /dev/null +++ b/.env.rust.mainnet-beta @@ -0,0 +1,12 @@ +CLUSTER=https://mainnet.helius-rpc.com/?api-key=YOURKEY +KEYPAIR=./rust_liquidator.json +REBALANCE_PADDING_USD=0.2 +RUST_BACKTRACE=1 +#PROGRAM_ID=SLendK7ySfcEzyaFqy93gDnD3RtrpXJcnRwb6zFHJSh +RUST_LOG=info +LIQUIDATOR_LOOKUP_TABLE_FILE=.lookuptable.rust.mainnet-beta +BASE_CURRENCY=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v +MIN_SOL_BALANCE=1.0 +USDC_MINT=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v +REBALANCE_SLIPPAGE_PCT=0.3 +NON_SWAPPABLE_DUST_USD_VALUE=0.1 diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..a3e725a --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,57 @@ +name: Rust + +on: + push: + branches: + - master + - 'release/**' + pull_request: + branches: + - master + - 'release/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} + +jobs: + rust_fmt_and_test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: install essential + run: | + sudo apt-get update + sudo apt-get install -y pkg-config build-essential libudev-dev + - uses: dtolnay/rust-toolchain@1.73.0 + with: + components: clippy + - uses: dtolnay/rust-toolchain@nightly + with: + components: rustfmt + - name: Rust cache + uses: Swatinem/rust-cache@v2 + with: + shared-key: "ts-tests" + - name: Set up SSH keys + uses: webfactory/ssh-agent@v0.7.0 + with: + # Use hubbleprotocolbot's key: + # - docker+cargo fails when mounting multiple keys (https://github.com/docker/buildx/issues/341) + # - GitHub does not support reusing deploy keys + ssh-private-key: | + ${{ secrets.HUBBLEPROTOCOLBOT_GITHUB_KEY }} + - uses: actions-rs/cargo@v1 + name: Rust format + with: + toolchain: nightly + command: fmt + args: --all -- --check + - uses: actions-rs/clippy-check@v1 + name: Clippy + with: + token: ${{ secrets.GITHUB_TOKEN }} + args: --all -- --deny warnings + - name: Cargo test + run: | + cargo test diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..743024e --- /dev/null +++ b/.gitignore @@ -0,0 +1,28 @@ +# generated +**/node_modules +ts-tests/src/@codegen/jup-perps +.cargo + +# production +/build +ts-tests/dist +.env +.env.production +.env.devnet +.env.mainnet-beta + +# misc +id.json + +.idea/ + +test-ledger/ +yarn-error.log +tmp + +helm/charts +liquidator.json +target/ + +/config/routing_config.json +rust_liquidator.json diff --git a/.lookuptable.mainnet-beta b/.lookuptable.mainnet-beta new file mode 100644 index 0000000..4cdb999 --- /dev/null +++ b/.lookuptable.mainnet-beta @@ -0,0 +1 @@ +5s85qJWKLZGBQ6dscpqXi5tP1TMuhrp7avvkF5AmPes9 \ No newline at end of file diff --git a/.lookuptable.rust.mainnet-beta b/.lookuptable.rust.mainnet-beta new file mode 100644 index 0000000..772ebe2 --- /dev/null +++ b/.lookuptable.rust.mainnet-beta @@ -0,0 +1 @@ +EaXkVRPCmNJELmJuj2p78hEDMcmzbtnv6UucUjozRWx2 \ No newline at end of file diff --git a/.lookuptable.staging b/.lookuptable.staging new file mode 100644 index 0000000..1d2669a --- /dev/null +++ b/.lookuptable.staging @@ -0,0 +1 @@ +6CrxyZKFfav5DvHWhyJvMnCc36pxurnHrQdanNAq1gv1 \ No newline at end of file diff --git a/.rustfmt.toml b/.rustfmt.toml new file mode 100644 index 0000000..a58be74 --- /dev/null +++ b/.rustfmt.toml @@ -0,0 +1,3 @@ +imports_granularity = "Crate" +reorder_imports = true +group_imports = "StdExternalCrate" \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..956a24e --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,7810 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "Inflector" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" +dependencies = [ + "lazy_static", + "regex", +] + +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aead" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" +dependencies = [ + "generic-array", +] + +[[package]] +name = "aes" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", + "opaque-debug", +] + +[[package]] +name = "aes-gcm-siv" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589c637f0e68c877bbd59a4599bbe849cac8e5f3e4b5a3ebae8f528cd218dcdc" +dependencies = [ + "aead", + "aes", + "cipher", + "ctr", + "polyval", + "subtle", + "zeroize", +] + +[[package]] +name = "ahash" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" +dependencies = [ + "getrandom 0.2.14", + "once_cell", + "version_check", +] + +[[package]] +name = "ahash" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd7d5a2cecb58716e47d67d5703a249964b14c7be1ec3cad3affc295b2d1c35d" +dependencies = [ + "cfg-if", + "getrandom 0.2.14", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "aliasable" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" + +[[package]] +name = "alloc-no-stdlib" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" + +[[package]] +name = "alloc-stdlib" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" +dependencies = [ + "alloc-no-stdlib", +] + +[[package]] +name = "alloc-traits" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b2d54853319fd101b8dd81de382bcbf3e03410a64d8928bbee85a3e7dcde483" + +[[package]] +name = "anchor-attribute-access-control" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5f619f1d04f53621925ba8a2e633ba5a6081f2ae14758cbb67f38fd823e0a3e" +dependencies = [ + "anchor-syn", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-attribute-account" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7f2a3e1df4685f18d12a943a9f2a7456305401af21a07c9fe076ef9ecd6e400" +dependencies = [ + "anchor-syn", + "bs58 0.5.1", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-attribute-constant" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9423945cb55627f0b30903288e78baf6f62c6c8ab28fb344b6b25f1ffee3dca7" +dependencies = [ + "anchor-syn", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-attribute-error" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93ed12720033cc3c3bf3cfa293349c2275cd5ab99936e33dd4bf283aaad3e241" +dependencies = [ + "anchor-syn", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-attribute-event" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eef4dc0371eba2d8c8b54794b0b0eb786a234a559b77593d6f80825b6d2c77a2" +dependencies = [ + "anchor-syn", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-attribute-program" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b18c4f191331e078d4a6a080954d1576241c29c56638783322a18d308ab27e4f" +dependencies = [ + "anchor-syn", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-client" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb48c4a7911038da546dc752655a29fa49f6bd50ebc1edca218bac8da1012acd" +dependencies = [ + "anchor-lang", + "anyhow", + "futures", + "regex", + "serde", + "solana-account-decoder", + "solana-client", + "solana-sdk", + "thiserror", + "tokio", + "url", +] + +[[package]] +name = "anchor-derive-accounts" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5de10d6e9620d3bcea56c56151cad83c5992f50d5960b3a9bebc4a50390ddc3c" +dependencies = [ + "anchor-syn", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-derive-serde" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4e2e5be518ec6053d90a2a7f26843dbee607583c779e6c8395951b9739bdfbe" +dependencies = [ + "anchor-syn", + "borsh-derive-internal 0.10.3", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-derive-space" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ecc31d19fa54840e74b7a979d44bcea49d70459de846088a1d71e87ba53c419" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-lang" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35da4785497388af0553586d55ebdc08054a8b1724720ef2749d313494f2b8ad" +dependencies = [ + "anchor-attribute-access-control", + "anchor-attribute-account", + "anchor-attribute-constant", + "anchor-attribute-error", + "anchor-attribute-event", + "anchor-attribute-program", + "anchor-derive-accounts", + "anchor-derive-serde", + "anchor-derive-space", + "arrayref", + "base64 0.13.1", + "bincode", + "borsh 0.10.3", + "bytemuck", + "getrandom 0.2.14", + "solana-program", + "thiserror", +] + +[[package]] +name = "anchor-spl" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c4fd6e43b2ca6220d2ef1641539e678bfc31b6cc393cf892b373b5997b6a39a" +dependencies = [ + "anchor-lang", + "mpl-token-metadata", + "serum_dex", + "solana-program", + "spl-associated-token-account 2.3.0", + "spl-token 4.0.0", + "spl-token-2022 0.9.0", +] + +[[package]] +name = "anchor-syn" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9101b84702fed2ea57bd22992f75065da5648017135b844283a2f6d74f27825" +dependencies = [ + "anyhow", + "bs58 0.5.1", + "heck 0.3.3", + "proc-macro2", + "quote", + "serde", + "serde_json", + "sha2 0.10.8", + "syn 1.0.109", + "thiserror", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi", +] + +[[package]] +name = "anyhow" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" + +[[package]] +name = "ark-bn254" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a22f4561524cd949590d78d7d4c5df8f592430d221f7f3c9497bbafd8972120f" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", + "itertools 0.10.5", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "derivative", + "digest 0.10.7", + "itertools 0.10.5", + "num-bigint 0.4.4", + "num-traits", + "paste", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint 0.4.4", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "digest 0.10.7", + "num-bigint 0.4.4", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "arrayref" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "ascii" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e" + +[[package]] +name = "asn1-rs" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" +dependencies = [ + "asn1-rs-derive", + "asn1-rs-impl", + "displaydoc", + "nom", + "num-traits", + "rusticata-macros", + "thiserror", + "time", +] + +[[package]] +name = "asn1-rs-derive" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "synstructure", +] + +[[package]] +name = "asn1-rs-impl" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "assert_matches" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" + +[[package]] +name = "async-channel" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" +dependencies = [ + "concurrent-queue", + "event-listener", + "futures-core", +] + +[[package]] +name = "async-compression" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07dbbf24db18d609b1462965249abdf49129ccad073ec257da372adc83259c60" +dependencies = [ + "brotli", + "flate2", + "futures-core", + "memchr", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "async-mutex" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479db852db25d9dbf6204e6cb6253698f175c15726470f78af0d918e99d6156e" +dependencies = [ + "event-listener", +] + +[[package]] +name = "async-trait" +version = "0.1.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" + +[[package]] +name = "aws-config" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3182c19847238b50b62ae0383a6dbfc14514e552eb5e307e1ea83ccf5840b8a6" +dependencies = [ + "aws-credential-types", + "aws-runtime", + "aws-sdk-sso", + "aws-sdk-ssooidc", + "aws-sdk-sts", + "aws-smithy-async", + "aws-smithy-http", + "aws-smithy-json", + "aws-smithy-runtime", + "aws-smithy-runtime-api", + "aws-smithy-types", + "aws-types", + "bytes", + "fastrand", + "hex", + "http 0.2.12", + "hyper", + "ring 0.17.8", + "time", + "tokio", + "tracing", + "zeroize", +] + +[[package]] +name = "aws-credential-types" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e16838e6c9e12125face1c1eff1343c75e3ff540de98ff7ebd61874a89bcfeb9" +dependencies = [ + "aws-smithy-async", + "aws-smithy-runtime-api", + "aws-smithy-types", + "zeroize", +] + +[[package]] +name = "aws-runtime" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4963ac9ff2d33a4231b3806c1c69f578f221a9cabb89ad2bde62ce2b442c8a7" +dependencies = [ + "aws-credential-types", + "aws-sigv4", + "aws-smithy-async", + "aws-smithy-http", + "aws-smithy-runtime-api", + "aws-smithy-types", + "aws-types", + "bytes", + "fastrand", + "http 0.2.12", + "http-body", + "percent-encoding", + "pin-project-lite", + "tracing", + "uuid", +] + +[[package]] +name = "aws-sdk-sns" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5bc1f4b250ee27816119fc8e593ec9382c77e7a98fb7bbe3a71a6729b4a17f1" +dependencies = [ + "aws-credential-types", + "aws-runtime", + "aws-smithy-async", + "aws-smithy-http", + "aws-smithy-json", + "aws-smithy-query", + "aws-smithy-runtime", + "aws-smithy-runtime-api", + "aws-smithy-types", + "aws-smithy-xml", + "aws-types", + "http 0.2.12", + "once_cell", + "regex-lite", + "tracing", +] + +[[package]] +name = "aws-sdk-sso" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca7e8097448832fcd22faf6bb227e97d76b40e354509d1307653a885811c7151" +dependencies = [ + "aws-credential-types", + "aws-runtime", + "aws-smithy-async", + "aws-smithy-http", + "aws-smithy-json", + "aws-smithy-runtime", + "aws-smithy-runtime-api", + "aws-smithy-types", + "aws-types", + "bytes", + "http 0.2.12", + "once_cell", + "regex-lite", + "tracing", +] + +[[package]] +name = "aws-sdk-ssooidc" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75073590e23d63044606771afae309fada8eb10ded54a1ce4598347221d3fef" +dependencies = [ + "aws-credential-types", + "aws-runtime", + "aws-smithy-async", + "aws-smithy-http", + "aws-smithy-json", + "aws-smithy-runtime", + "aws-smithy-runtime-api", + "aws-smithy-types", + "aws-types", + "bytes", + "http 0.2.12", + "once_cell", + "regex-lite", + "tracing", +] + +[[package]] +name = "aws-sdk-sts" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "650e4aaae41547151dea4d8142f7ffcc8ab8ba76d5dccc8933936ef2102c3356" +dependencies = [ + "aws-credential-types", + "aws-runtime", + "aws-smithy-async", + "aws-smithy-http", + "aws-smithy-json", + "aws-smithy-query", + "aws-smithy-runtime", + "aws-smithy-runtime-api", + "aws-smithy-types", + "aws-smithy-xml", + "aws-types", + "http 0.2.12", + "once_cell", + "regex-lite", + "tracing", +] + +[[package]] +name = "aws-sigv4" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58b56f1cbe6fd4d0c2573df72868f20ab1c125ca9c9dbce17927a463433a2e57" +dependencies = [ + "aws-credential-types", + "aws-smithy-http", + "aws-smithy-runtime-api", + "aws-smithy-types", + "bytes", + "form_urlencoded", + "hex", + "hmac 0.12.1", + "http 0.2.12", + "http 1.1.0", + "once_cell", + "percent-encoding", + "sha2 0.10.8", + "time", + "tracing", +] + +[[package]] +name = "aws-smithy-async" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62220bc6e97f946ddd51b5f1361f78996e704677afc518a4ff66b7a72ea1378c" +dependencies = [ + "futures-util", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "aws-smithy-http" +version = "0.60.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a7de001a1b9a25601016d8057ea16e31a45fdca3751304c8edf4ad72e706c08" +dependencies = [ + "aws-smithy-runtime-api", + "aws-smithy-types", + "bytes", + "bytes-utils", + "futures-core", + "http 0.2.12", + "http-body", + "once_cell", + "percent-encoding", + "pin-project-lite", + "pin-utils", + "tracing", +] + +[[package]] +name = "aws-smithy-json" +version = "0.60.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4683df9469ef09468dad3473d129960119a0d3593617542b7d52086c8486f2d6" +dependencies = [ + "aws-smithy-types", +] + +[[package]] +name = "aws-smithy-query" +version = "0.60.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2fbd61ceb3fe8a1cb7352e42689cec5335833cd9f94103a61e98f9bb61c64bb" +dependencies = [ + "aws-smithy-types", + "urlencoding", +] + +[[package]] +name = "aws-smithy-runtime" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b36f1f98c8d7b6256b86d4a3c8c4abb120670267baa9712a485ba477eaac9e9" +dependencies = [ + "aws-smithy-async", + "aws-smithy-http", + "aws-smithy-runtime-api", + "aws-smithy-types", + "bytes", + "fastrand", + "h2", + "http 0.2.12", + "http-body", + "hyper", + "hyper-rustls", + "once_cell", + "pin-project-lite", + "pin-utils", + "rustls", + "tokio", + "tracing", +] + +[[package]] +name = "aws-smithy-runtime-api" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cc56a5c96ec741de6c5e6bf1ce6948be969d6506dfa9c39cffc284e31e4979b" +dependencies = [ + "aws-smithy-async", + "aws-smithy-types", + "bytes", + "http 0.2.12", + "http 1.1.0", + "pin-project-lite", + "tokio", + "tracing", + "zeroize", +] + +[[package]] +name = "aws-smithy-types" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abe14dceea1e70101d38fbf2a99e6a34159477c0fb95e68e05c66bd7ae4c3729" +dependencies = [ + "base64-simd", + "bytes", + "bytes-utils", + "futures-core", + "http 0.2.12", + "http-body", + "itoa", + "num-integer", + "pin-project-lite", + "pin-utils", + "ryu", + "serde", + "time", + "tokio", + "tokio-util 0.7.10", +] + +[[package]] +name = "aws-smithy-xml" +version = "0.60.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d123fbc2a4adc3c301652ba8e149bf4bc1d1725affb9784eb20c953ace06bf55" +dependencies = [ + "xmlparser", +] + +[[package]] +name = "aws-types" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a43b56df2c529fe44cb4d92bd64d0479883fb9608ff62daede4df5405381814" +dependencies = [ + "aws-credential-types", + "aws-smithy-async", + "aws-smithy-runtime-api", + "aws-smithy-types", + "http 0.2.12", + "rustc_version", + "tracing", +] + +[[package]] +name = "az" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b7e4c2464d97fe331d41de9d5db0def0a96f4d823b8b32a2efd503578988973" + +[[package]] +name = "backtrace" +version = "0.3.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64-simd" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "339abbe78e73178762e23bea9dfd08e697eb3f3301cd4be981c0f78ba5859195" +dependencies = [ + "outref", + "vsimd", +] + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +dependencies = [ + "serde", +] + +[[package]] +name = "bitmaps" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "031043d04099746d8db04daf1fa424b2bc8bd69d92b25962dcde24da39ab64a2" +dependencies = [ + "typenum", +] + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "blake3" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30cca6d3674597c30ddf2c587bf8d9d65c9a84d2326d941cc79c9842dfe0ef52" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if", + "constant_time_eq", + "digest 0.10.7", +] + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "block-padding", + "generic-array", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-padding" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" + +[[package]] +name = "borsh" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15bf3650200d8bffa99015595e10f1fbd17de07abbc25bb067da79e769939bfa" +dependencies = [ + "borsh-derive 0.9.3", + "hashbrown 0.11.2", +] + +[[package]] +name = "borsh" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4114279215a005bc675e386011e594e1d9b800918cea18fcadadcce864a2046b" +dependencies = [ + "borsh-derive 0.10.3", + "hashbrown 0.13.2", +] + +[[package]] +name = "borsh" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0901fc8eb0aca4c83be0106d6f2db17d86a08dfc2c25f0e84464bf381158add6" +dependencies = [ + "borsh-derive 1.4.0", + "cfg_aliases", +] + +[[package]] +name = "borsh-derive" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6441c552f230375d18e3cc377677914d2ca2b0d36e52129fe15450a2dce46775" +dependencies = [ + "borsh-derive-internal 0.9.3", + "borsh-schema-derive-internal 0.9.3", + "proc-macro-crate 0.1.5", + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "borsh-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0754613691538d51f329cce9af41d7b7ca150bc973056f1156611489475f54f7" +dependencies = [ + "borsh-derive-internal 0.10.3", + "borsh-schema-derive-internal 0.10.3", + "proc-macro-crate 0.1.5", + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "borsh-derive" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51670c3aa053938b0ee3bd67c3817e471e626151131b934038e83c5bf8de48f5" +dependencies = [ + "once_cell", + "proc-macro-crate 3.1.0", + "proc-macro2", + "quote", + "syn 2.0.60", + "syn_derive", +] + +[[package]] +name = "borsh-derive-internal" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "borsh-derive-internal" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afb438156919598d2c7bad7e1c0adf3d26ed3840dbc010db1a882a65583ca2fb" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "borsh-schema-derive-internal" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "borsh-schema-derive-internal" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634205cc43f74a1b9046ef87c4540ebda95696ec0f315024860cad7c5b0f5ccd" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "brotli" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "125740193d7fee5cc63ab9e16c2fdc4e07c74ba755cc53b327d6ea029e9fc569" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65622a320492e09b5e0ac436b14c54ff68199bac392d0e89a6832c4518eea525" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + +[[package]] +name = "bs58" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" + +[[package]] +name = "bs58" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "bumpalo" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "bv" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8834bb1d8ee5dc048ee3124f2c7c1afcc6bc9aed03f11e9dfd8c69470a5db340" +dependencies = [ + "feature-probe", + "serde", +] + +[[package]] +name = "bytecheck" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2" +dependencies = [ + "bytecheck_derive", + "ptr_meta", + "simdutf8", +] + +[[package]] +name = "bytecheck_derive" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "bytemuck" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d6d68c57235a3a081186990eca2867354726650f42f7516ca50c28d6281fd15" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4da9a32f3fed317401fa3c862968128267c3106685286e15d5aaa3d7389c2f60" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" + +[[package]] +name = "bytes-utils" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dafe3a8757b027e2be6e4e5601ed563c55989fcf1546e933c66c8eb3a058d35" +dependencies = [ + "bytes", + "either", +] + +[[package]] +name = "bzip2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" +dependencies = [ + "bzip2-sys", + "libc", +] + +[[package]] +name = "bzip2-sys" +version = "0.1.11+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "caps" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "190baaad529bcfbde9e1a19022c42781bdb6ff9de25721abdb8fd98c0807730b" +dependencies = [ + "libc", + "thiserror", +] + +[[package]] +name = "cc" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d32a725bc159af97c3e629873bb9f88fb8cf8a4867175f76dc987815ea07c83b" +dependencies = [ + "jobserver", + "libc", + "once_cell", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + +[[package]] +name = "chrono" +version = "0.4.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "serde", + "wasm-bindgen", + "windows-targets 0.52.5", +] + +[[package]] +name = "chrono-humanize" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799627e6b4d27827a814e837b9d8a504832086081806d45b1afa34dc982b023b" +dependencies = [ + "chrono", +] + +[[package]] +name = "cipher" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" +dependencies = [ + "generic-array", +] + +[[package]] +name = "clap" +version = "2.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" +dependencies = [ + "ansi_term", + "atty", + "bitflags 1.3.2", + "strsim 0.8.0", + "textwrap 0.11.0", + "unicode-width", + "vec_map", +] + +[[package]] +name = "clap" +version = "3.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" +dependencies = [ + "atty", + "bitflags 1.3.2", + "clap_derive", + "clap_lex", + "indexmap 1.9.3", + "once_cell", + "strsim 0.10.0", + "termcolor", + "terminal_size", + "textwrap 0.16.1", +] + +[[package]] +name = "clap_derive" +version = "3.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" +dependencies = [ + "heck 0.4.1", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "clap_lex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", +] + +[[package]] +name = "colored" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" +dependencies = [ + "lazy_static", + "windows-sys 0.48.0", +] + +[[package]] +name = "combine" +version = "3.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da3da6baa321ec19e1cc41d31bf599f00c783d0517095cdaf0332e3fe8d20680" +dependencies = [ + "ascii", + "byteorder", + "either", + "memchr", + "unreachable", +] + +[[package]] +name = "concurrent-queue" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "console" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" +dependencies = [ + "encode_unicode", + "lazy_static", + "libc", + "unicode-width", + "windows-sys 0.52.0", +] + +[[package]] +name = "console_error_panic_hook" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" +dependencies = [ + "cfg-if", + "wasm-bindgen", +] + +[[package]] +name = "console_log" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89f72f65e8501878b8a004d5a1afb780987e2ce2b4532c562e367a72c57499f" +dependencies = [ + "log", + "web-sys", +] + +[[package]] +name = "const-oid" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" + +[[package]] +name = "constant_time_eq" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" + +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "crypto-mac" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "ctr" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" +dependencies = [ + "cipher", +] + +[[package]] +name = "curve25519-dalek" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90f9d052967f590a76e62eb387bd0bbb1b000182c3cefe5364db6b7211651bc0" +dependencies = [ + "byteorder", + "digest 0.9.0", + "rand_core 0.5.1", + "serde", + "subtle", + "zeroize", +] + +[[package]] +name = "darling" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +dependencies = [ + "darling_core 0.13.4", + "darling_macro 0.13.4", +] + +[[package]] +name = "darling" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" +dependencies = [ + "darling_core 0.14.4", + "darling_macro 0.14.4", +] + +[[package]] +name = "darling" +version = "0.20.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" +dependencies = [ + "darling_core 0.20.8", + "darling_macro 0.20.8", +] + +[[package]] +name = "darling_core" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.10.0", + "syn 1.0.109", +] + +[[package]] +name = "darling_core" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.10.0", + "syn 1.0.109", +] + +[[package]] +name = "darling_core" +version = "0.20.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.10.0", + "syn 2.0.60", +] + +[[package]] +name = "darling_macro" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +dependencies = [ + "darling_core 0.13.4", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "darling_macro" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" +dependencies = [ + "darling_core 0.14.4", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "darling_macro" +version = "0.20.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" +dependencies = [ + "darling_core 0.20.8", + "quote", + "syn 2.0.60", +] + +[[package]] +name = "dashmap" +version = "4.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e77a43b28d0668df09411cb0bc9a8c2adc40f9a048afe863e05fd43251e8e39c" +dependencies = [ + "cfg-if", + "num_cpus", + "rayon", +] + +[[package]] +name = "data-encoding" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" + +[[package]] +name = "decimal-wad" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cc2736e4f7d82be485e49c721a7031f30e1f57b433bb346d7a6af4c377fd0f" +dependencies = [ + "uint", +] + +[[package]] +name = "der" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c" +dependencies = [ + "const-oid", +] + +[[package]] +name = "der-parser" +version = "8.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" +dependencies = [ + "asn1-rs", + "displaydoc", + "nom", + "num-bigint 0.4.4", + "num-traits", + "rusticata-macros", +] + +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "derivation-path" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e5c37193a1db1d8ed868c03ec7b152175f26160a5b740e5e484143877e0adf0" + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8" +dependencies = [ + "derive_builder_macro 0.12.0", +] + +[[package]] +name = "derive_builder" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f59169f400d8087f238c5c0c7db6a28af18681717f3b623227d92f397e938c7" +dependencies = [ + "derive_builder_macro 0.13.1", +] + +[[package]] +name = "derive_builder_core" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c11bdc11a0c47bc7d37d582b5285da6849c96681023680b906673c5707af7b0f" +dependencies = [ + "darling 0.14.4", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder_core" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4ec317cc3e7ef0928b0ca6e4a634a4d6c001672ae210438cf114a83e56b018d" +dependencies = [ + "darling 0.14.4", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder_macro" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" +dependencies = [ + "derive_builder_core 0.12.0", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder_macro" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "870368c3fb35b8031abb378861d4460f573b92238ec2152c927a21f77e3e0127" +dependencies = [ + "derive_builder_core 0.13.1", + "syn 1.0.109", +] + +[[package]] +name = "dialoguer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59c6f2989294b9a498d3ad5491a79c6deb604617378e1cdc4bfc1c1361fe2f87" +dependencies = [ + "console", + "shell-words", + "tempfile", + "zeroize", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer 0.10.4", + "crypto-common", + "subtle", +] + +[[package]] +name = "dir-diff" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7ad16bf5f84253b50d6557681c58c3ab67c47c77d39fed9aeb56e947290bd10" +dependencies = [ + "walkdir", +] + +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "displaydoc" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + +[[package]] +name = "dlopen2" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09b4f5f101177ff01b8ec4ecc81eead416a8aa42819a2869311b3420fa114ffa" +dependencies = [ + "dlopen2_derive", + "libc", + "once_cell", + "winapi", +] + +[[package]] +name = "dlopen2_derive" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cbae11b3de8fce2a456e8ea3dada226b35fe791f0dc1d360c0941f0bb681f3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + +[[package]] +name = "dotenvy" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" + +[[package]] +name = "dyn-clone" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" + +[[package]] +name = "eager" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abe71d579d1812060163dff96056261deb5bf6729b100fa2e36a68b9649ba3d3" + +[[package]] +name = "ed25519" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" +dependencies = [ + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +dependencies = [ + "curve25519-dalek", + "ed25519", + "rand 0.7.3", + "serde", + "sha2 0.9.9", + "zeroize", +] + +[[package]] +name = "ed25519-dalek-bip32" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d2be62a4061b872c8c0873ee4fc6f101ce7b889d039f019c5fa2af471a59908" +dependencies = [ + "derivation-path", + "ed25519-dalek", + "hmac 0.12.1", + "sha2 0.10.8", +] + +[[package]] +name = "educe" +version = "0.4.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f0042ff8246a363dbe77d2ceedb073339e85a804b9a47636c6e016a9a32c05f" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "either" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" + +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + +[[package]] +name = "encoding_rs" +version = "0.8.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "enum-iterator" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fd242f399be1da0a5354aa462d57b4ab2b4ee0683cc552f7c007d2d12d36e94" +dependencies = [ + "enum-iterator-derive", +] + +[[package]] +name = "enum-iterator-derive" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c19cbb53d33b57ac4df1f0af6b92c38c107cded663c4aea9fae1189dcfc17cf5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + +[[package]] +name = "enum-ordinalize" +version = "3.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bf1fa3f06bbff1ea5b1a9c7b14aa992a39657db60a2759457328d7e058f49ee" +dependencies = [ + "num-bigint 0.4.4", + "num-traits", + "proc-macro2", + "quote", + "syn 2.0.60", +] + +[[package]] +name = "enumflags2" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83c8d82922337cd23a15f88b70d8e4ef5f11da38dd7cdb55e84dd5de99695da0" +dependencies = [ + "enumflags2_derive", +] + +[[package]] +name = "enumflags2_derive" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "946ee94e3dbf58fdd324f9ce245c7b238d46a66f00e86a020b71996349e46cce" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "env_logger" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "farms" +version = "0.1.0" +source = "git+https://github.com/Kamino-Finance/kfarms#23da54c9f1433257351242c964f9806cb16fa205" +dependencies = [ + "anchor-lang", + "anchor-spl", + "bytemuck", + "decimal-wad", + "num-derive 0.3.3", + "num-traits", + "num_enum 0.5.11", + "scope-types", + "solana-security-txt", + "spl-token 4.0.0", + "static_assertions", + "uint", +] + +[[package]] +name = "fastrand" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" + +[[package]] +name = "feature-probe" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835a3dc7d1ec9e75e2b5fb4ba75396837112d2060b03f7d43bc1897c7f7211da" + +[[package]] +name = "field-offset" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f" +dependencies = [ + "memoffset 0.9.1", + "rustc_version", +] + +[[package]] +name = "filetime" +version = "0.2.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "windows-sys 0.52.0", +] + +[[package]] +name = "fixed" +version = "1.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fc715d38bea7b5bf487fcd79bcf8c209f0b58014f3018a7a19c2b855f472048" +dependencies = [ + "az", + "bytemuck", + "half", + "typenum", +] + +[[package]] +name = "fixed-macro" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0c48af8cb14e02868f449f8a2187bd78af7a08da201fdc78d518ecb1675bc" +dependencies = [ + "fixed", + "fixed-macro-impl", + "fixed-macro-types", +] + +[[package]] +name = "fixed-macro-impl" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c93086f471c0a1b9c5e300ea92f5cd990ac6d3f8edf27616ef624b8fa6402d4b" +dependencies = [ + "fixed", + "paste", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "fixed-macro-types" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "044a61b034a2264a7f65aa0c3cd112a01b4d4ee58baace51fead3f21b993c7e4" +dependencies = [ + "fixed", + "fixed-macro-impl", +] + +[[package]] +name = "flate2" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fs-err" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" +dependencies = [ + "autocfg", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-executor" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" + +[[package]] +name = "futures-macro" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "serde", + "typenum", + "version_check", +] + +[[package]] +name = "gethostname" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1ebd34e35c46e00bb73e81363248d627782724609fe1b6396f553f68fe3862e" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" + +[[package]] +name = "goblin" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7666983ed0dd8d21a6f6576ee00053ca0926fb281a5522577a4dbd0f1b54143" +dependencies = [ + "log", + "plain", + "scroll", +] + +[[package]] +name = "h2" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http 0.2.12", + "indexmap 2.2.6", + "slab", + "tokio", + "tokio-util 0.7.10", + "tracing", +] + +[[package]] +name = "half" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" +dependencies = [ + "cfg-if", + "crunchy", +] + +[[package]] +name = "hash32" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hashbrown" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +dependencies = [ + "ahash 0.7.8", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash 0.7.8", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash 0.8.5", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" + +[[package]] +name = "headers" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06683b93020a07e3dbcf5f8c0f6d40080d725bea7936fc01ad345c01b97dc270" +dependencies = [ + "base64 0.21.7", + "bytes", + "headers-core", + "http 0.2.12", + "httpdate", + "mime", + "sha1", +] + +[[package]] +name = "headers-core" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" +dependencies = [ + "http 0.2.12", +] + +[[package]] +name = "heck" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +dependencies = [ + "serde", +] + +[[package]] +name = "histogram" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12cb882ccb290b8646e554b157ab0b71e64e8d5bef775cd66b6531e52d302669" + +[[package]] +name = "hmac" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" +dependencies = [ + "crypto-mac", + "digest 0.9.0", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "hmac-drbg" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" +dependencies = [ + "digest 0.9.0", + "generic-array", + "hmac 0.8.1", +] + +[[package]] +name = "http" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http 0.2.12", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "hyper" +version = "0.14.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http 0.2.12", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" +dependencies = [ + "futures-util", + "http 0.2.12", + "hyper", + "log", + "rustls", + "rustls-native-certs", + "tokio", + "tokio-rustls", +] + +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "im" +version = "15.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0acd33ff0285af998aaf9b57342af478078f53492322fafc47450e09397e0e9" +dependencies = [ + "bitmaps", + "rand_core 0.6.4", + "rand_xoshiro", + "rayon", + "serde", + "sized-chunks", + "typenum", + "version_check", +] + +[[package]] +name = "index_list" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70891286cb8e844fdfcf1178b47569699f9e20b5ecc4b45a6240a64771444638" + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", +] + +[[package]] +name = "indexmap" +version = "2.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +dependencies = [ + "equivalent", + "hashbrown 0.14.3", +] + +[[package]] +name = "indicatif" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "763a5a8f45087d6bcea4222e7b72c291a054edf80e4ef6efd2a4979878c7bea3" +dependencies = [ + "console", + "instant", + "number_prefix", + "portable-atomic", + "unicode-width", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi 0.3.9", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "ipnet" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" + +[[package]] +name = "itertools" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "jobserver" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" +dependencies = [ + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "jsonrpc-core" +version = "18.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14f7f76aef2d054868398427f6c54943cf3d1caa9a7ec7d0c38d69df97a965eb" +dependencies = [ + "futures", + "futures-executor", + "futures-util", + "log", + "serde", + "serde_derive", + "serde_json", +] + +[[package]] +name = "juno" +version = "0.1.0" +source = "git+https://github.com/Kamino-Finance/juno#ca1a39d7ed884eac6db13f2bdbb75a8dd9be22f7" +dependencies = [ + "async-trait", + "base64 0.13.1", + "bincode", + "futures", + "itertools 0.10.5", + "reqwest", + "serde", + "serde_derive", + "serde_json", + "serde_with 1.14.0", + "solana-address-lookup-table-program", + "solana-client", + "solana-program", + "solana-sdk", + "thiserror", + "url", +] + +[[package]] +name = "kamino_lending" +version = "0.1.0" +source = "git+https://github.com/Kamino-Finance/klend#c02bcf7dfe932af27d429df4111b3a3ca05a0dd3" +dependencies = [ + "anchor-lang", + "anchor-spl", + "bitflags 2.5.0", + "borsh 0.10.3", + "bytemuck", + "derivative", + "derive_builder 0.13.1", + "farms", + "fixed", + "fixed-macro", + "num_enum 0.7.2", + "pyth-sdk-solana", + "scope-types", + "solana-program", + "solana-security-txt", + "static_assertions", + "strum 0.24.0", + "switchboard-itf", + "uint", +] + +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "klend-terminator" +version = "0.2.0-SNAPSHOT" +dependencies = [ + "anchor-client", + "anchor-lang", + "anchor-spl", + "anyhow", + "arrayref", + "async-trait", + "aws-config", + "aws-sdk-sns", + "bytemuck", + "clap 3.2.25", + "colored", + "derive_builder 0.12.0", + "dotenvy", + "farms", + "fixed", + "futures", + "itertools 0.12.1", + "juno", + "kamino_lending", + "lazy_static", + "nohash-hasher", + "num_enum 0.5.11", + "orbit-link", + "scope-types", + "serde", + "serde_json", + "solana-account-decoder", + "solana-program-test", + "solana-rpc-client", + "solana-sdk", + "spl-associated-token-account 1.1.3", + "spl-token 3.5.0", + "spl-token-client", + "static-pubkey", + "strum 0.24.0", + "thiserror", + "tokio", + "tracing", + "tracing-subscriber", + "urlencoding", + "warp", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.153" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.5.0", + "libc", +] + +[[package]] +name = "libsecp256k1" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9d220bc1feda2ac231cb78c3d26f27676b8cf82c96971f7aeef3d0cf2797c73" +dependencies = [ + "arrayref", + "base64 0.12.3", + "digest 0.9.0", + "hmac-drbg", + "libsecp256k1-core", + "libsecp256k1-gen-ecmult", + "libsecp256k1-gen-genmult", + "rand 0.7.3", + "serde", + "sha2 0.9.9", + "typenum", +] + +[[package]] +name = "libsecp256k1-core" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0f6ab710cec28cef759c5f18671a27dae2a5f952cdaaee1d8e2908cb2478a80" +dependencies = [ + "crunchy", + "digest 0.9.0", + "subtle", +] + +[[package]] +name = "libsecp256k1-gen-ecmult" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccab96b584d38fac86a83f07e659f0deafd0253dc096dab5a36d53efe653c5c3" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "libsecp256k1-gen-genmult" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67abfe149395e3aa1c48a2beb32b068e2334402df8181f818d3aee2b304c4f5d" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "light-poseidon" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c9a85a9752c549ceb7578064b4ed891179d20acd85f27318573b64d2d7ee7ee" +dependencies = [ + "ark-bn254", + "ark-ff", + "num-bigint 0.4.4", + "thiserror", +] + +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + +[[package]] +name = "linux-raw-sys" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" + +[[package]] +name = "lock_api" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" + +[[package]] +name = "lru" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999beba7b6e8345721bd280141ed958096a2e4abdf74f67ff4ce49b4b54e47a" +dependencies = [ + "hashbrown 0.12.3", +] + +[[package]] +name = "lz4" +version = "1.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e9e2dd86df36ce760a60f6ff6ad526f7ba1f14ba0356f8254fb6905e6494df1" +dependencies = [ + "libc", + "lz4-sys", +] + +[[package]] +name = "lz4-sys" +version = "1.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57d27b317e207b10f69f5e75494119e391a96f48861ae870d1da6edac98ca900" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "memchr" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" + +[[package]] +name = "memmap2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +dependencies = [ + "autocfg", +] + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "merlin" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" +dependencies = [ + "byteorder", + "keccak", + "rand_core 0.6.4", + "zeroize", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +dependencies = [ + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.48.0", +] + +[[package]] +name = "modular-bitfield" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a53d79ba8304ac1c4f9eb3b9d281f21f7be9d4626f72ce7df4ad8fbde4f38a74" +dependencies = [ + "modular-bitfield-impl", + "static_assertions", +] + +[[package]] +name = "modular-bitfield-impl" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a7d5f7076603ebc68de2dc6a650ec331a062a13abaa346975be747bbfa4b789" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "mpl-token-metadata" +version = "3.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba8ee05284d79b367ae8966d558e1a305a781fc80c9df51f37775169117ba64f" +dependencies = [ + "borsh 0.10.3", + "num-derive 0.3.3", + "num-traits", + "solana-program", + "thiserror", +] + +[[package]] +name = "multer" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01acbdc23469fd8fe07ab135923371d5f5a422fbf9c522158677c8eb15bc51c2" +dependencies = [ + "bytes", + "encoding_rs", + "futures-util", + "http 0.2.12", + "httparse", + "log", + "memchr", + "mime", + "spin 0.9.8", + "version_check", +] + +[[package]] +name = "native-tls" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "nix" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" +dependencies = [ + "bitflags 1.3.2", + "cfg-if", + "libc", + "memoffset 0.7.1", + "pin-utils", +] + +[[package]] +name = "nohash-hasher" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8536030f9fea7127f841b45bb6243b27255787fb4eb83958aa1ef9d2fdc0c36" +dependencies = [ + "num-bigint 0.2.6", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-derive" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d869c01cc0c455284163fd0092f1f93835385ccab5a98a0dcc497b2f8bf055a9" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" +dependencies = [ + "autocfg", + "num-bigint 0.2.6", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi 0.3.9", + "libc", +] + +[[package]] +name = "num_enum" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" +dependencies = [ + "num_enum_derive 0.5.11", +] + +[[package]] +name = "num_enum" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a015b430d3c108a207fd776d2e2196aaf8b1cf8cf93253e3a097ff3085076a1" +dependencies = [ + "num_enum_derive 0.6.1", +] + +[[package]] +name = "num_enum" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" +dependencies = [ + "num_enum_derive 0.7.2", +] + +[[package]] +name = "num_enum_derive" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "num_enum_derive" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 2.0.60", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" +dependencies = [ + "proc-macro-crate 3.1.0", + "proc-macro2", + "quote", + "syn 2.0.60", +] + +[[package]] +name = "number_prefix" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" + +[[package]] +name = "object" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "memchr", +] + +[[package]] +name = "oid-registry" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" +dependencies = [ + "asn1-rs", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "opaque-debug" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" + +[[package]] +name = "openssl" +version = "0.10.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" +dependencies = [ + "bitflags 2.5.0", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "opentelemetry" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6105e89802af13fdf48c49d7646d3b533a70e536d818aae7e78ba0433d01acb8" +dependencies = [ + "async-trait", + "crossbeam-channel", + "futures-channel", + "futures-executor", + "futures-util", + "js-sys", + "lazy_static", + "percent-encoding", + "pin-project", + "rand 0.8.5", + "thiserror", +] + +[[package]] +name = "orbit-link" +version = "0.2.0" +source = "git+https://github.com/Kamino-Finance/orbit-link#621d66fba1e46b554548b88abb1ae25cb6154fa1" +dependencies = [ + "anchor-client", + "async-trait", + "base64 0.21.7", + "bs58 0.5.1", + "futures", + "itertools 0.12.1", + "reqwest", + "serde", + "serde_json", + "solana-account-decoder", + "solana-client", + "solana-transaction-status", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "os_str_bytes" +version = "6.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" + +[[package]] +name = "ouroboros" +version = "0.15.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1358bd1558bd2a083fed428ffeda486fbfb323e698cdda7794259d592ca72db" +dependencies = [ + "aliasable", + "ouroboros_macro", +] + +[[package]] +name = "ouroboros_macro" +version = "0.15.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f7d21ccd03305a674437ee1248f3ab5d4b1db095cf1caf49f1713ddf61956b7" +dependencies = [ + "Inflector", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "outref" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4030760ffd992bef45b0ae3f10ce1aba99e33464c90d14dd7c039884963ddc7a" + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.48.5", +] + +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + +[[package]] +name = "pbkdf2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "216eaa586a190f0a738f2f918511eecfa90f13295abec0e457cdebcceda80cbd" +dependencies = [ + "crypto-mac", +] + +[[package]] +name = "pbkdf2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "pem" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" +dependencies = [ + "base64 0.13.1", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "percentage" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fd23b938276f14057220b707937bcb42fa76dda7560e57a2da30cb52d557937" +dependencies = [ + "num", +] + +[[package]] +name = "pin-project" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkcs8" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0" +dependencies = [ + "der", + "spki", + "zeroize", +] + +[[package]] +name = "pkg-config" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" + +[[package]] +name = "plain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" + +[[package]] +name = "polyval" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" +dependencies = [ + "cfg-if", + "cpufeatures", + "opaque-debug", + "universal-hash", +] + +[[package]] +name = "portable-atomic" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "pretty-hex" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6fa0831dd7cc608c38a5e323422a0077678fa5744aa2be4ad91c4ece8eec8d5" + +[[package]] +name = "proc-macro-crate" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" +dependencies = [ + "toml", +] + +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit 0.19.15", +] + +[[package]] +name = "proc-macro-crate" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +dependencies = [ + "toml_edit 0.21.1", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "ptr_meta" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" +dependencies = [ + "ptr_meta_derive", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "pyth-sdk" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7aeef4d5f0a9c98ff5af2ddd84a8b89919c512188305b497a9eb9afa97a949" +dependencies = [ + "borsh 0.10.3", + "borsh-derive 0.10.3", + "getrandom 0.2.14", + "hex", + "schemars", + "serde", +] + +[[package]] +name = "pyth-sdk-solana" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "875de47128e93a881ede3ad97aa5a4dc32397995277ff5e599eed8bba8d43334" +dependencies = [ + "borsh 0.10.3", + "borsh-derive 0.10.3", + "bytemuck", + "num-derive 0.3.3", + "num-traits", + "pyth-sdk", + "serde", + "solana-program", + "thiserror", +] + +[[package]] +name = "qstring" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d464fae65fff2680baf48019211ce37aaec0c78e9264c84a3e484717f965104e" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "qualifier_attr" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e2e25ee72f5b24d773cae88422baddefff7714f97aab68d96fe2b6fc4a28fb2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + +[[package]] +name = "quinn" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "141bf7dfde2fbc246bfd3fe12f2455aa24b0fbd9af535d8c86c7bd1381ff2b1a" +dependencies = [ + "bytes", + "rand 0.8.5", + "ring 0.16.20", + "rustc-hash", + "rustls", + "rustls-native-certs", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" +dependencies = [ + "bytes", + "libc", + "socket2", + "tracing", + "windows-sys 0.48.0", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.14", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_xoshiro" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa" +dependencies = [ + "rand_core 0.6.4", +] + +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "rcgen" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffbe84efe2f38dea12e9bfc1f65377fdf03e53a18cb3b995faedf7934c7e785b" +dependencies = [ + "pem", + "ring 0.16.20", + "time", + "yasna", +] + +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_users" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" +dependencies = [ + "getrandom 0.2.14", + "libredox", + "thiserror", +] + +[[package]] +name = "regex" +version = "1.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.4.6", + "regex-syntax 0.8.3", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.3", +] + +[[package]] +name = "regex-lite" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30b661b2f27137bdbc16f00eda72866a92bb28af1753ffbd56744fb6e2e9cd8e" + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" + +[[package]] +name = "rend" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71fe3824f5629716b1589be05dacd749f6aa084c87e00e016714a8cdfccc997c" +dependencies = [ + "bytecheck", +] + +[[package]] +name = "reqwest" +version = "0.11.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +dependencies = [ + "async-compression", + "base64 0.21.7", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http 0.2.12", + "http-body", + "hyper", + "hyper-rustls", + "hyper-tls", + "ipnet", + "js-sys", + "log", + "mime", + "mime_guess", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "system-configuration", + "tokio", + "tokio-native-tls", + "tokio-rustls", + "tokio-util 0.7.10", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots 0.25.4", + "winreg", +] + +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin 0.5.2", + "untrusted 0.7.1", + "web-sys", + "winapi", +] + +[[package]] +name = "ring" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.14", + "libc", + "spin 0.9.8", + "untrusted 0.9.0", + "windows-sys 0.52.0", +] + +[[package]] +name = "rkyv" +version = "0.7.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cba464629b3394fc4dbc6f940ff8f5b4ff5c7aef40f29166fd4ad12acbc99c0" +dependencies = [ + "bitvec", + "bytecheck", + "bytes", + "hashbrown 0.12.3", + "ptr_meta", + "rend", + "rkyv_derive", + "seahash", + "tinyvec", + "uuid", +] + +[[package]] +name = "rkyv_derive" +version = "0.7.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7dddfff8de25e6f62b9d64e6e432bf1c6736c57d20323e15ee10435fbda7c65" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "rpassword" +version = "7.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80472be3c897911d0137b2d2b9055faf6eeac5b14e324073d83bc17b191d7e3f" +dependencies = [ + "libc", + "rtoolbox", + "windows-sys 0.48.0", +] + +[[package]] +name = "rtoolbox" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c247d24e63230cdb56463ae328478bd5eac8b8faa8c69461a77e8e323afac90e" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "rust_decimal" +version = "1.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1790d1c4c0ca81211399e0e0af16333276f375209e71a37b67698a373db5b47a" +dependencies = [ + "arrayvec", + "borsh 1.4.0", + "bytes", + "num-traits", + "rand 0.8.5", + "rkyv", + "serde", + "serde_json", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rusticata-macros" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632" +dependencies = [ + "nom", +] + +[[package]] +name = "rustix" +version = "0.37.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" +dependencies = [ + "bitflags 1.3.2", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys 0.3.8", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustix" +version = "0.38.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +dependencies = [ + "bitflags 2.5.0", + "errno", + "libc", + "linux-raw-sys 0.4.13", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustls" +version = "0.21.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fecbfb7b1444f477b345853b1fce097a2c6fb637b2bfb87e6bc5db0f043fae4" +dependencies = [ + "log", + "ring 0.17.8", + "rustls-webpki", + "sct", +] + +[[package]] +name = "rustls-native-certs" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64 0.21.7", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring 0.17.8", + "untrusted 0.9.0", +] + +[[package]] +name = "rustversion" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80af6f9131f277a45a3fba6ce8e2258037bb0477a67e610d3c1fe046ab31de47" + +[[package]] +name = "ryu" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" + +[[package]] +name = "safe-transmute" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98a01dab6acf992653be49205bdd549f32f17cb2803e8eacf1560bf97259aae8" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schannel" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "schemars" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45a28f4c49489add4ce10783f7911893516f15afe45d015608d41faca6bc4d29" +dependencies = [ + "dyn-clone", + "schemars_derive", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c767fd6fa65d9ccf9cf026122c1b555f2ef9a4f0cea69da4d7dbc3e258d30967" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 1.0.109", +] + +[[package]] +name = "scope-types" +version = "1.0.0" +source = "git+https://github.com/Kamino-Finance/scope?branch=anchor_0.29_idl#0c8f7925aad9f5cf30b6715f2bef0ece9235d87a" +dependencies = [ + "anchor-lang", + "bytemuck", + "cfg-if", + "num_enum 0.7.2", + "solana-program", +] + +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "scroll" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04c565b551bafbef4157586fa379538366e4385d42082f255bfd96e4fe8519da" +dependencies = [ + "scroll_derive", +] + +[[package]] +name = "scroll_derive" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1db149f81d46d2deba7cd3c50772474707729550221e69588478ebf9ada425ae" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + +[[package]] +name = "sct" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring 0.17.8", + "untrusted 0.9.0", +] + +[[package]] +name = "seahash" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" + +[[package]] +name = "security-framework" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "770452e37cad93e0a50d5abc3990d2bc351c36d0328f86cefec2f2fb206eaef6" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41f3cc463c0ef97e11c3461a9d3787412d30e8e7eb907c79180c4a57bf7c04ef" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" + +[[package]] +name = "serde" +version = "1.0.198" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9846a40c979031340571da2545a4e5b7c4163bdae79b301d5f86d03979451fcc" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_bytes" +version = "0.11.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.198" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e88edab869b01783ba905e7d0153f9fc1a6505a96e4ad3018011eedb838566d9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + +[[package]] +name = "serde_derive_internals" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "serde_json" +version = "1.0.116" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_with" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "678b5a069e50bf00ecd22d0cd8ddf7c236f68581b03db652061ed5eb13a312ff" +dependencies = [ + "serde", + "serde_with_macros 1.5.2", +] + +[[package]] +name = "serde_with" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07ff71d2c147a7b57362cead5e22f772cd52f6ab31cfcd9edcd7f6aeb2a0afbe" +dependencies = [ + "serde", + "serde_with_macros 2.3.3", +] + +[[package]] +name = "serde_with_macros" +version = "1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082" +dependencies = [ + "darling 0.13.4", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "serde_with_macros" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" +dependencies = [ + "darling 0.20.8", + "proc-macro2", + "quote", + "syn 2.0.60", +] + +[[package]] +name = "serde_yaml" +version = "0.9.34+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" +dependencies = [ + "indexmap 2.2.6", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + +[[package]] +name = "serum_dex" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02705854bae4622e552346c8edd43ab90c7425da35d63d2c689f39238f8d8b25" +dependencies = [ + "arrayref", + "bincode", + "bytemuck", + "byteorder", + "enumflags2", + "field-offset", + "itertools 0.9.0", + "num-traits", + "num_enum 0.5.11", + "safe-transmute", + "serde", + "solana-program", + "spl-token 3.5.0", + "static_assertions", + "thiserror", + "without-alloc", +] + +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "sha3" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809" +dependencies = [ + "block-buffer 0.9.0", + "digest 0.9.0", + "keccak", + "opaque-debug", +] + +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest 0.10.7", + "keccak", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shell-words" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" + +[[package]] +name = "signal-hook-registry" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +dependencies = [ + "libc", +] + +[[package]] +name = "signature" +version = "1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" + +[[package]] +name = "simdutf8" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" + +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + +[[package]] +name = "sized-chunks" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16d69225bde7a69b235da73377861095455d298f2b970996eec25ddbb42b3d1e" +dependencies = [ + "bitmaps", + "typenum", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "socket2" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "solana-account-decoder" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4e29f060cabd0e1bd90a63f8e1517ddd3365d3dc2eaa05f9a9fa542f4adeaaa" +dependencies = [ + "Inflector", + "base64 0.21.7", + "bincode", + "bs58 0.4.0", + "bv", + "lazy_static", + "serde", + "serde_derive", + "serde_json", + "solana-config-program", + "solana-sdk", + "spl-token 4.0.0", + "spl-token-2022 1.0.0", + "spl-token-group-interface", + "spl-token-metadata-interface", + "thiserror", + "zstd", +] + +[[package]] +name = "solana-accounts-db" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e32ca00e7785d0fde702aa6c9fa749d33d1c275980baee85de0543357cae28" +dependencies = [ + "arrayref", + "bincode", + "blake3", + "bv", + "bytemuck", + "byteorder", + "bzip2", + "crossbeam-channel", + "dashmap", + "flate2", + "fnv", + "fs-err", + "im", + "index_list", + "itertools 0.10.5", + "lazy_static", + "log", + "lz4", + "memmap2", + "modular-bitfield", + "num-derive 0.3.3", + "num-traits", + "num_cpus", + "num_enum 0.6.1", + "ouroboros", + "percentage", + "qualifier_attr", + "rand 0.8.5", + "rayon", + "regex", + "rustc_version", + "serde", + "serde_derive", + "solana-bucket-map", + "solana-config-program", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-measure", + "solana-metrics", + "solana-program-runtime", + "solana-rayon-threadlimit", + "solana-sdk", + "solana-stake-program", + "solana-system-program", + "solana-vote-program", + "static_assertions", + "strum 0.24.1", + "strum_macros 0.24.3", + "tar", + "tempfile", + "thiserror", +] + +[[package]] +name = "solana-address-lookup-table-program" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71a93d1c1a0c13de20e13a0c9bd7275b00bb901b8b7c55424fea98f71cb37778" +dependencies = [ + "bincode", + "bytemuck", + "log", + "num-derive 0.3.3", + "num-traits", + "rustc_version", + "serde", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-program", + "solana-program-runtime", + "solana-sdk", + "thiserror", +] + +[[package]] +name = "solana-banks-client" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ef7e659e9c12f85f79080b7f05e6b4d4f4319a09d2b13c000e00987b26d9813" +dependencies = [ + "borsh 0.10.3", + "futures", + "solana-banks-interface", + "solana-program", + "solana-sdk", + "tarpc", + "thiserror", + "tokio", + "tokio-serde", +] + +[[package]] +name = "solana-banks-interface" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48208df18acbb3558045695e52f1daa1e53ed5c3174a0a3f42c0b52c6d09f0e" +dependencies = [ + "serde", + "solana-sdk", + "tarpc", +] + +[[package]] +name = "solana-banks-server" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cd09c23b2c0b771606bc0a13efb7d41c23ade14bf434253582e1dca0f66c725" +dependencies = [ + "bincode", + "crossbeam-channel", + "futures", + "solana-accounts-db", + "solana-banks-interface", + "solana-client", + "solana-runtime", + "solana-sdk", + "solana-send-transaction-service", + "tarpc", + "tokio", + "tokio-serde", +] + +[[package]] +name = "solana-bpf-loader-program" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a396f4190c9bc81ec2d697673a571d7f064634916105fdf9efecb6fa5bec818" +dependencies = [ + "bincode", + "byteorder", + "libsecp256k1", + "log", + "scopeguard", + "solana-measure", + "solana-program-runtime", + "solana-sdk", + "solana-zk-token-sdk", + "solana_rbpf", + "thiserror", +] + +[[package]] +name = "solana-bucket-map" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4efb7bc86741650dc2a942d23e7e714d41bbc46eff5555784ec87ee7a591615" +dependencies = [ + "bv", + "bytemuck", + "log", + "memmap2", + "modular-bitfield", + "num_enum 0.6.1", + "rand 0.8.5", + "solana-measure", + "solana-sdk", + "tempfile", +] + +[[package]] +name = "solana-clap-utils" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62e5cdc0ae0c8ae79c39a4a362066d0d61764bc7ea7e033961fd7510fd24da2a" +dependencies = [ + "chrono", + "clap 2.34.0", + "rpassword", + "solana-remote-wallet", + "solana-sdk", + "thiserror", + "tiny-bip39", + "uriparse", + "url", +] + +[[package]] +name = "solana-cli-config" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6de25e2f3e00901ffbe09e625303fdda62baaa584992027bdc92fc3fca04e1a" +dependencies = [ + "dirs-next", + "lazy_static", + "serde", + "serde_derive", + "serde_yaml", + "solana-clap-utils", + "solana-sdk", + "url", +] + +[[package]] +name = "solana-cli-output" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f30b3aca5a25e1ca04b5b1107bcdc26fcc69d167df0f617dbca5967df62e0d42" +dependencies = [ + "Inflector", + "base64 0.21.7", + "chrono", + "clap 2.34.0", + "console", + "humantime", + "indicatif", + "pretty-hex", + "semver", + "serde", + "serde_json", + "solana-account-decoder", + "solana-clap-utils", + "solana-cli-config", + "solana-rpc-client-api", + "solana-sdk", + "solana-transaction-status", + "solana-vote-program", + "spl-memo 4.0.0", +] + +[[package]] +name = "solana-client" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1e2301c2af7e5a1dba0855f710329a2bb993829ed9fdf8f6207d02ee6fc54a4" +dependencies = [ + "async-trait", + "bincode", + "dashmap", + "futures", + "futures-util", + "indexmap 2.2.6", + "indicatif", + "log", + "quinn", + "rayon", + "solana-connection-cache", + "solana-measure", + "solana-metrics", + "solana-pubsub-client", + "solana-quic-client", + "solana-rpc-client", + "solana-rpc-client-api", + "solana-rpc-client-nonce-utils", + "solana-sdk", + "solana-streamer", + "solana-thin-client", + "solana-tpu-client", + "solana-udp-client", + "thiserror", + "tokio", +] + +[[package]] +name = "solana-compute-budget-program" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773ae3c4d99f9ed06d9dc5c6541df1db16bc42d77f91c46b9c9b117fc5e129b3" +dependencies = [ + "solana-program-runtime", + "solana-sdk", +] + +[[package]] +name = "solana-config-program" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595118948b966b110aad3f9d8d8464958abe379ecfa7a813b4fc82659c8259bc" +dependencies = [ + "bincode", + "chrono", + "serde", + "serde_derive", + "solana-program-runtime", + "solana-sdk", +] + +[[package]] +name = "solana-connection-cache" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d363d6bb43e618b6010b47c2eb0579777ce4ed388ca15b84a610a738edf0b97e" +dependencies = [ + "async-trait", + "bincode", + "crossbeam-channel", + "futures-util", + "indexmap 2.2.6", + "log", + "rand 0.8.5", + "rayon", + "rcgen", + "solana-measure", + "solana-metrics", + "solana-sdk", + "thiserror", + "tokio", +] + +[[package]] +name = "solana-cost-model" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1e8673cd74543895f310eb2dfd497c7ffc970a799923bd0f8fd6e0320e14ab" +dependencies = [ + "lazy_static", + "log", + "rustc_version", + "solana-address-lookup-table-program", + "solana-bpf-loader-program", + "solana-compute-budget-program", + "solana-config-program", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-loader-v4-program", + "solana-metrics", + "solana-program-runtime", + "solana-sdk", + "solana-stake-program", + "solana-system-program", + "solana-vote-program", +] + +[[package]] +name = "solana-frozen-abi" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96734b05823c8b515f8e3cc02641a27aee2c9760b1a43c74cb20f2a1ab0ab76c" +dependencies = [ + "ahash 0.8.5", + "blake3", + "block-buffer 0.10.4", + "bs58 0.4.0", + "bv", + "byteorder", + "cc", + "either", + "generic-array", + "im", + "lazy_static", + "log", + "memmap2", + "rustc_version", + "serde", + "serde_bytes", + "serde_derive", + "serde_json", + "sha2 0.10.8", + "solana-frozen-abi-macro", + "subtle", + "thiserror", +] + +[[package]] +name = "solana-frozen-abi-macro" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a0f1291a464fd046135d019d57a81be165ee3d23aa7df880b47dac683a0582a" +dependencies = [ + "proc-macro2", + "quote", + "rustc_version", + "syn 2.0.60", +] + +[[package]] +name = "solana-loader-v4-program" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09a437265099d9782e1f95eee2feb3b9b4f0247a177d0c0646148da738ae3b1f" +dependencies = [ + "log", + "solana-measure", + "solana-program-runtime", + "solana-sdk", + "solana_rbpf", +] + +[[package]] +name = "solana-logger" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5977c8f24b83cf50e7139ffdb25d70bad6a177f18ccc79ca2293d6a987fa81c" +dependencies = [ + "env_logger", + "lazy_static", + "log", +] + +[[package]] +name = "solana-measure" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a39ef01b2c65552d05013b2642ffd73258f2c80e3a59e44c499762047df9456" +dependencies = [ + "log", + "solana-sdk", +] + +[[package]] +name = "solana-metrics" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ad30ff3775412f2929d440446aef8b070676920bc5df495ea6398a8f28ce91f" +dependencies = [ + "crossbeam-channel", + "gethostname", + "lazy_static", + "log", + "reqwest", + "solana-sdk", + "thiserror", +] + +[[package]] +name = "solana-net-utils" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafd5178a38a039e12c14780f1b6a74f1e672d62357343e0aee6d0fc7e5bd18" +dependencies = [ + "bincode", + "clap 3.2.25", + "crossbeam-channel", + "log", + "nix", + "rand 0.8.5", + "serde", + "serde_derive", + "socket2", + "solana-logger", + "solana-sdk", + "solana-version", + "tokio", + "url", +] + +[[package]] +name = "solana-perf" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10d6293cddcc98ae092d00f43f741405da30aa083acb96666606130810b064f3" +dependencies = [ + "ahash 0.8.5", + "bincode", + "bv", + "caps", + "curve25519-dalek", + "dlopen2", + "fnv", + "lazy_static", + "libc", + "log", + "nix", + "rand 0.8.5", + "rayon", + "rustc_version", + "serde", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-metrics", + "solana-rayon-threadlimit", + "solana-sdk", + "solana-vote-program", +] + +[[package]] +name = "solana-program" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6412447793f8a3ef7526655906728325093b472e481791ac5c584e8d272166dc" +dependencies = [ + "ark-bn254", + "ark-ec", + "ark-ff", + "ark-serialize", + "base64 0.21.7", + "bincode", + "bitflags 2.5.0", + "blake3", + "borsh 0.10.3", + "borsh 0.9.3", + "bs58 0.4.0", + "bv", + "bytemuck", + "cc", + "console_error_panic_hook", + "console_log", + "curve25519-dalek", + "getrandom 0.2.14", + "itertools 0.10.5", + "js-sys", + "lazy_static", + "libc", + "libsecp256k1", + "light-poseidon", + "log", + "memoffset 0.9.1", + "num-bigint 0.4.4", + "num-derive 0.3.3", + "num-traits", + "parking_lot", + "rand 0.8.5", + "rustc_version", + "rustversion", + "serde", + "serde_bytes", + "serde_derive", + "serde_json", + "sha2 0.10.8", + "sha3 0.10.8", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-sdk-macro", + "thiserror", + "tiny-bip39", + "wasm-bindgen", + "zeroize", +] + +[[package]] +name = "solana-program-runtime" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1977e741a6793fca27413507457d797df0f41bc0ae634247d112bc77ab2b0325" +dependencies = [ + "base64 0.21.7", + "bincode", + "eager", + "enum-iterator", + "itertools 0.10.5", + "libc", + "log", + "num-derive 0.3.3", + "num-traits", + "percentage", + "rand 0.8.5", + "rustc_version", + "serde", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-measure", + "solana-metrics", + "solana-sdk", + "solana_rbpf", + "thiserror", +] + +[[package]] +name = "solana-program-test" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f39eaea98ce2538759f9868bc9be1b0c53db75b885b30b4a26ccd5d28724a788" +dependencies = [ + "assert_matches", + "async-trait", + "base64 0.21.7", + "bincode", + "chrono-humanize", + "crossbeam-channel", + "log", + "serde", + "solana-accounts-db", + "solana-banks-client", + "solana-banks-interface", + "solana-banks-server", + "solana-bpf-loader-program", + "solana-logger", + "solana-program-runtime", + "solana-runtime", + "solana-sdk", + "solana-vote-program", + "solana_rbpf", + "test-case", + "thiserror", + "tokio", +] + +[[package]] +name = "solana-pubsub-client" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad21dd5d6fe09116dbc29aec279b7cf08d250b564899dc87437bd780ed26290" +dependencies = [ + "crossbeam-channel", + "futures-util", + "log", + "reqwest", + "semver", + "serde", + "serde_derive", + "serde_json", + "solana-account-decoder", + "solana-rpc-client-api", + "solana-sdk", + "thiserror", + "tokio", + "tokio-stream", + "tokio-tungstenite 0.20.1", + "tungstenite 0.20.1", + "url", +] + +[[package]] +name = "solana-quic-client" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6201869768fe133ce9b8088e4f718f53ff164b8e5df3d0d46a6563a22545924f" +dependencies = [ + "async-mutex", + "async-trait", + "futures", + "itertools 0.10.5", + "lazy_static", + "log", + "quinn", + "quinn-proto", + "rcgen", + "rustls", + "solana-connection-cache", + "solana-measure", + "solana-metrics", + "solana-net-utils", + "solana-rpc-client-api", + "solana-sdk", + "solana-streamer", + "thiserror", + "tokio", +] + +[[package]] +name = "solana-rayon-threadlimit" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f100d0c3214d67bb847a1eefc7079f6bb755534266423f4c994ad3b40c685ed" +dependencies = [ + "lazy_static", + "num_cpus", +] + +[[package]] +name = "solana-remote-wallet" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3328c891079086b408a04e701470a346d517c9c51c0a96f2f166f616a3e1c3c8" +dependencies = [ + "console", + "dialoguer", + "log", + "num-derive 0.3.3", + "num-traits", + "parking_lot", + "qstring", + "semver", + "solana-sdk", + "thiserror", + "uriparse", +] + +[[package]] +name = "solana-rpc-client" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfacf1163a375d98c29779a03ba278b2ef43494f77e33826a33f9460563c0887" +dependencies = [ + "async-trait", + "base64 0.21.7", + "bincode", + "bs58 0.4.0", + "indicatif", + "log", + "reqwest", + "semver", + "serde", + "serde_derive", + "serde_json", + "solana-account-decoder", + "solana-rpc-client-api", + "solana-sdk", + "solana-transaction-status", + "solana-version", + "solana-vote-program", + "tokio", +] + +[[package]] +name = "solana-rpc-client-api" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fab293a88113511e66607d76bd027edfe0b1372b467fd76bbb5af03448539a2" +dependencies = [ + "base64 0.21.7", + "bs58 0.4.0", + "jsonrpc-core", + "reqwest", + "semver", + "serde", + "serde_derive", + "serde_json", + "solana-account-decoder", + "solana-sdk", + "solana-transaction-status", + "solana-version", + "spl-token-2022 1.0.0", + "thiserror", +] + +[[package]] +name = "solana-rpc-client-nonce-utils" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e43cb51374a6ec8fd401b3387334ef93e04f6d8ae87bbb29892aff42aeb1061" +dependencies = [ + "clap 2.34.0", + "solana-clap-utils", + "solana-rpc-client", + "solana-sdk", + "thiserror", +] + +[[package]] +name = "solana-runtime" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c00486a8cc4fd4beddc5e22fdb1836c38a1280b6c708329bcfdfc61be39e377" +dependencies = [ + "arrayref", + "base64 0.21.7", + "bincode", + "blake3", + "bv", + "bytemuck", + "byteorder", + "bzip2", + "crossbeam-channel", + "dashmap", + "dir-diff", + "flate2", + "fnv", + "fs-err", + "im", + "index_list", + "itertools 0.10.5", + "lazy_static", + "log", + "lru", + "lz4", + "memmap2", + "modular-bitfield", + "num-derive 0.3.3", + "num-traits", + "num_cpus", + "num_enum 0.6.1", + "ouroboros", + "percentage", + "qualifier_attr", + "rand 0.8.5", + "rayon", + "regex", + "rustc_version", + "serde", + "serde_derive", + "serde_json", + "siphasher", + "solana-accounts-db", + "solana-address-lookup-table-program", + "solana-bpf-loader-program", + "solana-bucket-map", + "solana-compute-budget-program", + "solana-config-program", + "solana-cost-model", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-loader-v4-program", + "solana-measure", + "solana-metrics", + "solana-perf", + "solana-program-runtime", + "solana-rayon-threadlimit", + "solana-sdk", + "solana-stake-program", + "solana-system-program", + "solana-version", + "solana-vote", + "solana-vote-program", + "solana-zk-token-proof-program", + "solana-zk-token-sdk", + "static_assertions", + "strum 0.24.1", + "strum_macros 0.24.3", + "symlink", + "tar", + "tempfile", + "thiserror", + "zstd", +] + +[[package]] +name = "solana-sdk" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de1ce8848de4198f9bc7e4574252be02b1ed86ecbc2fff506780d5f8d6e4c4a8" +dependencies = [ + "assert_matches", + "base64 0.21.7", + "bincode", + "bitflags 2.5.0", + "borsh 0.10.3", + "bs58 0.4.0", + "bytemuck", + "byteorder", + "chrono", + "derivation-path", + "digest 0.10.7", + "ed25519-dalek", + "ed25519-dalek-bip32", + "generic-array", + "hmac 0.12.1", + "itertools 0.10.5", + "js-sys", + "lazy_static", + "libsecp256k1", + "log", + "memmap2", + "num-derive 0.3.3", + "num-traits", + "num_enum 0.6.1", + "pbkdf2 0.11.0", + "qstring", + "qualifier_attr", + "rand 0.7.3", + "rand 0.8.5", + "rustc_version", + "rustversion", + "serde", + "serde_bytes", + "serde_derive", + "serde_json", + "serde_with 2.3.3", + "sha2 0.10.8", + "sha3 0.10.8", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-logger", + "solana-program", + "solana-sdk-macro", + "thiserror", + "uriparse", + "wasm-bindgen", +] + +[[package]] +name = "solana-sdk-macro" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5cc46bbda0a5472d8d0a4c846b22941436ac45c31456d3e885a387a5f264f7" +dependencies = [ + "bs58 0.4.0", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.60", +] + +[[package]] +name = "solana-security-txt" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "468aa43b7edb1f9b7b7b686d5c3aeb6630dc1708e86e31343499dd5c4d775183" + +[[package]] +name = "solana-send-transaction-service" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bd32d02d3f0de1172f16012834d3afa51cf077a2b19e59534e12e53be130295" +dependencies = [ + "crossbeam-channel", + "log", + "solana-client", + "solana-measure", + "solana-metrics", + "solana-runtime", + "solana-sdk", + "solana-tpu-client", +] + +[[package]] +name = "solana-stake-program" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d94e05db9762c5fc6114e788570c4645dbe7e7ea5da2e39269128944b3a200" +dependencies = [ + "bincode", + "log", + "rustc_version", + "solana-config-program", + "solana-program-runtime", + "solana-sdk", + "solana-vote-program", +] + +[[package]] +name = "solana-streamer" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46f02b475fc20c55ebbcfa5638ff93f9b780414cc6185e3a6d0992bca0ae81ee" +dependencies = [ + "async-channel", + "bytes", + "crossbeam-channel", + "futures-util", + "histogram", + "indexmap 2.2.6", + "itertools 0.10.5", + "libc", + "log", + "nix", + "pem", + "percentage", + "pkcs8", + "quinn", + "quinn-proto", + "rand 0.8.5", + "rcgen", + "rustls", + "smallvec", + "solana-metrics", + "solana-perf", + "solana-sdk", + "thiserror", + "tokio", + "x509-parser", +] + +[[package]] +name = "solana-system-program" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7eec04b67da2f353fe18dcf7e8bcdd6d8ddcece8598de55a6a7671fd01e9188f" +dependencies = [ + "bincode", + "log", + "serde", + "serde_derive", + "solana-program-runtime", + "solana-sdk", +] + +[[package]] +name = "solana-thin-client" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b6ce2304764b8bb699db734fde9cd19ace038d3895d828a557ea0ec2a9e0ecd" +dependencies = [ + "bincode", + "log", + "rayon", + "solana-connection-cache", + "solana-rpc-client", + "solana-rpc-client-api", + "solana-sdk", +] + +[[package]] +name = "solana-tpu-client" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa3e2351625e26f55e5e08f8e5aadaa2380fd0649f25641d6ba3f3848dbe5c9a" +dependencies = [ + "async-trait", + "bincode", + "futures-util", + "indexmap 2.2.6", + "indicatif", + "log", + "rayon", + "solana-connection-cache", + "solana-measure", + "solana-metrics", + "solana-pubsub-client", + "solana-rpc-client", + "solana-rpc-client-api", + "solana-sdk", + "thiserror", + "tokio", +] + +[[package]] +name = "solana-transaction-status" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0841bbd1845c87043e4184961e45cc7c08b36d96d0d146256b26ea5c74630a0f" +dependencies = [ + "Inflector", + "base64 0.21.7", + "bincode", + "borsh 0.10.3", + "bs58 0.4.0", + "lazy_static", + "log", + "serde", + "serde_derive", + "serde_json", + "solana-account-decoder", + "solana-sdk", + "spl-associated-token-account 2.3.0", + "spl-memo 4.0.0", + "spl-token 4.0.0", + "spl-token-2022 1.0.0", + "thiserror", +] + +[[package]] +name = "solana-udp-client" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bae54a100f0b0b5be065f5d05f2259f6d4a7b39f5866d579927f3ca35a01773b" +dependencies = [ + "async-trait", + "solana-connection-cache", + "solana-net-utils", + "solana-sdk", + "solana-streamer", + "thiserror", + "tokio", +] + +[[package]] +name = "solana-version" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f69945e38d7440221e2fac0aaa57a9d72adb329b0de705ca5bd9ba981aedc16" +dependencies = [ + "log", + "rustc_version", + "semver", + "serde", + "serde_derive", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-sdk", +] + +[[package]] +name = "solana-vote" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de0122b117497cac299cd52bbfcb9f3732d882833f5c87ee87d2d3541ba77057" +dependencies = [ + "crossbeam-channel", + "itertools 0.10.5", + "log", + "rustc_version", + "serde", + "serde_derive", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-sdk", + "solana-vote-program", + "thiserror", +] + +[[package]] +name = "solana-vote-program" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e574aafc3c5adc7106ab4605d8ad378c9a12f2cf1dec2e8ba1aa6fd97a5d5490" +dependencies = [ + "bincode", + "log", + "num-derive 0.3.3", + "num-traits", + "rustc_version", + "serde", + "serde_derive", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-metrics", + "solana-program", + "solana-program-runtime", + "solana-sdk", + "thiserror", +] + +[[package]] +name = "solana-zk-token-proof-program" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de791a3bb992976029ead33017d4d994614b10d3028c7598632019fdb432dcad" +dependencies = [ + "bytemuck", + "num-derive 0.3.3", + "num-traits", + "solana-program-runtime", + "solana-sdk", + "solana-zk-token-sdk", +] + +[[package]] +name = "solana-zk-token-sdk" +version = "1.17.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597dddc8ab46852dea7fc3d22e031fa4ffdb1b2291ac24d960605424a510a5f5" +dependencies = [ + "aes-gcm-siv", + "base64 0.21.7", + "bincode", + "bytemuck", + "byteorder", + "curve25519-dalek", + "getrandom 0.1.16", + "itertools 0.10.5", + "lazy_static", + "merlin", + "num-derive 0.3.3", + "num-traits", + "rand 0.7.3", + "serde", + "serde_json", + "sha3 0.9.1", + "solana-program", + "solana-sdk", + "subtle", + "thiserror", + "zeroize", +] + +[[package]] +name = "solana_rbpf" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d457cc2ba742c120492a64b7fa60e22c575e891f6b55039f4d736568fb112a3" +dependencies = [ + "byteorder", + "combine", + "goblin", + "hash32", + "libc", + "log", + "rand 0.8.5", + "rustc-demangle", + "scroll", + "thiserror", + "winapi", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "spki" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "spl-associated-token-account" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978dba3bcbe88d0c2c58366c254d9ea41c5f73357e72fc0bdee4d6b5fc99c8f4" +dependencies = [ + "assert_matches", + "borsh 0.9.3", + "num-derive 0.3.3", + "num-traits", + "solana-program", + "spl-token 3.5.0", + "spl-token-2022 0.6.1", + "thiserror", +] + +[[package]] +name = "spl-associated-token-account" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "992d9c64c2564cc8f63a4b508bf3ebcdf2254b0429b13cd1d31adb6162432a5f" +dependencies = [ + "assert_matches", + "borsh 0.10.3", + "num-derive 0.4.2", + "num-traits", + "solana-program", + "spl-token 4.0.0", + "spl-token-2022 1.0.0", + "thiserror", +] + +[[package]] +name = "spl-discriminator" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daa600f2fe56f32e923261719bae640d873edadbc5237681a39b8e37bfd4d263" +dependencies = [ + "bytemuck", + "solana-program", + "spl-discriminator-derive", +] + +[[package]] +name = "spl-discriminator-derive" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07fd7858fc4ff8fb0e34090e41d7eb06a823e1057945c26d480bfc21d2338a93" +dependencies = [ + "quote", + "spl-discriminator-syn", + "syn 2.0.60", +] + +[[package]] +name = "spl-discriminator-syn" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18fea7be851bd98d10721782ea958097c03a0c2a07d8d4997041d0ece6319a63" +dependencies = [ + "proc-macro2", + "quote", + "sha2 0.10.8", + "syn 2.0.60", + "thiserror", +] + +[[package]] +name = "spl-memo" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd0dc6f70db6bacea7ff25870b016a65ba1d1b6013536f08e4fd79a8f9005325" +dependencies = [ + "solana-program", +] + +[[package]] +name = "spl-memo" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f180b03318c3dbab3ef4e1e4d46d5211ae3c780940dd0a28695aba4b59a75a" +dependencies = [ + "solana-program", +] + +[[package]] +name = "spl-pod" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85a5db7e4efb1107b0b8e52a13f035437cdcb36ef99c58f6d467f089d9b2915a" +dependencies = [ + "borsh 0.10.3", + "bytemuck", + "solana-program", + "solana-zk-token-sdk", + "spl-program-error", +] + +[[package]] +name = "spl-program-error" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e0657b6490196971d9e729520ba934911ff41fbb2cb9004463dbe23cf8b4b4f" +dependencies = [ + "num-derive 0.4.2", + "num-traits", + "solana-program", + "spl-program-error-derive", + "thiserror", +] + +[[package]] +name = "spl-program-error-derive" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1845dfe71fd68f70382232742e758557afe973ae19e6c06807b2c30f5d5cb474" +dependencies = [ + "proc-macro2", + "quote", + "sha2 0.10.8", + "syn 2.0.60", +] + +[[package]] +name = "spl-tlv-account-resolution" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "062e148d3eab7b165582757453632ffeef490c02c86a48bfdb4988f63eefb3b9" +dependencies = [ + "bytemuck", + "solana-program", + "spl-discriminator", + "spl-pod", + "spl-program-error", + "spl-type-length-value", +] + +[[package]] +name = "spl-tlv-account-resolution" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f335787add7fa711819f9e7c573f8145a5358a709446fe2d24bf2a88117c90" +dependencies = [ + "bytemuck", + "solana-program", + "spl-discriminator", + "spl-pod", + "spl-program-error", + "spl-type-length-value", +] + +[[package]] +name = "spl-token" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e85e168a785e82564160dcb87b2a8e04cee9bfd1f4d488c729d53d6a4bd300d" +dependencies = [ + "arrayref", + "bytemuck", + "num-derive 0.3.3", + "num-traits", + "num_enum 0.5.11", + "solana-program", + "thiserror", +] + +[[package]] +name = "spl-token" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08459ba1b8f7c1020b4582c4edf0f5c7511a5e099a7a97570c9698d4f2337060" +dependencies = [ + "arrayref", + "bytemuck", + "num-derive 0.3.3", + "num-traits", + "num_enum 0.6.1", + "solana-program", + "thiserror", +] + +[[package]] +name = "spl-token-2022" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0043b590232c400bad5ee9eb983ced003d15163c4c5d56b090ac6d9a57457b47" +dependencies = [ + "arrayref", + "bytemuck", + "num-derive 0.3.3", + "num-traits", + "num_enum 0.5.11", + "solana-program", + "solana-zk-token-sdk", + "spl-memo 3.0.1", + "spl-token 3.5.0", + "thiserror", +] + +[[package]] +name = "spl-token-2022" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4abf34a65ba420584a0c35f3903f8d727d1f13ababbdc3f714c6b065a686e86" +dependencies = [ + "arrayref", + "bytemuck", + "num-derive 0.4.2", + "num-traits", + "num_enum 0.7.2", + "solana-program", + "solana-zk-token-sdk", + "spl-memo 4.0.0", + "spl-pod", + "spl-token 4.0.0", + "spl-token-metadata-interface", + "spl-transfer-hook-interface 0.3.0", + "spl-type-length-value", + "thiserror", +] + +[[package]] +name = "spl-token-2022" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d697fac19fd74ff472dfcc13f0b442dd71403178ce1de7b5d16f83a33561c059" +dependencies = [ + "arrayref", + "bytemuck", + "num-derive 0.4.2", + "num-traits", + "num_enum 0.7.2", + "solana-program", + "solana-security-txt", + "solana-zk-token-sdk", + "spl-memo 4.0.0", + "spl-pod", + "spl-token 4.0.0", + "spl-token-group-interface", + "spl-token-metadata-interface", + "spl-transfer-hook-interface 0.4.1", + "spl-type-length-value", + "thiserror", +] + +[[package]] +name = "spl-token-client" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f92490d4e0381c7456078db4ba7d97a19606933b53495154da7197ba703ac276" +dependencies = [ + "async-trait", + "curve25519-dalek", + "futures", + "futures-util", + "solana-banks-interface", + "solana-cli-output", + "solana-program-test", + "solana-rpc-client", + "solana-rpc-client-api", + "solana-sdk", + "spl-associated-token-account 2.3.0", + "spl-memo 4.0.0", + "spl-token 4.0.0", + "spl-token-2022 0.9.0", + "spl-token-metadata-interface", + "spl-transfer-hook-interface 0.3.0", + "thiserror", +] + +[[package]] +name = "spl-token-group-interface" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b889509d49fa74a4a033ca5dae6c2307e9e918122d97e58562f5c4ffa795c75d" +dependencies = [ + "bytemuck", + "solana-program", + "spl-discriminator", + "spl-pod", + "spl-program-error", +] + +[[package]] +name = "spl-token-metadata-interface" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c16ce3ba6979645fb7627aa1e435576172dd63088dc7848cb09aa331fa1fe4f" +dependencies = [ + "borsh 0.10.3", + "solana-program", + "spl-discriminator", + "spl-pod", + "spl-program-error", + "spl-type-length-value", +] + +[[package]] +name = "spl-transfer-hook-interface" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "051d31803f873cabe71aec3c1b849f35248beae5d19a347d93a5c9cccc5d5a9b" +dependencies = [ + "arrayref", + "bytemuck", + "solana-program", + "spl-discriminator", + "spl-pod", + "spl-program-error", + "spl-tlv-account-resolution 0.4.0", + "spl-type-length-value", +] + +[[package]] +name = "spl-transfer-hook-interface" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7aabdb7c471566f6ddcee724beb8618449ea24b399e58d464d6b5bc7db550259" +dependencies = [ + "arrayref", + "bytemuck", + "solana-program", + "spl-discriminator", + "spl-pod", + "spl-program-error", + "spl-tlv-account-resolution 0.5.2", + "spl-type-length-value", +] + +[[package]] +name = "spl-type-length-value" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f9ebd75d29c5f48de5f6a9c114e08531030b75b8ac2c557600ac7da0b73b1e8" +dependencies = [ + "bytemuck", + "solana-program", + "spl-discriminator", + "spl-pod", + "spl-program-error", +] + +[[package]] +name = "static-pubkey" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0547d5945c93f55e1b18bf2a67d1a3d0548561f2687645b22c1c1d4fbb9a8e90" +dependencies = [ + "bs58 0.4.0", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "strum" +version = "0.24.0" +source = "git+https://github.com/hubbleprotocol/strum?branch=checked_arithmetics#95f44367da40546bc94f4ff565268f45fb68ed5e" +dependencies = [ + "strum_macros 0.24.0", +] + +[[package]] +name = "strum" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" +dependencies = [ + "strum_macros 0.24.3", +] + +[[package]] +name = "strum_macros" +version = "0.24.0" +source = "git+https://github.com/hubbleprotocol/strum?branch=checked_arithmetics#95f44367da40546bc94f4ff565268f45fb68ed5e" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "rustversion", + "syn 1.0.109", +] + +[[package]] +name = "strum_macros" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "rustversion", + "syn 1.0.109", +] + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "switchboard-itf" +version = "0.1.0" +source = "git+https://github.com/Kamino-Finance/scope?branch=anchor_0.29_idl#0c8f7925aad9f5cf30b6715f2bef0ece9235d87a" +dependencies = [ + "anchor-lang", + "bytemuck", + "rust_decimal", +] + +[[package]] +name = "symlink" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7973cce6668464ea31f176d85b13c7ab3bba2cb3b77a2ed26abd7801688010a" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn_derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1329189c02ff984e9736652b1631330da25eaa6bc639089ed4915d25446cbe7b" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.60", +] + +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + +[[package]] +name = "synstructure" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "unicode-xid", +] + +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "tar" +version = "0.4.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" +dependencies = [ + "filetime", + "libc", + "xattr", +] + +[[package]] +name = "tarpc" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c38a012bed6fb9681d3bf71ffaa4f88f3b4b9ed3198cda6e4c8462d24d4bb80" +dependencies = [ + "anyhow", + "fnv", + "futures", + "humantime", + "opentelemetry", + "pin-project", + "rand 0.8.5", + "serde", + "static_assertions", + "tarpc-plugins", + "thiserror", + "tokio", + "tokio-serde", + "tokio-util 0.6.10", + "tracing", + "tracing-opentelemetry", +] + +[[package]] +name = "tarpc-plugins" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee42b4e559f17bce0385ebf511a7beb67d5cc33c12c96b7f4e9789919d9c10f" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "tempfile" +version = "3.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +dependencies = [ + "cfg-if", + "fastrand", + "rustix 0.38.34", + "windows-sys 0.52.0", +] + +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "terminal_size" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e6bf6f19e9f8ed8d4048dc22981458ebcf406d67e94cd422e5ecd73d63b3237" +dependencies = [ + "rustix 0.37.27", + "windows-sys 0.48.0", +] + +[[package]] +name = "test-case" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb2550dd13afcd286853192af8601920d959b14c401fcece38071d53bf0768a8" +dependencies = [ + "test-case-macros", +] + +[[package]] +name = "test-case-core" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adcb7fd841cd518e279be3d5a3eb0636409487998a4aff22f3de87b81e88384f" +dependencies = [ + "cfg-if", + "proc-macro2", + "quote", + "syn 2.0.60", +] + +[[package]] +name = "test-case-macros" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c89e72a01ed4c579669add59014b9a524d609c0c88c6a585ce37485879f6ffb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", + "test-case-core", +] + +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +dependencies = [ + "unicode-width", +] + +[[package]] +name = "textwrap" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" +dependencies = [ + "terminal_size", +] + +[[package]] +name = "thiserror" +version = "1.0.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0126ad08bff79f29fc3ae6a55cc72352056dfff61e3ff8bb7129476d44b23aa" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "time" +version = "0.3.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tiny-bip39" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffc59cb9dfc85bb312c3a78fd6aa8a8582e310b0fa885d5bb877f6dcc601839d" +dependencies = [ + "anyhow", + "hmac 0.8.1", + "once_cell", + "pbkdf2 0.4.0", + "rand 0.7.3", + "rustc-hash", + "sha2 0.9.9", + "thiserror", + "unicode-normalization", + "wasm-bindgen", + "zeroize", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-macros" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-serde" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "911a61637386b789af998ee23f50aa30d5fd7edcec8d6d3dedae5e5815205466" +dependencies = [ + "bincode", + "bytes", + "educe", + "futures-core", + "futures-sink", + "pin-project", + "serde", + "serde_json", +] + +[[package]] +name = "tokio-stream" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-tungstenite" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" +dependencies = [ + "futures-util", + "log", + "rustls", + "tokio", + "tokio-rustls", + "tungstenite 0.20.1", + "webpki-roots 0.25.4", +] + +[[package]] +name = "tokio-tungstenite" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c83b561d025642014097b66e6c1bb422783339e0909e4429cde4749d1990bc38" +dependencies = [ + "futures-util", + "log", + "tokio", + "tungstenite 0.21.0", +] + +[[package]] +name = "tokio-util" +version = "0.6.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "log", + "pin-project-lite", + "slab", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_datetime" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" + +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.2.6", + "toml_datetime", + "winnow", +] + +[[package]] +name = "toml_edit" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +dependencies = [ + "indexmap 2.2.6", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-opentelemetry" +version = "0.17.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbbe89715c1dbbb790059e2565353978564924ee85017b5fff365c872ff6721f" +dependencies = [ + "once_cell", + "opentelemetry", + "tracing", + "tracing-core", + "tracing-subscriber", +] + +[[package]] +name = "tracing-serde" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" +dependencies = [ + "serde", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "serde", + "serde_json", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", + "tracing-serde", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "tungstenite" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" +dependencies = [ + "byteorder", + "bytes", + "data-encoding", + "http 0.2.12", + "httparse", + "log", + "rand 0.8.5", + "rustls", + "sha1", + "thiserror", + "url", + "utf-8", + "webpki-roots 0.24.0", +] + +[[package]] +name = "tungstenite" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ef1a641ea34f399a848dea702823bbecfb4c486f911735368f1f137cb8257e1" +dependencies = [ + "byteorder", + "bytes", + "data-encoding", + "http 1.1.0", + "httparse", + "log", + "rand 0.8.5", + "sha1", + "thiserror", + "url", + "utf-8", +] + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "uint" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "unicase" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" +dependencies = [ + "version_check", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-normalization" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-segmentation" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" + +[[package]] +name = "unicode-width" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" + +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + +[[package]] +name = "universal-hash" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "unreachable" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" +dependencies = [ + "void", +] + +[[package]] +name = "unsafe-libyaml" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" + +[[package]] +name = "unsize" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fa7a7a734c1a5664a662ddcea0b6c9472a21da8888c957c7f1eaa09dba7a939" +dependencies = [ + "autocfg", +] + +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "uriparse" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0200d0fc04d809396c2ad43f3c95da3582a2556eba8d453c1087f4120ee352ff" +dependencies = [ + "fnv", + "lazy_static", +] + +[[package]] +name = "url" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "urlencoding" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" + +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + +[[package]] +name = "uuid" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "vec_map" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + +[[package]] +name = "vsimd" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64" + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "warp" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4378d202ff965b011c64817db11d5829506d3404edeadb61f190d111da3f231c" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "headers", + "http 0.2.12", + "hyper", + "log", + "mime", + "mime_guess", + "multer", + "percent-encoding", + "pin-project", + "scoped-tls", + "serde", + "serde_json", + "serde_urlencoded", + "tokio", + "tokio-tungstenite 0.21.0", + "tokio-util 0.7.10", + "tower-service", + "tracing", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.60", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" + +[[package]] +name = "web-sys" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-roots" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b291546d5d9d1eab74f069c77749f2cb8504a12caa20f0f2de93ddbf6f411888" +dependencies = [ + "rustls-webpki", +] + +[[package]] +name = "webpki-roots" +version = "0.25.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.5", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.5", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +dependencies = [ + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" + +[[package]] +name = "winnow" +version = "0.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] + +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "without-alloc" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "375db0478b203b950ef10d1cce23cdbe5f30c2454fd9e7673ff56656df23adbb" +dependencies = [ + "alloc-traits", + "unsize", +] + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "x509-parser" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0ecbeb7b67ce215e40e3cc7f2ff902f94a223acf44995934763467e7b1febc8" +dependencies = [ + "asn1-rs", + "base64 0.13.1", + "data-encoding", + "der-parser", + "lazy_static", + "nom", + "oid-registry", + "rusticata-macros", + "thiserror", + "time", +] + +[[package]] +name = "xattr" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" +dependencies = [ + "libc", + "linux-raw-sys 0.4.13", + "rustix 0.38.34", +] + +[[package]] +name = "xmlparser" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66fee0b777b0f5ac1c69bb06d361268faafa61cd4682ae064a171c16c433e9e4" + +[[package]] +name = "yasna" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" +dependencies = [ + "time", +] + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + +[[package]] +name = "zeroize" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + +[[package]] +name = "zstd" +version = "0.11.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "5.0.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.10+zstd.1.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" +dependencies = [ + "cc", + "pkg-config", +] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..206d74e --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,10 @@ +cargo-features = ["named-profiles"] + +[workspace] +members = ["terminator"] +resolver = "2" + +[profile.release] +lto = "thin" +codegen-units = 1 +overflow-checks = true diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..4e31f84 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Kamino + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..ca58100 --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +# Kamino lending liquidations bot + +## How to run + +- `.env` file: + +``` +CLUSTER= +KEYPAIR=./liquidator.json +RUST_BACKTRACE=1 +PROGRAM_ID=SLendK7ySfcEzyaFqy93gDnD3RtrpXJcnRwb6zFHJSh +RUST_LOG=info +LIQUIDATOR_LOOKUP_TABLE_FILE=.lookuptable.rust.mainnet-beta +``` + +- `ENV=.env.rust.mainnet-beta cargo run -- crank` diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..8142c30 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,2 @@ +[toolchain] +channel = "1.73.0" diff --git a/terminator/.gitignore b/terminator/.gitignore new file mode 100644 index 0000000..8bbe317 --- /dev/null +++ b/terminator/.gitignore @@ -0,0 +1,7 @@ +/target +/log +/aws-build +/test-ledger + +### Helm ### +*.tgz diff --git a/terminator/Cargo.toml b/terminator/Cargo.toml new file mode 100644 index 0000000..026c43d --- /dev/null +++ b/terminator/Cargo.toml @@ -0,0 +1,58 @@ +[package] +name = "klend-terminator" +version = "0.2.0-SNAPSHOT" +edition = "2021" +authors = ["Kamino Finance Developers "] +description = "A rust klend liquidator" + +[[bin]] +name = "klend-terminator" +path = "src/main.rs" + +[features] +staging = ["kamino_lending/staging"] + +[dependencies] +anchor-client = "0.29.0" +kamino_lending = { git = "https://github.com/Kamino-Finance/klend", default-features = false, features = ["no-entrypoint"] } +anyhow = "1.0.0" +aws-config = "1.1.6" +aws-sdk-sns = "1.15.0" +clap = { version = "3.2.11", features = ["derive", "env", "wrap_help"] } +serde = "1.0.136" +serde_json = "1.0.79" +tracing = "0.1.10" +tracing-subscriber = { version = "0.3.9", features = ["std", "fmt", "json", "env-filter"] } +tokio = "1.14.1" +warp = "0.3.3" +nohash-hasher = "0.2.0" +orbit-link = { git = "https://github.com/Kamino-Finance/orbit-link" } +async-trait = "0.1.51" +futures = "0.3.18" +colored = "2.0.4" +urlencoding = "2.1.3" +bytemuck = { version="1.4.0", features=["min_const_generics", "derive"] } +anchor-lang = "0.29.0" +anchor-spl = { version = "0.29.0", features = ["dex", "token"] } +num_enum = "0.5.0" +scope = { git = "https://github.com/Kamino-Finance/scope", branch = "anchor_0.29_idl", package = "scope-types" } +strum = { git = "https://github.com/hubbleprotocol/strum", features = [ + "derive", +], branch = "checked_arithmetics" } +solana-account-decoder = "~1.17.18" +solana-rpc-client = "~1.17.18" +solana-sdk = "~1.17.18" +solana-program-test = "~1.17.18" +spl-associated-token-account = "1.1.3" +arrayref = "0.3.6" +derive_builder = "0.12.0" +thiserror = "1.0.0" +farms = { git = "https://github.com/Kamino-Finance/kfarms", default-features = false, features = ["no-entrypoint"] } +static-pubkey = "1.0.3" +spl-token = "3.5.0" +juno = { git = "https://github.com/Kamino-Finance/juno" } +dotenvy = "0.15.7" +spl-token-client = "0.7.1" +itertools = "0.12.0" +lazy_static = "1.4.0" +fixed = "1.27.0" diff --git a/terminator/src/accounts.rs b/terminator/src/accounts.rs new file mode 100644 index 0000000..7ec2242 --- /dev/null +++ b/terminator/src/accounts.rs @@ -0,0 +1,236 @@ +use std::collections::{HashMap, HashSet}; + +use anchor_client::{ + solana_client::{ + nonblocking::rpc_client::RpcClient, + rpc_filter::{Memcmp, MemcmpEncodedBytes, RpcFilterType}, + }, + solana_sdk::{account::Account, account_info::AccountInfo, pubkey::Pubkey, signer::Signer}, +}; +use anchor_lang::Id; +use anchor_spl::token::Token; +use anyhow::Result; +use kamino_lending::{LendingMarket, Reserve}; +use orbit_link::{async_client::AsyncClient, OrbitLink}; +use spl_associated_token_account::instruction::create_associated_token_account; +use tracing::info; + +use crate::{ + client::{rpc, KlendClient}, + consts::WRAPPED_SOL_MINT, +}; + +pub fn create_is_signer_account_infos<'a>( + accounts: &'a mut [(Pubkey, bool, &'a mut Account)], +) -> HashMap> { + accounts + .iter_mut() + .map(|(key, is_signer, account)| { + ( + *key, + AccountInfo::new( + key, + *is_signer, + false, + &mut account.lamports, + &mut account.data, + &account.owner, + account.executable, + account.rent_epoch, + ), + ) + }) + .collect() +} + +pub struct MarketAccounts { + pub reserves: HashMap, + pub lending_market: LendingMarket, +} + +pub struct OracleAccounts { + pub pyth_accounts: Vec<(Pubkey, bool, Account)>, + pub switchboard_accounts: Vec<(Pubkey, bool, Account)>, + pub scope_price_accounts: Vec<(Pubkey, bool, Account)>, +} + +pub async fn market_and_reserve_accounts( + client: &KlendClient, + lending_market: &Pubkey, +) -> Result { + let market = client + .client + .get_anchor_account::(lending_market) + .await?; + + let filter = RpcFilterType::Memcmp(Memcmp::new( + 32, + MemcmpEncodedBytes::Bytes(lending_market.to_bytes().to_vec()), + )); + let filters = vec![filter]; + + let res: Vec<(Pubkey, Reserve)> = + rpc::get_zero_copy_pa(&client.client, &client.program_id, &filters).await?; + + let reserves: HashMap = res.into_iter().collect(); + + Ok(MarketAccounts { + reserves, + lending_market: market, + }) +} + +pub async fn oracle_accounts( + client: &OrbitLink, + reserves: &HashMap, +) -> Result { + let mut pyth_accounts = HashSet::new(); + let mut switchboard_feeds = HashSet::new(); + let mut scope_prices = HashSet::new(); + + for (_, reserve) in reserves.iter() { + pyth_accounts.insert(reserve.config.token_info.pyth_configuration.price); + switchboard_feeds.insert( + reserve + .config + .token_info + .switchboard_configuration + .price_aggregator, + ); + switchboard_feeds.insert( + reserve + .config + .token_info + .switchboard_configuration + .twap_aggregator, + ); + scope_prices.insert(reserve.config.token_info.scope_configuration.price_feed); + } + + let pyth_account_pubkeys: Vec = pyth_accounts.into_iter().collect(); + let pyth_accounts = client + .client + .get_multiple_accounts(pyth_account_pubkeys.as_slice()) + .await?; + + let pyth_accounts_mapped = pyth_accounts + .into_iter() + .zip(pyth_account_pubkeys.into_iter()) + .filter(|(account, _)| account.is_some()) + .map(|(account, pubkey)| (pubkey, false, account.unwrap())) + .collect::>(); + + let switchboard_feed_pubkeys: Vec = switchboard_feeds.into_iter().collect(); + let switchboard_feeds = client + .client + .get_multiple_accounts(switchboard_feed_pubkeys.as_slice()) + .await?; + + let switchboard_feeds_mapped = switchboard_feeds + .into_iter() + .zip(switchboard_feed_pubkeys.into_iter()) + .filter(|(account, _)| account.is_some()) + .map(|(account, pubkey)| (pubkey, false, account.unwrap())) + .collect::>(); + + let scope_price_pubkeys: Vec = scope_prices.into_iter().collect(); + let scope_prices = client + .client + .get_multiple_accounts(scope_price_pubkeys.as_slice()) + .await?; + + let scope_prices_mapped = scope_prices + .into_iter() + .zip(scope_price_pubkeys.into_iter()) + .filter(|(account, _)| account.is_some()) + .map(|(account, pubkey)| (pubkey, false, account.unwrap())) + .collect::>(); + + Ok(OracleAccounts { + pyth_accounts: pyth_accounts_mapped, + switchboard_accounts: switchboard_feeds_mapped, + scope_price_accounts: scope_prices_mapped, + }) +} + +#[macro_export] +macro_rules! map_and_collect_accounts { + ($accounts:expr) => {{ + $accounts + .iter_mut() + .map(|(pk, writable, acc)| (*pk, *writable, acc)) + .collect::>() + }}; +} + +pub fn map_accounts_and_create_infos( + accounts: &mut [(Pubkey, bool, Account)], +) -> HashMap { + accounts + .iter_mut() + .map(|(key, is_signer, account)| { + ( + *key, + AccountInfo::new( + key, + *is_signer, + false, + &mut account.lamports, + &mut account.data, + &account.owner, + account.executable, + account.rent_epoch, + ), + ) + }) + .collect() +} + +pub async fn unwrap_wsol_ata(klend_client: &KlendClient) -> Result { + info!("Unwrapping sol.."); + let user = klend_client.liquidator.wallet.pubkey(); + + // Close the account + let instructions = vec![spl_token::instruction::close_account( + &Token::id(), + klend_client.liquidator.atas.get(&WRAPPED_SOL_MINT).unwrap(), + &user, + &user, + &[], + )?]; + + // // Sync remaining sol (no need to do this upon close, on open only) + // info!("Sync native for wsol ata {}", wsol_ata); + // let wsol_ata = klend_client.liquidator.atas.get(&WRAPPED_SOL_MINT).unwrap(); + // instructions.push(instruction::sync_native(&Token::id(), &wsol_ata).unwrap()); + + // Then create it again so we have wsol ata existing + let recreate_ix = + create_associated_token_account(&user, &user, &WRAPPED_SOL_MINT, &Token::id()); + + let tx = klend_client + .client + .tx_builder() + .add_ixs(instructions) + .add_ix(recreate_ix) + .build(&[]) + .await?; + + let (sig, _) = klend_client.client.send_and_confirm_transaction(tx).await?; + + info!("Executed unwrap transaction: {:?}", sig); + Ok(sig.to_string()) +} + +pub async fn find_account( + client: &RpcClient, + address: Pubkey, +) -> Result> { + let res = client.get_account(&address).await; + if let Ok(account) = res { + Ok(Some((address, account))) + } else { + println!("Ata not found: {}", address); + Ok(None) + } +} diff --git a/terminator/src/client.rs b/terminator/src/client.rs new file mode 100644 index 0000000..41ee4fc --- /dev/null +++ b/terminator/src/client.rs @@ -0,0 +1,772 @@ +use std::{ + collections::{HashMap, HashSet}, + fs::{File, OpenOptions}, + io::{Read, Write}, + str::FromStr, + sync::Arc, + thread, + time::Duration, +}; + +type TransactionResult = std::result::Result<(), TransactionError>; + +use anchor_client::{ + solana_client::{ + nonblocking::rpc_client::RpcClient, + rpc_filter::{Memcmp, MemcmpEncodedBytes, RpcFilterType}, + }, + solana_sdk::pubkey::Pubkey, +}; +use anyhow::{anyhow, Result}; +use kamino_lending::{ + utils::seeds, LendingMarket, Obligation, ReferrerTokenState, Reserve, ReserveFarmKind, +}; +use orbit_link::OrbitLink; +use solana_account_decoder::parse_address_lookup_table::UiLookupTable; +use solana_sdk::{ + address_lookup_table::{state::AddressLookupTable, AddressLookupTableAccount}, + commitment_config::CommitmentConfig, + instruction::Instruction, + signature::{Keypair, Signature}, + transaction::{TransactionError, VersionedTransaction}, +}; +use tokio::task; +use tracing::info; + +use crate::{ + accounts::{find_account, market_and_reserve_accounts, MarketAccounts}, + consts::{NULL_PUBKEY, WRAPPED_SOL_MINT}, + instructions::{self, InstructionBlocks}, + liquidator::Liquidator, + lookup_tables::collect_keys, + model::StateWithKey, + px, + px::Prices, +}; + +pub struct KlendClient { + pub program_id: Pubkey, + + pub client: OrbitLink, + + // Txn data + pub lookup_table: Option, + + // Rebalance settings + pub rebalance_config: Option, + + // Liquidator + // TODO: move all the fields of the liquidator out of this struct and flatten it + pub liquidator: Liquidator, +} + +#[derive(Debug, Clone)] +pub struct RebalanceConfig { + pub base_token: Pubkey, + pub min_sol_balance: f64, + pub usdc_mint: Pubkey, + pub rebalance_slippage_pct: f64, + pub non_swappable_dust_usd_value: f64, +} + +impl KlendClient { + pub fn init( + client: OrbitLink, + program_id: Pubkey, + rebalance_config: Option, + ) -> Result { + // Create a dumb one first + let liquidator = Liquidator { + wallet: Arc::new(Keypair::new()), + atas: HashMap::new(), + }; + + Ok(Self { + program_id, + client, + lookup_table: None, + liquidator, + rebalance_config, + }) + } + + pub async fn fetch_market_and_reserves(&self, market: &Pubkey) -> Result { + market_and_reserve_accounts(self, market).await + } + + pub async fn fetch_obligations(&self, market: &Pubkey) -> Result> { + info!("Fetching obligations for market: {}", market); + let filter = RpcFilterType::Memcmp(Memcmp::new( + 32, + MemcmpEncodedBytes::Bytes(market.to_bytes().to_vec()), + )); + let filters = vec![filter]; + let obligations = rpc::get_zero_copy_pa(&self.client, &self.program_id, &filters).await?; + Ok(obligations) + } + + pub async fn fetch_obligation(&self, obligation_address: &Pubkey) -> Result { + info!("Fetching obligation: {}", obligation_address); + let obligation = self + .client + .get_anchor_account::(obligation_address) + .await?; + Ok(obligation) + } + + pub async fn fetch_referrer_token_states(&self) -> Result> { + let states = self + .client + .get_all_zero_copy_accounts::() + .await?; + let map = states.into_iter().collect(); + Ok(map) + } + + pub async fn load_lookup_table(&mut self, market_accounts: MarketAccounts) { + self.load_liquidator_lookup_table().await; + self.update_liquidator_lookup_table(collect_keys( + &market_accounts.reserves, + &self.liquidator, + &market_accounts.lending_market, + )) + .await; + self.client + .add_lookup_table(self.lookup_table.clone().unwrap()); + } + + async fn load_liquidator_lookup_table(&mut self) { + // The liquidator has one static lookup table associated with it + // and is stored on a local file + // Here we load it or create it and save it + // we do not manage the addresses, that is done in a separate stage + + let filename = std::env::var("LIQUIDATOR_LOOKUP_TABLE_FILE").unwrap(); + + if !std::path::Path::new(&filename).exists() { + File::create(&filename).unwrap(); + } + + let mut file = OpenOptions::new() + .read(true) + .write(true) + .open(&filename) + .unwrap(); + let mut current_content = String::new(); + file.read_to_string(&mut current_content).unwrap(); + + if current_content.is_empty() { + let lut = self + .create_init_reserve_lookup_table(&[], || { + thread::sleep(Duration::from_secs(12)); + }) + .await + .unwrap(); + self.lookup_table = Some(lut.clone()); + file.set_len(0).unwrap(); + file.write_all(lut.key.to_string().as_bytes()).unwrap(); + info!("Created new empty lookup table {}", lut.key); + } else { + let lut_key = Pubkey::from_str(¤t_content).unwrap(); + info!("Liquidator lookuptable {:?}", lut_key); + let lookup_table_data = self.client.client.get_account(&lut_key).await.unwrap(); + let lookup_table: UiLookupTable = UiLookupTable::from( + AddressLookupTable::deserialize(&lookup_table_data.data).unwrap(), + ); + self.lookup_table = Some(AddressLookupTableAccount { + key: lut_key, + addresses: lookup_table + .addresses + .iter() + .map(|x| Pubkey::from_str(x).unwrap()) + .collect::>(), + }); + info!( + "Loaded lookup table {} with {} keys", + lut_key, + lookup_table.addresses.len() + ); + } + } + + async fn update_liquidator_lookup_table(&mut self, expected: HashSet) { + if self.lookup_table.is_none() { + self.load_liquidator_lookup_table().await; + } + + // TODO: Maybe sleep + let lut = self.lookup_table.as_ref().unwrap(); + let already_in_lut: HashSet = HashSet::from_iter(lut.addresses.iter().copied()); + let expected_in_lut: HashSet = expected; + + let missing_keys = expected_in_lut + .iter() + .filter(|x| !already_in_lut.contains(x)) + .copied() + .collect::>(); + + let extra_keys = lut + .addresses + .iter() + .filter(|x| !expected_in_lut.contains(*x)) + .copied() + .collect::>(); + + info!("Missing keys: {:?}", missing_keys.len()); + info!("Extra keys: {:?}", extra_keys.len()); + + if !missing_keys.is_empty() { + info!("Extending lookup table"); + self.extend_lut_with_keys(lut.key, &missing_keys, || { + thread::sleep(Duration::from_secs(12)); + }) + .await + .unwrap(); + + // Reload it + self.load_liquidator_lookup_table().await; + } + } + + async fn create_init_reserve_lookup_table( + &mut self, + keys: &[Pubkey], + delay_fn: impl Fn(), + ) -> Result { + use solana_sdk::address_lookup_table::instruction; + + // Create lookup table + let recent_slot = self + .client + .client + .get_slot_with_commitment(CommitmentConfig::finalized()) + .await?; + + let (create_lookup_table, table_pk) = instruction::create_lookup_table( + self.client.payer_pubkey(), + self.client.payer_pubkey(), + recent_slot, + ); + + let txn = self.client.create_tx(&[create_lookup_table], &[]).await?; + + self.client.send_and_confirm_transaction(txn).await?; + + let keys = keys + .iter() + .filter(|x| **x != NULL_PUBKEY) + .copied() + .collect::>(); + + self.extend_lut_with_keys(table_pk, &keys, delay_fn).await?; + + Ok(AddressLookupTableAccount { + key: table_pk, + addresses: keys, + }) + } + + async fn extend_lut_with_keys( + &self, + table_pk: Pubkey, + keys: &[Pubkey], + delay_fn: impl Fn(), + ) -> Result<()> { + use solana_sdk::address_lookup_table::instruction; + + for selected_keys in keys.chunks(20) { + info!("Extending lookup table with {} keys", selected_keys.len()); + let extend_ix = instruction::extend_lookup_table( + table_pk, + self.client.payer_pubkey(), + Some(self.client.payer_pubkey()), + selected_keys.to_vec(), + ); + + let tx = self.client.create_tx(&[extend_ix], &[]).await?; + self.send_and_confirm_transaction(tx).await.unwrap(); + // wait until lookup table is active + delay_fn(); + } + + Ok(()) + } + + // TODO: move this to orbitlink + pub async fn send_and_confirm_transaction( + &self, + tx: VersionedTransaction, + ) -> Result<(Signature, Option)> { + let mut num_retries = 0; + let max_retries = 5; + loop { + num_retries += 1; + if num_retries > max_retries { + return Err(anyhow!("Max retries reached")); + } + let (sig, res) = self.client.send_and_confirm_transaction(tx.clone()).await?; + if let Some(Err(TransactionError::BlockhashNotFound)) = res { + continue; + } else { + return Ok((sig, res)); + } + } + } + + pub async fn fetch_all_prices( + &mut self, + reserves: &[Reserve], + usd_mint: &Pubkey, + ) -> Result { + let mut mints = reserves + .iter() + .map(|x| x.liquidity.mint_pubkey) + .collect::>(); + + if let Some(c) = &self.rebalance_config { + mints.insert(c.base_token); + mints.insert(c.usdc_mint); + }; + mints.insert(WRAPPED_SOL_MINT); + + // Convert mints to vec + let mints = mints.into_iter().collect::>(); + + // TOOD: fix amount to be per token + let amount = 100.0; + px::fetch_jup_prices(&mints, usd_mint, amount).await + } + + #[allow(clippy::too_many_arguments)] + pub async fn liquidate_obligation_and_redeem_reserve_collateral_ixns( + &self, + lending_market: StateWithKey, + debt_reserve: StateWithKey, + coll_reserve: StateWithKey, + obligation: StateWithKey, + liquidity_amount: u64, + min_acceptable_received_coll_amount: u64, + max_allowed_ltv_override_pct_opt: Option, + ) -> Result> { + let liquidate_ix = instructions::liquidate_obligation_and_redeem_reserve_collateral_ix( + &self.program_id, + lending_market, + debt_reserve.clone(), + coll_reserve.clone(), + &self.liquidator, + obligation.key, + liquidity_amount, + min_acceptable_received_coll_amount, + max_allowed_ltv_override_pct_opt, + ); + + let (pre_instructions, post_instructions) = self + .wrap_obligation_instruction_with_farms( + &[&coll_reserve, &debt_reserve], + &[ReserveFarmKind::Collateral, ReserveFarmKind::Debt], + &obligation, + &self.liquidator.wallet.clone(), + ) + .await; + + let mut instructions = vec![]; + for ix in pre_instructions { + instructions.push(ix.instruction); + } + instructions.push(liquidate_ix.instruction); + for ix in post_instructions { + instructions.push(ix.instruction); + } + + Ok(instructions) + } + + #[allow(clippy::too_many_arguments)] + pub async fn liquidate_obligation_and_redeem_reserve_collateral( + &mut self, + lending_market: StateWithKey, + debt_reserve: StateWithKey, + coll_reserve: StateWithKey, + obligation: StateWithKey, + liquidity_amount: u64, + min_acceptable_received_coll_amount: u64, + max_allowed_ltv_override_pct_opt: Option, + ) -> Result { + let instructions = self + .liquidate_obligation_and_redeem_reserve_collateral_ixns( + lending_market, + debt_reserve, + coll_reserve, + obligation, + liquidity_amount, + min_acceptable_received_coll_amount, + max_allowed_ltv_override_pct_opt, + ) + .await?; + + let txn = self.client.tx_builder().add_ixs(instructions); + let txn_b64 = txn.to_base64(); + println!( + "Simulation: https://explorer.solana.com/tx/inspector?message={}", + urlencoding::encode(&txn_b64) + ); + + txn.build_with_budget_and_fee(&[]).await.map_err(Into::into) + } + + pub async fn wrap_obligation_instruction_with_farms( + &self, + reserve_accts: &[&StateWithKey], + farm_modes: &[ReserveFarmKind], + obligation: &StateWithKey, + payer: &Arc, + ) -> (Vec, Vec) { + // If has farms, also do init farm obligations + // Always do refresh_reserve + // Always do refresh_obligation + // If has farms, also do refresh farms + // Then this ix + // If has farms, also do refresh farms + + let mut pre_instructions = vec![]; + let mut post_instructions = vec![]; + + let obligation_state = *(obligation.state.borrow()); + let obligation_address = obligation.key; + + let (deposit_reserves, borrow_reserves, referrer_token_states) = self + .get_obligation_reserves_and_referrer_token_states(&obligation_state) + .await; + + let mut unique_reserves = deposit_reserves + .iter() + .chain(borrow_reserves.iter()) + .filter_map(|x| *x) + .collect::>(); + unique_reserves.sort(); + unique_reserves.dedup(); + + let instruction_reserves = reserve_accts.iter().map(|x| x.key).collect::>(); + + // 1. Build init_obligation_farm if necessary + for reserve in reserve_accts { + let (farm_debt, farm_collateral) = { + let reserve_state = reserve.state.borrow(); + ( + reserve_state.get_farm(ReserveFarmKind::Debt), + reserve_state.get_farm(ReserveFarmKind::Collateral), + ) + }; + let (obligation_farm_debt, obligation_farm_coll) = + obligation_farms(&self.client, farm_debt, farm_collateral, obligation_address) + .await; + + if farm_debt != Pubkey::default() && obligation_farm_debt.is_none() { + let init_obligation_farm_ix = instructions::init_obligation_farm_for_reserve_ix( + &self.program_id, + reserve, + farm_debt, + &obligation_address, + &obligation_state.owner, + payer, + ReserveFarmKind::Debt, + ); + println!( + "Adding pre-ixn init_obligation_farm_ix current {:?} debt ", + farm_debt + ); + pre_instructions.push(init_obligation_farm_ix.clone()); + } + + if farm_collateral != Pubkey::default() && obligation_farm_coll.is_none() { + let init_obligation_farm_ix = instructions::init_obligation_farm_for_reserve_ix( + &self.program_id, + reserve, + farm_collateral, + &obligation_address, + &obligation_state.owner, + payer, + ReserveFarmKind::Collateral, + ); + println!( + "Adding pre-ixn init_obligation_farm_ix current {:?} coll", + farm_collateral + ); + pre_instructions.push(init_obligation_farm_ix.clone()); + } + } + + // 2. Build Refresh Reserve (for the non-instruction reserves - i.e. deposit, borrow) + for reserve_acc in unique_reserves { + if instruction_reserves.contains(&reserve_acc) { + continue; + } + let reserve: Reserve = self.client.get_anchor_account(&reserve_acc).await.unwrap(); + let refresh_reserve_ix = instructions::refresh_reserve_ix( + &self.program_id, + reserve, + &reserve_acc, + payer.clone(), + ); + println!("Adding pre-ixn refresh_reserve unique {:?}", reserve_acc); + pre_instructions.push(refresh_reserve_ix); + } + + // 3. Build Refresh Reserve (for the current instruction - i.e. deposit, borrow) + for reserve_acc in instruction_reserves { + let reserve: Reserve = self.client.get_anchor_account(&reserve_acc).await.unwrap(); + let refresh_reserve_ix = instructions::refresh_reserve_ix( + &self.program_id, + reserve, + &reserve_acc, + payer.clone(), + ); + println!("Adding pre-ixn refresh_reserve current {:?}", reserve_acc); + pre_instructions.push(refresh_reserve_ix); + } + + // 4. Build Refresh Obligation + let refresh_obligation_ix = instructions::refresh_obligation_ix( + &self.program_id, + obligation_state.lending_market, + obligation_address, + deposit_reserves, + borrow_reserves, + referrer_token_states, + payer.clone(), + ); + + println!("Adding pre-ixn refresh_obligation"); + pre_instructions.push(refresh_obligation_ix); + + for (reserve_acc, farm_mode) in reserve_accts.iter().zip(farm_modes.iter()) { + let reserve: Reserve = self + .client + .get_anchor_account(&reserve_acc.key) + .await + .unwrap(); + + let farm = reserve.get_farm(*farm_mode); + + // 5.1 Build Refresh Obligation Farms + if farm != Pubkey::default() { + let refresh_farms_ix = instructions::refresh_obligation_farm_for_reserve_ix( + &self.program_id, + reserve_acc, + farm, + obligation_address, + payer, + *farm_mode, + ); + + println!("pre_ixs refresh_obligation_farms {:?}", farm); + + pre_instructions.push(refresh_farms_ix.clone()); + post_instructions.push(refresh_farms_ix); + } + } + + (pre_instructions, post_instructions) + } + + pub async fn get_obligation_reserves_and_referrer_token_states( + &self, + obligation: &Obligation, + ) -> ( + Vec>, + Vec>, + Vec>, + ) { + let deposit_reserves: Vec> = obligation + .deposits + .iter() + .filter(|x| x.deposit_reserve != Pubkey::default()) + .map(|x| Some(x.deposit_reserve)) + .collect(); + + let borrow_reserves: Vec> = obligation + .borrows + .iter() + .filter(|x| x.borrow_reserve != Pubkey::default()) + .map(|x| Some(x.borrow_reserve)) + .collect(); + + let referrer_token_states: Vec> = if obligation.has_referrer() { + let mut vec = Vec::with_capacity(borrow_reserves.len()); + + for borrow_reserve in borrow_reserves.iter() { + match borrow_reserve { + Some(borrow_reserve) => { + let reserve_account: Reserve = self + .client + .get_anchor_account(borrow_reserve) + .await + .unwrap(); + + vec.push(Some(get_referrer_token_state_key( + &obligation.referrer, + &reserve_account.liquidity.mint_pubkey, + ))); + } + None => {} + } + } + vec + } else { + Vec::new() + }; + + (deposit_reserves, borrow_reserves, referrer_token_states) + } +} + +pub fn get_referrer_token_state_key(referrer: &Pubkey, mint: &Pubkey) -> Pubkey { + let (referrer_token_state_key, _referrer_token_state_bump) = Pubkey::find_program_address( + &[ + seeds::BASE_SEED_REFERRER_TOKEN_STATE, + referrer.as_ref(), + mint.as_ref(), + ], + &kamino_lending::id(), + ); + + referrer_token_state_key +} + +pub async fn obligation_farms( + client: &OrbitLink, + farm_debt: Pubkey, + farm_collateral: Pubkey, + obligation_address: Pubkey, +) -> ( + Option>, + Option>, +) { + let (obligation_farm_debt, _) = Pubkey::find_program_address( + &[ + farms::utils::consts::BASE_SEED_USER_STATE, + farm_debt.as_ref(), + obligation_address.as_ref(), + ], + &farms::ID, + ); + let (obligation_farm_coll, _) = Pubkey::find_program_address( + &[ + farms::utils::consts::BASE_SEED_USER_STATE, + farm_collateral.as_ref(), + obligation_address.as_ref(), + ], + &farms::ID, + ); + + let obligation_farm_debt_account = if farm_debt == Pubkey::default() { + None + } else if let Ok(None) = find_account(&client.client, obligation_farm_debt).await { + None + } else { + let acc = client + .get_anchor_account::(&obligation_farm_debt) + .await + .unwrap(); + + Some(StateWithKey::new(acc, obligation_farm_debt)) + }; + + let obligation_farm_coll_account = if farm_collateral == Pubkey::default() { + None + } else if let Ok(None) = find_account(&client.client, obligation_farm_coll).await { + None + } else { + let acc = client + .get_anchor_account::(&obligation_farm_coll) + .await + .unwrap(); + + Some(StateWithKey::new(acc, obligation_farm_coll)) + }; + + (obligation_farm_debt_account, obligation_farm_coll_account) +} + +pub mod utils { + use super::*; + + pub async fn fetch_markets_and_reserves( + client: &Arc, + markets: &[Pubkey], + ) -> anyhow::Result> { + let futures = markets + .iter() + .map(|market| { + let client = client.clone(); + let market = *market; + task::spawn(async move { client.fetch_market_and_reserves(&market).await }) + }) + .collect::>(); + + let results = futures::future::join_all(futures).await; + + let mut map = HashMap::new(); + for (i, result) in results.into_iter().enumerate() { + let r = result??; + map.insert(markets[i], r); + } + Ok(map) + } +} + +pub mod rpc { + use anchor_client::solana_client::{ + rpc_config::{RpcAccountInfoConfig, RpcProgramAccountsConfig}, + rpc_filter::{Memcmp, MemcmpEncodedBytes, RpcFilterType}, + }; + use anchor_lang::{Discriminator, Owner}; + use bytemuck::{from_bytes, AnyBitPattern}; + use orbit_link::OrbitLink; + use solana_account_decoder::UiAccountEncoding; + use solana_rpc_client::nonblocking::rpc_client::RpcClient; + + use super::*; + + pub async fn get_zero_copy_pa( + client: &OrbitLink, + program_id: &Pubkey, + filters: &[RpcFilterType], + ) -> Result> + where + Acc: AnyBitPattern + Owner + Discriminator, + { + let size = u64::try_from(std::mem::size_of::() + 8).unwrap(); + let discrim_memcmp = RpcFilterType::Memcmp(Memcmp::new( + 0, + MemcmpEncodedBytes::Bytes(Acc::discriminator().to_vec()), + )); + let mut all_filters = vec![RpcFilterType::DataSize(size), discrim_memcmp]; + for f in filters { + all_filters.push(f.clone()); + } + let config = RpcProgramAccountsConfig { + filters: Some(all_filters), + account_config: RpcAccountInfoConfig { + encoding: Some(UiAccountEncoding::Base64Zstd), + ..RpcAccountInfoConfig::default() + }, + ..RpcProgramAccountsConfig::default() + }; + + let accs = client + .client + .get_program_accounts_with_config(program_id, config) + .await?; + + let parsed_accounts = accs + .into_iter() + .map(|(pubkey, account)| { + let data: &[u8] = &account.data; + let acc: &Acc = from_bytes(&data[8..]); + Ok((pubkey, *acc)) + }) + .collect::>>()?; + Ok(parsed_accounts) + } +} diff --git a/terminator/src/config.rs b/terminator/src/config.rs new file mode 100644 index 0000000..5373756 --- /dev/null +++ b/terminator/src/config.rs @@ -0,0 +1,133 @@ +use std::{collections::HashMap, path::PathBuf, str::FromStr, time::Duration}; + +use anchor_lang::{prelude::Pubkey, solana_program}; +use anyhow::{anyhow, Result}; +use lazy_static::lazy_static; +use orbit_link::OrbitLink; +use solana_rpc_client::nonblocking::rpc_client::RpcClient; +use solana_sdk::{ + commitment_config::CommitmentConfig, + signature::{read_keypair_file, Keypair}, +}; +use static_pubkey::static_pubkey; + +use crate::{ + client::{KlendClient, RebalanceConfig}, + Actions, Args, RebalanceArgs, +}; + +lazy_static! { + pub static ref LENDING_MARKETS: HashMap> = { + let mut m = HashMap::new(); + let mainnet_markets = vec![ + static_pubkey!("7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF"), + static_pubkey!("ByYiZxp8QrdN9qbdtaAiePN8AAr3qvTPppNJDpf5DVJ5"), + static_pubkey!("DxXdAyU3kCjnyggvHmY5nAwg5cRbbmdyX3npfDMjjMek"), + ]; + m.insert( + static_pubkey!("KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD"), + mainnet_markets, + ); + let staging_markets = vec![static_pubkey!( + "6WVSwDQXrBZeQVnu6hpnsRZhodaJTZBUaC334SiiBKdb" + )]; + m.insert( + static_pubkey!("SLendK7ySfcEzyaFqy93gDnD3RtrpXJcnRwb6zFHJSh"), + staging_markets, + ); + m + }; +} + +pub async fn get_lending_markets(program_id: &Pubkey) -> Result> { + let env = std::env::var("MARKETS").ok(); + let markets = if let Some(markets) = env { + let markets: Vec = markets + .split(',') + .map(|s| Pubkey::from_str(s).unwrap()) + .collect(); + markets + } else { + // todo use API + let markets = LENDING_MARKETS + .get(program_id) + .ok_or(anyhow!("No markets found for program {:?}", program_id))?; + markets.clone() + }; + Ok(markets) +} + +pub fn get_client_for_action(args: &Args) -> Result { + let (payer, placeholder) = get_keypair_for_action(&args.keypair)?; + let commitment = CommitmentConfig::processed(); + let rpc = RpcClient::new_with_timeout_and_commitment( + args.cluster.url().to_string(), + Duration::from_secs(300), + commitment, + ); + let orbit_link: OrbitLink = + OrbitLink::new(rpc, payer, None, commitment, placeholder)?; + let rebalance_config = get_rebalance_config_for_action(&args.action); + let klend_client = KlendClient::init( + orbit_link, + args.klend_program_id.unwrap_or(kamino_lending::id()), + rebalance_config, + )?; + Ok(klend_client) +} + +pub fn get_keypair_for_action( + keypair: &Option, +) -> Result<(Option, Option)> { + let (keypair, pubkey) = client_keypair_and_pubkey(keypair)?; + validate_keypair_for_action(&keypair)?; + Ok((keypair, pubkey)) +} + +pub fn client_keypair_and_pubkey( + keypair: &Option, +) -> Result<(Option, Option)> { + Ok(if let Some(key) = keypair { + ( + Some( + read_keypair_file(key.clone()) + .map_err(|e| anyhow!("Keypair file {:?} not found or invalid {:?}", key, e))?, + ), + None, + ) + } else { + ( + None, + Some(Pubkey::from_str( + "K1endProducer111111111111111111111111111111", + )?), + ) + }) +} + +fn validate_keypair_for_action(keypair: &Option) -> Result<()> { + if keypair.is_none() { + return Err(anyhow::anyhow!("Keypair is required for this action")); + } + + Ok(()) +} + +pub fn get_rebalance_config_for_action(action: &Actions) -> Option { + match action { + Actions::Liquidate { rebalance_args, .. } + | Actions::Crank { rebalance_args, .. } + | Actions::Rebalance { rebalance_args, .. } + | Actions::Swap { rebalance_args, .. } => Some(parse_rebalance_args(rebalance_args)), + } +} + +fn parse_rebalance_args(args: &RebalanceArgs) -> RebalanceConfig { + RebalanceConfig { + base_token: args.base_currency, + min_sol_balance: args.min_sol_balance, + usdc_mint: args.usdc_mint, + rebalance_slippage_pct: args.rebalance_slippage_pct, + non_swappable_dust_usd_value: args.non_swappable_dust_usd_value, + } +} diff --git a/terminator/src/consts.rs b/terminator/src/consts.rs new file mode 100644 index 0000000..d21f693 --- /dev/null +++ b/terminator/src/consts.rs @@ -0,0 +1,13 @@ +use anchor_lang::{prelude::Pubkey, solana_program}; +use static_pubkey::static_pubkey; + +/// Canonical null pubkey. Prints out as "nu11111111111111111111111111111111111111111" +pub const NULL_PUBKEY: Pubkey = Pubkey::new_from_array([ + 11, 193, 238, 216, 208, 116, 241, 195, 55, 212, 76, 22, 75, 202, 40, 216, 76, 206, 27, 169, + 138, 64, 177, 28, 19, 90, 156, 0, 0, 0, 0, 0, +]); + +pub const MAX_ACCOUNTS_PER_TRANSACTION: usize = 64; +pub const MAX_EXTRA_ACCOUNTS_BUFFER: usize = 30; // the maximum size of the buffer we allow for the extra accounts; it is a very conservative value and with the current max number of accounts that can be locked in a tx this should be never reached +pub const EXTRA_ACCOUNTS_BUFFER: usize = 5; // the max_accounts limit in Jup API is not strict, so we need some tolerance +pub const WRAPPED_SOL_MINT: Pubkey = static_pubkey!("So11111111111111111111111111111111111111112"); diff --git a/terminator/src/instructions.rs b/terminator/src/instructions.rs new file mode 100644 index 0000000..ed07fe1 --- /dev/null +++ b/terminator/src/instructions.rs @@ -0,0 +1,286 @@ +use std::sync::Arc; + +use anchor_client::solana_sdk::{instruction::Instruction, pubkey::Pubkey, signature::Keypair}; +use anchor_lang::{prelude::Rent, system_program::System, Id, InstructionData, ToAccountMetas}; +use anchor_spl::token::Token; +use kamino_lending::{LendingMarket, Reserve, ReserveFarmKind}; +use solana_sdk::{ + signer::Signer, + sysvar::{ + SysvarId, {self}, + }, +}; + +use crate::{consts::NULL_PUBKEY, liquidator::Liquidator, model::StateWithKey, readable, writable}; + +#[derive(Clone)] +pub struct InstructionBlocks { + pub instruction: Instruction, + pub payer: Pubkey, + pub signers: Vec>, +} + +#[allow(clippy::too_many_arguments)] +pub fn liquidate_obligation_and_redeem_reserve_collateral_ix( + program_id: &Pubkey, + lending_market: StateWithKey, + debt_reserve: StateWithKey, + coll_reserve: StateWithKey, + liquidator: &Liquidator, + obligation: Pubkey, + liquidity_amount: u64, + min_acceptable_received_liq_amount: u64, + max_allowed_ltv_override_pct_opt: Option, +) -> InstructionBlocks { + let lending_market_pubkey = lending_market.key; + let lending_market_authority = + kamino_lending::utils::seeds::pda::lending_market_auth(&lending_market_pubkey); + + let coll_reserve_state = coll_reserve.state.borrow(); + let coll_reserve_address = coll_reserve.key; + + let debt_reserve_state = debt_reserve.state.borrow(); + let debt_reserve_address = debt_reserve.key; + + let collateral_ctoken = coll_reserve_state.collateral.mint_pubkey; + let collateral_token = coll_reserve_state.liquidity.mint_pubkey; + let debt_token = debt_reserve_state.liquidity.mint_pubkey; + + let instruction = Instruction { + program_id: *program_id, + accounts: kamino_lending::accounts::LiquidateObligationAndRedeemReserveCollateral { + liquidator: liquidator.wallet.pubkey(), + lending_market: lending_market.key, + repay_reserve: debt_reserve_address, + repay_reserve_liquidity_supply: debt_reserve_state.liquidity.supply_vault, + withdraw_reserve: coll_reserve_address, + withdraw_reserve_collateral_mint: coll_reserve_state.collateral.mint_pubkey, + withdraw_reserve_collateral_supply: coll_reserve_state.collateral.supply_vault, + withdraw_reserve_liquidity_supply: coll_reserve_state.liquidity.supply_vault, + withdraw_reserve_liquidity_fee_receiver: coll_reserve_state.liquidity.fee_vault, + lending_market_authority, + obligation, + user_destination_collateral: *liquidator.atas.get(&collateral_ctoken).unwrap(), + user_destination_liquidity: *liquidator.atas.get(&collateral_token).unwrap(), + user_source_liquidity: *liquidator.atas.get(&debt_token).unwrap(), + instruction_sysvar_account: sysvar::instructions::ID, + repay_liquidity_token_program: Token::id(), + repay_reserve_liquidity_mint: debt_reserve_state.liquidity.mint_pubkey, + withdraw_reserve_liquidity_mint: coll_reserve_state.liquidity.mint_pubkey, + collateral_token_program: Token::id(), // TODO: add Token2022 + withdraw_liquidity_token_program: Token::id(), // TODO: add Token2022 + } + .to_account_metas(None), + data: kamino_lending::instruction::LiquidateObligationAndRedeemReserveCollateral { + liquidity_amount, + min_acceptable_received_liquidity_amount: min_acceptable_received_liq_amount, + max_allowed_ltv_override_percent: max_allowed_ltv_override_pct_opt.unwrap_or(0), + } + .data(), + }; + + InstructionBlocks { + instruction, + payer: liquidator.wallet.pubkey(), + signers: vec![liquidator.wallet.clone()], + } +} + +pub fn refresh_reserve_ix( + program_id: &Pubkey, + reserve: Reserve, + address: &Pubkey, + payer: Arc, +) -> InstructionBlocks { + let instruction = Instruction { + program_id: *program_id, + accounts: kamino_lending::accounts::RefreshReserve { + lending_market: reserve.lending_market, + reserve: *address, + pyth_oracle: maybe_null_pk(reserve.config.token_info.pyth_configuration.price), + switchboard_price_oracle: maybe_null_pk( + reserve + .config + .token_info + .switchboard_configuration + .price_aggregator, + ), + switchboard_twap_oracle: maybe_null_pk( + reserve + .config + .token_info + .switchboard_configuration + .twap_aggregator, + ), + scope_prices: maybe_null_pk(reserve.config.token_info.scope_configuration.price_feed), + } + .to_account_metas(None), + data: kamino_lending::instruction::RefreshReserve.data(), + }; + + InstructionBlocks { + instruction, + payer: payer.pubkey(), + signers: vec![payer.clone()], + } +} + +pub fn refresh_obligation_farm_for_reserve_ix( + program_id: &Pubkey, + reserve: &StateWithKey, + reserve_farm_state: Pubkey, + obligation: Pubkey, + owner: &Arc, + farms_mode: ReserveFarmKind, +) -> InstructionBlocks { + let (user_farm_state, _) = Pubkey::find_program_address( + &[ + farms::utils::consts::BASE_SEED_USER_STATE, + reserve_farm_state.as_ref(), + obligation.as_ref(), + ], + &farms::ID, + ); + + let reserve_state = reserve.state.borrow(); + let reserve_address = reserve.key; + let lending_market_authority = + kamino_lending::utils::seeds::pda::lending_market_auth(&reserve_state.lending_market); + + let accts = kamino_lending::accounts::RefreshObligationFarmsForReserve { + crank: owner.pubkey(), + obligation, + lending_market: reserve_state.lending_market, + lending_market_authority, + reserve: reserve_address, + obligation_farm_user_state: user_farm_state, + reserve_farm_state, + rent: Rent::id(), + farms_program: farms::id(), + system_program: System::id(), + }; + + let instruction = Instruction { + program_id: *program_id, + accounts: accts.to_account_metas(None), + data: kamino_lending::instruction::RefreshObligationFarmsForReserve { + mode: farms_mode as u8, + } + .data(), + }; + + InstructionBlocks { + instruction, + payer: owner.pubkey(), + signers: vec![owner.clone()], + } +} + +#[allow(clippy::too_many_arguments)] +pub fn init_obligation_farm_for_reserve_ix( + program_id: &Pubkey, + reserve_accounts: &StateWithKey, + reserve_farm_state: Pubkey, + obligation: &Pubkey, + owner: &Pubkey, + payer: &Arc, + mode: ReserveFarmKind, +) -> InstructionBlocks { + let (obligation_farm_state, _user_state_bump) = Pubkey::find_program_address( + &[ + farms::utils::consts::BASE_SEED_USER_STATE, + reserve_farm_state.as_ref(), + obligation.as_ref(), + ], + &farms::ID, + ); + + let reserve_state = reserve_accounts.state.borrow(); + let reserve_address = reserve_accounts.key; + let lending_market_authority = + kamino_lending::utils::seeds::pda::lending_market_auth(&reserve_state.lending_market); + + let accts = kamino_lending::accounts::InitObligationFarmsForReserve { + payer: payer.pubkey(), + owner: *owner, + obligation: *obligation, + lending_market: reserve_state.lending_market, + lending_market_authority, + reserve: reserve_address, + obligation_farm: obligation_farm_state, + reserve_farm_state, + rent: Rent::id(), + farms_program: farms::id(), + system_program: System::id(), + }; + + let instruction = Instruction { + program_id: *program_id, + accounts: accts.to_account_metas(None), + data: kamino_lending::instruction::InitObligationFarmsForReserve { mode: mode as u8 } + .data(), + }; + + InstructionBlocks { + instruction, + payer: payer.pubkey(), + signers: vec![payer.clone()], + } +} + +pub fn refresh_obligation_ix( + program_id: &Pubkey, + market: Pubkey, + obligation: Pubkey, + deposit_reserves: Vec>, + borrow_reserves: Vec>, + referrer_token_states: Vec>, + payer: Arc, +) -> InstructionBlocks { + let mut accounts = kamino_lending::accounts::RefreshObligation { + obligation, + lending_market: market, + } + .to_account_metas(None); + + deposit_reserves + .iter() + .filter(|reserve| reserve.is_some()) + .for_each(|reserve| { + accounts.push(readable!(reserve.unwrap())); + }); + + borrow_reserves + .iter() + .filter(|reserve| reserve.is_some()) + .for_each(|reserve| { + accounts.push(writable!(reserve.unwrap())); + }); + + referrer_token_states + .iter() + .filter(|referrer_token_state: &&Option| referrer_token_state.is_some()) + .for_each(|referrer_token_state| { + accounts.push(writable!(referrer_token_state.unwrap())); + }); + + let instruction = Instruction { + program_id: *program_id, + accounts, + data: kamino_lending::instruction::RefreshObligation.data(), + }; + + InstructionBlocks { + instruction, + payer: payer.pubkey(), + signers: vec![payer.clone()], + } +} + +pub fn maybe_null_pk(pubkey: Pubkey) -> Option { + if pubkey == Pubkey::default() || pubkey == NULL_PUBKEY { + None + } else { + Some(pubkey) + } +} diff --git a/terminator/src/jupiter.rs b/terminator/src/jupiter.rs new file mode 100644 index 0000000..420e4dd --- /dev/null +++ b/terminator/src/jupiter.rs @@ -0,0 +1,114 @@ +use std::collections::HashSet; + +use anchor_lang::prelude::Pubkey; +use juno::{get_quote, get_swap_instructions, AsyncAccountFetcher, DecompiledVersionedTx}; +use tracing::warn; + +use crate::consts::{ + EXTRA_ACCOUNTS_BUFFER, MAX_ACCOUNTS_PER_TRANSACTION, MAX_EXTRA_ACCOUNTS_BUFFER, +}; + +pub async fn get_best_swap_route( + input_mint: &Pubkey, + output_mint: &Pubkey, + amount: u64, + only_direct_routes: bool, + slippage_bps: Option, + price_impact_limit: Option, + max_accounts: Option, +) -> juno::Result { + let best_route = get_quote( + input_mint, + output_mint, + amount, + only_direct_routes, + slippage_bps, + max_accounts, + ) + .await?; + + let route_price_impact_pct = best_route + .price_impact_pct + .parse::() + .map_err(|_| juno::Error::ResponseTypeConversionError)?; + if let Some(price_impact_limit) = price_impact_limit { + if route_price_impact_pct > price_impact_limit { + return Err(juno::Error::PriceImpactTooHigh(route_price_impact_pct)); + } + } + Ok(best_route) +} + +#[allow(clippy::too_many_arguments)] +/// Get the swap instructions for the best route matching parameters +pub async fn get_best_swap_instructions( + input_mint: &Pubkey, + output_mint: &Pubkey, + amount: u64, + only_direct_routes: bool, + slippage_bps: Option, + price_impact_limit: Option, + user_public_key: Pubkey, + accounts_fetcher: &impl AsyncAccountFetcher, + accounts: Option<&Vec<&Pubkey>>, + accounts_count_buffer: Option, +) -> juno::Result { + // when we use Jup swap + Kamino's swap rewards in a single transaction, the total number of unique accounts that we can lock (include) in the tx is 64. We need to count how many accounts the Kamino ix will use and require Jup API to give us a route that uses less than MAX_ACCOUNTS_PER_TRANSACTION - the amount of accounts that Kamino will use. The Jup API is taking the maxAccounts as a recommandation not as a hard limit so we should have a buffer such as the number of real accounts in the swap ix - buffer size <= maxAccounts. While this is not true we increase the buffer size (so be more aggressive with the maxAccounts parameter passed to the Jup API). + // Example: SwapRewards ix uses 30 distinct accounts; maxAccounts = 64 - 30 - 5 = 29; the route returned by Jup for 29 maxAccounts has 40 accounts and 36 of them are distinct from the SwapRewards, so 66 accounts locked in total, which is too much. Increase the buffer by to so now maxAccounts = 64 - 30 - 7 = 27. he route returned by Jup for 27 maxAccounts has 35 accounts and 32 of them are distinct from the SwapRewards so 62 accounts locked so the tx will succeed. + let accounts_count_buffer = accounts_count_buffer.unwrap_or(0); + let mut extra_accounts_buffer = EXTRA_ACCOUNTS_BUFFER; + + let mut accounts_distict: HashSet<&Pubkey> = HashSet::new(); + if let Some(accounts) = accounts { + accounts_distict.extend(accounts.iter()); + } + accounts_distict.insert(&user_public_key); + + let accounts_distict_count = accounts_distict.len(); + + while extra_accounts_buffer < MAX_EXTRA_ACCOUNTS_BUFFER { + let max_accounts = MAX_ACCOUNTS_PER_TRANSACTION + .saturating_sub(accounts_distict_count) + .saturating_sub(extra_accounts_buffer) + .saturating_sub(accounts_count_buffer); + + let best_route = match get_best_swap_route( + input_mint, + output_mint, + amount, + only_direct_routes, + slippage_bps, + price_impact_limit, + Some(max_accounts.try_into().unwrap()), + ) + .await + { + Ok(res) => Some(res), + Err(_) => None, + }; + + if let Some(best_route) = best_route { + let instructions_result = + get_swap_instructions(best_route, user_public_key, accounts_fetcher).await; + if let Ok(decompiled_tx) = instructions_result { + let total_accounts = decompiled_tx + .instructions + .iter() + .flat_map(|ix| ix.accounts.iter().map(|a| &a.pubkey)) + .chain(accounts_distict.iter().copied()) + .collect::>(); + if total_accounts.len() <= MAX_ACCOUNTS_PER_TRANSACTION { + println!("max accounts {}", max_accounts); + return Ok(decompiled_tx); + } + } + } else { + warn!("cannot find route from {input_mint} to {output_mint} for max_accounts {max_accounts}"); + return Err(juno::Error::NoValidRoute); + } + + extra_accounts_buffer += 2; + } + + Err(juno::Error::NoValidRoute) +} diff --git a/terminator/src/liquidator.rs b/terminator/src/liquidator.rs new file mode 100644 index 0000000..8d6ff2c --- /dev/null +++ b/terminator/src/liquidator.rs @@ -0,0 +1,230 @@ +use std::{collections::HashMap, sync::Arc}; + +use anchor_client::solana_client::nonblocking::rpc_client::RpcClient; +use anchor_lang::{prelude::Pubkey, solana_program::program_pack::Pack, AccountDeserialize, Id}; +use anchor_spl::token::{Mint, Token}; +use anyhow::{anyhow, Result}; +use kamino_lending::Reserve; +use solana_sdk::{signature::Keypair, signer::Signer}; +use spl_associated_token_account::{ + get_associated_token_address, instruction::create_associated_token_account, +}; +use spl_token::state::Account as TokenAccount; +use tracing::{debug, info, warn}; + +use crate::{accounts::find_account, client::KlendClient, consts::WRAPPED_SOL_MINT, px::Prices}; + +#[derive(Debug, Clone, Default)] +pub struct Holdings { + pub holdings: Vec, + pub sol: Holding, +} + +#[derive(Debug, Clone, Default)] +pub struct Holding { + pub mint: Pubkey, + pub ata: Pubkey, + pub decimals: u8, + pub balance: u64, + pub ui_balance: f64, + pub label: String, + pub usd_value: f64, +} + +impl Holdings { + pub fn holding_of(&self, mint: &Pubkey) -> Result { + for holding in self.holdings.iter() { + if holding.mint == *mint { + return Ok(holding.clone()); + } + } + Err(anyhow!("Holding not found for mint {}", mint)) + } +} + +#[derive(Debug, Clone)] +pub struct Liquidator { + pub wallet: Arc, + pub atas: HashMap, +} + +fn label_of(mint: &Pubkey, reserves: &HashMap) -> String { + for (_, reserve) in reserves.iter() { + if &reserve.liquidity.mint_pubkey == mint { + let symbol = reserve.config.token_info.symbol().to_string(); + if symbol == "SOL" { + return "WSOL".to_string(); + } else { + return symbol; + } + } + } + mint.to_string() +} + +impl Liquidator { + pub async fn init( + client: &KlendClient, + reserves: &HashMap, + ) -> Result { + // Load reserves mints + let mints: Vec = reserves + .iter() + .flat_map(|(_, r)| [r.liquidity.mint_pubkey, r.collateral.mint_pubkey]) + .collect(); + // Load wallet + let mut atas = HashMap::new(); + let wallet = match { client.client.payer().ok() } { + Some(wallet) => { + // Load or create atas + info!("Loading atas..."); + let wallet = Arc::new(wallet.insecure_clone()); + let get_or_create_atas_futures = mints + .iter() + .map(|mint| get_or_create_ata(client, &wallet, mint)); + let get_or_create_atas = + futures::future::join_all(get_or_create_atas_futures).await; + for (i, ata) in get_or_create_atas.into_iter().enumerate() { + atas.insert(*mints.get(i).unwrap(), ata?); + } + info!( + "Loaded liquidator {} with {} tokens", + wallet.pubkey(), + atas.len(), + ); + wallet + } + None => Arc::new(Keypair::new()), + }; + + let liquidator = Liquidator { wallet, atas }; + + Ok(liquidator) + } + + pub async fn fetch_holdings( + &self, + client: &RpcClient, + reserves: &HashMap, + prices: &Prices, + ) -> Result { + let mut holdings = Vec::new(); + // TODO: optimize this, get all accounts in batch to have 1 single rpc call + let get_token_balance_futures = self + .atas + .iter() + .map(|(mint, ata)| get_token_balance(client, mint, ata)); + let get_token_balance = futures::future::join_all(get_token_balance_futures).await; + for (i, (mint, ata)) in self.atas.iter().enumerate() { + match get_token_balance.get(i) { + Some(Ok((balance, decimals))) => { + let ui_balance = *balance as f64 / 10u64.pow(*decimals as u32) as f64; + holdings.push(Holding { + mint: *mint, + ata: *ata, + decimals: *decimals, + balance: *balance, + ui_balance, + label: label_of(mint, reserves), + usd_value: if *balance > 0 { + prices + .prices + .get(mint) + .map_or(0.0, |price| ui_balance * price) + } else { + 0.0 + }, + }); + } + Some(Err(e)) => { + warn!( + "Error getting balance for mint {:?} and ata {:?}: {:?}", + mint, ata, e + ); + } + None => { + warn!("No result for mint {:?} and ata {:?}", mint, ata); + } + } + } + + // Load SOL balance + let balance = client.get_balance(&self.wallet.pubkey()).await.unwrap(); + let ui_balance = balance as f64 / 10u64.pow(9) as f64; + let sol_holding = Holding { + mint: Pubkey::default(), // No mint, this is the native balance + ata: Pubkey::default(), // Holding in the native account, not in the ata + decimals: 9, + balance, + ui_balance, + label: "SOL".to_string(), + usd_value: ui_balance * prices.prices.get(&WRAPPED_SOL_MINT).unwrap(), + }; + info!("Holding {} SOL", sol_holding.ui_balance); + + for holding in holdings.iter() { + if holding.balance > 0 { + info!("Holding {} {}", holding.ui_balance, holding.label); + } + } + + let holding = Holdings { + holdings, + sol: sol_holding, + }; + Ok(holding) + } +} + +async fn get_or_create_ata( + client: &KlendClient, + owner: &Arc, + mint: &Pubkey, +) -> Result { + let owner_pubkey = &owner.pubkey(); + let ata = get_associated_token_address(owner_pubkey, mint); + if !matches!(find_account(&client.client.client, ata).await, Ok(None)) { + debug!("Liquidator ATA for mint {} exists: {}", mint, ata); + Ok(ata) + } else { + debug!( + "Liquidator ATA for mint {} does not exist, creating...", + mint + ); + let ix = create_associated_token_account(owner_pubkey, owner_pubkey, mint, &Token::id()); + let tx = client + .client + .tx_builder() + .add_ix(ix) + .build(&[]) + .await + .unwrap(); + + let (sig, _) = client.send_and_confirm_transaction(tx).await.unwrap(); + + debug!( + "Created ata for liquidator: {}, mint: {}, ata: {}, sig: {:?}", + owner.pubkey(), + mint, + ata, + sig + ); + + Ok(ata) + } +} + +/// get the balance of a token account +pub async fn get_token_balance( + client: &RpcClient, + mint: &Pubkey, + token_account: &Pubkey, +) -> Result<(u64, u8)> { + let mint_account = client.get_account(mint).await?; + let token_account = client.get_account(token_account).await?; + let token_account = TokenAccount::unpack(&token_account.data)?; + let mint_account = Mint::try_deserialize_unchecked(&mut mint_account.data.as_ref())?; + let amount = token_account.amount; + let decimals = mint_account.decimals; + Ok((amount, decimals)) +} diff --git a/terminator/src/lookup_tables.rs b/terminator/src/lookup_tables.rs new file mode 100644 index 0000000..f8345cf --- /dev/null +++ b/terminator/src/lookup_tables.rs @@ -0,0 +1,41 @@ +use std::collections::{HashMap, HashSet}; + +use anchor_lang::prelude::Pubkey; +use kamino_lending::{LendingMarket, Reserve}; + +use crate::liquidator::Liquidator; + +pub fn collect_keys( + reserves: &HashMap, + liquidator: &Liquidator, + lending_market: &LendingMarket, +) -> HashSet { + let mut lending_markets = HashSet::new(); + let mut keys = HashSet::new(); + for (pubkey, reserve) in reserves { + keys.insert(*pubkey); + keys.insert(reserve.collateral.supply_vault); + keys.insert(reserve.collateral.mint_pubkey); + keys.insert(reserve.liquidity.supply_vault); + keys.insert(reserve.liquidity.fee_vault); + keys.insert(reserve.liquidity.mint_pubkey); + lending_markets.insert(reserve.lending_market); + } + + for (mint, ata) in liquidator.atas.iter() { + keys.insert(*mint); + keys.insert(*ata); + } + + keys.insert(lending_market.lending_market_owner); + keys.insert(lending_market.risk_council); + + for lending_market in lending_markets.iter() { + let lending_market_authority = + kamino_lending::utils::seeds::pda::lending_market_auth(lending_market); + keys.insert(*lending_market); + keys.insert(lending_market_authority); + } + + keys +} diff --git a/terminator/src/macros.rs b/terminator/src/macros.rs new file mode 100644 index 0000000..4382c16 --- /dev/null +++ b/terminator/src/macros.rs @@ -0,0 +1,42 @@ +#[macro_export] +macro_rules! readable { + ($res:expr) => { + ::anchor_lang::prelude::AccountMeta::new_readonly($res, false) + }; +} + +#[macro_export] +macro_rules! signer { + ($res:expr) => { + ::anchor_lang::prelude::AccountMeta::new_readonly($res, true) + }; +} + +#[macro_export] +macro_rules! writable { + ($res:expr) => { + ::anchor_lang::prelude::AccountMeta::new($res, false) + }; +} + +#[macro_export] +macro_rules! writable_signer { + ($res:expr) => { + AccountMeta::new($res, true) + }; +} + +#[macro_export] +macro_rules! it_event { + ($event:expr) => { + if let Ok(val) = std::env::var("INTEGRATION_TEST") { + if val == "true" { + let msg = serde_json::json!({ + "scheme": "integration-test", + "type": $event + }); + println!("{}", msg.to_string()); + } + }; + } +} diff --git a/terminator/src/main.rs b/terminator/src/main.rs new file mode 100644 index 0000000..67aaca6 --- /dev/null +++ b/terminator/src/main.rs @@ -0,0 +1,793 @@ +use std::{path::PathBuf, sync::Arc, time::Duration}; + +use anchor_client::{solana_sdk::pubkey::Pubkey, Cluster}; +use anyhow::Result; +use clap::{Parser, Subcommand}; +use colored::Colorize; +use consts::WRAPPED_SOL_MINT; +use itertools::Itertools; +use juno::DecompiledVersionedTx; +use kamino_lending::Reserve; +use solana_sdk::{ + compute_budget::{self}, + signer::Signer, +}; +use tokio::time::sleep; +use tracing::info; +use tracing_subscriber::filter::EnvFilter; + +use crate::{ + accounts::{map_accounts_and_create_infos, oracle_accounts, OracleAccounts}, + client::{KlendClient, RebalanceConfig}, + config::get_lending_markets, + jupiter::get_best_swap_instructions, + liquidator::{Holding, Holdings}, + math::LiquidationStrategy, + model::StateWithKey, + operations::{ + obligation_reserves, referrer_token_states_of_obligation, split_obligations, + ObligationReserves, SplitObligations, + }, + px::fetch_jup_prices, + utils::get_all_reserve_mints, +}; + +pub mod accounts; +pub mod client; +mod config; +pub mod consts; +pub mod instructions; +pub mod jupiter; +pub mod liquidator; +pub mod lookup_tables; +pub mod macros; +pub mod math; +mod model; +pub mod operations; +mod px; +pub mod sysvars; +mod utils; + +const USDC_MINT_STR: &str = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"; + +#[derive(Parser, Debug)] +#[clap(author, version, about, long_about = None)] +pub struct Args { + /// Klend program id + /// Default is mainnet: KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD + /// If compiled with staging profile, default is: SLendK7ySfcEzyaFqy93gDnD3RtrpXJcnRwb6zFHJSh + #[clap(long, env, parse(try_from_str))] + klend_program_id: Option, + + /// Connect to solana validator + #[clap(long, env, parse(try_from_str), default_value = "localnet")] + cluster: Cluster, + + /// Account keypair to pay for the transactions + #[clap(long, env, parse(from_os_str))] + keypair: Option, + + /// Markets to be considered + /// Defaults to using api endpoint if not specified + #[clap(long, env, parse(try_from_str))] + markets: Option>, + + /// Set flag to activate json log output + #[clap(long, env = "JSON_LOGS")] + json: bool, + + /// Print timestamps in logs (not needed on grafana) + #[clap(long, env, default_value = "true")] + log_timestamps: bool, + + /// Run with embedded webserver (default false) + #[clap(short, env, long)] + server: bool, + + /// Embedded webserver port + /// Only valid if --server is also used + #[clap(long, env, default_value = "8080")] + server_port: u16, + + /// Subcommand to execute + #[clap(subcommand)] + action: Actions, +} + +#[derive(Parser, Debug)] +pub struct RebalanceArgs { + /// What to hold the balance in + #[clap(long, env, parse(try_from_str), default_value = USDC_MINT_STR)] + base_currency: Pubkey, + + /// Necessary for fees + #[clap(long, env, parse(try_from_str), default_value = "0.5")] + min_sol_balance: f64, + + /// Used for jup quote pxs etc. + #[clap(long, env, parse(try_from_str), default_value = USDC_MINT_STR)] + usdc_mint: Pubkey, + + /// From token + #[clap(long, env, parse(try_from_str), default_value = "0.35")] + rebalance_slippage_pct: f64, + + /// Threshold value to trigger a rebalance + #[clap(long, env, parse(try_from_str), default_value = "5.0")] + non_swappable_dust_usd_value: f64, +} + +#[derive(Debug, Subcommand)] +pub enum Actions { + /// Automatically refresh the prices + #[clap()] + Crank { + /// Obligation to be cranked + #[clap(long, env, parse(try_from_str))] + obligation: Option, + + #[clap(flatten)] + rebalance_args: RebalanceArgs, + }, + #[clap()] + Liquidate { + /// Obligation to be liquidated + #[clap(long, env, parse(try_from_str))] + obligation: Pubkey, + + #[clap(flatten)] + rebalance_args: RebalanceArgs, + }, + #[clap()] + Swap { + /// From token + #[clap(long, env, parse(try_from_str))] + from: Pubkey, + + /// From token + #[clap(long, env, parse(try_from_str))] + to: Pubkey, + + /// From token + #[clap(long, env, parse(try_from_str))] + amount: f64, + + /// From token + #[clap(long, env, parse(try_from_str))] + slippage_pct: f64, + + #[clap(flatten)] + rebalance_args: RebalanceArgs, + }, + + #[clap()] + Rebalance { + #[clap(flatten)] + rebalance_args: RebalanceArgs, + }, +} + +#[tokio::main] +async fn main() -> Result<()> { + if let Ok(e) = std::env::var("ENV") { + dotenvy::from_filename(e)?; + } else if PathBuf::from(".env").exists() { + dotenvy::from_filename(".env")?; + }; + let args: Args = Args::parse(); + + let env_filter = EnvFilter::from_default_env(); + let env_filter = env_filter.add_directive("kamino_lending=warn".parse()?); + tracing_subscriber::fmt() + .with_env_filter(env_filter) + .compact() + .init(); + + info!("Starting with {:#?}", args); + + info!("Initializing client.."); + let klend_client = config::get_client_for_action(&args)?; + let klend_client = Arc::new(klend_client); + + it_event!("klend_terminator::started"); + + info!("Executing action.."); + match args.action { + Actions::Crank { + obligation: obligation_filter, + rebalance_args: _, + } => crank(&klend_client, obligation_filter).await, + Actions::Liquidate { + obligation, + rebalance_args: _, + } => liquidate(&klend_client, &obligation).await, + Actions::Swap { + from, + to, + amount, + slippage_pct, + rebalance_args: _, + } => swap::swap_action(&klend_client, from, to, amount, slippage_pct).await, + Actions::Rebalance { rebalance_args: _ } => rebalance(&klend_client).await, + } +} + +async fn rebalance(klend_client: &Arc) -> Result<()> { + let lending_markets = get_lending_markets(&klend_client.program_id).await?; + + info!("Rebalancing..."); + let rebalance_config = match &klend_client.rebalance_config { + None => Err(anyhow::anyhow!("Rebalance settings not found")), + Some(c) => Ok(c), + }?; + let RebalanceConfig { + base_token, + min_sol_balance, + rebalance_slippage_pct: slippage, + .. + } = rebalance_config; + info!( + "Loading markets and reserves for {} markets..", + lending_markets.len() + ); + let markets = + crate::client::utils::fetch_markets_and_reserves(klend_client, &lending_markets).await?; + let (all_reserves, _ctoken_mints, liquidity_mints) = get_all_reserve_mints(&markets); + info!("Loading Jupiter prices.."); + let amount = 100.0; + let pxs = fetch_jup_prices(&liquidity_mints, &rebalance_config.usdc_mint, amount).await?; + info!("Loading holdings.."); + let mut holdings = klend_client + .liquidator + .fetch_holdings(&klend_client.client.client, &all_reserves, &pxs) + .await?; + + let base = holdings.holding_of(base_token).unwrap(); + info!( + "Base {:?} {} holding {}", + base.mint, base.label, base.ui_balance + ); + let sol_holding = &holdings.sol; + info!( + "SOL holding {}, Min sol holding {}", + sol_holding.ui_balance, min_sol_balance + ); + + // Rules: + // - if sol_balance < min_sol -> base token swaps into min_sol balance at least + // - if sol_balance > min_sol * 2 -> swap the diff from current_sol - min_sol * 2 -> base token + // - every non base token goes into base token if > $1 -> swap it partially at most $20k at a time + + const SOL_BUFFER_FACTOR: f64 = 2.0; + let sol_balance = sol_holding.ui_balance; + + if sol_balance < *min_sol_balance { + // Swap base token into SOL to reach min sol balance + let target = min_sol_balance * SOL_BUFFER_FACTOR; + let missing = target - sol_balance; + + let px_sol_to_base = pxs.a_to_b(&WRAPPED_SOL_MINT, base_token); + let base_to_swap = missing * px_sol_to_base * (1.0 + slippage / 100.0); + + info!("Sol balance {} is below min_balance {} so we are topping up to {}, therefore acquiring {} more SOL, sol_price_to_base {}, swapping base {}", + sol_balance, + min_sol_balance, + target, + missing, + px_sol_to_base, + base_to_swap + ); + + // TODO: make these ixns go together + swap::swap( + klend_client, + &holdings, + base_token, + &sol_holding.mint, + base_to_swap, + *slippage, + ) + .await?; + + let _ = accounts::unwrap_wsol_ata(klend_client).await?; + + // Reload holdings + tokio::time::sleep(Duration::from_secs(5)).await; + holdings = klend_client + .liquidator + .fetch_holdings(&klend_client.client.client, &all_reserves, &pxs) + .await?; + } + + // TODO: If we have too much wsol and it's not the base asset + // then just unwrap it + // accounts::unwrap_wsol_ata(klend_client).await; + if rebalance_config.base_token != WRAPPED_SOL_MINT { + let wsol_holding = holdings.holding_of(&WRAPPED_SOL_MINT).unwrap(); + if wsol_holding.usd_value > 1.0 { + info!("Unwrapping {} WSOL", wsol_holding.ui_balance); + let _ = accounts::unwrap_wsol_ata(klend_client).await?; + + // Reload holdings + tokio::time::sleep(Duration::from_secs(5)).await; + klend_client + .liquidator + .fetch_holdings(&klend_client.client.client, &all_reserves, &pxs) + .await?; + } + } + + // Now swap the remaining + for Holding { + mint, + ui_balance, + usd_value, + label, + .. + } in holdings.holdings.clone().into_iter() + { + if &mint == base_token { + continue; + } + + if usd_value < rebalance_config.non_swappable_dust_usd_value { + // We don't swap it, too small + continue; + } + + // Swap the whole thing + let px = pxs.a_to_b(&mint, base_token); + let estimated_base = ui_balance * px * (1.0 + slippage / 100.0); + info!( + "Swapping non-base token {} amount: {} expecting back {} base", + label, ui_balance, estimated_base + ); + + swap::swap( + klend_client, + &holdings, + &mint, + base_token, + ui_balance, + *slippage, + ) + .await?; + } + Ok(()) +} + +pub mod swap { + use super::*; + + pub async fn swap_action( + klend_client: &Arc, + from: Pubkey, + to: Pubkey, + amount: f64, + slippage_pct: f64, + ) -> Result<()> { + let rebalance_config = match &klend_client.rebalance_config { + None => Err(anyhow::anyhow!("Rebalance settings not found")), + Some(c) => Ok(c), + }?; + + let lending_markets = get_lending_markets(&klend_client.program_id).await?; + let markets = + client::utils::fetch_markets_and_reserves(klend_client, &lending_markets).await?; + let (reserves, _, l_mints) = get_all_reserve_mints(&markets); + let pxs = fetch_jup_prices(&l_mints, &rebalance_config.usdc_mint, amount as f32).await?; + let holdings = klend_client + .liquidator + .fetch_holdings(&klend_client.client.client, &reserves, &pxs) + .await?; + swap(klend_client, &holdings, &from, &to, amount, slippage_pct).await + } + + pub async fn swap( + klend_client: &KlendClient, + holdings: &Holdings, + from: &Pubkey, + to: &Pubkey, + amount: f64, + slippage_pct: f64, + ) -> Result<()> { + // https://quote-api.jup.ag/v6/quote?inputMint=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&outputMint=So11111111111111111111111111111111111111112&amount=94576524&slippageBps=50&swapMode=ExactIn&onlyDirectRoutes=true&asLegacyTransaction=false + + let from_token = holdings.holding_of(from)?; + let to_token = holdings.holding_of(to)?; + let user = klend_client.liquidator.wallet.pubkey(); + + info!( + "Swapping {} {} for {} with slippage {}%", + amount, + from_token.label.to_string().green(), + to_token.label.to_string().green(), + slippage_pct + ); + + let amount_to_swap = (amount * 10f64.powf(from_token.decimals as f64)).floor() as u64; + let slippage_bps = (slippage_pct * 100f64).floor() as u16; + + let jupiter_swap = get_best_swap_instructions( + from, + to, + amount_to_swap, + false, + Some(slippage_bps), + None, + user, + &klend_client.client.client, + None, + None, + ) + .await?; + + let DecompiledVersionedTx { + lookup_tables, + instructions: jup_ixs, + } = jupiter_swap; + + let mut builder = klend_client.client.tx_builder().add_ixs(jup_ixs); + + if let Some(lookup_tables) = lookup_tables { + for table in lookup_tables.into_iter() { + builder = builder.add_lookup_table(table); + } + } + + let tx = builder.build(&[]).await?; + + info!("Sending transaction..."); + let (sig, _) = klend_client.client.send_and_confirm_transaction(tx).await?; + info!("Executed transaction: {:?}", sig); + + Ok(()) + } +} + +async fn liquidate(klend_client: &KlendClient, obligation: &Pubkey) -> Result<()> { + info!("Liquidating obligation {}", obligation.to_string().green()); + let rebalance_config = match &klend_client.rebalance_config { + None => Err(anyhow::anyhow!("Rebalance settings not found")), + Some(c) => Ok(c), + }?; + + // Reload accounts + let mut ob = klend_client.fetch_obligation(obligation).await?; + let market_accs = klend_client + .fetch_market_and_reserves(&ob.lending_market) + .await?; + let mut reserves = market_accs.reserves; + let market = &market_accs.lending_market; + // todo - don't load all + let rts = klend_client.fetch_referrer_token_states().await?; + + let clock = sysvars::clock(&klend_client.client.client).await; + + // Pick debt and coll reserves to liquidate + let debt_res_key = ob.borrows[0].borrow_reserve; + let coll_res_key = ob.deposits[0].deposit_reserve; + + // Refresh reserves and obligation + operations::refresh_reserves_and_obligation( + klend_client, + &debt_res_key, + &coll_res_key, + obligation, + &mut ob, + &mut reserves, + &rts, + market, + &clock, + ) + .await?; + + // Now it's all fully refreshed and up to date + let debt_reserve_state = *reserves.get(&debt_res_key).unwrap(); + let coll_reserve_state = *reserves.get(&coll_res_key).unwrap(); + let debt_mint = debt_reserve_state.liquidity.mint_pubkey; + let debt_reserve = StateWithKey::new(debt_reserve_state, debt_res_key); + let coll_reserve = StateWithKey::new(coll_reserve_state, coll_res_key); + let lending_market = StateWithKey::new(*market, ob.lending_market); + let obligation = StateWithKey::new(ob, *obligation); + let pxs = fetch_jup_prices(&[debt_mint], &rebalance_config.usdc_mint, 100.0).await?; + let holdings = klend_client + .liquidator + .fetch_holdings(&klend_client.client.client, &reserves, &pxs) + .await?; + + let deposit_reserves: Vec> = ob + .deposits + .iter() + .filter(|coll| coll.deposit_reserve != Pubkey::default()) + .map(|coll| { + StateWithKey::new( + *reserves.get(&coll.deposit_reserve).unwrap(), + coll.deposit_reserve, + ) + }) + .collect(); + + let max_allowed_ltv_override_pct_opt = Some(10); + let liquidation_swap_slippage_pct = 0.5; + let min_acceptable_received_collateral_amount = 1; + let liquidation_strategy = math::decide_liquidation_strategy( + &rebalance_config.base_token, + &obligation, + &lending_market, + &coll_reserve, + &debt_reserve, + &clock, + max_allowed_ltv_override_pct_opt, + liquidation_swap_slippage_pct, + holdings, + )?; + + let (swap_amount, liquidate_amount) = match liquidation_strategy { + Some(LiquidationStrategy::LiquidateAndRedeem(liquidate_amount)) => (0, liquidate_amount), + Some(LiquidationStrategy::SwapThenLiquidate(swap_amount, liquidate_amount)) => { + (swap_amount, liquidate_amount) + } + None => (0, 0), + }; + + // Simulate liquidation + let res = kamino_lending::lending_market::lending_operations::liquidate_and_redeem( + &lending_market.state.borrow(), + &debt_reserve, + &coll_reserve, + &mut obligation.state.borrow_mut(), + &clock, + liquidate_amount, + min_acceptable_received_collateral_amount, + max_allowed_ltv_override_pct_opt, + deposit_reserves.into_iter(), + ); + + println!("Simulating the liquidation {:#?}", res); + + if res.is_ok() { + let user = klend_client.liquidator.wallet.pubkey(); + let base_mint = &rebalance_config.base_token; + + let mut ixns = vec![]; + let mut luts = vec![]; + + if swap_amount > 0 { + let jupiter_swap = get_best_swap_instructions( + base_mint, + &debt_mint, + swap_amount, + false, + Some((liquidation_swap_slippage_pct * 100.0) as u16), + None, + user, + &klend_client.client.client, + None, + None, + ) + .await + .unwrap(); + + let DecompiledVersionedTx { + lookup_tables, + instructions: jup_ixs, + } = jupiter_swap; + + // Filter compute budget ixns + let jup_ixs = jup_ixs + .into_iter() + .filter(|ix| ix.program_id != compute_budget::id()) + .collect_vec(); + + ixns.extend_from_slice(&jup_ixs); + + if let Some(lookup_tables) = lookup_tables { + for table in lookup_tables.into_iter() { + luts.push(table); + } + } + } + + let liquidate_ixns = klend_client + .liquidate_obligation_and_redeem_reserve_collateral_ixns( + lending_market, + debt_reserve, + coll_reserve, + obligation, + liquidate_amount, + min_acceptable_received_collateral_amount, + max_allowed_ltv_override_pct_opt, + ) + .await + .unwrap(); + ixns.extend_from_slice(&liquidate_ixns); + + // TODO: add compute budget + prio fees + let mut txn = klend_client.client.tx_builder().add_ixs(ixns.clone()); + for lut in luts { + txn = txn.add_lookup_table(lut); + } + + let txn_b64 = txn.to_base64(); + println!( + "Simulation: https://explorer.solana.com/tx/inspector?message={}", + urlencoding::encode(&txn_b64) + ); + + let txn = txn.build_with_budget_and_fee(&[]).await.unwrap(); + + let res = klend_client + .client + .client + .simulate_transaction(&txn) + .await + .unwrap(); + info!("Simulation result: {:?}", res); + + for ix in ixns { + println!("Instruction: {:?} {:?}", ix.program_id, ix.data); + } + + let should_send = false; + + if should_send { + let sig = klend_client + .client + .send_and_confirm_transaction(txn) + .await + .unwrap(); + + info!("Liquidation tx sent: {:?}", sig.0); + info!("Liquidation tx res: {:?}", sig.1); + } + } + Ok(()) +} + +async fn crank(klend_client: &KlendClient, obligation_filter: Option) -> Result<()> { + let sleep_duration = Duration::from_secs(10); + let (markets, ob) = match obligation_filter { + None => { + let lending_markets = get_lending_markets(&klend_client.program_id).await?; + info!("Cranking all markets {lending_markets:?}.."); + (lending_markets, None) + } + Some(filter) => { + let ob = klend_client.fetch_obligation(&filter).await?; + let market = ob.lending_market; + (vec![market], Some(ob)) + } + }; + + loop { + for market in &markets { + info!("{} cranking market", market.to_string().green()); + let st = std::time::Instant::now(); + let clock = sysvars::get_clock(&klend_client.client.client) + .await + .unwrap(); + + let start = std::time::Instant::now(); + + // Reload accounts + let obligations = match ob { + None => { + let obs = klend_client.fetch_obligations(market).await?; + info!( + "Fetched {} obligations in {}s", + obs.len(), + start.elapsed().as_secs() + ); + obs + } + Some(o) => vec![(obligation_filter.unwrap(), o)], + }; + let market_accs = klend_client.fetch_market_and_reserves(market).await?; + let rts = klend_client.fetch_referrer_token_states().await?; + info!("Market accounts fetched in {}s", start.elapsed().as_secs()); + + let mut reserves = market_accs.reserves.clone(); + let lending_market = market_accs.lending_market; + // let obligations = obligations.clone(); + + let OracleAccounts { + mut pyth_accounts, + mut switchboard_accounts, + mut scope_price_accounts, + } = oracle_accounts(&klend_client.client, &reserves) + .await + .unwrap(); + + let pyth_account_infos = map_accounts_and_create_infos(&mut pyth_accounts); + let switchboard_feed_infos = map_accounts_and_create_infos(&mut switchboard_accounts); + let scope_price_infos = map_accounts_and_create_infos(&mut scope_price_accounts); + + // Refresh all reserves first + for (key, reserve) in reserves.iter_mut() { + info!( + "Refreshing reserve {} token {} with status {}", + key.to_string().green(), + reserve.config.token_info.symbol().purple(), + reserve.config.status + ); + // if reserve.config.status != ReserveStatus::Active as u8 { + // continue; + // } + let ignore_tokens = ["EURC", "CHAI"]; + if ignore_tokens.contains(&reserve.config.token_info.symbol()) { + continue; + } + operations::refresh_reserve( + key, + reserve, + &lending_market, + &clock, + &pyth_account_infos, + &switchboard_feed_infos, + &scope_price_infos, + ) + .unwrap(); + } + + // Refresh all obligations second + let SplitObligations { + zero_debt, + mut risky, + } = split_obligations(&obligations); + let num_obligations = risky.len(); + + info!("Total obligations: {}", risky.len() + zero_debt.len()); + info!("Zero debt obligations: {}", zero_debt.len()); + info!("Risky obligations: {}", risky.len()); + + let mut healthy_obligations = 0; + let mut unhealthy_obligations = 0; + for (i, (address, obligation)) in risky.iter_mut().enumerate() { + // Apply the filter + if let Some(obligation_filter) = obligation_filter { + if *address != obligation_filter { + continue; + } + } + info!("Processing obligation {:?}", address); + + // Refresh the obligation + let ObligationReserves { + deposit_reserves, + borrow_reserves, + } = obligation_reserves(obligation, &reserves)?; + let referrer_states = referrer_token_states_of_obligation( + address, + obligation, + &borrow_reserves, + &rts, + )?; + kamino_lending::lending_market::lending_operations::refresh_obligation( + obligation, + &lending_market, + clock.slot, + deposit_reserves.into_iter(), + borrow_reserves.into_iter(), + referrer_states.into_iter(), + )?; + + info!("Refreshed obligation: {}", address.to_string().green()); + let obligation_stats = math::obligation_info(address, obligation); + math::print_obligation_stats(&obligation_stats, address, i, num_obligations); + + if obligation_stats.ltv > obligation_stats.unhealthy_ltv { + unhealthy_obligations += 1; + } else { + healthy_obligations += 1; + } + } + + let en = st.elapsed().as_secs_f64(); + info!( + "{} evaluated {} total obligations {} with debt, {} healthy, {} unhealthy. Sleeping for {:?}, duration {:?}", market.to_string().green(), risky.len() + zero_debt.len(), num_obligations, healthy_obligations, unhealthy_obligations, sleep_duration, en + ); + } + sleep(sleep_duration).await; + } +} diff --git a/terminator/src/math.rs b/terminator/src/math.rs new file mode 100644 index 0000000..6178643 --- /dev/null +++ b/terminator/src/math.rs @@ -0,0 +1,207 @@ +use anchor_lang::prelude::Pubkey; +use anyhow::Result; +use colored::Colorize; +use kamino_lending::{utils::Fraction, LiquidationParams, Obligation}; +use tracing::{debug, info}; + +use crate::{liquidator::Holdings, model::StateWithKey}; + +#[derive(Debug)] +pub enum LiquidationStrategy { + LiquidateAndRedeem(u64), + SwapThenLiquidate(u64, u64), +} + +pub struct ObligationInfo { + pub borrowed_amount: Fraction, + pub deposited_amount: Fraction, + pub ltv: Fraction, + pub unhealthy_ltv: Fraction, +} + +pub fn obligation_info(address: &Pubkey, obligation: &Obligation) -> ObligationInfo { + let borrowed_amount = Fraction::from_bits(obligation.borrow_factor_adjusted_debt_value_sf); + let deposited_amount = Fraction::from_bits(obligation.deposited_value_sf); + + let (ltv, unhealthy_ltv) = if borrowed_amount > 0 && deposited_amount == 0 { + info!("Obligation {address} has bad debt: {:?}", obligation); + (Fraction::ZERO, Fraction::ZERO) + } else if deposited_amount > 0 || borrowed_amount > 0 { + ( + obligation.loan_to_value(), + obligation.unhealthy_loan_to_value(), + ) + } else { + (Fraction::ZERO, Fraction::ZERO) + }; + + ObligationInfo { + borrowed_amount, + deposited_amount, + ltv, + unhealthy_ltv, + } +} + +pub fn print_obligation_stats( + obl_info: &ObligationInfo, + address: &Pubkey, + i: usize, + num_obligations: usize, +) { + let ObligationInfo { + borrowed_amount, + deposited_amount, + ltv, + unhealthy_ltv, + } = obl_info; + + let is_liquidatable = ltv > unhealthy_ltv; + let msg = format!( + "{}/{} obligation: {}, healthy: {}, LTV: {:?}%/{:?}%, deposited: {} borrowed: {}", + i + 1, + num_obligations, + address.to_string().green(), + if is_liquidatable { + "NO".red() + } else { + "YES".green() + }, + ltv * 100, + unhealthy_ltv * 100, + deposited_amount, + borrowed_amount + ); + if is_liquidatable { + info!("{}", msg); + } else { + debug!("{}", msg); + } +} + +#[allow(clippy::too_many_arguments)] +pub fn decide_liquidation_strategy( + base_mint: &Pubkey, + obligation: &StateWithKey, + lending_market: &StateWithKey, + coll_reserve: &StateWithKey, + debt_reserve: &StateWithKey, + clock: &anchor_lang::prelude::Clock, + max_allowed_ltv_override_pct_opt: Option, + liquidation_swap_slippage_pct: f64, + holdings: Holdings, +) -> Result> { + let debt_res_key = debt_reserve.key; + + // Calculate what is possible first + let LiquidationParams { user_ltv, .. } = + kamino_lending::liquidation_operations::get_liquidation_params( + &lending_market.state.borrow(), + &coll_reserve.state.borrow(), + &debt_reserve.state.borrow(), + &obligation.state.borrow(), + clock.slot, + true, // todo actually check if this is true + true, // todo actually check if this is true + max_allowed_ltv_override_pct_opt, + )?; + + let obligation_state = obligation.state.borrow(); + let lending_market = lending_market.state.borrow(); + let (debt_liquidity, _) = obligation_state + .find_liquidity_in_borrows(debt_res_key) + .unwrap(); + + let full_debt_amount_f = Fraction::from_bits(debt_liquidity.borrowed_amount_sf); + let full_debt_mv_f = Fraction::from_bits(debt_liquidity.market_value_sf); + + let liquidatable_debt = + kamino_lending::liquidation_operations::max_liquidatable_borrowed_amount( + &obligation_state, + lending_market.liquidation_max_debt_close_factor_pct, + lending_market.max_liquidatable_debt_market_value_at_once, + debt_liquidity, + user_ltv, + lending_market.insolvency_risk_unhealthy_ltv_pct, + ) + .min(full_debt_amount_f); + + let liquidation_ratio = liquidatable_debt / full_debt_amount_f; + + // This is what is possible, liquidatable/repayable debt in lamports and in $ terms + let liqidatable_amount: u64 = liquidatable_debt.to_num(); + let liquidable_mv = liquidation_ratio * full_debt_mv_f; + + // Compare to what we have already + let debt_mint = &debt_reserve.state.borrow().liquidity.mint_pubkey; + + let debt_holding = holdings.holding_of(debt_mint).unwrap(); + let base_holding = holdings.holding_of(base_mint).unwrap(); + + // Always assume we are fully rebalanced otherwise it's very hard to decide + let decision = if debt_mint == base_mint { + // liquidate as much as we have / is possible + let debt_holding_balance = debt_holding.balance; + let liquidate_amount = debt_holding_balance.min(liqidatable_amount); + + info!( + "LiquidateAndRedeem math nums + liquidate_amount: {liquidate_amount} + debt_holding.balance: {debt_holding_balance} + liquidatable_amount: {liqidatable_amount}," + ); + + Some(LiquidationStrategy::LiquidateAndRedeem(liquidate_amount)) + } else { + // Swap base token to debt token then liquidate + // compare market values, add slippage, then swap base token + slippage into debt token + let holding_mv = base_holding.usd_value; + let liquidable_mv: f64 = liquidable_mv.to_num(); + + // Adjust by slippage how much we would have if we had to swap + let holding_mv = holding_mv * (1.0 - liquidation_swap_slippage_pct / 100.0); + + // Liquidate as much as possible (the lowest of holding or liquidatable in $ terms) + let liquidation_mv = holding_mv.min(liquidable_mv); + + // Decide on the final amount + let ratio = liquidation_mv / holding_mv; + let swap_amount = (base_holding.balance as f64 * ratio) as u64; + let liquidate_amount = (liqidatable_amount as f64 * ratio) as u64; + + info!( + "SwapAndLiquidate math nums + holding_mv: {holding_mv}, + liquidable_mv: {liquidable_mv}, + liquidation_mv: {liquidation_mv}, + ratio: {ratio}, + swap_amount: {swap_amount}, + liquidate_amount: {liquidate_amount}" + ); + + Some(LiquidationStrategy::SwapThenLiquidate( + swap_amount, + liquidate_amount, + )) + + // TODO: what if we have barely anything? + // need to do flash loans + }; + + // Print everything such that we can debug later how the decision was made + info!( + "Liquidation decision: {decision:?}, + full_debt_amount: {full_debt_amount_f}, + full_debt_mv: {full_debt_mv_f}, + liquidatable_debt: {liquidatable_debt}, + liquidation_ratio: {liquidation_ratio}, + liqidatable_amount: {liqidatable_amount}, + liquidable_mv: {liquidable_mv}, + debt_holding: {debt_holding:?}, + base_holding: {base_holding:?}, + liquidation_swap_slippage_pct: {liquidation_swap_slippage_pct} + " + ); + + Ok(decision) +} diff --git a/terminator/src/model.rs b/terminator/src/model.rs new file mode 100644 index 0000000..98f557e --- /dev/null +++ b/terminator/src/model.rs @@ -0,0 +1,35 @@ +use std::{ + cell::{Ref, RefCell, RefMut}, + rc::Rc, +}; + +use anchor_lang::prelude::Pubkey; +use kamino_lending::utils::AnyAccountLoader; + +#[derive(Default, Clone)] +pub struct StateWithKey { + pub key: Pubkey, + pub state: Rc>, +} + +impl StateWithKey { + pub fn new(state: T, key: Pubkey) -> Self { + Self { + key, + state: Rc::new(RefCell::new(state)), + } + } +} + +impl AnyAccountLoader<'_, T> for StateWithKey { + fn get_mut(&self) -> anchor_lang::Result> { + Ok(RefMut::map(self.state.borrow_mut(), |state| state)) + } + fn get(&self) -> anchor_lang::Result> { + Ok(Ref::map(self.state.borrow(), |state| state)) + } + + fn get_pubkey(&self) -> Pubkey { + self.key + } +} diff --git a/terminator/src/operations.rs b/terminator/src/operations.rs new file mode 100644 index 0000000..07e0b2f --- /dev/null +++ b/terminator/src/operations.rs @@ -0,0 +1,287 @@ +use std::collections::HashMap; + +use anchor_client::solana_sdk::{account_info::AccountInfo, clock::Clock, pubkey::Pubkey}; +use anyhow::Result; +use colored::Colorize; +use kamino_lending::{ + utils::seeds::BASE_SEED_REFERRER_TOKEN_STATE, LendingMarket, Obligation, ReferrerTokenState, + Reserve, +}; +use tracing::{info, warn}; + +use crate::{ + accounts::{map_accounts_and_create_infos, oracle_accounts, OracleAccounts}, + client::KlendClient, + model::StateWithKey, +}; + +pub fn refresh_reserve<'a>( + key: &Pubkey, + reserve: &mut Reserve, + lending_market: &LendingMarket, + clock: &Clock, + pyth_account_infos: &HashMap>, + switchboard_feed_infos: &HashMap>, + scope_price_infos: &HashMap>, +) -> Result<()> { + if kamino_lending::lending_market::lending_operations::is_price_refresh_needed( + reserve, + lending_market, + clock.unix_timestamp, + ) { + let pyth_oracle = if reserve.config.token_info.pyth_configuration.is_enabled() { + Some( + pyth_account_infos + .get(&reserve.config.token_info.pyth_configuration.price) + .unwrap(), + ) + } else { + None + }; + + let switchboard_price_oracle = if reserve + .config + .token_info + .switchboard_configuration + .is_enabled() + { + Some( + switchboard_feed_infos + .get( + &reserve + .config + .token_info + .switchboard_configuration + .price_aggregator, + ) + .unwrap(), + ) + } else { + None + }; + + let switchboard_twap_oracle = if reserve + .config + .token_info + .switchboard_configuration + .is_enabled() + { + Some( + switchboard_feed_infos + .get( + &reserve + .config + .token_info + .switchboard_configuration + .twap_aggregator, + ) + .unwrap(), + ) + } else { + None + }; + + let scope_prices = if reserve.config.token_info.scope_configuration.is_enabled() { + Some( + scope_price_infos + .get(&reserve.config.token_info.scope_configuration.price_feed) + .unwrap(), + ) + } else { + None + }; + + reserve.config.token_info.validate_token_info_config( + pyth_oracle, + switchboard_price_oracle, + switchboard_twap_oracle, + scope_prices, + )?; + + let px = kamino_lending::utils::prices::get_price( + &reserve.config.token_info, + pyth_oracle, + switchboard_price_oracle, + switchboard_twap_oracle, + scope_prices, + clock.unix_timestamp, + )?; + + kamino_lending::lending_market::lending_operations::refresh_reserve( + reserve, + clock, + px, + lending_market.referral_fee_bps, + )?; + } + + info!( + "{} {} reserve refreshed", + reserve.config.token_info.symbol().purple(), + key.to_string().bright_blue() + ); + + Ok(()) +} + +pub struct ObligationReserves { + pub borrow_reserves: Vec>, + pub deposit_reserves: Vec>, +} + +pub fn obligation_reserves( + obligation: &Obligation, + reserve_states: &HashMap, +) -> Result { + let mut deposit_reserves: Vec> = vec![]; + for deposit in obligation.deposits.iter() { + if deposit.deposit_reserve != Pubkey::default() { + let res = reserve_states + .get(&deposit.deposit_reserve) + .ok_or(anyhow::anyhow!( + "Obligation deposit reserve {:?} not found from {:?}", + deposit.deposit_reserve, + reserve_states.keys() + ))?; + deposit_reserves.push(StateWithKey::new(*res, deposit.deposit_reserve)); + } + } + + let mut borrow_reserves: Vec> = vec![]; + for borrow in obligation.borrows.iter() { + if borrow.borrow_reserve != Pubkey::default() { + let res = reserve_states + .get(&borrow.borrow_reserve) + .ok_or(anyhow::anyhow!( + "Obligation borrow reserve {:?} not found from {:?}", + borrow.borrow_reserve, + reserve_states.keys() + ))?; + borrow_reserves.push(StateWithKey::new(*res, borrow.borrow_reserve)); + } + } + + Ok(ObligationReserves { + deposit_reserves, + borrow_reserves, + }) +} + +pub struct SplitObligations { + pub zero_debt: Vec<(Pubkey, Obligation)>, + pub risky: Vec<(Pubkey, Obligation)>, +} + +pub fn split_obligations(obligations: &[(Pubkey, Obligation)]) -> SplitObligations { + let (zero_debt, risky) = obligations + .iter() + .partition(|(_, obligation)| obligation.has_debt == 0); + + SplitObligations { risky, zero_debt } +} + +#[allow(clippy::too_many_arguments)] +pub async fn refresh_reserves_and_obligation( + klend_client: &KlendClient, + debt_res_key: &Pubkey, + coll_res_key: &Pubkey, + obligation_addr: &Pubkey, + obligation_state: &mut Obligation, + reserves: &mut HashMap, + referrer_token_states: &HashMap, + lending_market: &LendingMarket, + clock: &Clock, +) -> Result<()> { + let OracleAccounts { + mut pyth_accounts, + mut switchboard_accounts, + mut scope_price_accounts, + } = oracle_accounts(&klend_client.client, reserves).await?; + + let pyth_account_infos = map_accounts_and_create_infos(&mut pyth_accounts); + let switchboard_feed_infos = map_accounts_and_create_infos(&mut switchboard_accounts); + let scope_price_infos = map_accounts_and_create_infos(&mut scope_price_accounts); + + // Refresh reserves and obligation + { + let debt_reserve_state = reserves.get_mut(debt_res_key).unwrap(); + refresh_reserve( + debt_res_key, + debt_reserve_state, + lending_market, + clock, + &pyth_account_infos, + &switchboard_feed_infos, + &scope_price_infos, + )?; + } + + { + let coll_reserve_state = reserves.get_mut(coll_res_key).unwrap(); + refresh_reserve( + coll_res_key, + coll_reserve_state, + lending_market, + clock, + &pyth_account_infos, + &switchboard_feed_infos, + &scope_price_infos, + )?; + } + + let ObligationReserves { + borrow_reserves, + deposit_reserves, + } = obligation_reserves(obligation_state, reserves)?; + let referrer_states = referrer_token_states_of_obligation( + obligation_addr, + obligation_state, + &borrow_reserves, + referrer_token_states, + )?; + + kamino_lending::lending_market::lending_operations::refresh_obligation( + obligation_state, + lending_market, + clock.slot, + deposit_reserves.into_iter(), + borrow_reserves.into_iter(), + referrer_states.into_iter(), + )?; + Ok(()) +} + +pub fn referrer_token_states_of_obligation( + obligation_addr: &Pubkey, + obligation: &Obligation, + obligation_borrow_reserves: &Vec>, + referrer_token_states: &HashMap, +) -> Result>> { + let rts = if obligation.has_referrer() { + let mut rts = Vec::new(); + let referrer = obligation.referrer; + for reserve in obligation_borrow_reserves { + let (key, _) = Pubkey::find_program_address( + &[ + BASE_SEED_REFERRER_TOKEN_STATE, + referrer.as_ref(), + reserve.state.borrow().liquidity.mint_pubkey.as_ref(), + ], + &kamino_lending::ID, + ); + match referrer_token_states.get(&key) { + Some(acc) => rts.push(StateWithKey::new(*acc, key)), + None => { + warn!( + "Obligation {:?} referrer token state {:?} not found", + obligation_addr, key, + ) + } + } + } + rts + } else { + vec![] + }; + Ok(rts) +} diff --git a/terminator/src/px.rs b/terminator/src/px.rs new file mode 100644 index 0000000..523a0d2 --- /dev/null +++ b/terminator/src/px.rs @@ -0,0 +1,33 @@ +use std::{collections::HashMap, str::FromStr}; + +use anchor_lang::prelude::Pubkey; +use anyhow::Result; +use juno::SwapPrice; +use tracing::info; + +pub struct Prices { + pub prices: HashMap, +} + +impl Prices { + pub fn a_to_b(&self, a: &Pubkey, b: &Pubkey) -> f64 { + info!("Getting price of {} to {}", a, b); + let a_price = self.prices.get(a).unwrap(); + let b_price = self.prices.get(b).unwrap(); + + a_price / b_price + } +} + +pub async fn fetch_jup_prices( + input_mints: &[Pubkey], + output_mint: &Pubkey, + amount: f32, +) -> Result { + let raw_prices = juno::get_prices(input_mints, output_mint, amount).await?; + let mut prices: HashMap = HashMap::new(); + for (mint, SwapPrice { price, .. }) in raw_prices { + prices.insert(Pubkey::from_str(&mint).unwrap(), price as f64); + } + Ok(Prices { prices }) +} diff --git a/terminator/src/sysvars.rs b/terminator/src/sysvars.rs new file mode 100644 index 0000000..43c92ca --- /dev/null +++ b/terminator/src/sysvars.rs @@ -0,0 +1,15 @@ +use anchor_lang::{prelude::Clock, solana_program::sysvar::SysvarId}; +use anyhow::Result; +use orbit_link::async_client::AsyncClient; + +/// Get current clock +pub async fn get_clock(rpc: &impl AsyncClient) -> Result { + let clock = rpc.get_account(&Clock::id()).await?.deserialize_data()?; + + Ok(clock) +} + +/// Get current clock +pub async fn clock(rpc: &impl AsyncClient) -> Clock { + get_clock(rpc).await.unwrap() +} diff --git a/terminator/src/utils.rs b/terminator/src/utils.rs new file mode 100644 index 0000000..5fa9b69 --- /dev/null +++ b/terminator/src/utils.rs @@ -0,0 +1,22 @@ +use std::collections::HashMap; + +use anchor_lang::prelude::Pubkey; +use kamino_lending::Reserve; + +use crate::accounts::MarketAccounts; + +pub fn get_all_reserve_mints( + market_accounts: &HashMap, +) -> (HashMap, Vec, Vec) { + let mut all_reserves = HashMap::new(); + let mut c_mints = Vec::new(); + let mut l_mints = Vec::new(); + for (_, market_account) in market_accounts.iter() { + for (_, reserve) in market_account.reserves.iter() { + all_reserves.insert(reserve.liquidity.mint_pubkey, *reserve); + c_mints.push(reserve.collateral.mint_pubkey); + l_mints.push(reserve.liquidity.mint_pubkey); + } + } + (all_reserves, c_mints, l_mints) +}