diff --git a/Cargo.lock b/Cargo.lock index dca3b1a..1e7b482 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -307,24 +307,12 @@ version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" -[[package]] -name = "arc-swap" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b3d0060af21e8d11a926981cc00c6c1541aa91dd64b9f881985c3da1094425f" - [[package]] name = "arrayref" version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" -[[package]] -name = "arrayvec" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" - [[package]] name = "arrayvec" version = "0.7.4" @@ -340,7 +328,7 @@ dependencies = [ "asn1-rs-derive", "asn1-rs-impl", "displaydoc", - "nom 7.1.3", + "nom", "num-traits", "rusticata-macros", "thiserror", @@ -496,18 +484,6 @@ 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.0" @@ -515,7 +491,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0231f06152bf547e9c2b5194f247cd97aacf6dcd8b15d8e5ec0663f64580da87" dependencies = [ "arrayref", - "arrayvec 0.7.4", + "arrayvec", "cc", "cfg-if", "constant_time_eq", @@ -553,7 +529,7 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15bf3650200d8bffa99015595e10f1fbd17de07abbc25bb067da79e769939bfa" dependencies = [ - "borsh-derive 0.9.3", + "borsh-derive", "hashbrown 0.11.2", ] @@ -563,7 +539,6 @@ version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f58b559fd6448c6e2fd0adb5720cd98a2506594cafa4737ff98c396f3e82f667" dependencies = [ - "borsh-derive 1.3.1", "cfg_aliases", ] @@ -580,20 +555,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "borsh-derive" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aadb5b6ccbd078890f6d7003694e33816e6b784358f18e15e7e6d9f065a57cd" -dependencies = [ - "once_cell", - "proc-macro-crate 3.1.0", - "proc-macro2 1.0.78", - "quote 1.0.35", - "syn 2.0.52", - "syn_derive", -] - [[package]] name = "borsh-derive-internal" version = "0.9.3" @@ -665,28 +626,6 @@ dependencies = [ "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 1.0.78", - "quote 1.0.35", - "syn 1.0.109", -] - [[package]] name = "bytemuck" version = "1.14.3" @@ -904,17 +843,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "cron" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f8c3e73077b4b4a6ab1ea5047c37c57aee77657bc8ecd6f29b0af082d0b0c07" -dependencies = [ - "chrono", - "nom 7.1.3", - "once_cell", -] - [[package]] name = "crossbeam-channel" version = "0.5.12" @@ -998,19 +926,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "dashmap" -version = "5.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" -dependencies = [ - "cfg-if", - "hashbrown 0.14.3", - "lock_api", - "once_cell", - "parking_lot_core", -] - [[package]] name = "data-encoding" version = "2.5.0" @@ -1034,7 +949,7 @@ checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" dependencies = [ "asn1-rs", "displaydoc", - "nom 7.1.3", + "nom", "num-bigint 0.4.4", "num-traits", "rusticata-macros", @@ -1144,8 +1059,8 @@ dependencies = [ [[package]] name = "drift" -version = "2.67.0" -source = "git+https://github.com/drift-labs/protocol-v2.git?tag=v2.67.0#90cb797f1051ee60fd8db024e288a08fcda7e296" +version = "2.71.0" +source = "git+https://github.com/drift-labs/protocol-v2.git?tag=v2.71.0#7df812dc26f590fd96f8623de0a93faf471d2193" dependencies = [ "anchor-lang", "anchor-spl", @@ -1155,7 +1070,6 @@ dependencies = [ "bytemuck", "drift-macros", "enumflags2", - "getrandom 0.2.12", "num-derive", "num-integer", "num-traits", @@ -1165,7 +1079,7 @@ dependencies = [ "solana-program", "solana-security-txt", "static_assertions", - "switchboard-solana", + "switchboard", "thiserror", "uint", ] @@ -1365,30 +1279,12 @@ dependencies = [ "termcolor", ] -[[package]] -name = "envy" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f47e0157f2cb54f5ae1bd371b30a2ae4311e1c028f575cd4e81de7353215965" -dependencies = [ - "serde", -] - [[package]] name = "equivalent" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" -[[package]] -name = "erased-serde" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388979d208a049ffdfb22fa33b9c81942215b940910bccfe258caeb25d125cb3" -dependencies = [ - "serde", -] - [[package]] name = "errno" version = "0.3.8" @@ -1467,12 +1363,6 @@ dependencies = [ "percent-encoding", ] -[[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" @@ -1696,9 +1586,6 @@ name = "hex" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" -dependencies = [ - "serde", -] [[package]] name = "hex-literal" @@ -2017,34 +1904,12 @@ dependencies = [ "cpufeatures", ] -[[package]] -name = "kv-log-macro" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" -dependencies = [ - "log", -] - [[package]] name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -[[package]] -name = "lexical-core" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6607c62aa161d23d17a9072cc5da0be67cdfc89d3afb1e8d9c842bebc2525ffe" -dependencies = [ - "arrayvec 0.5.2", - "bitflags 1.3.2", - "cfg-if", - "ryu", - "static_assertions", -] - [[package]] name = "lib-sokoban" version = "0.3.0" @@ -2159,9 +2024,6 @@ name = "log" version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" -dependencies = [ - "value-bag", -] [[package]] name = "memchr" @@ -2270,17 +2132,6 @@ dependencies = [ "memoffset 0.6.5", ] -[[package]] -name = "nom" -version = "5.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08959a387a676302eebf4ddbcbc611da04285579f76f88ee0506c63b1a61dd4b" -dependencies = [ - "lexical-core", - "memchr", - "version_check", -] - [[package]] name = "nom" version = "7.1.3" @@ -2666,39 +2517,7 @@ 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 1.0.78", - "quote 1.0.35", - "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 1.0.78", - "quote 1.0.35", - "version_check", + "toml_edit", ] [[package]] @@ -2719,26 +2538,6 @@ 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 1.0.78", - "quote 1.0.35", - "syn 1.0.109", -] - [[package]] name = "pyth" version = "0.1.0" @@ -2835,12 +2634,6 @@ dependencies = [ "proc-macro2 1.0.78", ] -[[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" @@ -3002,15 +2795,6 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" -[[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.24" @@ -3087,35 +2871,6 @@ dependencies = [ "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 1.0.78", - "quote 1.0.35", - "syn 1.0.109", -] - [[package]] name = "rpassword" version = "6.0.1" @@ -3128,22 +2883,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "rust_decimal" -version = "1.34.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b39449a79f45e8da28c57c341891b69a183044b29518bb8f86dbac9df60bb7df" -dependencies = [ - "arrayvec 0.7.4", - "borsh 1.3.1", - "bytes", - "num-traits", - "rand 0.8.5", - "rkyv", - "serde", - "serde_json", -] - [[package]] name = "rustc-demangle" version = "0.1.23" @@ -3171,7 +2910,7 @@ version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632" dependencies = [ - "nom 7.1.3", + "nom", ] [[package]] @@ -3294,12 +3033,6 @@ dependencies = [ "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.9.2" @@ -3358,15 +3091,6 @@ dependencies = [ "syn 2.0.52", ] -[[package]] -name = "serde_fmt" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d4ddca14104cd60529e8c7f7ba71a2c8acd8f7f5cfcdc2faf97eeb7c3010a4" -dependencies = [ - "serde", -] - [[package]] name = "serde_json" version = "1.0.114" @@ -3425,15 +3149,6 @@ dependencies = [ "without-alloc", ] -[[package]] -name = "sgx-quote" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1640577af7b81d10db340c4b31006b77972e3918f351eec4e65c389c8b58e21" -dependencies = [ - "nom 5.1.3", -] - [[package]] name = "sha-1" version = "0.10.1" @@ -3569,12 +3284,6 @@ 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 = "sized-chunks" version = "0.6.5" @@ -3933,7 +3642,7 @@ dependencies = [ "bitflags 1.3.2", "blake3", "borsh 0.9.3", - "borsh-derive 0.9.3", + "borsh-derive", "bs58 0.4.0", "bv", "bytemuck", @@ -4328,143 +4037,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] -name = "superslice" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab16ced94dbd8a46c82fd81e3ed9a8727dac2977ea869d217bcc4ea1f122e81f" - -[[package]] -name = "sval" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82a2386bea23a121e4e72450306b1dd01078b6399af11b93897bf84640a28a59" - -[[package]] -name = "sval_buffer" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16c047898a0e19002005512243bc9ef1c1037aad7d03d6c594e234efec80795" -dependencies = [ - "sval", - "sval_ref", -] - -[[package]] -name = "sval_dynamic" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a74fb116e2ecdcb280b0108aa2ee4434df50606c3208c47ac95432730eaac20c" -dependencies = [ - "sval", -] - -[[package]] -name = "sval_fmt" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10837b4f0feccef271b2b1c03784e08f6d0bb6d23272ec9e8c777bfadbb8f1b8" -dependencies = [ - "itoa", - "ryu", - "sval", -] - -[[package]] -name = "sval_json" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891f5ecdf34ce61a8ab2d10f9cfdc303347b0afec4dad6702757419d2d8312a9" -dependencies = [ - "itoa", - "ryu", - "sval", -] - -[[package]] -name = "sval_nested" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63fcffb4b79c531f38e3090788b64f3f4d54a180aacf02d69c42fa4e4bf284c3" -dependencies = [ - "sval", - "sval_buffer", - "sval_ref", -] - -[[package]] -name = "sval_ref" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af725f9c2aa7cec4ca9c47da2cc90920c4c82d3fa537094c66c77a5459f5809d" -dependencies = [ - "sval", -] - -[[package]] -name = "sval_serde" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d7589c649a03d21df40b9a926787d2c64937fa1dccec8d87c6cd82989a2e0a4" -dependencies = [ - "serde", - "sval", - "sval_nested", -] - -[[package]] -name = "switchboard-common" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c96fe58be35530580b729fa5d846661c89a007982527f4ff0ca6010168564159" -dependencies = [ - "async-trait", - "base64 0.21.7", - "envy", - "futures", - "getrandom 0.2.12", - "hex", - "log", - "serde", - "serde_json", - "sgx-quote", - "sha2 0.10.8", - "sha3 0.10.8", -] - -[[package]] -name = "switchboard-solana" -version = "0.27.98" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9294f92faac77f225977284b61baffe07c6f32c748c57871fcd277b3d9fa4369" +name = "switchboard" +version = "0.1.0" +source = "git+https://github.com/drift-labs/protocol-v2.git?tag=v2.71.0#7df812dc26f590fd96f8623de0a93faf471d2193" dependencies = [ - "anchor-client", "anchor-lang", - "anchor-spl", - "arc-swap", - "base64 0.21.7", - "bincode", - "bytemuck", - "chrono", - "cron", - "dashmap", - "futures", - "hex", - "kv-log-macro", - "log", - "rust_decimal", - "serde", - "serde_json", - "sgx-quote", - "sha2 0.10.8", - "solana-account-decoder", - "solana-address-lookup-table-program", - "solana-client", - "solana-program", - "superslice", - "switchboard-common", - "tokio", - "tokio-util", - "url", ] [[package]] @@ -4500,18 +4077,6 @@ dependencies = [ "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 1.0.78", - "quote 1.0.35", - "syn 2.0.52", -] - [[package]] name = "sync_wrapper" version = "0.1.2" @@ -4551,12 +4116,6 @@ dependencies = [ "libc", ] -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - [[package]] name = "tempfile" version = "3.10.1" @@ -4694,7 +4253,6 @@ dependencies = [ "signal-hook-registry", "socket2 0.5.6", "tokio-macros", - "tracing", "windows-sys 0.48.0", ] @@ -4791,7 +4349,6 @@ dependencies = [ "futures-core", "futures-sink", "pin-project-lite", - "slab", "tokio", "tracing", ] @@ -4822,17 +4379,6 @@ dependencies = [ "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.5", - "toml_datetime", - "winnow", -] - [[package]] name = "tower-service" version = "0.3.2" @@ -5039,48 +4585,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "uuid" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" - -[[package]] -name = "value-bag" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "126e423afe2dd9ac52142e7e9d5ce4135d7e13776c529d27fd6bc49f19e3280b" -dependencies = [ - "value-bag-serde1", - "value-bag-sval2", -] - -[[package]] -name = "value-bag-serde1" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ede32f342edc46e84bd41fd394ce2192b553de11725dd83b6223150610c21b44" -dependencies = [ - "erased-serde", - "serde", - "serde_fmt", -] - -[[package]] -name = "value-bag-sval2" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0024e44b25144c2f4d0ed35d39688e0090d57753e20fef38d08e0c1a40bdf23d" -dependencies = [ - "sval", - "sval_buffer", - "sval_dynamic", - "sval_fmt", - "sval_json", - "sval_ref", - "sval_serde", -] - [[package]] name = "vcpkg" version = "0.2.15" @@ -5422,15 +4926,6 @@ dependencies = [ "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" @@ -5442,7 +4937,7 @@ dependencies = [ "data-encoding", "der-parser", "lazy_static", - "nom 7.1.3", + "nom", "oid-registry", "rusticata-macros", "thiserror", diff --git a/Cargo.toml b/Cargo.toml index fc8f7dd..7ea2d5f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ test_utils = [] anchor-lang = "0.27.0" bytemuck = "1.13.0" base64 = "0.13" -drift = { git = "https://github.com/drift-labs/protocol-v2.git", tag = "v2.67.0", features = [ +drift = { git = "https://github.com/drift-labs/protocol-v2.git", tag = "v2.71.0", features = [ "mainnet-beta", ] } env_logger = "0.10.1" diff --git a/src/liquidation.rs b/src/liquidation.rs index 5bc45f2..14aaf3a 100644 --- a/src/liquidation.rs +++ b/src/liquidation.rs @@ -26,7 +26,7 @@ use drift::{ spot_market::SpotMarket, spot_market_map::SpotMarketMap, state::State, - user::{PerpPosition, SpotPosition, User}, + user::{MarketType, PerpPosition, SpotPosition, User}, }, }; use fnv::FnvHashSet; @@ -282,13 +282,18 @@ pub fn calculate_liquidation_price_inner( .get_ref(&market_index) .map_err(|err| SdkError::Anchor(Box::new(err.into())))?; + let max_confidence_interval_multiplier = perp_market.get_max_confidence_interval_multiplier().map_err(|err| SdkError::Anchor(Box::new(err.into())))?; + let (oracle_price_data, _oracle_validity) = oracle_map .get_price_data_and_validity( + MarketType::Perp, + perp_market.market_index, &perp_market.amm.oracle, perp_market .amm .historical_oracle_data .last_oracle_price_twap, + max_confidence_interval_multiplier, ) .map_err(|err| SdkError::Anchor(Box::new(err.into())))?;