diff --git a/.vscode/settings.json b/.vscode/settings.json index 2fb7fc685..0cfc88f74 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -69,5 +69,8 @@ "wsol", "WSOLATA" ], - "editor.formatOnSave": true + "editor.formatOnSave": true, + "rust-analyzer.linkedProjects": [ + "./programs/uxd/Cargo.toml" + ] } diff --git a/Cargo.lock b/Cargo.lock index 8214b9041..a2b40c4b2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -60,27 +60,16 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ - "getrandom 0.2.10", - "once_cell", - "version_check", -] - -[[package]] -name = "ahash" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" -dependencies = [ - "cfg-if", + "getrandom 0.2.7", "once_cell", "version_check", ] [[package]] name = "aho-corasick" -version = "1.0.2" +version = "0.7.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" dependencies = [ "memchr", ] @@ -114,10 +103,10 @@ checksum = "cf7d535e1381be3de2c0716c0a1c1e32ad9df1042cddcf7bc18d743569e53319" dependencies = [ "anchor-syn 0.26.0", "anyhow", - "proc-macro2 1.0.60", - "quote 1.0.28", + "proc-macro2 1.0.66", + "quote 1.0.31", "regex", - "syn 1.0.109", + "syn 1.0.99", ] [[package]] @@ -129,10 +118,10 @@ dependencies = [ "anchor-syn 0.26.0", "anyhow", "bs58 0.4.0", - "proc-macro2 1.0.60", - "quote 1.0.28", + "proc-macro2 1.0.66", + "quote 1.0.31", "rustversion", - "syn 1.0.109", + "syn 1.0.99", ] [[package]] @@ -142,8 +131,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1be64a48e395fe00b8217287f226078be2cf32dae42fdf8a885b997945c3d28" dependencies = [ "anchor-syn 0.26.0", - "proc-macro2 1.0.60", - "syn 1.0.109", + "proc-macro2 1.0.66", + "syn 1.0.99", ] [[package]] @@ -153,9 +142,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38ea6713d1938c0da03656ff8a693b17dc0396da66d1ba320557f07e86eca0d4" dependencies = [ "anchor-syn 0.26.0", - "proc-macro2 1.0.60", - "quote 1.0.28", - "syn 1.0.109", + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 1.0.99", ] [[package]] @@ -166,9 +155,9 @@ checksum = "d401f11efb3644285685f8339829a9786d43ed7490bb1699f33c478d04d5a582" dependencies = [ "anchor-syn 0.26.0", "anyhow", - "proc-macro2 1.0.60", - "quote 1.0.28", - "syn 1.0.109", + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 1.0.99", ] [[package]] @@ -180,9 +169,9 @@ dependencies = [ "anchor-syn 0.26.0", "anyhow", "heck 0.3.3", - "proc-macro2 1.0.60", - "quote 1.0.28", - "syn 1.0.109", + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 1.0.99", ] [[package]] @@ -193,9 +182,9 @@ checksum = "6ad769993b5266714e8939e47fbdede90e5c030333c7522d99a4d4748cf26712" dependencies = [ "anchor-syn 0.26.0", "anyhow", - "proc-macro2 1.0.60", - "quote 1.0.28", - "syn 1.0.109", + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 1.0.99", ] [[package]] @@ -206,9 +195,9 @@ checksum = "4e677fae4a016a554acdd0e3b7f178d3acafaa7e7ffac6b8690cf4e171f1c116" dependencies = [ "anchor-syn 0.26.0", "anyhow", - "proc-macro2 1.0.60", - "quote 1.0.28", - "syn 1.0.109", + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 1.0.99", ] [[package]] @@ -219,9 +208,9 @@ checksum = "340beef6809d1c3fcc7ae219153d981e95a8a277ff31985bd7050e32645dc9a8" dependencies = [ "anchor-syn 0.26.0", "anyhow", - "proc-macro2 1.0.60", - "quote 1.0.28", - "syn 1.0.109", + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 1.0.99", ] [[package]] @@ -241,7 +230,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03e8733d55b8492bde0d6f219c25769786758ff9e5e90a16e6a348f91284af50" dependencies = [ "anchor-idl", - "syn 1.0.109", + "syn 1.0.99", ] [[package]] @@ -252,7 +241,7 @@ checksum = "7092a50cf959ebf53460162cb07e88d4cc8ea7fa8c45292e80503a3186033daf" dependencies = [ "anchor-idl", "darling", - "syn 1.0.109", + "syn 1.0.99", ] [[package]] @@ -264,10 +253,10 @@ dependencies = [ "anchor-syn 0.24.2", "darling", "heck 0.4.1", - "proc-macro2 1.0.60", - "quote 1.0.28", + "proc-macro2 1.0.66", + "quote 1.0.31", "serde_json", - "syn 1.0.109", + "syn 1.0.99", ] [[package]] @@ -286,7 +275,7 @@ dependencies = [ "anchor-attribute-state", "anchor-derive-accounts", "arrayref", - "base64 0.13.1", + "base64 0.13.0", "bincode", "borsh 0.9.3", "bytemuck", @@ -315,13 +304,13 @@ dependencies = [ "anyhow", "bs58 0.3.1", "heck 0.3.3", - "proc-macro2 1.0.60", + "proc-macro2 1.0.66", "proc-macro2-diagnostics", - "quote 1.0.28", + "quote 1.0.31", "serde", "serde_json", "sha2 0.9.9", - "syn 1.0.109", + "syn 1.0.99", "thiserror", ] @@ -334,13 +323,13 @@ dependencies = [ "anyhow", "bs58 0.3.1", "heck 0.3.3", - "proc-macro2 1.0.60", + "proc-macro2 1.0.66", "proc-macro2-diagnostics", - "quote 1.0.28", + "quote 1.0.31", "serde", "serde_json", "sha2 0.9.9", - "syn 1.0.109", + "syn 1.0.99", "thiserror", ] @@ -370,21 +359,21 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.71" +version = "1.0.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +checksum = "1485d4d2cc45e7b201ee3767015c96faa5904387c9d87c6efdd0fb511f12d305" [[package]] name = "arrayref" -version = "0.3.7" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" +checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" [[package]] name = "arrayvec" -version = "0.7.3" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8868f09ff8cea88b079da74ae569d9b8c62a23c68c746240b704ee6f7525c89c" +checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" [[package]] name = "ascii" @@ -405,7 +394,7 @@ dependencies = [ "num-traits", "rusticata-macros", "thiserror", - "time 0.3.22", + "time 0.3.23", ] [[package]] @@ -414,9 +403,9 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" dependencies = [ - "proc-macro2 1.0.60", - "quote 1.0.28", - "syn 1.0.109", + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 1.0.99", "synstructure", ] @@ -426,9 +415,9 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" dependencies = [ - "proc-macro2 1.0.60", - "quote 1.0.28", - "syn 1.0.109", + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 1.0.99", ] [[package]] @@ -462,13 +451,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.68" +version = "0.1.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" +checksum = "a564d521dd56509c4c47480d00b80ee55f7e385ae48db5744c67ad50c92d2ebf" dependencies = [ - "proc-macro2 1.0.60", - "quote 1.0.28", - "syn 2.0.18", + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 2.0.26", ] [[package]] @@ -496,9 +485,9 @@ checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" [[package]] name = "base64" -version = "0.13.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] name = "base64" @@ -565,9 +554,9 @@ dependencies = [ [[package]] name = "blake3" -version = "1.4.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "729b71f35bd3fa1a4c86b85d32c8b9069ea7fe14f7a53cfabb65f62d4265b888" +checksum = "a08e53fc5a564bb15bfe6fae56bd71522205f1f91893f9c0116edad6496c183f" dependencies = [ "arrayref", "arrayvec", @@ -589,9 +578,9 @@ dependencies = [ [[package]] name = "block-buffer" -version = "0.10.4" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" dependencies = [ "generic-array", ] @@ -619,7 +608,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4114279215a005bc675e386011e594e1d9b800918cea18fcadadcce864a2046b" dependencies = [ "borsh-derive 0.10.3", - "hashbrown 0.13.2", + "hashbrown 0.12.3", ] [[package]] @@ -631,8 +620,8 @@ dependencies = [ "borsh-derive-internal 0.9.3", "borsh-schema-derive-internal 0.9.3", "proc-macro-crate 0.1.5", - "proc-macro2 1.0.60", - "syn 1.0.109", + "proc-macro2 1.0.66", + "syn 1.0.99", ] [[package]] @@ -644,8 +633,8 @@ dependencies = [ "borsh-derive-internal 0.10.3", "borsh-schema-derive-internal 0.10.3", "proc-macro-crate 0.1.5", - "proc-macro2 1.0.60", - "syn 1.0.109", + "proc-macro2 1.0.66", + "syn 1.0.99", ] [[package]] @@ -654,9 +643,9 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" dependencies = [ - "proc-macro2 1.0.60", - "quote 1.0.28", - "syn 1.0.109", + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 1.0.99", ] [[package]] @@ -665,9 +654,9 @@ version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "afb438156919598d2c7bad7e1c0adf3d26ed3840dbc010db1a882a65583ca2fb" dependencies = [ - "proc-macro2 1.0.60", - "quote 1.0.28", - "syn 1.0.109", + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 1.0.99", ] [[package]] @@ -676,9 +665,9 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" dependencies = [ - "proc-macro2 1.0.60", - "quote 1.0.28", - "syn 1.0.109", + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 1.0.99", ] [[package]] @@ -687,9 +676,9 @@ version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "634205cc43f74a1b9046ef87c4540ebda95696ec0f315024860cad7c5b0f5ccd" dependencies = [ - "proc-macro2 1.0.60", - "quote 1.0.28", - "syn 1.0.109", + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 1.0.99", ] [[package]] @@ -727,9 +716,9 @@ checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "c1ad822118d20d2c234f427000d5acc36eabe1e29a348c89b63dd60b13f28e5d" [[package]] name = "bv" @@ -758,9 +747,9 @@ version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7ec4c6f261935ad534c0c22dbef2201b45918860eb1c574b972bd213a76af61" dependencies = [ - "proc-macro2 1.0.60", - "quote 1.0.28", - "syn 1.0.109", + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 1.0.99", ] [[package]] @@ -778,9 +767,9 @@ version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdde5c9cd29ebd706ce1b35600920a33550e402fc998a2e53ad3b42c3c47a192" dependencies = [ - "proc-macro2 1.0.60", - "quote 1.0.28", - "syn 2.0.18", + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 2.0.26", ] [[package]] @@ -828,9 +817,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.79" +version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" dependencies = [ "jobserver", ] @@ -925,6 +914,16 @@ dependencies = [ "os_str_bytes", ] +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + [[package]] name = "combine" version = "3.8.1" @@ -963,9 +962,9 @@ dependencies = [ [[package]] name = "console_log" -version = "0.2.2" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89f72f65e8501878b8a004d5a1afb780987e2ce2b4532c562e367a72c57499f" +checksum = "501a375961cef1a0d44767200e66e4a559283097e91d0730b1d75dfb2f8a1494" dependencies = [ "log", "web-sys", @@ -979,9 +978,9 @@ checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" [[package]] name = "constant_time_eq" -version = "0.2.6" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21a53c0a4d288377e7415b53dcfc3c04da5cdc2cc95c8d5ac178b58f0b861ad6" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" [[package]] name = "core-foundation" @@ -1001,9 +1000,9 @@ checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "cpufeatures" -version = "0.2.7" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" +checksum = "dc948ebb96241bb40ab73effeb80d9f93afaad49359d159a5e61be51619fe813" dependencies = [ "libc", ] @@ -1120,6 +1119,50 @@ dependencies = [ "zeroize", ] +[[package]] +name = "cxx" +version = "1.0.97" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e88abab2f5abbe4c56e8f1fb431b784d710b709888f35755a160e62e33fe38e8" +dependencies = [ + "cc", + "cxxbridge-flags", + "cxxbridge-macro", + "link-cplusplus", +] + +[[package]] +name = "cxx-build" +version = "1.0.97" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c0c11acd0e63bae27dcd2afced407063312771212b7a823b4fd72d633be30fb" +dependencies = [ + "cc", + "codespan-reporting", + "once_cell", + "proc-macro2 1.0.66", + "quote 1.0.31", + "scratch", + "syn 2.0.26", +] + +[[package]] +name = "cxxbridge-flags" +version = "1.0.97" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d3816ed957c008ccd4728485511e3d9aaf7db419aa321e3d2c5a2f3411e36c8" + +[[package]] +name = "cxxbridge-macro" +version = "1.0.97" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26acccf6f445af85ea056362561a24ef56cdc15fcc685f03aec50b9c702cb6d" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 2.0.26", +] + [[package]] name = "darling" version = "0.14.4" @@ -1138,10 +1181,10 @@ checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" dependencies = [ "fnv", "ident_case", - "proc-macro2 1.0.60", - "quote 1.0.28", + "proc-macro2 1.0.66", + "quote 1.0.31", "strsim 0.10.0", - "syn 1.0.109", + "syn 1.0.99", ] [[package]] @@ -1151,8 +1194,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" dependencies = [ "darling_core", - "quote 1.0.28", - "syn 1.0.109", + "quote 1.0.31", + "syn 1.0.99", ] [[package]] @@ -1228,7 +1271,7 @@ version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer 0.10.4", + "block-buffer 0.10.2", "crypto-common", "subtle", ] @@ -1269,9 +1312,9 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ - "proc-macro2 1.0.60", - "quote 1.0.28", - "syn 2.0.18", + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 2.0.26", ] [[package]] @@ -1297,6 +1340,12 @@ dependencies = [ "syn 0.15.44", ] +[[package]] +name = "dyn-clone" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "304e6508efa593091e97a9abbc10f90aa7ca635b6d2784feff3c89d41dd12272" + [[package]] name = "eager" version = "0.1.0" @@ -1335,7 +1384,7 @@ dependencies = [ "derivation-path", "ed25519-dalek", "hmac 0.12.1", - "sha2 0.10.6", + "sha2 0.10.7", ] [[package]] @@ -1345,16 +1394,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "079044df30bb07de7d846d41a184c4b00e66ebdac93ee459253474f3a47e50ae" dependencies = [ "enum-ordinalize", - "proc-macro2 1.0.60", - "quote 1.0.28", - "syn 1.0.109", + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 1.0.99", ] [[package]] name = "either" -version = "1.8.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" [[package]] name = "encode_unicode" @@ -1386,9 +1435,9 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8958699f9359f0b04e691a13850d48b7de329138023876d07cbd024c2c820598" dependencies = [ - "proc-macro2 1.0.60", - "quote 1.0.28", - "syn 1.0.109", + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 1.0.99", ] [[package]] @@ -1399,28 +1448,28 @@ checksum = "e4f76552f53cefc9a7f64987c3701b99d982f7690606fd67de1d09712fbf52f1" dependencies = [ "num-bigint 0.4.3", "num-traits", - "proc-macro2 1.0.60", - "quote 1.0.28", - "syn 2.0.18", + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 2.0.26", ] [[package]] name = "enum_dispatch" -version = "0.3.11" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11f36e95862220b211a6e2aa5eca09b4fa391b13cd52ceb8035a24bf65a79de2" +checksum = "8f33313078bb8d4d05a2733a94ac4c2d8a0df9a2b84424ebf4f33bfc224a890e" dependencies = [ "once_cell", - "proc-macro2 1.0.60", - "quote 1.0.28", - "syn 1.0.109", + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 2.0.26", ] [[package]] name = "env_logger" -version = "0.9.3" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" +checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" dependencies = [ "atty", "humantime", @@ -1429,27 +1478,6 @@ dependencies = [ "termcolor", ] -[[package]] -name = "errno" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" -dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", - "libc", -] - [[package]] name = "event-listener" version = "2.5.3" @@ -1458,9 +1486,9 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "fastrand" -version = "1.9.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" dependencies = [ "instant", ] @@ -1568,9 +1596,9 @@ version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ - "proc-macro2 1.0.60", - "quote 1.0.28", - "syn 2.0.18", + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 2.0.26", ] [[package]] @@ -1614,9 +1642,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.7" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" dependencies = [ "serde", "typenum", @@ -1648,9 +1676,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" dependencies = [ "cfg-if", "js-sys", @@ -1672,9 +1700,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.19" +version = "0.3.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d357c7ae988e7d2182f7d7871d0b963962420b0678b0997ce7de72001aeab782" +checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" dependencies = [ "bytes", "fnv", @@ -1704,7 +1732,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" dependencies = [ - "ahash 0.7.6", + "ahash", ] [[package]] @@ -1713,16 +1741,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash 0.7.6", -] - -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash 0.8.3", + "ahash", ] [[package]] @@ -1751,18 +1770,18 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.2.6" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" [[package]] -name = "hermit-abi" -version = "0.3.1" +name = "hex" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +dependencies = [ + "serde", +] [[package]] name = "histogram" @@ -1842,9 +1861,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.26" +version = "0.14.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" dependencies = [ "bytes", "futures-channel", @@ -1893,11 +1912,12 @@ dependencies = [ [[package]] name = "iana-time-zone-haiku" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" dependencies = [ - "cc", + "cxx", + "cxx-build", ] [[package]] @@ -1923,7 +1943,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0acd33ff0285af998aaf9b57342af478078f53492322fafc47450e09397e0e9" dependencies = [ "bitmaps", - "rand_core 0.6.4", + "rand_core 0.6.3", "rand_xoshiro", "rayon", "serde", @@ -1978,37 +1998,26 @@ 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.1", - "libc", - "windows-sys 0.48.0", -] - [[package]] name = "ipnet" -version = "2.7.2" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f" +checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" [[package]] name = "itertools" -version = "0.10.5" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" dependencies = [ "either", ] [[package]] name = "itoa" -version = "1.0.6" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" +checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" [[package]] name = "jobserver" @@ -2021,9 +2030,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "258451ab10b34f8af53416d1fdab72c22e805f0c92a1136d59470ec0b11138b2" dependencies = [ "wasm-bindgen", ] @@ -2045,12 +2054,9 @@ dependencies = [ [[package]] name = "keccak" -version = "0.1.4" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" -dependencies = [ - "cpufeatures", -] +checksum = "f9b7d56ba4a8344d6be9729995e6b06f928af29998cdf79fe390cbf6b1fee838" [[package]] name = "lazy_static" @@ -2060,9 +2066,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.146" +version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "libloading" @@ -2074,12 +2080,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "libm" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" - [[package]] name = "libsecp256k1" version = "0.6.0" @@ -2129,22 +2129,25 @@ dependencies = [ ] [[package]] -name = "linked-hash-map" -version = "0.5.6" +name = "link-cplusplus" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" +checksum = "9d240c6f7e1ba3a28b0249f774e6a9dd0175054b52dfbb61b16eb8505c3785c9" +dependencies = [ + "cc", +] [[package]] -name = "linux-raw-sys" -version = "0.3.8" +name = "linked-hash-map" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "lock_api" -version = "0.4.10" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" dependencies = [ "autocfg", "scopeguard", @@ -2152,9 +2155,12 @@ dependencies = [ [[package]] name = "log" -version = "0.4.19" +version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] [[package]] name = "lru" @@ -2193,9 +2199,9 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "memmap2" -version = "0.5.10" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +checksum = "95af15f345b17af2efc8ead6080fb8bc376f8cec1b35277b935637595fe77498" dependencies = [ "libc", ] @@ -2237,7 +2243,7 @@ checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" dependencies = [ "byteorder", "keccak", - "rand_core 0.6.4", + "rand_core 0.6.3", "zeroize", ] @@ -2300,9 +2306,9 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a7d5f7076603ebc68de2dc6a650ec331a062a13abaa346975be747bbfa4b789" dependencies = [ - "proc-macro2 1.0.60", - "quote 1.0.28", - "syn 1.0.109", + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 1.0.99", ] [[package]] @@ -2343,10 +2349,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8536030f9fea7127f841b45bb6243b27255787fb4eb83958aa1ef9d2fdc0c36" dependencies = [ "num-bigint 0.2.6", - "num-complex", + "num-complex 0.2.4", + "num-integer", + "num-iter", + "num-rational 0.2.4", + "num-traits", +] + +[[package]] +name = "num" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05180d69e3da0e530ba2a1dae5110317e49e3b7f3d41be227dc5f92e49ee7af" +dependencies = [ + "num-bigint 0.4.3", + "num-complex 0.4.3", "num-integer", "num-iter", - "num-rational", + "num-rational 0.4.1", "num-traits", ] @@ -2382,15 +2402,24 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-complex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02e0d21255c828d6f128a1e41534206671e8c3ea0c62f32291e808dc82cff17d" +dependencies = [ + "num-traits", +] + [[package]] name = "num-derive" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" dependencies = [ - "proc-macro2 1.0.60", - "quote 1.0.28", - "syn 1.0.109", + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 1.0.99", ] [[package]] @@ -2426,6 +2455,18 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-rational" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +dependencies = [ + "autocfg", + "num-bigint 0.4.3", + "num-integer", + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.15" @@ -2433,16 +2474,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" dependencies = [ "autocfg", - "libm", ] [[package]] name = "num_cpus" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.2.6", + "hermit-abi 0.3.2", "libc", ] @@ -2461,10 +2501,10 @@ 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 1.0.60", - "quote 1.0.28", - "syn 1.0.109", + "proc-macro-crate 1.2.1", + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 1.0.99", ] [[package]] @@ -2484,9 +2524,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.18.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "074864da206b4973b84eb91683020dbefd6a8c3f0f38e054d93954e891935e4e" [[package]] name = "opaque-debug" @@ -2543,9 +2583,9 @@ checksum = "5f7d21ccd03305a674437ee1248f3ab5d4b1db095cf1caf49f1713ddf61956b7" dependencies = [ "Inflector", "proc-macro-error", - "proc-macro2 1.0.60", - "quote 1.0.28", - "syn 1.0.109", + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 1.0.99", ] [[package]] @@ -2556,7 +2596,7 @@ checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" dependencies = [ "instant", "lock_api", - "parking_lot_core 0.8.6", + "parking_lot_core 0.8.5", ] [[package]] @@ -2571,9 +2611,9 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.8.6" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" +checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" dependencies = [ "cfg-if", "instant", @@ -2593,7 +2633,7 @@ dependencies = [ "libc", "redox_syscall 0.3.5", "smallvec", - "windows-targets 0.48.0", + "windows-targets 0.48.1", ] [[package]] @@ -2620,7 +2660,7 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" dependencies = [ - "base64 0.13.1", + "base64 0.13.0", ] [[package]] @@ -2635,34 +2675,34 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fd23b938276f14057220b707937bcb42fa76dda7560e57a2da30cb52d557937" dependencies = [ - "num", + "num 0.2.1", ] [[package]] name = "pin-project" -version = "1.1.0" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c95a7476719eab1e366eaf73d0260af3021184f18177925b07f54b30089ceead" +checksum = "030ad2bc4db10a8944cb0d837f158bdfec4d4a4873ab701a95046770d11f8842" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.0" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" +checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c" dependencies = [ - "proc-macro2 1.0.60", - "quote 1.0.28", - "syn 2.0.18", + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 2.0.26", ] [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" [[package]] name = "pin-utils" @@ -2707,9 +2747,9 @@ dependencies = [ [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" [[package]] name = "proc-macro-crate" @@ -2722,12 +2762,13 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "1.3.1" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +checksum = "eda0fc3b0fb7c975631757e14d9049da17374063edb6ebbcbc54d880d4fe94e9" dependencies = [ "once_cell", - "toml_edit", + "thiserror", + "toml", ] [[package]] @@ -2737,9 +2778,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", - "proc-macro2 1.0.60", - "quote 1.0.28", - "syn 1.0.109", + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 1.0.99", "version_check", ] @@ -2749,8 +2790,8 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "proc-macro2 1.0.60", - "quote 1.0.28", + "proc-macro2 1.0.66", + "quote 1.0.31", "version_check", ] @@ -2765,9 +2806,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.60" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] @@ -2778,31 +2819,31 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4bf29726d67464d49fa6224a1d07936a8c08bb3fba727c7493f6cf1616fdaada" dependencies = [ - "proc-macro2 1.0.60", - "quote 1.0.28", - "syn 1.0.109", + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 1.0.99", "version_check", "yansi", ] [[package]] name = "proptest" -version = "1.2.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e35c06b98bf36aba164cc17cb25f7e232f5c4aeea73baa14b8a9f0d92dbfa65" +checksum = "1e0d9cc07f18492d879586c92b485def06bc850da3118075cd45d50e9c95b0e5" dependencies = [ "bit-set", "bitflags", "byteorder", "lazy_static", "num-traits", + "quick-error 2.0.1", "rand 0.8.5", "rand_chacha 0.3.1", "rand_xorshift", - "regex-syntax 0.6.29", + "regex-syntax", "rusty-fork", "tempfile", - "unarray", ] [[package]] @@ -2820,9 +2861,39 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" dependencies = [ - "proc-macro2 1.0.60", - "quote 1.0.28", - "syn 1.0.109", + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 1.0.99", +] + +[[package]] +name = "pyth-sdk" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00bf2540203ca3c7a5712fdb8b5897534b7f6a0b6e7b0923ff00466c5f9efcb3" +dependencies = [ + "borsh 0.9.3", + "borsh-derive 0.9.3", + "hex", + "schemars", + "serde", +] + +[[package]] +name = "pyth-sdk-solana" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1fcd2dcd063ea85004667cf5cb07f30de7387f17249df988a295e764a47b9f5" +dependencies = [ + "borsh 0.9.3", + "borsh-derive 0.9.3", + "bytemuck", + "num-derive", + "num-traits", + "pyth-sdk", + "serde", + "solana-program", + "thiserror", ] [[package]] @@ -2840,6 +2911,12 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" +[[package]] +name = "quick-error" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" + [[package]] name = "quinn" version = "0.8.5" @@ -2904,11 +2981,11 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.28" +version = "1.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +checksum = "5fe8a65d69dd0808184ebb5f836ab526bb259db23c657efa38711b1072ee47f0" dependencies = [ - "proc-macro2 1.0.60", + "proc-macro2 1.0.66", ] [[package]] @@ -2938,7 +3015,7 @@ checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha 0.3.1", - "rand_core 0.6.4", + "rand_core 0.6.3", ] [[package]] @@ -2958,7 +3035,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.4", + "rand_core 0.6.3", ] [[package]] @@ -2972,11 +3049,11 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.4" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" dependencies = [ - "getrandom 0.2.10", + "getrandom 0.2.7", ] [[package]] @@ -2994,7 +3071,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" dependencies = [ - "rand_core 0.6.4", + "rand_core 0.6.3", ] [[package]] @@ -3003,7 +3080,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa" dependencies = [ - "rand_core 0.6.4", + "rand_core 0.6.3", ] [[package]] @@ -3036,7 +3113,7 @@ checksum = "6413f3de1edee53342e6138e75b56d32e7bc6e332b3bd62d497b1929d4cfbcdd" dependencies = [ "pem", "ring", - "time 0.3.22", + "time 0.3.23", "yasna", ] @@ -3064,33 +3141,36 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ - "getrandom 0.2.10", + "getrandom 0.2.7", "redox_syscall 0.2.16", "thiserror", ] [[package]] name = "regex" -version = "1.8.4" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" +checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.2", + "regex-syntax", ] [[package]] name = "regex-syntax" -version = "0.6.29" +version = "0.6.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" +checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" [[package]] -name = "regex-syntax" -version = "0.7.2" +name = "remove_dir_all" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +dependencies = [ + "winapi", +] [[package]] name = "rend" @@ -3126,7 +3206,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "rustls", - "rustls-pemfile 1.0.2", + "rustls-pemfile 1.0.3", "serde", "serde_json", "serde_urlencoded", @@ -3180,9 +3260,9 @@ version = "0.7.42" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2e06b915b5c230a17d7a736d1e2e63ee753c256a8614ef3f5147b13a4f5541d" dependencies = [ - "proc-macro2 1.0.60", - "quote 1.0.28", - "syn 1.0.109", + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 1.0.99", ] [[package]] @@ -3199,9 +3279,9 @@ dependencies = [ [[package]] name = "rust_decimal" -version = "1.29.1" +version = "1.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26bd36b60561ee1fb5ec2817f198b6fd09fa571c897a5e86d1487cfc2b096dfc" +checksum = "d0446843641c69436765a35a5a77088e28c2e6a12da93e84aa3ab1cd4aa5a042" dependencies = [ "arrayvec", "borsh 0.10.3", @@ -3245,20 +3325,6 @@ dependencies = [ "nom", ] -[[package]] -name = "rustix" -version = "0.37.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b96e891d04aa506a6d1f318d2771bcb1c7dfda84e126660ace067c9b474bb2c0" -dependencies = [ - "bitflags", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys", - "windows-sys 0.48.0", -] - [[package]] name = "rustls" version = "0.20.8" @@ -3273,12 +3339,12 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", - "rustls-pemfile 1.0.2", + "rustls-pemfile 1.0.3", "schannel", "security-framework", ] @@ -3289,23 +3355,23 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5eebeaeb360c87bfb72e84abdb3447159c0eaececf1bef2aecd65a8be949d1c9" dependencies = [ - "base64 0.13.1", + "base64 0.13.0", ] [[package]] name = "rustls-pemfile" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" +checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ "base64 0.21.2", ] [[package]] name = "rustversion" -version = "1.0.12" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" +checksum = "97477e48b4cf8603ad5f7aaf897467cf42ab4218a38ef76fb14c2d6773a6d6a8" [[package]] name = "rusty-fork" @@ -3314,16 +3380,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" dependencies = [ "fnv", - "quick-error", + "quick-error 1.2.3", "tempfile", "wait-timeout", ] [[package]] name = "ryu" -version = "1.0.13" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" [[package]] name = "same-file" @@ -3336,11 +3402,35 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" dependencies = [ - "windows-sys 0.42.0", + "windows-sys 0.48.0", +] + +[[package]] +name = "schemars" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02c613288622e5f0c3fdc5dbd4db1c5fbe752746b1d1a56a0630b78fd00de44f" +dependencies = [ + "dyn-clone", + "schemars_derive", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "109da1e6b197438deb6db99952990c7f959572794b80ff93707d55a232545e7c" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.31", + "serde_derive_internals", + "syn 1.0.99", ] [[package]] @@ -3349,6 +3439,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +[[package]] +name = "scratch" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3cf7c11c38cb994f3d40e8a8cde3bbd1f72a435e4c49e85d6553d8312306152" + [[package]] name = "scroll" version = "0.11.0" @@ -3360,13 +3456,13 @@ dependencies = [ [[package]] name = "scroll_derive" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdbda6ac5cd1321e724fa9cee216f3a61885889b896f073b8f82322789c5250e" +checksum = "1db149f81d46d2deba7cd3c50772474707729550221e69588478ebf9ada425ae" dependencies = [ - "proc-macro2 1.0.60", - "quote 1.0.28", - "syn 1.0.109", + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 2.0.26", ] [[package]] @@ -3410,44 +3506,55 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.17" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" +checksum = "93f6841e709003d68bb2deee8c343572bf446003ec20a583e76f7b15cebf3711" [[package]] name = "serde" -version = "1.0.164" +version = "1.0.144" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8c8cf938e98f769bc164923b06dce91cea1751522f46f8466461af04c9027d" +checksum = "0f747710de3dcd43b88c9168773254e809d8ddbdf9653b84e2554ab219f17860" dependencies = [ "serde_derive", ] [[package]] name = "serde_bytes" -version = "0.11.9" +version = "0.11.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "416bda436f9aab92e02c8e10d49a15ddd339cea90b6e340fe51ed97abb548294" +checksum = "cfc50e8183eeeb6178dcb167ae34a8051d63535023ae38b5d8d12beae193d37b" dependencies = [ "serde", ] [[package]] name = "serde_derive" -version = "1.0.164" +version = "1.0.144" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94ed3a816fb1d101812f83e789f888322c34e291f894f19590dc310963e87a00" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 1.0.99", +] + +[[package]] +name = "serde_derive_internals" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68" +checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" dependencies = [ - "proc-macro2 1.0.60", - "quote 1.0.28", - "syn 2.0.18", + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 1.0.99", ] [[package]] name = "serde_json" -version = "1.0.96" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44" dependencies = [ "itoa", "ryu", @@ -3504,9 +3611,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" dependencies = [ "cfg-if", "cpufeatures", @@ -3527,9 +3634,9 @@ dependencies = [ [[package]] name = "sha3" -version = "0.10.8" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +checksum = "bdf0c33fae925bdc080598b84bc15c55e7b9a4a43b3c704da051f977469691c9" dependencies = [ "digest 0.10.7", "keccak", @@ -3592,9 +3699,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.10.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" [[package]] name = "socket2" @@ -3613,7 +3720,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd1d1d16c04e7867408f2e0383a863e272dba2eda2c4b7095c70aa1a7ad4ff36" dependencies = [ "Inflector", - "base64 0.13.1", + "base64 0.13.0", "bincode", "bs58 0.4.0", "bv", @@ -3776,7 +3883,7 @@ checksum = "0e803c468b3609af59298721f3a66ad145fa68416bfa420775f190ed9cfc6355" dependencies = [ "async-mutex", "async-trait", - "base64 0.13.1", + "base64 0.13.0", "bincode", "bs58 0.4.0", "bytes", @@ -3876,7 +3983,7 @@ version = "1.14.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f53e63c8f2aac07bc21167e7ede9b9d010ae25523fff5c01b171d9bab9a5a394" dependencies = [ - "ahash 0.7.6", + "ahash", "blake3", "block-buffer 0.9.0", "bs58 0.4.0", @@ -3892,13 +3999,13 @@ dependencies = [ "log", "memmap2", "once_cell", - "rand_core 0.6.4", + "rand_core 0.6.3", "rustc_version", "serde", "serde_bytes", "serde_derive", "serde_json", - "sha2 0.10.6", + "sha2 0.10.7", "solana-frozen-abi-macro", "subtle", "thiserror", @@ -3910,10 +4017,10 @@ version = "1.14.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "daeaaa2713c06a2fe4bcdcfe7e1af55ee8a89c4d6693860b4041997af667207a" dependencies = [ - "proc-macro2 1.0.60", - "quote 1.0.28", + "proc-macro2 1.0.66", + "quote 1.0.31", "rustc_version", - "syn 1.0.109", + "syn 1.0.99", ] [[package]] @@ -3979,7 +4086,7 @@ version = "1.14.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e9460658e4e92257ead496f8f3e36d8ec6778e09b476b7be6a518121bf0bd74" dependencies = [ - "ahash 0.7.6", + "ahash", "bincode", "bv", "caps", @@ -4006,7 +4113,7 @@ version = "1.14.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d66c02ad6002fbe7903ec96edd16352fe7964d3ee43b02053112f5304529849f" dependencies = [ - "base64 0.13.1", + "base64 0.13.0", "bincode", "bitflags", "blake3", @@ -4019,7 +4126,7 @@ dependencies = [ "console_error_panic_hook", "console_log", "curve25519-dalek", - "getrandom 0.2.10", + "getrandom 0.2.7", "itertools", "js-sys", "lazy_static", @@ -4038,8 +4145,8 @@ dependencies = [ "serde_bytes", "serde_derive", "serde_json", - "sha2 0.10.6", - "sha3 0.10.8", + "sha2 0.10.7", + "sha3 0.10.6", "solana-frozen-abi", "solana-frozen-abi-macro", "solana-sdk-macro", @@ -4055,7 +4162,7 @@ version = "1.14.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d57bc75db0cbfb8e0620cef48b4de3388ed1ea5fbdcc68769da0c2b1ccf69bc" dependencies = [ - "base64 0.13.1", + "base64 0.13.0", "bincode", "eager", "enum-iterator", @@ -4084,7 +4191,7 @@ checksum = "c0c4b86a72a48ebb66b2182a692b449d8590cab3eb9626a1967cc704aeb488c4" dependencies = [ "assert_matches", "async-trait", - "base64 0.13.1", + "base64 0.13.0", "bincode", "chrono-humanize", "log", @@ -4198,7 +4305,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60cbad77fa09d23fa5e05029dec6c88e4b784be76cf6ae390f82cc04b8089e73" dependencies = [ "assert_matches", - "base64 0.13.1", + "base64 0.13.0", "bincode", "bitflags", "borsh 0.9.3", @@ -4230,8 +4337,8 @@ dependencies = [ "serde_bytes", "serde_derive", "serde_json", - "sha2 0.10.6", - "sha3 0.10.8", + "sha2 0.10.7", + "sha3 0.10.6", "solana-frozen-abi", "solana-frozen-abi-macro", "solana-logger", @@ -4249,10 +4356,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b73f54502e7d537472bf393ffce0c252c55b534f16797029a1614d79ec0209c9" dependencies = [ "bs58 0.4.0", - "proc-macro2 1.0.60", - "quote 1.0.28", + "proc-macro2 1.0.66", + "quote 1.0.31", "rustversion", - "syn 1.0.109", + "syn 1.0.99", ] [[package]] @@ -4329,7 +4436,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "feacea79beaefa2aec4ea02bd56573845bcf2a480858f7d666077138928fc259" dependencies = [ "Inflector", - "base64 0.13.1", + "base64 0.13.0", "bincode", "borsh 0.9.3", "bs58 0.4.0", @@ -4411,7 +4518,7 @@ checksum = "b28c5ec36aa1393174f7ea18c0cb809af82c10977bc5b2e1240a6b4b048b8f24" dependencies = [ "aes-gcm-siv", "arrayref", - "base64 0.13.1", + "base64 0.13.0", "bincode", "bytemuck", "byteorder", @@ -4578,10 +4685,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" dependencies = [ "heck 0.4.1", - "proc-macro2 1.0.60", - "quote 1.0.28", + "proc-macro2 1.0.66", + "quote 1.0.31", "rustversion", - "syn 1.0.109", + "syn 1.0.99", ] [[package]] @@ -4609,23 +4716,23 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.109" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" dependencies = [ - "proc-macro2 1.0.60", - "quote 1.0.28", + "proc-macro2 1.0.66", + "quote 1.0.31", "unicode-ident", ] [[package]] name = "syn" -version = "2.0.18" +version = "2.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" +checksum = "45c3457aacde3c65315de5031ec191ce46604304d2446e803d71ade03308d970" dependencies = [ - "proc-macro2 1.0.60", - "quote 1.0.28", + "proc-macro2 1.0.66", + "quote 1.0.31", "unicode-ident", ] @@ -4635,9 +4742,9 @@ version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ - "proc-macro2 1.0.60", - "quote 1.0.28", - "syn 1.0.109", + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 1.0.99", "unicode-xid 0.2.4", ] @@ -4649,9 +4756,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tar" -version = "0.4.38" +version = "0.4.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b55807c0344e1e6c04d7c965f5289c39a8d94ae23ed5c0b57aabac549f871c6" +checksum = "ec96d2ffad078296368d46ff1cb309be1c23c513b4ab0e22a45de0185275ac96" dependencies = [ "filetime", "libc", @@ -4688,30 +4795,30 @@ version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ee42b4e559f17bce0385ebf511a7beb67d5cc33c12c96b7f4e9789919d9c10f" dependencies = [ - "proc-macro2 1.0.60", - "quote 1.0.28", - "syn 1.0.109", + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 1.0.99", ] [[package]] name = "tempfile" -version = "3.6.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" dependencies = [ - "autocfg", "cfg-if", "fastrand", - "redox_syscall 0.3.5", - "rustix", - "windows-sys 0.48.0", + "libc", + "redox_syscall 0.2.16", + "remove_dir_all", + "winapi", ] [[package]] name = "termcolor" -version = "1.2.0" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" dependencies = [ "winapi-util", ] @@ -4733,22 +4840,22 @@ checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" [[package]] name = "thiserror" -version = "1.0.40" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +checksum = "f5f6586b7f764adc0231f4c79be7b920e766bb2f3e51b3661cdb263828f19994" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.40" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +checksum = "12bafc5b54507e0149cdf1b145a5d80ab80a90bcd9275df43d4fff68460f6c21" dependencies = [ - "proc-macro2 1.0.60", - "quote 1.0.28", - "syn 2.0.18", + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 1.0.99", ] [[package]] @@ -4774,9 +4881,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.22" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea9e1b3cf1243ae005d9e74085d4d542f3125458f3a81af210d901dcd7411efd" +checksum = "59e399c068f43a5d116fedaf73b203fa4f9c519f17e2b34f63221d3792f81446" dependencies = [ "itoa", "serde", @@ -4792,9 +4899,9 @@ checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" [[package]] name = "time-macros" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "372950940a5f07bf38dbe211d7283c9e6d7327df53794992d293e534c733d09b" +checksum = "96ba15a897f3c86766b757e5ac7221554c6750054d74d5b28844fce5fb36a6c4" dependencies = [ "time-core", ] @@ -4859,9 +4966,9 @@ version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" dependencies = [ - "proc-macro2 1.0.60", - "quote 1.0.28", - "syn 1.0.109", + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 1.0.99", ] [[package]] @@ -4949,9 +5056,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.11" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" dependencies = [ "serde", ] @@ -4962,17 +5069,6 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622" -[[package]] -name = "toml_edit" -version = "0.19.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239410c8609e8125456927e6707163a3b1fdb40561e4b803bc041f466ccfdc13" -dependencies = [ - "indexmap", - "toml_datetime", - "winnow", -] - [[package]] name = "tower-service" version = "0.3.2" @@ -4994,13 +5090,13 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.24" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" +checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ - "proc-macro2 1.0.60", - "quote 1.0.28", - "syn 2.0.18", + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 2.0.26", ] [[package]] @@ -5049,7 +5145,7 @@ version = "0.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e27992fd6a8c29ee7eef28fc78349aa244134e10ad447ce3b9f0ac0ed0fa4ce0" dependencies = [ - "base64 0.13.1", + "base64 0.13.0", "byteorder", "bytes", "http", @@ -5067,15 +5163,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" - -[[package]] -name = "unarray" -version = "0.1.4" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" +checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" [[package]] name = "unicode-bidi" @@ -5085,9 +5175,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.9" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" +checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf" [[package]] name = "unicode-normalization" @@ -5100,9 +5190,9 @@ dependencies = [ [[package]] name = "unicode-segmentation" -version = "1.10.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" +checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" [[package]] name = "unicode-width" @@ -5176,9 +5266,9 @@ checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" [[package]] name = "uuid" -version = "1.3.4" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa2982af2eec27de306107c027578ff7f423d65f7250e40ce0fea8f45248b81" +checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" [[package]] name = "uxd" @@ -5188,7 +5278,10 @@ dependencies = [ "anchor-spl", "credix_client", "mercurial-vault", + "num 0.4.1", + "num-traits", "proptest", + "pyth-sdk-solana", "solana-program", "solana-program-test", "solana-sdk", @@ -5256,11 +5349,10 @@ dependencies = [ [[package]] name = "want" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ - "log", "try-lock", ] @@ -5284,9 +5376,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "fc7652e3f6c4706c8d9cd54832c4a4ccb9b5336e2c3bd154d5cccfbf1c1f5f7d" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -5294,24 +5386,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "662cd44805586bd52971b9586b1df85cdbbd9112e4ef4d8f41559c334dc6ac3f" dependencies = [ "bumpalo", "log", "once_cell", - "proc-macro2 1.0.60", - "quote 1.0.28", - "syn 2.0.18", + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 1.0.99", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.37" +version = "0.4.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +checksum = "fa76fb221a1f8acddf5b54ace85912606980ad661ac7a503b4570ffd3a624dad" dependencies = [ "cfg-if", "js-sys", @@ -5321,38 +5413,38 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "b260f13d3012071dfb1512849c033b1925038373aea48ced3012c09df952c602" dependencies = [ - "quote 1.0.28", + "quote 1.0.31", "wasm-bindgen-macro-support", ] [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "5be8e654bdd9b79216c2929ab90721aa82faf65c48cdf08bdc4e7f51357b80da" dependencies = [ - "proc-macro2 1.0.60", - "quote 1.0.28", - "syn 2.0.18", + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 1.0.99", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "6598dd0bd3c7d51095ff6531a5b23e02acdc81804e30d8f07afb77b7215a140a" [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "ed055ab27f941423197eb86b2035720b1a3ce40504df082cac2ecc6ed73335a1" dependencies = [ "js-sys", "wasm-bindgen", @@ -5414,22 +5506,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows-targets 0.48.0", -] - -[[package]] -name = "windows-sys" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", + "windows-targets 0.48.1", ] [[package]] @@ -5447,7 +5524,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.0", + "windows-targets 0.48.1", ] [[package]] @@ -5467,9 +5544,9 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" dependencies = [ "windows_aarch64_gnullvm 0.48.0", "windows_aarch64_msvc 0.48.0", @@ -5598,7 +5675,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0ecbeb7b67ce215e40e3cc7f2ff902f94a223acf44995934763467e7b1febc8" dependencies = [ "asn1-rs", - "base64 0.13.1", + "base64 0.13.0", "data-encoding", "der-parser", "lazy_static", @@ -5606,7 +5683,7 @@ dependencies = [ "oid-registry", "rusticata-macros", "thiserror", - "time 0.3.22", + "time 0.3.23", ] [[package]] @@ -5639,7 +5716,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" dependencies = [ - "time 0.3.22", + "time 0.3.23", ] [[package]] @@ -5657,9 +5734,9 @@ version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ - "proc-macro2 1.0.60", - "quote 1.0.28", - "syn 2.0.18", + "proc-macro2 1.0.66", + "quote 1.0.31", + "syn 2.0.26", ] [[package]] diff --git a/programs/uxd/Cargo.toml b/programs/uxd/Cargo.toml index 4089ca8a4..d76499be1 100644 --- a/programs/uxd/Cargo.toml +++ b/programs/uxd/Cargo.toml @@ -28,18 +28,18 @@ development = [] [dependencies] uxd-cpi = { version = "7.3.1", features = ["development"] } - -anchor-lang = "0.26.0" +anchor-lang = {version = "0.26.0", features = ["init-if-needed"]} anchor-spl = "0.26.0" - mercurial-vault = { git = "https://github.com/mercurial-finance/vault-sdk", features = [ "cpi", ], rev = "3724175d8435f7acb7a33077a5a9f1eb58ab3399" } - credix_client = { version = "0.7.4", features = [ "pre-mainnet", "cpi", ], default-features = false } +pyth-sdk-solana = "0.7.2" +num-traits = "0.2.15" +num = "0.4.0" [dev-dependencies] proptest = "1.0.0" diff --git a/programs/uxd/src/error.rs b/programs/uxd/src/error.rs index 918760cdc..409b703b2 100644 --- a/programs/uxd/src/error.rs +++ b/programs/uxd/src/error.rs @@ -28,8 +28,8 @@ pub enum UxdError { RedeemableMercurialVaultAmountUnderManagementCap, #[msg("Minting amount would go past the credix lp depository Redeemable Amount Under Management Cap.")] RedeemableCredixLpAmountUnderManagementCap, - #[msg("Math error.")] - MathError, + #[msg("Math overflow.")] + MathOverflow, #[msg("The order couldn't be executed with the provided slippage.")] SlippageReached, #[msg("A bump was expected but is missing.")] @@ -120,6 +120,23 @@ pub enum UxdError { #[msg("The Credix WithdrawEpoch isn't in its redeem phase.")] InvalidCredixWithdrawEpochRedeemPhase, + #[msg("The provided LTV bps isn't valid.")] + InvalidLtvBps, + #[msg("The provided LTV is over the depository's maximum value.")] + LtvBpsOverLimit, + #[msg("Borrowing is disabled for the current depository.")] + BorrowingDisabled, + #[msg("Unsupported price oracle")] + UnsupportedOracle, + #[msg("Invalid oracle account")] + InvalidOracleAccount, + #[msg("Invalid oracle state")] + InvalidOracleState, + #[msg("Stale oracle price")] + StaleOraclePrice, + #[msg("Invalid oracle price")] + InvalidOraclePrice, + #[msg("Default - Check the source code for more info.")] Default, } diff --git a/programs/uxd/src/events.rs b/programs/uxd/src/events.rs index 470ae683a..89828ea53 100644 --- a/programs/uxd/src/events.rs +++ b/programs/uxd/src/events.rs @@ -150,6 +150,22 @@ pub struct InitializeIdentityDepositoryEvent { pub collateral_mint: Pubkey, } +/// Event called in [instructions::initialize_lsd_depository::handler]. +#[event] +pub struct InitializeLsdDepositoryEvent { + /// The controller version. + #[index] + pub version: u8, + #[index] + pub depository_version: u8, + #[index] + pub controller: Pubkey, + #[index] + pub depository: Pubkey, + pub collateral_mint: Pubkey, + pub liquidation_mint: Pubkey, +} + /// Event called in [instructions::mint_with_identity_depository::handler]. #[event] pub struct MintWithIdentityDepositoryEvent { diff --git a/programs/uxd/src/instructions/credix_lp/collect_profits_of_credix_lp_depository.rs b/programs/uxd/src/instructions/credix_lp/collect_profits_of_credix_lp_depository.rs index f7b916a79..5a94251a9 100644 --- a/programs/uxd/src/instructions/credix_lp/collect_profits_of_credix_lp_depository.rs +++ b/programs/uxd/src/instructions/credix_lp/collect_profits_of_credix_lp_depository.rs @@ -168,7 +168,7 @@ pub(crate) fn handler(ctx: Context) -> Resul let total_shares_supply_before: u64 = ctx.accounts.credix_shares_mint.supply; let total_shares_value_before: u64 = liquidity_collateral_amount_before .checked_add(outstanding_collateral_amount_before) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; let owned_shares_amount_before: u64 = ctx.accounts.depository_shares.amount; let owned_shares_value_before: u64 = compute_value_for_shares_amount_floor( @@ -198,7 +198,7 @@ pub(crate) fn handler(ctx: Context) -> Resul // Compute the amount of profits that we can safely withdraw assets_value .checked_sub(liabilities_value) - .ok_or(UxdError::MathError)? + .ok_or(UxdError::MathOverflow)? }; msg!( "[collect_profits_of_credix_lp_depository:profits_value:{}]", @@ -208,7 +208,7 @@ pub(crate) fn handler(ctx: Context) -> Resul // Assumes and enforce a collateral/redeemable 1:1 relationship on purpose let collateral_amount_before_precision_loss: u64 = u64::try_from(profits_value) .ok() - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; msg!( "[collect_profits_of_credix_lp_depository:collateral_amount_before_precision_loss:{}]", collateral_amount_before_precision_loss @@ -303,7 +303,7 @@ pub(crate) fn handler(ctx: Context) -> Resul let total_shares_supply_after: u64 = ctx.accounts.credix_shares_mint.supply; let total_shares_value_after: u64 = liquidity_collateral_amount_after .checked_add(outstanding_collateral_amount_after) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; let owned_shares_amount_after: u64 = ctx.accounts.depository_shares.amount; let owned_shares_value_after: u64 = compute_value_for_shares_amount_floor( diff --git a/programs/uxd/src/instructions/credix_lp/mint_with_credix_lp_depository.rs b/programs/uxd/src/instructions/credix_lp/mint_with_credix_lp_depository.rs index 310b3b28b..eddc61dbf 100644 --- a/programs/uxd/src/instructions/credix_lp/mint_with_credix_lp_depository.rs +++ b/programs/uxd/src/instructions/credix_lp/mint_with_credix_lp_depository.rs @@ -160,7 +160,7 @@ pub(crate) fn handler( let total_shares_supply_before: u64 = ctx.accounts.credix_shares_mint.supply; let total_shares_value_before: u64 = liquidity_collateral_amount_before .checked_add(outstanding_collateral_amount_before) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; let owned_shares_amount_before: u64 = ctx.accounts.depository_shares.amount; let owned_shares_value_before: u64 = compute_value_for_shares_amount_floor( @@ -302,7 +302,7 @@ pub(crate) fn handler( let total_shares_supply_after: u64 = ctx.accounts.credix_shares_mint.supply; let total_shares_value_after: u64 = liquidity_collateral_amount_after .checked_add(outstanding_collateral_amount_after) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; let owned_shares_amount_after: u64 = ctx.accounts.depository_shares.amount; let owned_shares_value_after: u64 = compute_value_for_shares_amount_floor( diff --git a/programs/uxd/src/instructions/credix_lp/rebalance_create_withdraw_request_from_credix_lp_depository.rs b/programs/uxd/src/instructions/credix_lp/rebalance_create_withdraw_request_from_credix_lp_depository.rs index 5d11d25a4..d86c2844c 100644 --- a/programs/uxd/src/instructions/credix_lp/rebalance_create_withdraw_request_from_credix_lp_depository.rs +++ b/programs/uxd/src/instructions/credix_lp/rebalance_create_withdraw_request_from_credix_lp_depository.rs @@ -191,7 +191,7 @@ pub(crate) fn handler( let total_shares_supply: u64 = ctx.accounts.credix_shares_mint.supply; let total_shares_value: u64 = liquidity_collateral_amount .checked_add(outstanding_collateral_amount) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; let owned_shares_amount: u64 = ctx.accounts.depository_shares.amount; let owned_shares_value: u64 = compute_value_for_shares_amount_floor( owned_shares_amount, @@ -200,7 +200,7 @@ pub(crate) fn handler( )?; owned_shares_value .checked_sub(redeemable_amount_under_management) - .ok_or(UxdError::MathError)? + .ok_or(UxdError::MathOverflow)? }; let overflow_value = { @@ -216,7 +216,7 @@ pub(crate) fn handler( } else { redeemable_amount_under_management .checked_sub(redeemable_amount_under_management_target_amount) - .ok_or(UxdError::MathError)? + .ok_or(UxdError::MathOverflow)? } }; @@ -228,7 +228,7 @@ pub(crate) fn handler( let requested_collateral_amount = profits_collateral_amount .checked_add(overflow_value) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; msg!( "[rebalance_create_withdraw_request_from_credix_lp_depository:requested_collateral_amount:{}]", requested_collateral_amount diff --git a/programs/uxd/src/instructions/credix_lp/rebalance_redeem_withdraw_request_from_credix_lp_depository.rs b/programs/uxd/src/instructions/credix_lp/rebalance_redeem_withdraw_request_from_credix_lp_depository.rs index cf63ad47d..b653a40d1 100644 --- a/programs/uxd/src/instructions/credix_lp/rebalance_redeem_withdraw_request_from_credix_lp_depository.rs +++ b/programs/uxd/src/instructions/credix_lp/rebalance_redeem_withdraw_request_from_credix_lp_depository.rs @@ -260,7 +260,7 @@ pub(crate) fn handler( .pool_outstanding_credit; liquidity_collateral_amount_before .checked_add(outstanding_collateral_amount_before) - .ok_or(UxdError::MathError)? + .ok_or(UxdError::MathOverflow)? }; let owned_shares_amount_before: u64 = ctx.accounts.depository_shares.amount; @@ -284,7 +284,7 @@ pub(crate) fn handler( let profits_collateral_amount = owned_shares_value_before .checked_sub(redeemable_amount_under_management) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; msg!( "[rebalance_redeem_withdraw_request_from_credix_lp_depository:profits_collateral_amount:{}]", profits_collateral_amount @@ -303,7 +303,7 @@ pub(crate) fn handler( } else { redeemable_amount_under_management .checked_sub(redeemable_amount_under_management_target_amount) - .ok_or(UxdError::MathError)? + .ok_or(UxdError::MathOverflow)? } }; msg!( @@ -336,11 +336,11 @@ pub(crate) fn handler( checked_convert_u128_to_u64( u128::from(locked_liquidity) .checked_mul(investor_total_lp_amount.into()) - .ok_or(UxdError::MathError)? + .ok_or(UxdError::MathOverflow)? .checked_div(participating_investors_total_lp_amount.into()) - .ok_or(UxdError::MathError)? + .ok_or(UxdError::MathOverflow)? .checked_sub(base_amount_withdrawn.into()) - .ok_or(UxdError::MathError)?, + .ok_or(UxdError::MathOverflow)?, )? }; @@ -360,14 +360,14 @@ pub(crate) fn handler( let withdrawal_overflow_value = std::cmp::min( withdrawable_total_collateral_amount .checked_sub(withdrawal_profits_collateral_amount) - .ok_or(UxdError::MathError)?, + .ok_or(UxdError::MathOverflow)?, overflow_value, ); // The sum of the two is what we will actually withdraw let withdrawal_total_collateral_amount = withdrawal_profits_collateral_amount .checked_add(withdrawal_overflow_value) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; // --------------------------------------------------------------------- // -- Phase 5 @@ -400,7 +400,7 @@ pub(crate) fn handler( let withdrawal_profits_collateral_amount_after_precision_loss = withdrawal_total_collateral_amount_after_precision_loss .checked_sub(withdrawal_overflow_value_after_precision_loss) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; // --------------------------------------------------------------------- // -- Phase 6 @@ -473,7 +473,7 @@ pub(crate) fn handler( .pool_outstanding_credit; liquidity_collateral_amount_after .checked_add(outstanding_collateral_amount_after) - .ok_or(UxdError::MathError)? + .ok_or(UxdError::MathOverflow)? }; let owned_shares_amount_after: u64 = ctx.accounts.depository_shares.amount; @@ -587,21 +587,21 @@ pub(crate) fn handler( depository.collateral_amount_deposited = depository .collateral_amount_deposited .checked_sub(withdrawal_overflow_value_after_precision_loss.into()) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; identity_depository.collateral_amount_deposited = identity_depository .collateral_amount_deposited .checked_add(withdrawal_overflow_value_after_precision_loss.into()) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; // Redeemable under management accounting updates depository.redeemable_amount_under_management = depository .redeemable_amount_under_management .checked_sub(withdrawal_overflow_value_after_precision_loss.into()) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; identity_depository.redeemable_amount_under_management = identity_depository .redeemable_amount_under_management .checked_add(withdrawal_overflow_value_after_precision_loss.into()) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; // Done Ok(()) diff --git a/programs/uxd/src/instructions/credix_lp/redeem_from_credix_lp_depository.rs b/programs/uxd/src/instructions/credix_lp/redeem_from_credix_lp_depository.rs index 1c09c7775..faa6fea20 100644 --- a/programs/uxd/src/instructions/credix_lp/redeem_from_credix_lp_depository.rs +++ b/programs/uxd/src/instructions/credix_lp/redeem_from_credix_lp_depository.rs @@ -190,7 +190,7 @@ pub(crate) fn handler( let total_shares_supply_before: u64 = ctx.accounts.credix_shares_mint.supply; let total_shares_value_before: u64 = liquidity_collateral_amount_before .checked_add(outstanding_collateral_amount_before) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; let owned_shares_amount_before: u64 = ctx.accounts.depository_shares.amount; let owned_shares_value_before: u64 = compute_value_for_shares_amount_floor( @@ -317,7 +317,7 @@ pub(crate) fn handler( let total_shares_supply_after: u64 = ctx.accounts.credix_shares_mint.supply; let total_shares_value_after: u64 = liquidity_collateral_amount_after .checked_add(outstanding_collateral_amount_after) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; let owned_shares_amount_after: u64 = ctx.accounts.depository_shares.amount; let owned_shares_value_after: u64 = compute_value_for_shares_amount_floor( diff --git a/programs/uxd/src/instructions/edit_controller.rs b/programs/uxd/src/instructions/edit_controller.rs index fa3141d77..c00e20166 100644 --- a/programs/uxd/src/instructions/edit_controller.rs +++ b/programs/uxd/src/instructions/edit_controller.rs @@ -4,7 +4,7 @@ use crate::events::SetRouterDepositories; use crate::events::SetRouterDepositoriesWeightBps; use crate::validate_is_program_frozen; use crate::Controller; -use crate::BPS_UNIT_CONVERSION; +use crate::BPS_POWER; use crate::CONTROLLER_NAMESPACE; use crate::MAX_REDEEMABLE_GLOBAL_SUPPLY_CAP; use anchor_lang::prelude::*; @@ -142,11 +142,11 @@ impl<'info> EditController<'info> { let total_weight_bps = depositories_routing_weight_bps .identity_depository_weight_bps .checked_add(depositories_routing_weight_bps.mercurial_vault_depository_weight_bps) - .ok_or(UxdError::MathError)? + .ok_or(UxdError::MathOverflow)? .checked_add(depositories_routing_weight_bps.credix_lp_depository_weight_bps) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; require!( - u64::from(total_weight_bps) == BPS_UNIT_CONVERSION, + u64::from(total_weight_bps) == BPS_POWER, UxdError::InvalidDepositoriesWeightBps ); } diff --git a/programs/uxd/src/instructions/initialize_controller.rs b/programs/uxd/src/instructions/initialize_controller.rs index 9544d95df..b650a3d4c 100644 --- a/programs/uxd/src/instructions/initialize_controller.rs +++ b/programs/uxd/src/instructions/initialize_controller.rs @@ -63,7 +63,7 @@ pub(crate) fn handler( let controller = &mut ctx.accounts.controller.load_init()?; let redeemable_mint_unit = 10_u64 .checked_pow(redeemable_mint_decimals.into()) - .ok_or_else(|| error!(UxdError::MathError))?; + .ok_or_else(|| error!(UxdError::MathOverflow))?; controller.bump = *ctx .bumps @@ -80,7 +80,7 @@ pub(crate) fn handler( // Default to 1 Million redeemable total cap controller.redeemable_global_supply_cap = DEFAULT_REDEEMABLE_GLOBAL_SUPPLY_CAP .checked_mul(redeemable_mint_unit.into()) - .ok_or_else(|| error!(UxdError::MathError))?; + .ok_or_else(|| error!(UxdError::MathOverflow))?; controller.redeemable_circulating_supply = u128::MIN; controller.is_frozen = false; controller.profits_total_collected = u128::MIN; diff --git a/programs/uxd/src/instructions/initialize_identity_depository.rs b/programs/uxd/src/instructions/initialize_identity_depository.rs index 29c557155..fd32b845b 100644 --- a/programs/uxd/src/instructions/initialize_identity_depository.rs +++ b/programs/uxd/src/instructions/initialize_identity_depository.rs @@ -88,7 +88,7 @@ pub(crate) fn handler(ctx: Context) -> Result<()> .redeemable_mint_decimals .into(), ) - .ok_or_else(|| error!(UxdError::MathError))?; + .ok_or_else(|| error!(UxdError::MathOverflow))?; // - Initialize Depository state let depository = &mut ctx.accounts.depository.load_init()?; @@ -100,9 +100,10 @@ pub(crate) fn handler(ctx: Context) -> Result<()> depository.collateral_vault = ctx.accounts.collateral_vault.key(); depository.collateral_vault_bump = collateral_vault_bump; depository.redeemable_amount_under_management = u128::MIN; - depository.redeemable_amount_under_management_cap = DEFAULT_REDEEMABLE_UNDER_MANAGEMENT_CAP - .checked_mul(redeemable_mint_unit) - .ok_or_else(|| error!(UxdError::MathError))?; + depository.redeemable_amount_under_management_cap = + u128::from(DEFAULT_REDEEMABLE_UNDER_MANAGEMENT_CAP) + .checked_mul(redeemable_mint_unit) + .ok_or_else(|| error!(UxdError::MathOverflow))?; depository.minting_disabled = true; depository.mango_collateral_reinjected_wsol = false; diff --git a/programs/uxd/src/instructions/lsd/borrow_from_lsd_depository.rs b/programs/uxd/src/instructions/lsd/borrow_from_lsd_depository.rs new file mode 100644 index 000000000..269248c12 --- /dev/null +++ b/programs/uxd/src/instructions/lsd/borrow_from_lsd_depository.rs @@ -0,0 +1,284 @@ +use anchor_lang::prelude::*; +use anchor_spl::token; +use anchor_spl::token::Mint; +use anchor_spl::token::MintTo; +use anchor_spl::token::Token; +use anchor_spl::token::TokenAccount; +use anchor_spl::token::Transfer; + +use crate::BPS_POWER; +use crate::LSD_USER_LIQUIDATION_THREAD_AUTHORITY_NAMESPACE; +use crate::error::UxdError; +use crate::state::LsdDepository; +use crate::state::LsdPosition; +use crate::state::OraclePrice; +use crate::utils::maths; +use crate::utils::validate_collateral_amount; +use crate::utils::validate_loan_to_value_bps; +use crate::validate_is_program_frozen; +use crate::Controller; +use crate::CONTROLLER_NAMESPACE; +use crate::LSD_DEPOSITORY_NAMESPACE; +use crate::LSD_POSITION_SPACE; +use crate::LSD_PROFITS_TOKEN_ACCOUNT_NAMESPACE; + +// clockwork automation cost per action +pub const CLOCKWORK_AUTOMATION_FEE: u64 = 1_000; + +#[derive(Accounts)] +pub struct BorrowFromLsdDepository<'info> { + /// #1 + pub user: Signer<'info>, + + /// #2 + #[account(mut)] + pub payer: Signer<'info>, + + /// #3 + #[account( + mut, + seeds = [CONTROLLER_NAMESPACE], + bump = controller.load()?.bump, + has_one = redeemable_mint @UxdError::InvalidRedeemableMint + )] + pub controller: AccountLoader<'info, Controller>, + + /// #4 + #[account( + mut, + seeds = [LSD_DEPOSITORY_NAMESPACE, collateral_mint.key().as_ref()], + bump = depository.load()?.bump, + has_one = collateral_mint @UxdError::InvalidCollateralMint + )] + pub depository: AccountLoader<'info, LsdDepository>, + + /// #5 + #[account( + mut, + seeds = [LSD_PROFITS_TOKEN_ACCOUNT_NAMESPACE, depository.key().as_ref()], + token::authority = depository, + token::mint = liquidation_mint, + bump = depository.load()?.profits_token_account_bump, + )] + pub profits_token_account: Account<'info, TokenAccount>, + + /// #6 + #[account( + mut, + constraint = user_collateral.owner == user.key() @UxdError::InvalidOwner, + constraint = user_collateral.mint == collateral_mint.key() @UxdError::InvalidCollateralMint, + )] + pub user_collateral: Box>, + + /// # + #[account( + mut, + constraint = user_redeemable.owner == user.key() @UxdError::InvalidOwner, + constraint = user_redeemable.mint == redeemable_mint.key() @UxdError::InvalidRedeemableMint, + )] + pub user_redeemable: Box>, + + /// # + /// Tracks the user overall position in the LSD Depository (one per user, per LSD Depository). + #[account( + init_if_needed, + seeds = [depository.key().as_ref(), user.key().as_ref()], + space = LSD_POSITION_SPACE, + payer = payer, + bump, + )] + pub lsd_position: AccountLoader<'info, LsdPosition>, + + /// # + /// PDA holding the deposited collateral on behalf of the lsd_position + #[account( + init_if_needed, + seeds = [lsd_position.key().as_ref()], + token::authority = lsd_position, + token::mint = collateral_mint, + payer = payer, + bump, + )] + pub lsd_position_collateral: Box>, + + /// # price oracle account for the collateral + #[account( + constraint = collateral_oracle_account.key() == depository.load()?.collateral_oracle_params.oracle_account + )] + pub collateral_oracle_account: AccountInfo<'info>, + + /// # + #[account(mut)] + pub redeemable_mint: Box>, + + /// # + pub collateral_mint: Box>, + + /// # + pub liquidation_mint: Box>, + + /// # + pub system_program: Program<'info, System>, + + /// # + pub token_program: Program<'info, Token>, + + /// # + pub uxd_program: Program<'info, crate::program::Uxd>, + + /// # + pub rent: Sysvar<'info, Rent>, +} + +pub(crate) fn handler(ctx: Context, collateral_amount: u64, loan_to_value_bps: u16) -> Result<()> { + // - 0 [CHECKS] ------------------------------------------------------------ + { + // - 0.1 verify that borrows are enabled + let lsd_depository = ctx.accounts.depository.load()?; + require!(lsd_depository.borrowing_disabled == false, UxdError::BorrowingDisabled); + + } + + // - 1 [TRANSFER USER'S COLLATERAL] ---------------------------------------- + { + msg!("[transfer] {} collateral from user to his lsd_position", + collateral_amount, + ); + token::transfer( + ctx.accounts + .to_transfer_collateral_from_user_to_lsd_position_collateral_ta_context(), + collateral_amount, + )?; + } + + // - 2 [MINT REDEEMABLES] -------------------------------------------------- + let redeemable_borrow_amount = collateral_amount / u64::from(loan_to_value_bps) * u64::from(BPS_POWER); + { + msg!("[mint] {} redeemable to user (ltv {})", + collateral_amount, + u64::from(loan_to_value_bps) / BPS_POWER, + ); + let controller_bump = ctx.accounts.controller.load()?.bump; + let controller_pda_signer: &[&[&[u8]]] = &[&[CONTROLLER_NAMESPACE, &[controller_bump]]]; + token::mint_to( + ctx.accounts + .to_mint_redeemable_context() + .with_signer(controller_pda_signer), + redeemable_borrow_amount, + )?; + } + + // - 3 [SETUP LIQUIDATION CRON] -------------------------------------------- + let liquidation_price: u64; + { + let controller = &mut ctx.accounts.controller.load_mut()?; + let depository = &mut ctx.accounts.depository.load_mut()?; + let curtime = controller.get_time()?; + let collateral_oracle_params = depository.collateral_oracle_params; + let lsd_price = OraclePrice::new_from_oracle( + &ctx.accounts + .collateral_oracle_account + .to_account_info(), + &collateral_oracle_params, + curtime, + false, + )?; + let lsd_price_usd = lsd_price.get_asset_amount_usd(collateral_amount, depository.collateral_mint_decimals)?; + liquidation_price = maths::checked_mul(redeemable_borrow_amount, maths::checked_div(u64::from(depository.max_loan_to_value_bps), u64::from(BPS_POWER))?)?; + + // Create a clockwork thread to auto-liquidate when the price is reached + {} + // - - setup/update either another cron or in previous cron: liquidate when running out of funding + } + + // - 3.1 [INITIALIZE LSD POSITION if needed] ------------------------------- + { + let lsd_position = &mut ctx.accounts.lsd_position.load_mut()?; + if lsd_position.is_initialized == false { + lsd_position.is_initialized = true; + lsd_position.bump = *ctx + .bumps + .get("lsd_position") + .ok_or_else(|| error!(UxdError::BumpError))?; + lsd_position.user_liquidation_thread_authority_bump = *ctx + .bumps + .get("user_liquidation_thread_authority") + .ok_or_else(|| error!(UxdError::BumpError))?; + lsd_position.depository = ctx.accounts.depository.key(); + } + } + + // - 4 [UPDATE STATS] ------------------------------------------------------ + { + let controller = &mut ctx.accounts.controller.load_mut()?; + let depository = &mut ctx.accounts.depository.load_mut()?; + let lsd_position = &mut ctx.accounts.lsd_position.load_mut()?; + // Depository + depository.collateral_amount_deposits = depository + .collateral_amount_deposits + .checked_add(collateral_amount) + .ok_or(UxdError::MathOverflow)?; + depository.redeemable_amount_under_management = depository + .redeemable_amount_under_management + .checked_add(redeemable_borrow_amount) + .ok_or(UxdError::MathOverflow)?; + // Controller + controller.redeemable_circulating_supply = controller + .redeemable_circulating_supply + .checked_add(redeemable_borrow_amount.into()) + .ok_or(UxdError::MathOverflow)?; + // LSD Position + lsd_position.collateral_amount = lsd_position + .collateral_amount + .checked_add(collateral_amount) + .ok_or(UxdError::MathOverflow)?; + lsd_position.redeemable_amount = lsd_position + .redeemable_amount + .checked_add(redeemable_borrow_amount) + .ok_or(UxdError::MathOverflow)?; + lsd_position.liquidation_price = liquidation_price; + } + + // - 5 [POST CHECKS]-------------------------------------------------------- + { + let depository = ctx.accounts.depository.load()?; + // - 6.1 check that the depository is not over the redeemable amount cap + require!(depository.redeemable_amount_under_management <= depository.redeemable_amount_under_management_cap, UxdError::MathOverflow); + } + + Ok(()) +} + +impl<'info> BorrowFromLsdDepository<'info> { + fn to_transfer_collateral_from_user_to_lsd_position_collateral_ta_context( + &self, + ) -> CpiContext<'_, '_, '_, 'info, Transfer<'info>> { + let cpi_program = self.token_program.to_account_info(); + let cpi_accounts = Transfer { + from: self.user_collateral.to_account_info(), + to: self.lsd_position_collateral.to_account_info(), + authority: self.user.to_account_info(), + }; + CpiContext::new(cpi_program, cpi_accounts) + } + + fn to_mint_redeemable_context(&self) -> CpiContext<'_, '_, '_, 'info, MintTo<'info>> { + let cpi_program = self.token_program.to_account_info(); + let cpi_accounts = MintTo { + mint: self.redeemable_mint.to_account_info(), + to: self.user_redeemable.to_account_info(), + authority: self.controller.to_account_info(), + }; + CpiContext::new(cpi_program, cpi_accounts) + } +} + +// Validate +impl<'info> BorrowFromLsdDepository<'info> { + pub(crate) fn validate(&self, collateral_amount: u64, loan_to_value_bps: u16) -> Result<()> { + validate_is_program_frozen(self.controller.load()?)?; + validate_collateral_amount(&self.user_collateral, collateral_amount)?; + validate_loan_to_value_bps(loan_to_value_bps, self.depository.load()?.max_loan_to_value_bps)?; + Ok(()) + } +} diff --git a/programs/uxd/src/instructions/lsd/configure_lsd_depository.rs b/programs/uxd/src/instructions/lsd/configure_lsd_depository.rs new file mode 100644 index 000000000..e69de29bb diff --git a/programs/uxd/src/instructions/lsd/initialize_lsd_depository.rs b/programs/uxd/src/instructions/lsd/initialize_lsd_depository.rs new file mode 100644 index 000000000..69fe873ca --- /dev/null +++ b/programs/uxd/src/instructions/lsd/initialize_lsd_depository.rs @@ -0,0 +1,149 @@ +use anchor_lang::prelude::*; +use anchor_spl::token::Mint; +use anchor_spl::token::Token; +use anchor_spl::token::TokenAccount; + +use crate::DEFAULT_LSD_LIQUIDATION_FEE_BPS; +use crate::DEFAULT_LSD_LIQUIDATION_LTV_THRESHOLD_BPS; +use crate::DEFAULT_LSD_MAX_LTV_BPS; +use crate::LSD_PROFITS_TOKEN_ACCOUNT_NAMESPACE; +use crate::error::UxdError; +use crate::events::InitializeLsdDepositoryEvent; +use crate::state::LSD_DEPOSITORY_SPACE; +use crate::state::LsdDepository; +use crate::validate_is_program_frozen; +use crate::Controller; +use crate::CONTROLLER_NAMESPACE; +use crate::DEFAULT_REDEEMABLE_UNDER_MANAGEMENT_CAP; +use crate::LSD_DEPOSITORY_ACCOUNT_VERSION; +use crate::LSD_DEPOSITORY_NAMESPACE; + +#[derive(Accounts)] +pub struct InitializeLsdDepository<'info> { + /// #1 Authored call accessible only to the signer matching Controller.authority + pub authority: Signer<'info>, + + /// #2 + #[account(mut)] + pub payer: Signer<'info>, + + /// #3 + #[account( + mut, + seeds = [CONTROLLER_NAMESPACE], + bump = controller.load()?.bump, + has_one = authority @UxdError::InvalidAuthority, + )] + pub controller: AccountLoader<'info, Controller>, + + /// #4 + #[account( + init, + seeds = [LSD_DEPOSITORY_NAMESPACE, collateral_mint.key().as_ref()], + bump, + payer = payer, + space = LSD_DEPOSITORY_SPACE, + )] + pub depository: AccountLoader<'info, LsdDepository>, + + /// #5 + pub collateral_mint: Account<'info, Mint>, + + /// #6 + pub liquidation_mint: Account<'info, Mint>, + + /// #7 + #[account( + init, + seeds = [LSD_PROFITS_TOKEN_ACCOUNT_NAMESPACE, depository.key().as_ref()], + token::authority = depository, + token::mint = liquidation_mint, + bump, + payer = payer, + )] + pub profits_token_account: Account<'info, TokenAccount>, + + /// #6 + pub system_program: Program<'info, System>, + + /// #7 + pub token_program: Program<'info, Token>, + + /// #8 + pub rent: Sysvar<'info, Rent>, +} + +pub(crate) fn handler(ctx: Context) -> Result<()> { + let depository_bump = *ctx + .bumps + .get("depository") + .ok_or_else(|| error!(UxdError::BumpError))?; + let profits_token_account_bump = *ctx + .bumps + .get("profits_token_account") + .ok_or_else(|| error!(UxdError::BumpError))?; + + let redeemable_mint_unit = 10_u64 + .checked_pow( + ctx.accounts + .controller + .load()? + .redeemable_mint_decimals + .into(), + ) + .ok_or_else(|| error!(UxdError::MathOverflow))?; + + let depository = &mut ctx.accounts.depository.load_init()?; + depository.bump = depository_bump; + depository.version = LSD_DEPOSITORY_ACCOUNT_VERSION; + depository.collateral_mint = ctx.accounts.collateral_mint.key(); + depository.collateral_mint_decimals = ctx.accounts.collateral_mint.decimals; + depository.liquidation_mint = ctx.accounts.liquidation_mint.key(); + depository.liquidation_mint_decimals = ctx.accounts.liquidation_mint.decimals; + depository.profits_token_account = ctx.accounts.profits_token_account.key(); + depository.profits_token_account_bump = profits_token_account_bump; + + // Configuration + depository.borrowing_disabled = true; + depository.redeemable_amount_under_management_cap = DEFAULT_REDEEMABLE_UNDER_MANAGEMENT_CAP + .checked_mul(redeemable_mint_unit) + .ok_or_else(|| error!(UxdError::MathOverflow))?; + depository.borrowing_fee_bps = u8::MIN; + depository.repay_fee_bps = u8::MIN; + depository.max_loan_to_value_bps = DEFAULT_LSD_MAX_LTV_BPS; + depository.liquidation_loan_to_value_threshold_bps = DEFAULT_LSD_LIQUIDATION_LTV_THRESHOLD_BPS; + depository.liquidation_fee_bps = DEFAULT_LSD_LIQUIDATION_FEE_BPS; + depository.profits_beneficiary = Pubkey::default(); + + // Accounting + depository.collateral_amount_deposits = u64::MIN; + depository.redeemable_amount_under_management = u64::MIN; + + // Stats + depository.collateral_amount_liquidated = u128::MIN; + depository.borrow_fee_accrued = u128::MIN; + depository.repay_fee_accrued = u128::MIN; + depository.liquidation_fee_accrued = u128::MIN; + depository.profits_collected = u128::MIN; + + emit!(InitializeLsdDepositoryEvent { + version: ctx.accounts.controller.load()?.version, + depository_version: depository.version, + controller: ctx.accounts.controller.key(), + depository: ctx.accounts.depository.key(), + collateral_mint: ctx.accounts.collateral_mint.key(), + liquidation_mint: ctx.accounts.liquidation_mint.key(), + }); + + Ok(()) +} + +// Validate input arguments +impl<'info> InitializeLsdDepository<'info> { + + pub(crate) fn validate(&self) -> Result<()> { + validate_is_program_frozen(self.controller.load()?)?; + + Ok(()) + } +} diff --git a/programs/uxd/src/instructions/lsd/mod.rs b/programs/uxd/src/instructions/lsd/mod.rs new file mode 100644 index 000000000..0c2683e2e --- /dev/null +++ b/programs/uxd/src/instructions/lsd/mod.rs @@ -0,0 +1,5 @@ +pub mod borrow_from_lsd_depository; +pub mod initialize_lsd_depository; + +pub use borrow_from_lsd_depository::*; +pub use initialize_lsd_depository::*; diff --git a/programs/uxd/src/instructions/lsd/repay_lsd_depository_borrow.rs b/programs/uxd/src/instructions/lsd/repay_lsd_depository_borrow.rs new file mode 100644 index 000000000..e69de29bb diff --git a/programs/uxd/src/instructions/mercurial/collect_profits_of_mercurial_vault_depository.rs b/programs/uxd/src/instructions/mercurial/collect_profits_of_mercurial_vault_depository.rs index 2ea26ae95..73c83ee2f 100644 --- a/programs/uxd/src/instructions/mercurial/collect_profits_of_mercurial_vault_depository.rs +++ b/programs/uxd/src/instructions/mercurial/collect_profits_of_mercurial_vault_depository.rs @@ -176,7 +176,7 @@ pub fn handler(ctx: Context) -> Result // 11 - update accounting let current_time_as_unix_timestamp = u64::try_from(Clock::get()?.unix_timestamp) .ok() - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; ctx.accounts .depository @@ -223,7 +223,7 @@ impl<'info> CollectProfitsOfMercurialVaultDepository<'info> { ) -> Result { let current_time = u64::try_from(Clock::get()?.unix_timestamp) .ok() - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; // Because it's u64 type, we will never withdraw too much due to precision loss, but withdraw less. // We withdraw less interests and fee due to precision loss and that's ok @@ -234,7 +234,7 @@ impl<'info> CollectProfitsOfMercurialVaultDepository<'info> { target_value, self.mercurial_vault_lp_mint.supply, ) - .ok_or(UxdError::MathError)?) + .ok_or(UxdError::MathOverflow)?) } pub fn calculate_collectable_profits_value(&self) -> Result { @@ -249,11 +249,11 @@ impl<'info> CollectProfitsOfMercurialVaultDepository<'info> { let redeemable_amount_under_management: u64 = u64::try_from(self.depository.load()?.redeemable_amount_under_management) .ok() - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; Ok(owned_lp_tokens_value .checked_sub(redeemable_amount_under_management) - .ok_or(UxdError::MathError)?) + .ok_or(UxdError::MathOverflow)?) } } diff --git a/programs/uxd/src/instructions/mercurial/mint_with_mercurial_vault_depository.rs b/programs/uxd/src/instructions/mercurial/mint_with_mercurial_vault_depository.rs index 6fa0cb437..34a729655 100644 --- a/programs/uxd/src/instructions/mercurial/mint_with_mercurial_vault_depository.rs +++ b/programs/uxd/src/instructions/mercurial/mint_with_mercurial_vault_depository.rs @@ -177,7 +177,7 @@ pub fn handler( let total_paid_fees = base_redeemable_amount .checked_sub(redeemable_amount_less_fees) - .ok_or_else(|| error!(UxdError::MathError))?; + .ok_or_else(|| error!(UxdError::MathOverflow))?; // 6 - Redeemable amount should be a valid amount require!( diff --git a/programs/uxd/src/instructions/mercurial/redeem_from_mercurial_vault_depository.rs b/programs/uxd/src/instructions/mercurial/redeem_from_mercurial_vault_depository.rs index 0a2585830..f2feda92e 100644 --- a/programs/uxd/src/instructions/mercurial/redeem_from_mercurial_vault_depository.rs +++ b/programs/uxd/src/instructions/mercurial/redeem_from_mercurial_vault_depository.rs @@ -142,7 +142,7 @@ pub fn handler( let total_paid_fees = base_collateral_amount .checked_sub(collateral_amount_less_fees) - .ok_or_else(|| error!(UxdError::MathError))?; + .ok_or_else(|| error!(UxdError::MathOverflow))?; // 2 - Calculate the right amount of lp token to withdraw to match collateral_amount_less_fees // This LP amount is subjected to precision loss (we handle this precision loss later) @@ -175,7 +175,7 @@ pub fn handler( let collateral_balance_change = after_collateral_balance .checked_sub(before_collateral_balance) - .ok_or_else(|| error!(UxdError::MathError))?; + .ok_or_else(|| error!(UxdError::MathOverflow))?; require!( collateral_balance_change > 0, @@ -191,7 +191,7 @@ pub fn handler( let lp_token_change = before_lp_token_vault_balance .checked_sub(after_lp_token_vault_balance) - .ok_or_else(|| error!(UxdError::MathError))?; + .ok_or_else(|| error!(UxdError::MathOverflow))?; require!( lp_token_change == lp_token_amount_to_match_collateral_amount_less_fees, @@ -218,11 +218,11 @@ pub fn handler( // 9 - Update Onchain accounting to reflect the changes let redeemable_amount_change = i128::from(redeemable_amount) .checked_mul(-1) - .ok_or_else(|| error!(UxdError::MathError))?; + .ok_or_else(|| error!(UxdError::MathOverflow))?; let collateral_amount_deposited_change = i128::from(collateral_balance_change) .checked_mul(-1) - .ok_or_else(|| error!(UxdError::MathError))?; + .ok_or_else(|| error!(UxdError::MathOverflow))?; ctx.accounts .controller @@ -279,7 +279,7 @@ impl<'info> RedeemFromMercurialVaultDepository<'info> { ) -> Result { let current_time = u64::try_from(Clock::get()?.unix_timestamp) .ok() - .ok_or_else(|| error!(UxdError::MathError))?; + .ok_or_else(|| error!(UxdError::MathOverflow))?; // Because it's u64 type, we will never withdraw too much due to precision loss, but withdraw less. // The user pays for precision loss by getting less collateral. @@ -289,7 +289,7 @@ impl<'info> RedeemFromMercurialVaultDepository<'info> { target_collateral_value, self.mercurial_vault_lp_mint.supply, ) - .ok_or_else(|| error!(UxdError::MathError)) + .ok_or_else(|| error!(UxdError::MathOverflow)) } } diff --git a/programs/uxd/src/instructions/mint.rs b/programs/uxd/src/instructions/mint.rs index 300275953..28cc3b0f1 100644 --- a/programs/uxd/src/instructions/mint.rs +++ b/programs/uxd/src/instructions/mint.rs @@ -214,7 +214,7 @@ pub(crate) fn handler(ctx: Context, collateral_amount: u64) -> Result<()> let maximum_after_mint_circulating_supply = controller .redeemable_circulating_supply .checked_add(collateral_amount.into()) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; // Build the vector of all known depository participating in the routing system let depository_info = vec![ diff --git a/programs/uxd/src/instructions/mint_with_identity_depository.rs b/programs/uxd/src/instructions/mint_with_identity_depository.rs index 424f4bed0..92d61e8cf 100644 --- a/programs/uxd/src/instructions/mint_with_identity_depository.rs +++ b/programs/uxd/src/instructions/mint_with_identity_depository.rs @@ -118,16 +118,16 @@ pub(crate) fn handler( depository.collateral_amount_deposited = depository .collateral_amount_deposited .checked_add(collateral_amount.into()) - .ok_or_else(|| error!(UxdError::MathError))?; + .ok_or_else(|| error!(UxdError::MathOverflow))?; depository.redeemable_amount_under_management = depository .redeemable_amount_under_management .checked_add(redeemable_amount.into()) - .ok_or_else(|| error!(UxdError::MathError))?; + .ok_or_else(|| error!(UxdError::MathOverflow))?; // Controller controller.redeemable_circulating_supply = controller .redeemable_circulating_supply .checked_add(redeemable_amount.into()) - .ok_or_else(|| error!(UxdError::MathError))?; + .ok_or_else(|| error!(UxdError::MathOverflow))?; } // - 4 [SANITY CHECKS] ---------------------------------------------------- diff --git a/programs/uxd/src/instructions/mod.rs b/programs/uxd/src/instructions/mod.rs index ba04176d7..559b420b8 100644 --- a/programs/uxd/src/instructions/mod.rs +++ b/programs/uxd/src/instructions/mod.rs @@ -5,6 +5,7 @@ pub mod edit_mercurial_vault_depository; pub mod freeze_program; pub mod initialize_controller; pub mod initialize_identity_depository; +pub mod lsd; pub mod mercurial; pub mod mint; pub mod mint_with_identity_depository; @@ -19,6 +20,7 @@ pub use edit_mercurial_vault_depository::*; pub use freeze_program::*; pub use initialize_controller::*; pub use initialize_identity_depository::*; +pub use lsd::*; pub use mercurial::*; pub use mint::*; pub use mint_with_identity_depository::*; diff --git a/programs/uxd/src/instructions/redeem.rs b/programs/uxd/src/instructions/redeem.rs index 30ca04e2f..221380523 100644 --- a/programs/uxd/src/instructions/redeem.rs +++ b/programs/uxd/src/instructions/redeem.rs @@ -171,7 +171,7 @@ pub(crate) fn handler(ctx: Context, redeemable_amount: u64) -> Result<() let mimimum_after_redeem_circulating_supply = controller .redeemable_circulating_supply .checked_sub(redeemable_amount.into()) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; // Build the vector of all known depository participating in the routing system let depository_info = vec![ diff --git a/programs/uxd/src/instructions/redeem_from_identity_depository.rs b/programs/uxd/src/instructions/redeem_from_identity_depository.rs index 9c9cab1f9..7d74963cc 100644 --- a/programs/uxd/src/instructions/redeem_from_identity_depository.rs +++ b/programs/uxd/src/instructions/redeem_from_identity_depository.rs @@ -116,16 +116,16 @@ pub(crate) fn handler( depository.collateral_amount_deposited = depository .collateral_amount_deposited .checked_sub(collateral_amount.into()) - .ok_or_else(|| error!(UxdError::MathError))?; + .ok_or_else(|| error!(UxdError::MathOverflow))?; depository.redeemable_amount_under_management = depository .redeemable_amount_under_management .checked_sub(redeemable_amount.into()) - .ok_or_else(|| error!(UxdError::MathError))?; + .ok_or_else(|| error!(UxdError::MathOverflow))?; // Controller controller.redeemable_circulating_supply = controller .redeemable_circulating_supply .checked_sub(redeemable_amount.into()) - .ok_or_else(|| error!(UxdError::MathError))?; + .ok_or_else(|| error!(UxdError::MathOverflow))?; } // - 5 [EVENT LOGGING] ---------------------------------------------------- diff --git a/programs/uxd/src/lib.rs b/programs/uxd/src/lib.rs index b1151b4c9..258d9cd5d 100644 --- a/programs/uxd/src/lib.rs +++ b/programs/uxd/src/lib.rs @@ -24,6 +24,7 @@ pub const MERCURIAL_VAULT_DEPOSITORY_ACCOUNT_VERSION: u8 = 1; pub const CONTROLLER_ACCOUNT_VERSION: u8 = 1; pub const IDENTITY_DEPOSITORY_ACCOUNT_VERSION: u8 = 1; pub const CREDIX_LP_DEPOSITORY_ACCOUNT_VERSION: u8 = 1; +pub const LSD_DEPOSITORY_ACCOUNT_VERSION: u8 = 1; // These are just "namespaces" seeds for the PDA creations. pub const REDEEMABLE_MINT_NAMESPACE: &[u8] = b"REDEEMABLE"; @@ -33,6 +34,11 @@ pub const MERCURIAL_VAULT_DEPOSITORY_LP_TOKEN_VAULT_NAMESPACE: &[u8] = b"MERCURIALVAULTDEPOSITORYLPVAULT"; pub const IDENTITY_DEPOSITORY_NAMESPACE: &[u8] = b"IDENTITYDEPOSITORY"; pub const IDENTITY_DEPOSITORY_COLLATERAL_NAMESPACE: &[u8] = b"IDENTITYDEPOSITORYCOLLATERAL"; +pub const LSD_DEPOSITORY_NAMESPACE: &[u8] = b"LSDDEPOSITORY"; +pub const LSD_DEPOSITORY_COLLATERAL_NAMESPACE: &[u8] = b"LSDDEPOSITORYCOLLATERAL"; +pub const LSD_PROFITS_TOKEN_ACCOUNT_NAMESPACE: &[u8] = b"LSDPROFITSTOKENACCOUNT"; +pub const LSD_USER_LIQUIDATION_THREAD_AUTHORITY_NAMESPACE: &[u8] = + b"LSDUSERLIQUIDATIONTHREADAUTHORITY"; pub const CREDIX_LP_DEPOSITORY_NAMESPACE: &[u8] = b"CREDIX_LP_DEPOSITORY"; pub const CREDIX_LP_EXTERNAL_PASS_NAMESPACE: &[u8] = b"credix-pass"; @@ -41,17 +47,22 @@ pub const CREDIX_LP_EXTERNAL_WITHDRAW_REQUEST_NAMESPACE: &[u8] = b"withdraw-requ pub const MAX_REDEEMABLE_GLOBAL_SUPPLY_CAP: u128 = u128::MAX; pub const DEFAULT_REDEEMABLE_GLOBAL_SUPPLY_CAP: u128 = 1_000_000; // 1 Million redeemable UI units -pub const DEFAULT_REDEEMABLE_UNDER_MANAGEMENT_CAP: u128 = 1_000_000; // 1 Million redeemable UI units +pub const DEFAULT_REDEEMABLE_UNDER_MANAGEMENT_CAP: u64 = 1_000_000; // 1 Million redeemable UI units pub const ROUTER_DEPOSITORIES_COUNT: usize = 3; pub const ROUTER_IDENTITY_DEPOSITORY_INDEX: usize = 0; pub const ROUTER_MERCURIAL_VAULT_DEPOSITORY_INDEX: usize = 1; pub const ROUTER_CREDIX_LP_DEPOSITORY_INDEX: usize = 2; -const BPS_POW: u8 = 4; // Raise a number to BPS_POW to get order of magnitude of -pub const BPS_UNIT_CONVERSION: u64 = (10u64).pow(BPS_POW as u32); +pub const DEFAULT_LSD_MAX_LTV_BPS: u16 = 7500; // 75% +pub const DEFAULT_LSD_LIQUIDATION_LTV_THRESHOLD_BPS: u16 = 8000; // 85% +pub const DEFAULT_LSD_LIQUIDATION_FEE_BPS: u16 = 500; // 5% + +const BPS_DECIMALS: u8 = 4; +pub const BPS_POWER: u64 = (10u64).pow(BPS_DECIMALS as u32); const SOLANA_MAX_MINT_DECIMALS: u8 = 9; +pub const USD_DECIMALS: u8 = 6; #[program] #[deny(unused_must_use)] @@ -297,6 +308,22 @@ pub mod uxd { instructions::rebalance_redeem_withdraw_request_from_credix_lp_depository::handler(ctx) } + #[access_control(ctx.accounts.validate())] + pub fn initialize_lsd_depository(ctx: Context) -> Result<()> { + msg!("[initialize_lsd_depository]"); + instructions::initialize_lsd_depository::handler(ctx) + } + + #[access_control(ctx.accounts.validate(collateral_amount, loan_to_value_bps))] + pub fn borrow_from_lsd_depository( + ctx: Context, + collateral_amount: u64, + loan_to_value_bps: u16, + ) -> Result<()> { + msg!("[borrow_from_lsd_depository]"); + instructions::borrow_from_lsd_depository::handler(ctx, collateral_amount, loan_to_value_bps) + } + /// Freeze or resume all ixs associated with the controller (except this one). /// /// Parameters: diff --git a/programs/uxd/src/mercurial_utils/calculate_lp_tokens_value.rs b/programs/uxd/src/mercurial_utils/calculate_lp_tokens_value.rs index 3ef0bd85d..d9895ea84 100644 --- a/programs/uxd/src/mercurial_utils/calculate_lp_tokens_value.rs +++ b/programs/uxd/src/mercurial_utils/calculate_lp_tokens_value.rs @@ -12,7 +12,7 @@ pub fn calculate_lp_tokens_value( ) -> Result { let current_time = u64::try_from(Clock::get()?.unix_timestamp) .ok() - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; Ok(mercurial_vault .get_amount_by_share( @@ -20,5 +20,5 @@ pub fn calculate_lp_tokens_value( lp_token_amount, mercurial_vault_lp_mint_supply, ) - .ok_or(UxdError::MathError)?) + .ok_or(UxdError::MathOverflow)?) } diff --git a/programs/uxd/src/mercurial_utils/calculate_possible_lp_token_precision_loss_collateral_value.rs b/programs/uxd/src/mercurial_utils/calculate_possible_lp_token_precision_loss_collateral_value.rs index 97ec36d04..76e480b71 100644 --- a/programs/uxd/src/mercurial_utils/calculate_possible_lp_token_precision_loss_collateral_value.rs +++ b/programs/uxd/src/mercurial_utils/calculate_possible_lp_token_precision_loss_collateral_value.rs @@ -13,13 +13,13 @@ pub fn calculate_possible_lp_token_precision_loss_collateral_value( ) -> Result { let current_time = u64::try_from(Clock::get()?.unix_timestamp) .ok() - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; // Calculate the price of 1 native LP token // Do not use mercurial_vault.get_amount_by_share because it does not handle precision loss let total_unlocked_lp_token_value = mercurial_vault .get_unlocked_amount(current_time) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; compute_value_for_single_share_ceil( total_unlocked_lp_token_value, diff --git a/programs/uxd/src/mercurial_utils/check_collateral_value_changed_to_match_target.rs b/programs/uxd/src/mercurial_utils/check_collateral_value_changed_to_match_target.rs index d61b3531b..48545d350 100644 --- a/programs/uxd/src/mercurial_utils/check_collateral_value_changed_to_match_target.rs +++ b/programs/uxd/src/mercurial_utils/check_collateral_value_changed_to_match_target.rs @@ -11,11 +11,11 @@ pub fn check_collateral_value_changed_to_match_target( // Lp token precision loss + withdraw collateral precision loss let maximum_allowed_precision_loss = possible_lp_token_precision_loss_collateral_value .checked_add(1) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; let target_minimal_allowed_value = target .checked_sub(maximum_allowed_precision_loss) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; require!( is_within_range_inclusive( diff --git a/programs/uxd/src/state/controller.rs b/programs/uxd/src/state/controller.rs index efe630ef6..4454cab23 100644 --- a/programs/uxd/src/state/controller.rs +++ b/programs/uxd/src/state/controller.rs @@ -1,3 +1,4 @@ +use anchor_lang::prelude::Clock; use std::mem::size_of; use crate::error::UxdError; @@ -112,7 +113,7 @@ impl Controller { self.registered_mercurial_vault_depositories_count = self .registered_mercurial_vault_depositories_count .checked_add(1) - .ok_or_else(|| error!(UxdError::MathError))?; + .ok_or_else(|| error!(UxdError::MathOverflow))?; // Add the new Mercurial Vault Depository ID to the array of registered Depositories let new_entry_index = current_size; self.registered_mercurial_vault_depositories[new_entry_index] = @@ -133,7 +134,7 @@ impl Controller { self.registered_credix_lp_depositories_count = self .registered_credix_lp_depositories_count .checked_add(1) - .ok_or_else(|| error!(UxdError::MathError))?; + .ok_or_else(|| error!(UxdError::MathOverflow))?; // Add the new Credix Lp Depository ID to the array of registered Depositories let new_entry_index = current_size; self.registered_credix_lp_depositories[new_entry_index] = credix_lp_depository_id; @@ -160,7 +161,16 @@ impl Controller { self.profits_total_collected = self .profits_total_collected .checked_add(profits_collected.into()) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; Ok(()) } + + pub fn get_time(&self) -> Result { + let time = Clock::get()?.unix_timestamp; + if time > 0 { + Ok(time) + } else { + Err(ProgramError::InvalidAccountData.into()) + } + } } diff --git a/programs/uxd/src/state/credix_lp_depository.rs b/programs/uxd/src/state/credix_lp_depository.rs index 32e4e616d..c0ece4610 100644 --- a/programs/uxd/src/state/credix_lp_depository.rs +++ b/programs/uxd/src/state/credix_lp_depository.rs @@ -101,11 +101,11 @@ impl CredixLpDepository { self.collateral_amount_deposited = self .collateral_amount_deposited .checked_add(collateral_amount_added.into()) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; self.redeemable_amount_under_management = self .redeemable_amount_under_management .checked_add(redeemable_amount_added.into()) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; Ok(()) } @@ -128,11 +128,11 @@ impl CredixLpDepository { self.collateral_amount_deposited = self .collateral_amount_deposited .checked_sub(collateral_amount_removed.into()) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; self.redeemable_amount_under_management = self .redeemable_amount_under_management .checked_sub(redeemable_amount_removed.into()) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; Ok(()) } @@ -141,7 +141,7 @@ impl CredixLpDepository { self.minting_fee_total_accrued = self .minting_fee_total_accrued .checked_add(minting_fee_paid.into()) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; Ok(()) } @@ -150,7 +150,7 @@ impl CredixLpDepository { self.redeeming_fee_total_accrued = self .redeeming_fee_total_accrued .checked_add(redeeming_fee_paid.into()) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; Ok(()) } @@ -162,7 +162,7 @@ impl CredixLpDepository { self.profits_total_collected = self .profits_total_collected .checked_add(profits_collected.into()) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; Ok(()) } } diff --git a/programs/uxd/src/state/lsd_depository.rs b/programs/uxd/src/state/lsd_depository.rs new file mode 100644 index 000000000..e3e076890 --- /dev/null +++ b/programs/uxd/src/state/lsd_depository.rs @@ -0,0 +1,73 @@ +use anchor_lang::prelude::*; +use std::mem::size_of; + +use super::OracleParams; + +pub const LSD_DEPOSITORY_RESERVED_SPACE: usize = 256; +pub const LSD_DEPOSITORY_SPACE: usize = 8 + + size_of::() // bump + + size_of::() // version + + size_of::() // collateral_mint + + size_of::() // collateral_mint_decimal + + size_of::() // liquidation_mint + + size_of::() // liquidation_mint_decimal + + size_of::() // profits_token_account + + size_of::() // profits_token_account_bump + + + size_of::() // borrowing_disabled + + size_of::() // redeemable_amount_under_management_cap + + size_of::() // borrowing_fee_bps + + size_of::() // repay_fee_bps + + size_of::() // loan_to_value_bps + + size_of::() // max_loan_to_value_bps + + size_of::() // liquidation_loan_to_value_threshold_bps + + size_of::() // liquidation_fee_bps + + size_of::() // profits_beneficiary + + + size_of::() // collateral_amount_deposits + + size_of::() // redeemable_amount_under_management + + + size_of::() // collateral_amount_liquidated + + size_of::() // borrow_fee_accrued + + size_of::() // repay_fee_accrued + + size_of::() // liquidation_fee_total_accrued + + size_of::() // profits_collected + + + LSD_DEPOSITORY_RESERVED_SPACE; + +#[account(zero_copy)] +#[repr(packed)] +pub struct LsdDepository { + pub bump: u8, + pub version: u8, + pub collateral_mint: Pubkey, + pub collateral_mint_decimals: u8, + pub liquidation_mint: Pubkey, // when liquidation occurs, this is the target mint (should ) + pub liquidation_mint_decimals: u8, + pub profits_token_account: Pubkey, // using liquidation_mint. Contains liquidation profits + borrowing fees if any + pub profits_token_account_bump: u8, + pub collateral_oracle_params: OracleParams, + + // Configuration + pub borrowing_disabled: bool, + pub redeemable_amount_under_management_cap: u64, + pub borrowing_fee_bps: u8, + pub repay_fee_bps: u8, + pub max_loan_to_value_bps: u16, + pub liquidation_loan_to_value_threshold_bps: u16, + pub liquidation_fee_bps: u16, + pub profits_beneficiary: Pubkey, + + // Accouting + pub collateral_amount_deposits: u64, + pub redeemable_amount_under_management: u64, + + // Stats + pub collateral_amount_liquidated: u128, + pub borrow_fee_accrued: u128, + pub repay_fee_accrued: u128, + pub liquidation_fee_accrued: u128, + pub profits_collected: u128, + + pub _reserved: [u8; LSD_DEPOSITORY_RESERVED_SPACE], +} diff --git a/programs/uxd/src/state/lsd_position.rs b/programs/uxd/src/state/lsd_position.rs new file mode 100644 index 000000000..c9439d367 --- /dev/null +++ b/programs/uxd/src/state/lsd_position.rs @@ -0,0 +1,31 @@ +use anchor_lang::prelude::*; +use std::mem::size_of; + +pub const LSD_POSITION_RESERVED_SPACE: usize = 64; +pub const LSD_POSITION_SPACE: usize = 8 + + size_of::() // bump + + size_of::() // liquidation_thread_authority_bump + + size_of::() // depository + + size_of::() // collateral_amount + + size_of::() // redeemable_amount + + size_of::() // liquidation_price + + + size_of::() // is_initialized + + LSD_POSITION_RESERVED_SPACE; + +/// Represents a user position tied to a specific LSD Depository. +/// It tracks the total collateral deposits and UXD borrowed. + +#[account(zero_copy)] +#[repr(packed)] +pub struct LsdPosition { + pub bump: u8, + pub user_liquidation_thread_authority_bump: u8, + pub depository: Pubkey, + pub collateral_amount: u64, + pub redeemable_amount: u64, + pub liquidation_price: u64, + + pub is_initialized: bool, + pub _reserved: [u8; LSD_POSITION_RESERVED_SPACE], +} diff --git a/programs/uxd/src/state/mercurial_vault_depository.rs b/programs/uxd/src/state/mercurial_vault_depository.rs index 85c41da89..b55deaeb3 100644 --- a/programs/uxd/src/state/mercurial_vault_depository.rs +++ b/programs/uxd/src/state/mercurial_vault_depository.rs @@ -109,7 +109,7 @@ impl MercurialVaultDepository { self.profits_total_collected = self .profits_total_collected .checked_add(collected_profits.into()) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; self.last_profits_collection_unix_timestamp = current_time_as_unix_timestamp; diff --git a/programs/uxd/src/state/mod.rs b/programs/uxd/src/state/mod.rs index 13bf1426e..f7c7ca063 100644 --- a/programs/uxd/src/state/mod.rs +++ b/programs/uxd/src/state/mod.rs @@ -1,9 +1,15 @@ pub mod controller; pub mod credix_lp_depository; pub mod identity_depository; +pub mod lsd_depository; +pub mod lsd_position; pub mod mercurial_vault_depository; +pub mod oracle; pub use controller::*; pub use credix_lp_depository::*; pub use identity_depository::*; +pub use lsd_depository::*; +pub use lsd_position::*; pub use mercurial_vault_depository::*; +pub use oracle::*; diff --git a/programs/uxd/src/state/oracle.rs b/programs/uxd/src/state/oracle.rs new file mode 100644 index 000000000..f342a04da --- /dev/null +++ b/programs/uxd/src/state/oracle.rs @@ -0,0 +1,307 @@ +//! Oracle price service handling + +use crate::{ + utils::{self, is_empty_account, maths}, + BPS_POWER, USD_DECIMALS, +}; + +use {crate::error::UxdError, anchor_lang::prelude::*, core::cmp::Ordering}; + +const ORACLE_EXPONENT_SCALE: i32 = -9; +const ORACLE_PRICE_SCALE: u64 = 1_000_000_000; +const ORACLE_MAX_PRICE: u64 = (1 << 28) - 1; + +#[derive(Copy, Clone, PartialEq, AnchorSerialize, AnchorDeserialize, Debug)] +pub enum OracleType { + None, + Custom, + Pyth, +} + +impl Default for OracleType { + fn default() -> Self { + Self::None + } +} + +#[derive(Copy, Clone, Eq, PartialEq, AnchorSerialize, AnchorDeserialize, Default, Debug)] +pub struct OraclePrice { + pub price: u64, + pub exponent: i32, +} + +#[derive(Copy, Clone, PartialEq, AnchorSerialize, AnchorDeserialize, Default, Debug)] +pub struct OracleParams { + pub oracle_account: Pubkey, + pub oracle_type: OracleType, + pub max_price_error: u64, + pub max_price_age_sec: u32, +} + +#[account] +#[derive(Default, Debug)] +pub struct CustomOracle { + pub price: u64, + pub expo: i32, + pub conf: u64, + pub publish_time: i64, +} + +impl CustomOracle { + pub const LEN: usize = 8 + std::mem::size_of::(); +} + +impl PartialOrd for OraclePrice { + fn partial_cmp(&self, other: &OraclePrice) -> Option { + let (lhs, rhs) = if self.exponent == other.exponent { + (self.price, other.price) + } else if self.exponent < other.exponent { + if let Ok(scaled_price) = other.scale_to_exponent(self.exponent) { + (self.price, scaled_price.price) + } else { + return None; + } + } else if let Ok(scaled_price) = self.scale_to_exponent(other.exponent) { + (scaled_price.price, other.price) + } else { + return None; + }; + lhs.partial_cmp(&rhs) + } +} + +#[allow(dead_code)] +impl OraclePrice { + pub fn new(price: u64, exponent: i32) -> Self { + Self { price, exponent } + } + + pub fn new_from_token(amount_and_decimals: (u64, u8)) -> Self { + Self { + price: amount_and_decimals.0, + exponent: -(amount_and_decimals.1 as i32), + } + } + + pub fn new_from_oracle( + oracle_account: &AccountInfo, + oracle_params: &OracleParams, + current_time: i64, + use_ema: bool, + ) -> Result { + match oracle_params.oracle_type { + OracleType::Custom => Self::get_custom_price( + oracle_account, + oracle_params.max_price_error, + oracle_params.max_price_age_sec, + current_time, + ), + OracleType::Pyth => Self::get_pyth_price( + oracle_account, + oracle_params.max_price_error, + oracle_params.max_price_age_sec, + current_time, + use_ema, + ), + _ => err!(UxdError::UnsupportedOracle), + } + } + + // Converts token amount to USD with implied USD_DECIMALS decimals using oracle price + pub fn get_asset_amount_usd(&self, token_amount: u64, token_decimals: u8) -> Result { + if token_amount == 0 || self.price == 0 { + return Ok(0); + } + maths::checked_decimal_mul( + token_amount, + -(token_decimals as i32), + self.price, + self.exponent, + -(USD_DECIMALS as i32), + ) + } + + // Converts USD amount with implied USD_DECIMALS decimals to token amount + pub fn get_token_amount(&self, asset_amount_usd: u64, token_decimals: u8) -> Result { + if asset_amount_usd == 0 || self.price == 0 { + return Ok(0); + } + maths::checked_decimal_div( + asset_amount_usd, + -(USD_DECIMALS as i32), + self.price, + self.exponent, + -(token_decimals as i32), + ) + } + + /// Returns price with mantissa normalized to be less than ORACLE_MAX_PRICE + pub fn normalize(&self) -> Result { + let mut p = self.price; + let mut e = self.exponent; + + while p > ORACLE_MAX_PRICE { + p = maths::checked_div(p, 10)?; + e = maths::checked_add(e, 1)?; + } + + Ok(OraclePrice { + price: p, + exponent: e, + }) + } + + pub fn checked_div(&self, other: &OraclePrice) -> Result { + let base = self.normalize()?; + let other = other.normalize()?; + + Ok(OraclePrice { + price: maths::checked_div( + maths::checked_mul(base.price, ORACLE_PRICE_SCALE)?, + other.price, + )?, + exponent: maths::checked_sub( + maths::checked_add(base.exponent, ORACLE_EXPONENT_SCALE)?, + other.exponent, + )?, + }) + } + + pub fn checked_mul(&self, other: &OraclePrice) -> Result { + Ok(OraclePrice { + price: maths::checked_mul(self.price, other.price)?, + exponent: maths::checked_add(self.exponent, other.exponent)?, + }) + } + + pub fn scale_to_exponent(&self, target_exponent: i32) -> Result { + if target_exponent == self.exponent { + return Ok(*self); + } + let delta = maths::checked_sub(target_exponent, self.exponent)?; + if delta > 0 { + Ok(OraclePrice { + price: maths::checked_div(self.price, maths::checked_pow(10, delta as usize)?)?, + exponent: target_exponent, + }) + } else { + Ok(OraclePrice { + price: maths::checked_mul(self.price, maths::checked_pow(10, (-delta) as usize)?)?, + exponent: target_exponent, + }) + } + } + + pub fn checked_as_f64(&self) -> Result { + maths::checked_float_mul( + maths::checked_as_f64(self.price)?, + maths::checked_powi(10.0, self.exponent)?, + ) + } + + pub fn get_min_price(&self, other: &OraclePrice, is_stable: bool) -> Result { + let min_price = if self < other { self } else { other }; + if is_stable { + if min_price.exponent > 0 { + if min_price.price == 0 { + return Ok(*min_price); + } else { + return Ok(OraclePrice { + price: 1000000u64, + exponent: -6, + }); + } + } + let one_usd = maths::checked_pow(10u64, (-min_price.exponent) as usize)?; + if min_price.price > one_usd { + Ok(OraclePrice { + price: one_usd, + exponent: min_price.exponent, + }) + } else { + Ok(*min_price) + } + } else { + Ok(*min_price) + } + } + + // private helpers + fn get_custom_price( + custom_price_info: &AccountInfo, + max_price_error: u64, + max_price_age_sec: u32, + current_time: i64, + ) -> Result { + require!( + !utils::is_empty_account(custom_price_info)?, + UxdError::InvalidOracleAccount + ); + + let oracle_acc = Account::::try_from(custom_price_info)?; + + let last_update_age_sec = maths::checked_sub(current_time, oracle_acc.publish_time)?; + if last_update_age_sec > max_price_age_sec as i64 { + msg!("Error: Custom oracle price is stale"); + return err!(UxdError::StaleOraclePrice); + } + + if oracle_acc.price == 0 + || maths::checked_div( + maths::checked_mul(oracle_acc.conf as u128, BPS_POWER as u128)?, + oracle_acc.price as u128, + )? > max_price_error as u128 + { + msg!("Error: Custom oracle price is out of bounds"); + return err!(UxdError::InvalidOraclePrice); + } + + Ok(OraclePrice { + // price is i64 and > 0 per check above + price: oracle_acc.price, + exponent: oracle_acc.expo, + }) + } + + fn get_pyth_price( + pyth_price_info: &AccountInfo, + max_price_error: u64, + max_price_age_sec: u32, + current_time: i64, + use_ema: bool, + ) -> Result { + require!( + !is_empty_account(pyth_price_info)?, + UxdError::InvalidOracleAccount + ); + let price_feed = pyth_sdk_solana::load_price_feed_from_account_info(pyth_price_info) + .map_err(|_| UxdError::InvalidOracleAccount)?; + let pyth_price = if use_ema { + price_feed.get_ema_price_unchecked() + } else { + price_feed.get_price_unchecked() + }; + + let last_update_age_sec = maths::checked_sub(current_time, pyth_price.publish_time)?; + if last_update_age_sec > max_price_age_sec as i64 { + msg!("Error: Pyth oracle price is stale"); + return err!(UxdError::StaleOraclePrice); + } + + if pyth_price.price <= 0 + || maths::checked_div( + maths::checked_mul(pyth_price.conf as u128, BPS_POWER as u128)?, + pyth_price.price as u128, + )? > max_price_error as u128 + { + msg!("Error: Pyth oracle price is out of bounds"); + return err!(UxdError::InvalidOraclePrice); + } + + Ok(OraclePrice { + // price is i64 and > 0 per check above + price: pyth_price.price as u64, + exponent: pyth_price.expo, + }) + } +} diff --git a/programs/uxd/src/utils/accounts/is_empty_account.rs b/programs/uxd/src/utils/accounts/is_empty_account.rs new file mode 100644 index 000000000..4874d8079 --- /dev/null +++ b/programs/uxd/src/utils/accounts/is_empty_account.rs @@ -0,0 +1,5 @@ +use anchor_lang::prelude::*; + +pub fn is_empty_account(account_info: &AccountInfo) -> Result { + Ok(account_info.try_data_is_empty()? || account_info.try_lamports()? == 0) +} diff --git a/programs/uxd/src/utils/accounts/mod.rs b/programs/uxd/src/utils/accounts/mod.rs new file mode 100644 index 000000000..105e8ff99 --- /dev/null +++ b/programs/uxd/src/utils/accounts/mod.rs @@ -0,0 +1,3 @@ +pub mod is_empty_account; + +pub use is_empty_account::*; diff --git a/programs/uxd/src/utils/calculate_amount_less_fees.rs b/programs/uxd/src/utils/calculate_amount_less_fees.rs index 2986f1f39..bb3c5e911 100644 --- a/programs/uxd/src/utils/calculate_amount_less_fees.rs +++ b/programs/uxd/src/utils/calculate_amount_less_fees.rs @@ -1,10 +1,10 @@ -use crate::BPS_UNIT_CONVERSION; +use crate::BPS_POWER; use anchor_lang::prelude::*; use super::compute_amount_less_fraction_floor; pub fn calculate_amount_less_fees(amount: u64, fee_amount_in_bps: u8) -> Result { let fraction_numerator: u64 = fee_amount_in_bps.into(); - let fraction_denominator: u64 = BPS_UNIT_CONVERSION; + let fraction_denominator: u64 = BPS_POWER; compute_amount_less_fraction_floor(amount, fraction_numerator, fraction_denominator) } diff --git a/programs/uxd/src/utils/calculate_depositories_mint_collateral_amount.rs b/programs/uxd/src/utils/calculate_depositories_mint_collateral_amount.rs index 53f474563..826e112e8 100644 --- a/programs/uxd/src/utils/calculate_depositories_mint_collateral_amount.rs +++ b/programs/uxd/src/utils/calculate_depositories_mint_collateral_amount.rs @@ -39,7 +39,7 @@ pub fn calculate_depositories_mint_collateral_amount( Ok(depository .target_redeemable_amount .checked_sub(depository_redeemable_amount_under_management) - .ok_or(UxdError::MathError)?) + .ok_or(UxdError::MathOverflow)?) }) .collect::>>()?; @@ -68,11 +68,11 @@ pub fn calculate_depositories_mint_collateral_amount( let other_depositories_maximum_mintable_collateral_amount = total_maximum_mintable_collateral_amount .checked_sub(*depository_mintable_collateral_amount) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; compute_amount_less_fraction_floor( requested_mint_collateral_amount, other_depositories_maximum_mintable_collateral_amount, - total_maximum_mintable_collateral_amount, + total_maximum_mintable_collateral_amount.into(), ) }) .collect::>>()?; diff --git a/programs/uxd/src/utils/calculate_depositories_redeemable_amount.rs b/programs/uxd/src/utils/calculate_depositories_redeemable_amount.rs index d6384181a..6a3fed985 100644 --- a/programs/uxd/src/utils/calculate_depositories_redeemable_amount.rs +++ b/programs/uxd/src/utils/calculate_depositories_redeemable_amount.rs @@ -44,7 +44,7 @@ pub fn calculate_depositories_redeemable_amount( } Ok(depository_redeemable_amount_under_management .checked_sub(depository.target_redeemable_amount) - .ok_or(UxdError::MathError)?) + .ok_or(UxdError::MathOverflow)?) }) .collect::>>()?; @@ -84,7 +84,7 @@ pub fn calculate_depositories_redeemable_amount( let total_overall_redeemable_amount = total_over_target_redeemable_amount .checked_add(total_under_target_redeemable_amount) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; require!( total_overall_redeemable_amount >= requested_redeemable_amount, UxdError::InvalidRedeemableAmount @@ -111,17 +111,17 @@ pub fn calculate_depositories_redeemable_amount( ); let requested_second_redeemable_amount = requested_redeemable_amount .checked_sub(requested_first_redeemable_amount) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; // First step, try to use the over_target amounts, weighted for each depository let depository_first_redeemable_amount = if total_over_target_redeemable_amount > 0 { let other_depositories_over_target_redeemable_amount = total_over_target_redeemable_amount .checked_sub(*depository_over_target_redeemable_amount) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; compute_amount_less_fraction_floor( requested_first_redeemable_amount, other_depositories_over_target_redeemable_amount, - total_over_target_redeemable_amount, + total_over_target_redeemable_amount.into(), )? } else { 0 @@ -131,11 +131,11 @@ pub fn calculate_depositories_redeemable_amount( let other_depositories_under_target_redeemable_amount = total_under_target_redeemable_amount .checked_sub(*depository_under_target_redeemable_amount) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; compute_amount_less_fraction_floor( requested_second_redeemable_amount, other_depositories_under_target_redeemable_amount, - total_under_target_redeemable_amount, + total_under_target_redeemable_amount.into(), )? } else { 0 @@ -143,7 +143,7 @@ pub fn calculate_depositories_redeemable_amount( // The combo of the two gives our depository amount Ok(depository_first_redeemable_amount .checked_add(depository_second_redeemable_amount) - .ok_or(UxdError::MathError)?) + .ok_or(UxdError::MathOverflow)?) }, ) .collect::>>()?; @@ -160,7 +160,7 @@ pub fn calculate_depositories_redeemable_amount( let mut rounding_errors = requested_redeemable_amount .checked_sub(total_redeemable_amount) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; for i in 0..depositories_info.len() { let depository = &depositories_info[i]; @@ -170,15 +170,15 @@ pub fn calculate_depositories_redeemable_amount( let depository_remaining_after_redeem = checked_convert_u128_to_u64(depository.redeemable_amount_under_management)? .checked_sub(depositories_redeemable_amount[i]) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; let depository_rounding_correction = std::cmp::min(depository_remaining_after_redeem, rounding_errors); depositories_redeemable_amount[i] = depositories_redeemable_amount[i] .checked_add(depository_rounding_correction) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; rounding_errors = rounding_errors .checked_sub(depository_rounding_correction) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; } // Done diff --git a/programs/uxd/src/utils/calculate_depositories_sum_value.rs b/programs/uxd/src/utils/calculate_depositories_sum_value.rs index 5e066f4f8..fcb6097bd 100644 --- a/programs/uxd/src/utils/calculate_depositories_sum_value.rs +++ b/programs/uxd/src/utils/calculate_depositories_sum_value.rs @@ -15,7 +15,9 @@ pub fn calculate_depositories_sum_value(depositories_values: &Vec) -> Resul let sum = depositories_values .iter() .try_fold(0u64, |accumulator: u64, value: &u64| { - accumulator.checked_add(*value).ok_or(UxdError::MathError) + accumulator + .checked_add(*value) + .ok_or(UxdError::MathOverflow) })?; Ok(sum) } diff --git a/programs/uxd/src/utils/calculate_depositories_target_redeemable_amount.rs b/programs/uxd/src/utils/calculate_depositories_target_redeemable_amount.rs index b2ce6ec62..abf6eca81 100644 --- a/programs/uxd/src/utils/calculate_depositories_target_redeemable_amount.rs +++ b/programs/uxd/src/utils/calculate_depositories_target_redeemable_amount.rs @@ -3,7 +3,7 @@ use anchor_lang::require; use crate::error::UxdError; use crate::utils::calculate_depositories_sum_value; -use crate::BPS_UNIT_CONVERSION; +use crate::BPS_POWER; use crate::ROUTER_DEPOSITORIES_COUNT; use super::checked_convert_u128_to_u64; @@ -32,7 +32,7 @@ pub fn calculate_depositories_target_redeemable_amount( .collect::>(); let total_weight_bps = calculate_depositories_sum_value(&depositories_weights_bps)?; require!( - total_weight_bps == BPS_UNIT_CONVERSION, + total_weight_bps == BPS_POWER, UxdError::InvalidDepositoriesWeightBps, ); @@ -48,7 +48,7 @@ pub fn calculate_depositories_target_redeemable_amount( compute_amount_fraction_ceil( redeemable_circulating_supply, depository.weight_bps.into(), - BPS_UNIT_CONVERSION, + BPS_POWER, ) }) .collect::>>()?; @@ -80,7 +80,7 @@ pub fn calculate_depositories_target_redeemable_amount( } Ok(depository_raw_target_redeemable_amount .checked_sub(*depository_hard_cap_amount) - .ok_or(UxdError::MathError)?) + .ok_or(UxdError::MathOverflow)?) }, ) .collect::>>()?; @@ -97,7 +97,7 @@ pub fn calculate_depositories_target_redeemable_amount( } Ok(depository_hard_cap_amount .checked_sub(*depository_raw_target_redeemable_amount) - .ok_or(UxdError::MathError)?) + .ok_or(UxdError::MathOverflow)?) }, ) .collect::>>()?; @@ -154,9 +154,9 @@ pub fn calculate_depositories_target_redeemable_amount( }; let final_target = depository_raw_target_redeemable_amount .checked_add(overflow_amount_reallocated_from_other_depositories) - .ok_or(UxdError::MathError)? + .ok_or(UxdError::MathOverflow)? .checked_sub(*depository_overflow_amount) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; Ok(final_target) }, ) diff --git a/programs/uxd/src/utils/math/checked_add_u128_and_i128.rs b/programs/uxd/src/utils/math/checked_add_u128_and_i128.rs index 6cff57612..e28597c88 100644 --- a/programs/uxd/src/utils/math/checked_add_u128_and_i128.rs +++ b/programs/uxd/src/utils/math/checked_add_u128_and_i128.rs @@ -6,25 +6,25 @@ pub fn checked_add_u128_and_i128(value_before: u128, change_delta: i128) -> Resu if change_delta >= 0 { let increase: u128 = u128::try_from(change_delta) .ok() - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; return Ok(value_before .checked_add(increase) - .ok_or(UxdError::MathError)?); + .ok_or(UxdError::MathOverflow)?); } // In case of a negative change, substract the absolute value of the delta (decrease) let decrease: u128 = if change_delta == i128::MIN { // special case: i128::MIN does not have an i128 absolute value u128::try_from(i128::MAX) .ok() - .ok_or(UxdError::MathError)? + .ok_or(UxdError::MathOverflow)? .checked_add(1) - .ok_or(UxdError::MathError)? + .ok_or(UxdError::MathOverflow)? } else { - u128::try_from(change_delta.checked_abs().ok_or(UxdError::MathError)?) + u128::try_from(change_delta.checked_abs().ok_or(UxdError::MathOverflow)?) .ok() - .ok_or(UxdError::MathError)? + .ok_or(UxdError::MathOverflow)? }; Ok(value_before .checked_sub(decrease) - .ok_or(UxdError::MathError)?) + .ok_or(UxdError::MathOverflow)?) } diff --git a/programs/uxd/src/utils/math/checked_convert_u128_to_u64.rs b/programs/uxd/src/utils/math/checked_convert_u128_to_u64.rs index 4168d30b7..e0ceab6c7 100644 --- a/programs/uxd/src/utils/math/checked_convert_u128_to_u64.rs +++ b/programs/uxd/src/utils/math/checked_convert_u128_to_u64.rs @@ -2,5 +2,5 @@ use crate::error::UxdError; use anchor_lang::prelude::*; pub fn checked_convert_u128_to_u64(value: u128) -> Result { - Ok(u64::try_from(value).ok().ok_or(UxdError::MathError)?) + Ok(u64::try_from(value).ok().ok_or(UxdError::MathOverflow)?) } diff --git a/programs/uxd/src/utils/math/compute_amount_fraction_ceil.rs b/programs/uxd/src/utils/math/compute_amount_fraction_ceil.rs index 697aac598..837df33ea 100644 --- a/programs/uxd/src/utils/math/compute_amount_fraction_ceil.rs +++ b/programs/uxd/src/utils/math/compute_amount_fraction_ceil.rs @@ -8,7 +8,7 @@ pub fn compute_amount_fraction_ceil( fraction_numerator: u64, fraction_denominator: u64, ) -> Result { - require!(fraction_denominator > 0, UxdError::MathError); + require!(fraction_denominator > 0, UxdError::MathOverflow); if fraction_numerator == 0 || amount == 0 { return Ok(0); } @@ -17,14 +17,14 @@ pub fn compute_amount_fraction_ceil( let fraction_denominator: u128 = fraction_denominator.into(); let amount_fraction_ceil: u128 = amount .checked_mul(fraction_numerator) - .ok_or(UxdError::MathError)? + .ok_or(UxdError::MathOverflow)? .checked_sub(1) - .ok_or(UxdError::MathError)? + .ok_or(UxdError::MathOverflow)? .checked_div(fraction_denominator) - .ok_or(UxdError::MathError)? + .ok_or(UxdError::MathOverflow)? .checked_add(1) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; Ok(u64::try_from(amount_fraction_ceil) .ok() - .ok_or(UxdError::MathError)?) + .ok_or(UxdError::MathOverflow)?) } diff --git a/programs/uxd/src/utils/math/compute_amount_less_fraction_floor.rs b/programs/uxd/src/utils/math/compute_amount_less_fraction_floor.rs index 7b1aa3e89..ea136b8ff 100644 --- a/programs/uxd/src/utils/math/compute_amount_less_fraction_floor.rs +++ b/programs/uxd/src/utils/math/compute_amount_less_fraction_floor.rs @@ -8,7 +8,7 @@ pub fn compute_amount_less_fraction_floor( fraction_numerator: u64, fraction_denominator: u64, ) -> Result { - require!(fraction_denominator > 0, UxdError::MathError); + require!(fraction_denominator > 0, UxdError::MathOverflow); let amount: u128 = amount.into(); let fraction_numerator: u128 = fraction_numerator.into(); let fraction_denominator: u128 = fraction_denominator.into(); @@ -16,12 +16,12 @@ pub fn compute_amount_less_fraction_floor( .checked_mul( fraction_denominator .checked_sub(fraction_numerator) - .ok_or(UxdError::MathError)?, + .ok_or(UxdError::MathOverflow)?, ) - .ok_or(UxdError::MathError)? + .ok_or(UxdError::MathOverflow)? .checked_div(fraction_denominator) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; Ok(u64::try_from(amount_less_fraction) .ok() - .ok_or(UxdError::MathError)?) + .ok_or(UxdError::MathOverflow)?) } diff --git a/programs/uxd/src/utils/math/compute_decrease.rs b/programs/uxd/src/utils/math/compute_decrease.rs index 61753ffab..5121c549e 100644 --- a/programs/uxd/src/utils/math/compute_decrease.rs +++ b/programs/uxd/src/utils/math/compute_decrease.rs @@ -2,5 +2,5 @@ use crate::error::UxdError; use anchor_lang::prelude::*; pub fn compute_decrease(before: u64, after: u64) -> Result { - Ok(before.checked_sub(after).ok_or(UxdError::MathError)?) + Ok(before.checked_sub(after).ok_or(UxdError::MathOverflow)?) } diff --git a/programs/uxd/src/utils/math/compute_increase.rs b/programs/uxd/src/utils/math/compute_increase.rs index f497558c0..9d15bc155 100644 --- a/programs/uxd/src/utils/math/compute_increase.rs +++ b/programs/uxd/src/utils/math/compute_increase.rs @@ -2,5 +2,5 @@ use crate::error::UxdError; use anchor_lang::prelude::*; pub fn compute_increase(before: u64, after: u64) -> Result { - Ok(after.checked_sub(before).ok_or(UxdError::MathError)?) + Ok(after.checked_sub(before).ok_or(UxdError::MathOverflow)?) } diff --git a/programs/uxd/src/utils/math/compute_shares_amount_for_value_floor.rs b/programs/uxd/src/utils/math/compute_shares_amount_for_value_floor.rs index 006abd4e0..7d93dedb0 100644 --- a/programs/uxd/src/utils/math/compute_shares_amount_for_value_floor.rs +++ b/programs/uxd/src/utils/math/compute_shares_amount_for_value_floor.rs @@ -11,17 +11,17 @@ pub fn compute_shares_amount_for_value_floor( if value == 0 { return Ok(0); } - require!(total_shares_supply > 0, UxdError::MathError); - require!(total_shares_value > 0, UxdError::MathError); + require!(total_shares_supply > 0, UxdError::MathOverflow); + require!(total_shares_value > 0, UxdError::MathOverflow); let value: u128 = value.into(); let total_shares_supply: u128 = total_shares_supply.into(); let total_shares_value: u128 = total_shares_value.into(); let shares_amount: u128 = value .checked_mul(total_shares_supply) - .ok_or(UxdError::MathError)? + .ok_or(UxdError::MathOverflow)? .checked_div(total_shares_value) - .ok_or(UxdError::MathError)?; + .ok_or(UxdError::MathOverflow)?; Ok(u64::try_from(shares_amount) .ok() - .ok_or(UxdError::MathError)?) + .ok_or(UxdError::MathOverflow)?) } diff --git a/programs/uxd/src/utils/math/compute_value_for_shares_amount_floor.rs b/programs/uxd/src/utils/math/compute_value_for_shares_amount_floor.rs index fd7cbbe61..bdba47f04 100644 --- a/programs/uxd/src/utils/math/compute_value_for_shares_amount_floor.rs +++ b/programs/uxd/src/utils/math/compute_value_for_shares_amount_floor.rs @@ -11,15 +11,15 @@ pub fn compute_value_for_shares_amount_floor( if shares_amount == 0 { return Ok(0); } - require!(total_shares_supply > 0, UxdError::MathError); - require!(total_shares_value > 0, UxdError::MathError); + require!(total_shares_supply > 0, UxdError::MathOverflow); + require!(total_shares_value > 0, UxdError::MathOverflow); let shares_amount: u128 = shares_amount.into(); let total_shares_supply: u128 = total_shares_supply.into(); let total_shares_value: u128 = total_shares_value.into(); let value: u128 = shares_amount .checked_mul(total_shares_value) - .ok_or(UxdError::MathError)? + .ok_or(UxdError::MathOverflow)? .checked_div(total_shares_supply) - .ok_or(UxdError::MathError)?; - Ok(u64::try_from(value).ok().ok_or(UxdError::MathError)?) + .ok_or(UxdError::MathOverflow)?; + Ok(u64::try_from(value).ok().ok_or(UxdError::MathOverflow)?) } diff --git a/programs/uxd/src/utils/math/compute_value_for_single_share_ceil.rs b/programs/uxd/src/utils/math/compute_value_for_single_share_ceil.rs index f88f41656..c70ffba0f 100644 --- a/programs/uxd/src/utils/math/compute_value_for_single_share_ceil.rs +++ b/programs/uxd/src/utils/math/compute_value_for_single_share_ceil.rs @@ -7,13 +7,13 @@ pub fn compute_value_for_single_share_ceil( ) -> Result { // ceil ( total_shares_value / total_shares_supply ) // is equivalent to (total_shares_value - 1) / total_shares_supply + 1 - require!(total_shares_value > 0, UxdError::MathError); - require!(total_shares_supply > 0, UxdError::MathError); + require!(total_shares_value > 0, UxdError::MathOverflow); + require!(total_shares_supply > 0, UxdError::MathOverflow); Ok(total_shares_value .checked_sub(1) - .ok_or(UxdError::MathError)? + .ok_or(UxdError::MathOverflow)? .checked_div(total_shares_supply) - .ok_or(UxdError::MathError)? + .ok_or(UxdError::MathOverflow)? .checked_add(1) - .ok_or(UxdError::MathError)?) + .ok_or(UxdError::MathOverflow)?) } diff --git a/programs/uxd/src/utils/maths.rs b/programs/uxd/src/utils/maths.rs new file mode 100644 index 000000000..cedf27e61 --- /dev/null +++ b/programs/uxd/src/utils/maths.rs @@ -0,0 +1,406 @@ +//! Common math routines. + +#![allow(dead_code)] + +use {crate::error::UxdError, anchor_lang::prelude::*, std::fmt::Display}; + +pub fn checked_add(arg1: T, arg2: T) -> Result +where + T: num_traits::PrimInt + Display, +{ + if let Some(res) = arg1.checked_add(&arg2) { + Ok(res) + } else { + msg!("Error: Overflow in {} + {}", arg1, arg2); + err!(UxdError::MathOverflow) + } +} + +pub fn checked_sub(arg1: T, arg2: T) -> Result +where + T: num_traits::PrimInt + Display, +{ + if let Some(res) = arg1.checked_sub(&arg2) { + Ok(res) + } else { + msg!("Error: Overflow in {} - {}", arg1, arg2); + err!(UxdError::MathOverflow) + } +} + +pub fn checked_div(arg1: T, arg2: T) -> Result +where + T: num_traits::PrimInt + Display, +{ + if let Some(res) = arg1.checked_div(&arg2) { + Ok(res) + } else { + msg!("Error: Overflow in {} / {}", arg1, arg2); + err!(UxdError::MathOverflow) + } +} + +pub fn checked_float_div(arg1: T, arg2: T) -> Result +where + T: num_traits::Float + Display, +{ + if arg2 == T::zero() { + msg!("Error: Overflow in {} / {}", arg1, arg2); + return err!(UxdError::MathOverflow); + } + let res = arg1 / arg2; + if !res.is_finite() { + msg!("Error: Overflow in {} / {}", arg1, arg2); + err!(UxdError::MathOverflow) + } else { + Ok(res) + } +} + +pub fn checked_ceil_div(arg1: T, arg2: T) -> Result +where + T: num_traits::PrimInt + Display, +{ + if arg1 > T::zero() { + if arg1 == arg2 && arg2 != T::zero() { + return Ok(T::one()); + } + if let Some(res) = (arg1 - T::one()).checked_div(&arg2) { + Ok(res + T::one()) + } else { + msg!("Error: Overflow in {} / {}", arg1, arg2); + err!(UxdError::MathOverflow) + } + } else if let Some(res) = arg1.checked_div(&arg2) { + Ok(res) + } else { + msg!("Error: Overflow in {} / {}", arg1, arg2); + err!(UxdError::MathOverflow) + } +} + +pub fn checked_decimal_div( + coefficient1: u64, + exponent1: i32, + coefficient2: u64, + exponent2: i32, + target_exponent: i32, +) -> Result { + if coefficient2 == 0 { + msg!("Error: Overflow in {} / {}", coefficient1, coefficient2); + return err!(UxdError::MathOverflow); + } + if coefficient1 == 0 { + return Ok(0); + } + // compute scale factor for the dividend + let mut scale_factor = 0; + let mut target_power = checked_sub(checked_sub(exponent1, exponent2)?, target_exponent)?; + if exponent1 > 0 { + scale_factor = checked_add(scale_factor, exponent1)?; + } + if exponent2 < 0 { + scale_factor = checked_sub(scale_factor, exponent2)?; + target_power = checked_add(target_power, exponent2)?; + } + if target_exponent < 0 { + scale_factor = checked_sub(scale_factor, target_exponent)?; + target_power = checked_add(target_power, target_exponent)?; + } + let scaled_coeff1 = if scale_factor > 0 { + checked_mul( + coefficient1 as u128, + checked_pow(10u128, scale_factor as usize)?, + )? + } else { + coefficient1 as u128 + }; + + if target_power >= 0 { + checked_as_u64(checked_mul( + checked_div(scaled_coeff1, coefficient2 as u128)?, + checked_pow(10u128, target_power as usize)?, + )?) + } else { + checked_as_u64(checked_div( + checked_div(scaled_coeff1, coefficient2 as u128)?, + checked_pow(10u128, (-target_power) as usize)?, + )?) + } +} + +pub fn checked_decimal_ceil_div( + coefficient1: u64, + exponent1: i32, + coefficient2: u64, + exponent2: i32, + target_exponent: i32, +) -> Result { + if coefficient2 == 0 { + msg!("Error: Overflow in {} / {}", coefficient1, coefficient2); + return err!(UxdError::MathOverflow); + } + if coefficient1 == 0 { + return Ok(0); + } + // compute scale factor for the dividend + let mut scale_factor = 0; + let mut target_power = checked_sub(checked_sub(exponent1, exponent2)?, target_exponent)?; + if exponent1 > 0 { + scale_factor = checked_add(scale_factor, exponent1)?; + } + if exponent2 < 0 { + scale_factor = checked_sub(scale_factor, exponent2)?; + target_power = checked_add(target_power, exponent2)?; + } + if target_exponent < 0 { + scale_factor = checked_sub(scale_factor, target_exponent)?; + target_power = checked_add(target_power, target_exponent)?; + } + let scaled_coeff1 = if scale_factor > 0 { + checked_mul( + coefficient1 as u128, + checked_pow(10u128, scale_factor as usize)?, + )? + } else { + coefficient1 as u128 + }; + + if target_power >= 0 { + checked_as_u64(checked_mul( + checked_ceil_div(scaled_coeff1, coefficient2 as u128)?, + checked_pow(10u128, target_power as usize)?, + )?) + } else { + checked_as_u64(checked_div( + checked_ceil_div(scaled_coeff1, coefficient2 as u128)?, + checked_pow(10u128, (-target_power) as usize)?, + )?) + } +} + +pub fn checked_token_div( + amount1: u64, + decimals1: u8, + amount2: u64, + decimals2: u8, +) -> Result<(u64, u8)> { + let target_decimals = std::cmp::max(decimals1, decimals2); + Ok(( + checked_decimal_div( + amount1, + -(decimals1 as i32), + amount2, + -(decimals2 as i32), + -(target_decimals as i32), + )?, + target_decimals, + )) +} + +pub fn checked_mul(arg1: T, arg2: T) -> Result +where + T: num_traits::PrimInt + Display, +{ + if let Some(res) = arg1.checked_mul(&arg2) { + Ok(res) + } else { + msg!("Error: Overflow in {} * {}", arg1, arg2); + err!(UxdError::MathOverflow) + } +} + +pub fn checked_float_mul(arg1: T, arg2: T) -> Result +where + T: num_traits::Float + Display, +{ + let res = arg1 * arg2; + if !res.is_finite() { + msg!("Error: Overflow in {} * {}", arg1, arg2); + err!(UxdError::MathOverflow) + } else { + Ok(res) + } +} + +pub fn checked_decimal_mul( + coefficient1: u64, + exponent1: i32, + coefficient2: u64, + exponent2: i32, + target_exponent: i32, +) -> Result { + if coefficient1 == 0 || coefficient2 == 0 { + return Ok(0); + } + let target_power = checked_sub(checked_add(exponent1, exponent2)?, target_exponent)?; + if target_power >= 0 { + checked_as_u64(checked_mul( + checked_mul(coefficient1 as u128, coefficient2 as u128)?, + checked_pow(10u128, target_power as usize)?, + )?) + } else { + checked_as_u64(checked_div( + checked_mul(coefficient1 as u128, coefficient2 as u128)?, + checked_pow(10u128, (-target_power) as usize)?, + )?) + } +} + +pub fn checked_decimal_ceil_mul( + coefficient1: u64, + exponent1: i32, + coefficient2: u64, + exponent2: i32, + target_exponent: i32, +) -> Result { + if coefficient1 == 0 || coefficient2 == 0 { + return Ok(0); + } + let target_power = checked_sub(checked_add(exponent1, exponent2)?, target_exponent)?; + if target_power >= 0 { + checked_as_u64(checked_mul( + checked_mul(coefficient1 as u128, coefficient2 as u128)?, + checked_pow(10u128, target_power as usize)?, + )?) + } else { + checked_as_u64(checked_ceil_div( + checked_mul(coefficient1 as u128, coefficient2 as u128)?, + checked_pow(10u128, (-target_power) as usize)?, + )?) + } +} + +pub fn checked_token_mul( + amount1: u64, + decimals1: u8, + amount2: u64, + decimals2: u8, +) -> Result<(u64, u8)> { + let target_decimals = std::cmp::max(decimals1, decimals2); + Ok(( + checked_decimal_mul( + amount1, + -(decimals1 as i32), + amount2, + -(decimals2 as i32), + -(target_decimals as i32), + )?, + target_decimals, + )) +} + +pub fn checked_pow(arg: T, exp: usize) -> Result +where + T: num_traits::PrimInt + Display, +{ + if let Some(res) = num_traits::checked_pow(arg, exp) { + Ok(res) + } else { + msg!("Error: Overflow in {} ^ {}", arg, exp); + err!(UxdError::MathOverflow) + } +} + +pub fn checked_powf(arg: f64, exp: f64) -> Result { + let res = f64::powf(arg, exp); + if res.is_finite() { + Ok(res) + } else { + msg!("Error: Overflow in {} ^ {}", arg, exp); + err!(UxdError::MathOverflow) + } +} + +pub fn checked_powi(arg: f64, exp: i32) -> Result { + let res = if exp > 0 { + f64::powi(arg, exp) + } else { + // wrokaround due to f64::powi() not working properly on-chain with negative exponent + checked_float_div(1.0, f64::powi(arg, -exp))? + }; + if res.is_finite() { + Ok(res) + } else { + msg!("Error: Overflow in {} ^ {}", arg, exp); + err!(UxdError::MathOverflow) + } +} + +pub fn checked_as_usize(arg: T) -> Result +where + T: Display + num_traits::ToPrimitive + Clone, +{ + let option: Option = num_traits::NumCast::from(arg.clone()); + if let Some(res) = option { + Ok(res) + } else { + msg!("Error: Overflow in {} as usize", arg); + err!(UxdError::MathOverflow) + } +} + +pub fn checked_as_u64(arg: T) -> Result +where + T: Display + num_traits::ToPrimitive + Clone, +{ + let option: Option = num_traits::NumCast::from(arg.clone()); + if let Some(res) = option { + Ok(res) + } else { + msg!("Error: Overflow in {} as u64", arg); + err!(UxdError::MathOverflow) + } +} + +pub fn checked_as_u128(arg: T) -> Result +where + T: Display + num_traits::ToPrimitive + Clone, +{ + let option: Option = num_traits::NumCast::from(arg.clone()); + if let Some(res) = option { + Ok(res) + } else { + msg!("Error: Overflow in {} as u128", arg); + err!(UxdError::MathOverflow) + } +} + +pub fn checked_as_f64(arg: T) -> Result +where + T: Display + num_traits::ToPrimitive + Clone, +{ + let option: Option = num_traits::NumCast::from(arg.clone()); + if let Some(res) = option { + Ok(res) + } else { + msg!("Error: Overflow in {} as f64", arg); + err!(UxdError::MathOverflow) + } +} + +pub fn scale_to_exponent(arg: u64, exponent: i32, target_exponent: i32) -> Result { + if target_exponent == exponent { + return Ok(arg); + } + let delta = checked_sub(target_exponent, exponent)?; + if delta > 0 { + checked_div(arg, checked_pow(10, delta as usize)?) + } else { + checked_mul(arg, checked_pow(10, (-delta) as usize)?) + } +} + +pub fn to_ui_amount(amount: u64, decimals: u8) -> Result { + checked_float_div( + checked_as_f64(amount)?, + checked_powi(10.0, decimals as i32)?, + ) +} + +pub fn to_token_amount(ui_amount: f64, decimals: u8) -> Result { + checked_as_u64(checked_float_mul( + ui_amount, + checked_powi(10.0, decimals as i32)?, + )?) +} diff --git a/programs/uxd/src/utils/mod.rs b/programs/uxd/src/utils/mod.rs index bef56ce01..0efdceaf8 100644 --- a/programs/uxd/src/utils/mod.rs +++ b/programs/uxd/src/utils/mod.rs @@ -1,14 +1,18 @@ +pub mod accounts; pub mod calculate_amount_less_fees; pub mod calculate_credix_lp_depository_target_amount; pub mod calculate_depositories_mint_collateral_amount; pub mod calculate_depositories_redeemable_amount; pub mod calculate_depositories_sum_value; pub mod calculate_depositories_target_redeemable_amount; +pub mod maths; pub mod math; pub mod validate_collateral_amount; pub mod validate_collateral_mint_usdc; +pub mod validate_loan_to_value_bps; pub mod validate_redeemable_amount; +pub use accounts::*; pub use calculate_amount_less_fees::*; pub use calculate_credix_lp_depository_target_amount::*; pub use calculate_depositories_mint_collateral_amount::*; @@ -16,6 +20,8 @@ pub use calculate_depositories_redeemable_amount::*; pub use calculate_depositories_sum_value::*; pub use calculate_depositories_target_redeemable_amount::*; pub use math::*; +pub use math::*; pub use validate_collateral_amount::*; pub use validate_collateral_mint_usdc::*; +pub use validate_loan_to_value_bps::*; pub use validate_redeemable_amount::*; diff --git a/programs/uxd/src/utils/validate_loan_to_value_bps.rs b/programs/uxd/src/utils/validate_loan_to_value_bps.rs new file mode 100644 index 000000000..f0637a74b --- /dev/null +++ b/programs/uxd/src/utils/validate_loan_to_value_bps.rs @@ -0,0 +1,14 @@ +use crate::error::UxdError; +use anchor_lang::prelude::*; + +pub fn validate_loan_to_value_bps( + loan_to_value_bps: u16, + depository_loan_to_value_bps: u16, +) -> Result<()> { + require!(loan_to_value_bps > 0, UxdError::InvalidLtvBps); + require!( + loan_to_value_bps <= depository_loan_to_value_bps, + UxdError::LtvBpsOverLimit + ); + Ok(()) +} diff --git a/programs/uxd/tests/unit_tests/utils/calculate_depositories_target_redeemable_amount.rs b/programs/uxd/tests/unit_tests/utils/calculate_depositories_target_redeemable_amount.rs index d2544c1a2..8d0a29a9f 100644 --- a/programs/uxd/tests/unit_tests/utils/calculate_depositories_target_redeemable_amount.rs +++ b/programs/uxd/tests/unit_tests/utils/calculate_depositories_target_redeemable_amount.rs @@ -6,7 +6,7 @@ mod test_calculate_depositories_target_redeemable_amount { use uxd::utils::calculate_depositories_target_redeemable_amount; use uxd::utils::is_within_range_inclusive; use uxd::utils::DepositoryInfoForTargetRedeemableAmount; - use uxd::BPS_UNIT_CONVERSION; + use uxd::BPS_POWER; use uxd::ROUTER_CREDIX_LP_DEPOSITORY_INDEX; use uxd::ROUTER_DEPOSITORIES_COUNT; use uxd::ROUTER_IDENTITY_DEPOSITORY_INDEX; @@ -263,13 +263,13 @@ mod test_calculate_depositories_target_redeemable_amount { let total_weight_arbitrary = identity_depository_weight_arbitrary + mercurial_vault_depository_weight_arbitrary + credix_lp_depository_weight_arbitrary; - let identity_depository_weight_bps = identity_depository_weight_arbitrary * BPS_UNIT_CONVERSION / total_weight_arbitrary; - let mercurial_vault_depository_weight_bps = mercurial_vault_depository_weight_arbitrary * BPS_UNIT_CONVERSION / total_weight_arbitrary; - let credix_lp_depository_weight_bps = credix_lp_depository_weight_arbitrary * BPS_UNIT_CONVERSION / total_weight_arbitrary; + let identity_depository_weight_bps = identity_depository_weight_arbitrary * BPS_POWER / total_weight_arbitrary; + let mercurial_vault_depository_weight_bps = mercurial_vault_depository_weight_arbitrary * BPS_POWER / total_weight_arbitrary; + let credix_lp_depository_weight_bps = credix_lp_depository_weight_arbitrary * BPS_POWER / total_weight_arbitrary; // In case of rounding error, we add the rounding errors to identity depository to keep the sum EXACTLY to 100% let total_weight_bps = identity_depository_weight_bps + mercurial_vault_depository_weight_bps + credix_lp_depository_weight_bps; - let identity_depository_weight_bps = identity_depository_weight_bps + BPS_UNIT_CONVERSION - total_weight_bps; + let identity_depository_weight_bps = identity_depository_weight_bps + BPS_POWER - total_weight_bps; // Everything else should never panic let depositories_target_redeemable_amount = diff --git a/target/idl/uxd.json b/target/idl/uxd.json index ebaa749e0..db20314f8 100644 --- a/target/idl/uxd.json +++ b/target/idl/uxd.json @@ -34,7 +34,9 @@ "name": "payer", "isMut": true, "isSigner": true, - "docs": ["#2"] + "docs": [ + "#2" + ] }, { "name": "controller", @@ -56,19 +58,25 @@ "name": "systemProgram", "isMut": false, "isSigner": false, - "docs": ["#5 System Program"] + "docs": [ + "#5 System Program" + ] }, { "name": "tokenProgram", "isMut": false, "isSigner": false, - "docs": ["#6 Token Program"] + "docs": [ + "#6 Token Program" + ] }, { "name": "rent", "isMut": false, "isSigner": false, - "docs": ["#7 Rent Sysvar"] + "docs": [ + "#7 Rent Sysvar" + ] } ], "args": [ @@ -205,7 +213,9 @@ "name": "depository", "isMut": true, "isSigner": false, - "docs": ["#3"] + "docs": [ + "#3" + ] } ], "args": [ @@ -224,43 +234,57 @@ "name": "user", "isMut": false, "isSigner": true, - "docs": ["#1"] + "docs": [ + "#1" + ] }, { "name": "payer", "isMut": true, "isSigner": true, - "docs": ["#2"] + "docs": [ + "#2" + ] }, { "name": "controller", "isMut": true, "isSigner": false, - "docs": ["#3"] + "docs": [ + "#3" + ] }, { "name": "redeemableMint", "isMut": true, "isSigner": false, - "docs": ["#4"] + "docs": [ + "#4" + ] }, { "name": "collateralMint", "isMut": false, "isSigner": false, - "docs": ["#5"] + "docs": [ + "#5" + ] }, { "name": "userRedeemable", "isMut": true, "isSigner": false, - "docs": ["#6"] + "docs": [ + "#6" + ] }, { "name": "userCollateral", "isMut": true, "isSigner": false, - "docs": ["#7"] + "docs": [ + "#7" + ] }, { "name": "identityDepository", @@ -274,13 +298,17 @@ "name": "identityDepositoryCollateralVault", "isMut": true, "isSigner": false, - "docs": ["#9 - Token account holding the collateral from minting"] + "docs": [ + "#9 - Token account holding the collateral from minting" + ] }, { "name": "mercurialVaultDepository", "isMut": true, "isSigner": false, - "docs": ["#10"] + "docs": [ + "#10" + ] }, { "name": "mercurialVaultDepositoryLpTokenVault", @@ -294,13 +322,17 @@ "name": "mercurialVaultDepositoryVault", "isMut": true, "isSigner": false, - "docs": ["#12"] + "docs": [ + "#12" + ] }, { "name": "mercurialVaultDepositoryVaultLpMint", "isMut": true, "isSigner": false, - "docs": ["#13"] + "docs": [ + "#13" + ] }, { "name": "mercurialVaultDepositoryCollateralTokenSafe", @@ -314,91 +346,121 @@ "name": "credixLpDepository", "isMut": true, "isSigner": false, - "docs": ["#15"] + "docs": [ + "#15" + ] }, { "name": "credixLpDepositoryCollateral", "isMut": true, "isSigner": false, - "docs": ["#16"] + "docs": [ + "#16" + ] }, { "name": "credixLpDepositoryShares", "isMut": true, "isSigner": false, - "docs": ["#17"] + "docs": [ + "#17" + ] }, { "name": "credixLpDepositoryPass", "isMut": false, "isSigner": false, - "docs": ["#18"] + "docs": [ + "#18" + ] }, { "name": "credixLpDepositoryGlobalMarketState", "isMut": false, "isSigner": false, - "docs": ["#19"] + "docs": [ + "#19" + ] }, { "name": "credixLpDepositorySigningAuthority", "isMut": false, "isSigner": false, - "docs": ["#20 - CHECK: unused by us, checked by credix"] + "docs": [ + "#20 - CHECK: unused by us, checked by credix" + ] }, { "name": "credixLpDepositoryLiquidityCollateral", "isMut": true, "isSigner": false, - "docs": ["#21"] + "docs": [ + "#21" + ] }, { "name": "credixLpDepositorySharesMint", "isMut": true, "isSigner": false, - "docs": ["#22"] + "docs": [ + "#22" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "docs": ["#23"] + "docs": [ + "#23" + ] }, { "name": "tokenProgram", "isMut": false, "isSigner": false, - "docs": ["#24"] + "docs": [ + "#24" + ] }, { "name": "associatedTokenProgram", "isMut": false, "isSigner": false, - "docs": ["#25"] + "docs": [ + "#25" + ] }, { "name": "mercurialVaultProgram", "isMut": false, "isSigner": false, - "docs": ["#26"] + "docs": [ + "#26" + ] }, { "name": "credixProgram", "isMut": false, "isSigner": false, - "docs": ["#27"] + "docs": [ + "#27" + ] }, { "name": "uxdProgram", "isMut": false, "isSigner": false, - "docs": ["#28"] + "docs": [ + "#28" + ] }, { "name": "rent", "isMut": false, "isSigner": false, - "docs": ["#29"] + "docs": [ + "#29" + ] } ], "args": [ @@ -415,43 +477,57 @@ "name": "user", "isMut": false, "isSigner": true, - "docs": ["#1"] + "docs": [ + "#1" + ] }, { "name": "payer", "isMut": true, "isSigner": true, - "docs": ["#2"] + "docs": [ + "#2" + ] }, { "name": "controller", "isMut": true, "isSigner": false, - "docs": ["#3"] + "docs": [ + "#3" + ] }, { "name": "redeemableMint", "isMut": true, "isSigner": false, - "docs": ["#4"] + "docs": [ + "#4" + ] }, { "name": "collateralMint", "isMut": false, "isSigner": false, - "docs": ["#5"] + "docs": [ + "#5" + ] }, { "name": "userRedeemable", "isMut": true, "isSigner": false, - "docs": ["#6"] + "docs": [ + "#6" + ] }, { "name": "userCollateral", "isMut": true, "isSigner": false, - "docs": ["#7"] + "docs": [ + "#7" + ] }, { "name": "identityDepository", @@ -465,13 +541,17 @@ "name": "identityDepositoryCollateralVault", "isMut": true, "isSigner": false, - "docs": ["#9 - Token account holding the collateral from minting"] + "docs": [ + "#9 - Token account holding the collateral from minting" + ] }, { "name": "mercurialVaultDepository", "isMut": true, "isSigner": false, - "docs": ["#10"] + "docs": [ + "#10" + ] }, { "name": "mercurialVaultDepositoryLpTokenVault", @@ -485,13 +565,17 @@ "name": "mercurialVaultDepositoryVault", "isMut": true, "isSigner": false, - "docs": ["#12"] + "docs": [ + "#12" + ] }, { "name": "mercurialVaultDepositoryVaultLpMint", "isMut": true, "isSigner": false, - "docs": ["#13"] + "docs": [ + "#13" + ] }, { "name": "mercurialVaultDepositoryCollateralTokenSafe", @@ -505,43 +589,57 @@ "name": "credixLpDepository", "isMut": true, "isSigner": false, - "docs": ["#15"] + "docs": [ + "#15" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "docs": ["#16"] + "docs": [ + "#16" + ] }, { "name": "tokenProgram", "isMut": false, "isSigner": false, - "docs": ["#17"] + "docs": [ + "#17" + ] }, { "name": "associatedTokenProgram", "isMut": false, "isSigner": false, - "docs": ["#18"] + "docs": [ + "#18" + ] }, { "name": "mercurialVaultProgram", "isMut": false, "isSigner": false, - "docs": ["#19"] + "docs": [ + "#19" + ] }, { "name": "uxdProgram", "isMut": false, "isSigner": false, - "docs": ["#20"] + "docs": [ + "#20" + ] }, { "name": "rent", "isMut": false, "isSigner": false, - "docs": ["#21"] + "docs": [ + "#21" + ] } ], "args": [ @@ -558,49 +656,65 @@ "name": "user", "isMut": false, "isSigner": true, - "docs": ["#1"] + "docs": [ + "#1" + ] }, { "name": "payer", "isMut": true, "isSigner": true, - "docs": ["#2"] + "docs": [ + "#2" + ] }, { "name": "controller", "isMut": true, "isSigner": false, - "docs": ["#3"] + "docs": [ + "#3" + ] }, { "name": "depository", "isMut": true, "isSigner": false, - "docs": ["#4"] + "docs": [ + "#4" + ] }, { "name": "redeemableMint", "isMut": true, "isSigner": false, - "docs": ["#5"] + "docs": [ + "#5" + ] }, { "name": "userRedeemable", "isMut": true, "isSigner": false, - "docs": ["#6"] + "docs": [ + "#6" + ] }, { "name": "collateralMint", "isMut": false, "isSigner": false, - "docs": ["#7"] + "docs": [ + "#7" + ] }, { "name": "userCollateral", "isMut": true, "isSigner": false, - "docs": ["#8"] + "docs": [ + "#8" + ] }, { "name": "depositoryLpTokenVault", @@ -615,13 +729,17 @@ "name": "mercurialVault", "isMut": true, "isSigner": false, - "docs": ["#10"] + "docs": [ + "#10" + ] }, { "name": "mercurialVaultLpMint", "isMut": true, "isSigner": false, - "docs": ["#11"] + "docs": [ + "#11" + ] }, { "name": "mercurialVaultCollateralTokenSafe", @@ -636,19 +754,25 @@ "name": "mercurialVaultProgram", "isMut": false, "isSigner": false, - "docs": ["#13"] + "docs": [ + "#13" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "docs": ["#14"] + "docs": [ + "#14" + ] }, { "name": "tokenProgram", "isMut": false, "isSigner": false, - "docs": ["#15"] + "docs": [ + "#15" + ] } ], "args": [ @@ -665,43 +789,57 @@ "name": "authority", "isMut": false, "isSigner": true, - "docs": ["#1"] + "docs": [ + "#1" + ] }, { "name": "payer", "isMut": true, "isSigner": true, - "docs": ["#2"] + "docs": [ + "#2" + ] }, { "name": "controller", "isMut": true, "isSigner": false, - "docs": ["#3"] + "docs": [ + "#3" + ] }, { "name": "depository", "isMut": true, "isSigner": false, - "docs": ["#4"] + "docs": [ + "#4" + ] }, { "name": "collateralMint", "isMut": false, "isSigner": false, - "docs": ["#5"] + "docs": [ + "#5" + ] }, { "name": "mercurialVault", "isMut": false, "isSigner": false, - "docs": ["#6"] + "docs": [ + "#6" + ] }, { "name": "mercurialVaultLpMint", "isMut": false, "isSigner": false, - "docs": ["#7"] + "docs": [ + "#7" + ] }, { "name": "depositoryLpTokenVault", @@ -716,19 +854,25 @@ "name": "systemProgram", "isMut": false, "isSigner": false, - "docs": ["#9"] + "docs": [ + "#9" + ] }, { "name": "tokenProgram", "isMut": false, "isSigner": false, - "docs": ["#10"] + "docs": [ + "#10" + ] }, { "name": "rent", "isMut": false, "isSigner": false, - "docs": ["#11"] + "docs": [ + "#11" + ] } ], "args": [ @@ -753,49 +897,65 @@ "name": "user", "isMut": false, "isSigner": true, - "docs": ["#1"] + "docs": [ + "#1" + ] }, { "name": "payer", "isMut": true, "isSigner": true, - "docs": ["#2"] + "docs": [ + "#2" + ] }, { "name": "controller", "isMut": true, "isSigner": false, - "docs": ["#3"] + "docs": [ + "#3" + ] }, { "name": "depository", "isMut": true, "isSigner": false, - "docs": ["#4"] + "docs": [ + "#4" + ] }, { "name": "redeemableMint", "isMut": true, "isSigner": false, - "docs": ["#5"] + "docs": [ + "#5" + ] }, { "name": "userRedeemable", "isMut": true, "isSigner": false, - "docs": ["#6"] + "docs": [ + "#6" + ] }, { "name": "collateralMint", "isMut": false, "isSigner": false, - "docs": ["#7"] + "docs": [ + "#7" + ] }, { "name": "userCollateral", "isMut": true, "isSigner": false, - "docs": ["#8"] + "docs": [ + "#8" + ] }, { "name": "depositoryLpTokenVault", @@ -810,13 +970,17 @@ "name": "mercurialVault", "isMut": true, "isSigner": false, - "docs": ["#10"] + "docs": [ + "#10" + ] }, { "name": "mercurialVaultLpMint", "isMut": true, "isSigner": false, - "docs": ["#11"] + "docs": [ + "#11" + ] }, { "name": "mercurialVaultCollateralTokenSafe", @@ -831,19 +995,25 @@ "name": "mercurialVaultProgram", "isMut": false, "isSigner": false, - "docs": ["#13"] + "docs": [ + "#13" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "docs": ["#14"] + "docs": [ + "#14" + ] }, { "name": "tokenProgram", "isMut": false, "isSigner": false, - "docs": ["#15"] + "docs": [ + "#15" + ] } ], "args": [ @@ -860,31 +1030,41 @@ "name": "payer", "isMut": true, "isSigner": true, - "docs": ["#1"] + "docs": [ + "#1" + ] }, { "name": "controller", "isMut": true, "isSigner": false, - "docs": ["#2"] + "docs": [ + "#2" + ] }, { "name": "depository", "isMut": true, "isSigner": false, - "docs": ["#3"] + "docs": [ + "#3" + ] }, { "name": "collateralMint", "isMut": false, "isSigner": false, - "docs": ["#4"] + "docs": [ + "#4" + ] }, { "name": "profitsBeneficiaryCollateral", "isMut": true, "isSigner": false, - "docs": ["#5"] + "docs": [ + "#5" + ] }, { "name": "depositoryLpTokenVault", @@ -899,13 +1079,17 @@ "name": "mercurialVault", "isMut": true, "isSigner": false, - "docs": ["#7"] + "docs": [ + "#7" + ] }, { "name": "mercurialVaultLpMint", "isMut": true, "isSigner": false, - "docs": ["#8"] + "docs": [ + "#8" + ] }, { "name": "mercurialVaultCollateralTokenSafe", @@ -920,19 +1104,25 @@ "name": "mercurialVaultProgram", "isMut": false, "isSigner": false, - "docs": ["#10"] + "docs": [ + "#10" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "docs": ["#11"] + "docs": [ + "#11" + ] }, { "name": "tokenProgram", "isMut": false, "isSigner": false, - "docs": ["#12"] + "docs": [ + "#12" + ] } ], "args": [] @@ -952,7 +1142,9 @@ "name": "payer", "isMut": true, "isSigner": true, - "docs": ["#2"] + "docs": [ + "#2" + ] }, { "name": "controller", @@ -974,31 +1166,42 @@ "name": "collateralVault", "isMut": true, "isSigner": false, - "docs": ["#5", "Token account holding the collateral from minting"] + "docs": [ + "#5", + "Token account holding the collateral from minting" + ] }, { "name": "collateralMint", "isMut": false, "isSigner": false, - "docs": ["#6 The collateral mint used by the `depository` instance"] + "docs": [ + "#6 The collateral mint used by the `depository` instance" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "docs": ["#7 System Program"] + "docs": [ + "#7 System Program" + ] }, { "name": "tokenProgram", "isMut": false, "isSigner": false, - "docs": ["#8 Token Program"] + "docs": [ + "#8 Token Program" + ] }, { "name": "rent", "isMut": false, "isSigner": false, - "docs": ["#9 Rent Sysvar"] + "docs": [ + "#9 Rent Sysvar" + ] } ], "args": [] @@ -1010,13 +1213,17 @@ "name": "user", "isMut": false, "isSigner": true, - "docs": ["#1 Public call accessible to any user"] + "docs": [ + "#1 Public call accessible to any user" + ] }, { "name": "payer", "isMut": true, "isSigner": true, - "docs": ["#2"] + "docs": [ + "#2" + ] }, { "name": "controller", @@ -1038,7 +1245,10 @@ "name": "collateralVault", "isMut": true, "isSigner": false, - "docs": ["#5", "Token account holding the collateral from minting"] + "docs": [ + "#5", + "Token account holding the collateral from minting" + ] }, { "name": "redeemableMint", @@ -1071,13 +1281,17 @@ "name": "systemProgram", "isMut": false, "isSigner": false, - "docs": ["#9"] + "docs": [ + "#9" + ] }, { "name": "tokenProgram", "isMut": false, "isSigner": false, - "docs": ["#10 Token Program"] + "docs": [ + "#10 Token Program" + ] } ], "args": [ @@ -1094,13 +1308,17 @@ "name": "user", "isMut": false, "isSigner": true, - "docs": ["#1 Public call accessible to any user"] + "docs": [ + "#1 Public call accessible to any user" + ] }, { "name": "payer", "isMut": true, "isSigner": true, - "docs": ["#2"] + "docs": [ + "#2" + ] }, { "name": "controller", @@ -1122,7 +1340,10 @@ "name": "collateralVault", "isMut": true, "isSigner": false, - "docs": ["#5", "Token account holding the collateral from minting"] + "docs": [ + "#5", + "Token account holding the collateral from minting" + ] }, { "name": "redeemableMint", @@ -1155,13 +1376,17 @@ "name": "systemProgram", "isMut": false, "isSigner": false, - "docs": ["#10"] + "docs": [ + "#10" + ] }, { "name": "tokenProgram", "isMut": false, "isSigner": false, - "docs": ["#11"] + "docs": [ + "#11" + ] } ], "args": [ @@ -1178,97 +1403,129 @@ "name": "authority", "isMut": false, "isSigner": true, - "docs": ["#1"] + "docs": [ + "#1" + ] }, { "name": "payer", "isMut": true, "isSigner": true, - "docs": ["#2"] + "docs": [ + "#2" + ] }, { "name": "controller", "isMut": true, "isSigner": false, - "docs": ["#3"] + "docs": [ + "#3" + ] }, { "name": "depository", "isMut": true, "isSigner": false, - "docs": ["#4"] + "docs": [ + "#4" + ] }, { "name": "collateralMint", "isMut": false, "isSigner": false, - "docs": ["#5"] + "docs": [ + "#5" + ] }, { "name": "depositoryCollateral", "isMut": true, "isSigner": false, - "docs": ["#6"] + "docs": [ + "#6" + ] }, { "name": "depositoryShares", "isMut": true, "isSigner": false, - "docs": ["#7"] + "docs": [ + "#7" + ] }, { "name": "credixProgramState", "isMut": false, "isSigner": false, - "docs": ["#8"] + "docs": [ + "#8" + ] }, { "name": "credixGlobalMarketState", "isMut": false, "isSigner": false, - "docs": ["#9"] + "docs": [ + "#9" + ] }, { "name": "credixSigningAuthority", "isMut": false, "isSigner": false, - "docs": ["#10"] + "docs": [ + "#10" + ] }, { "name": "credixLiquidityCollateral", "isMut": false, "isSigner": false, - "docs": ["#11"] + "docs": [ + "#11" + ] }, { "name": "credixSharesMint", "isMut": false, "isSigner": false, - "docs": ["#12"] + "docs": [ + "#12" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "docs": ["#13"] + "docs": [ + "#13" + ] }, { "name": "tokenProgram", "isMut": false, "isSigner": false, - "docs": ["#14"] + "docs": [ + "#14" + ] }, { "name": "associatedTokenProgram", "isMut": false, "isSigner": false, - "docs": ["#15"] + "docs": [ + "#15" + ] }, { "name": "rent", "isMut": false, "isSigner": false, - "docs": ["#16"] + "docs": [ + "#16" + ] } ], "args": [ @@ -1293,121 +1550,161 @@ "name": "user", "isMut": false, "isSigner": true, - "docs": ["#1"] + "docs": [ + "#1" + ] }, { "name": "payer", "isMut": true, "isSigner": true, - "docs": ["#2"] + "docs": [ + "#2" + ] }, { "name": "controller", "isMut": true, "isSigner": false, - "docs": ["#3"] + "docs": [ + "#3" + ] }, { "name": "depository", "isMut": true, "isSigner": false, - "docs": ["#4"] + "docs": [ + "#4" + ] }, { "name": "redeemableMint", "isMut": true, "isSigner": false, - "docs": ["#5"] + "docs": [ + "#5" + ] }, { "name": "collateralMint", "isMut": false, "isSigner": false, - "docs": ["#6"] + "docs": [ + "#6" + ] }, { "name": "userRedeemable", "isMut": true, "isSigner": false, - "docs": ["#7"] + "docs": [ + "#7" + ] }, { "name": "userCollateral", "isMut": true, "isSigner": false, - "docs": ["#8"] + "docs": [ + "#8" + ] }, { "name": "depositoryCollateral", "isMut": true, "isSigner": false, - "docs": ["#9"] + "docs": [ + "#9" + ] }, { "name": "depositoryShares", "isMut": true, "isSigner": false, - "docs": ["#10"] + "docs": [ + "#10" + ] }, { "name": "credixGlobalMarketState", "isMut": false, "isSigner": false, - "docs": ["#11"] + "docs": [ + "#11" + ] }, { "name": "credixSigningAuthority", "isMut": false, "isSigner": false, - "docs": ["#12"] + "docs": [ + "#12" + ] }, { "name": "credixLiquidityCollateral", "isMut": true, "isSigner": false, - "docs": ["#13"] + "docs": [ + "#13" + ] }, { "name": "credixSharesMint", "isMut": true, "isSigner": false, - "docs": ["#14"] + "docs": [ + "#14" + ] }, { "name": "credixPass", "isMut": false, "isSigner": false, - "docs": ["#15"] + "docs": [ + "#15" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "docs": ["#16"] + "docs": [ + "#16" + ] }, { "name": "tokenProgram", "isMut": false, "isSigner": false, - "docs": ["#17"] + "docs": [ + "#17" + ] }, { "name": "associatedTokenProgram", "isMut": false, "isSigner": false, - "docs": ["#18"] + "docs": [ + "#18" + ] }, { "name": "credixProgram", "isMut": false, "isSigner": false, - "docs": ["#19"] + "docs": [ + "#19" + ] }, { "name": "rent", "isMut": false, "isSigner": false, - "docs": ["#20"] + "docs": [ + "#20" + ] } ], "args": [ @@ -1424,145 +1721,193 @@ "name": "user", "isMut": false, "isSigner": true, - "docs": ["#1"] + "docs": [ + "#1" + ] }, { "name": "payer", "isMut": true, "isSigner": true, - "docs": ["#2"] + "docs": [ + "#2" + ] }, { "name": "controller", "isMut": true, "isSigner": false, - "docs": ["#3"] + "docs": [ + "#3" + ] }, { "name": "depository", "isMut": true, "isSigner": false, - "docs": ["#4"] + "docs": [ + "#4" + ] }, { "name": "redeemableMint", "isMut": true, "isSigner": false, - "docs": ["#5"] + "docs": [ + "#5" + ] }, { "name": "collateralMint", "isMut": false, "isSigner": false, - "docs": ["#6"] + "docs": [ + "#6" + ] }, { "name": "userRedeemable", "isMut": true, "isSigner": false, - "docs": ["#7"] + "docs": [ + "#7" + ] }, { "name": "userCollateral", "isMut": true, "isSigner": false, - "docs": ["#8"] + "docs": [ + "#8" + ] }, { "name": "depositoryCollateral", "isMut": true, "isSigner": false, - "docs": ["#9"] + "docs": [ + "#9" + ] }, { "name": "depositoryShares", "isMut": true, "isSigner": false, - "docs": ["#10"] + "docs": [ + "#10" + ] }, { "name": "credixProgramState", "isMut": false, "isSigner": false, - "docs": ["#11"] + "docs": [ + "#11" + ] }, { "name": "credixGlobalMarketState", "isMut": true, "isSigner": false, - "docs": ["#12"] + "docs": [ + "#12" + ] }, { "name": "credixSigningAuthority", "isMut": false, "isSigner": false, - "docs": ["#13"] + "docs": [ + "#13" + ] }, { "name": "credixLiquidityCollateral", "isMut": true, "isSigner": false, - "docs": ["#14"] + "docs": [ + "#14" + ] }, { "name": "credixSharesMint", "isMut": true, "isSigner": false, - "docs": ["#15"] + "docs": [ + "#15" + ] }, { "name": "credixPass", "isMut": false, "isSigner": false, - "docs": ["#16"] + "docs": [ + "#16" + ] }, { "name": "credixTreasuryCollateral", "isMut": true, "isSigner": false, - "docs": ["#17"] + "docs": [ + "#17" + ] }, { "name": "credixMultisigKey", "isMut": false, "isSigner": false, - "docs": ["#18"] + "docs": [ + "#18" + ] }, { "name": "credixMultisigCollateral", "isMut": true, "isSigner": false, - "docs": ["#19"] + "docs": [ + "#19" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "docs": ["#20"] + "docs": [ + "#20" + ] }, { "name": "tokenProgram", "isMut": false, "isSigner": false, - "docs": ["#21"] + "docs": [ + "#21" + ] }, { "name": "associatedTokenProgram", "isMut": false, "isSigner": false, - "docs": ["#22"] + "docs": [ + "#22" + ] }, { "name": "credixProgram", "isMut": false, "isSigner": false, - "docs": ["#23"] + "docs": [ + "#23" + ] }, { "name": "rent", "isMut": false, "isSigner": false, - "docs": ["#24"] + "docs": [ + "#24" + ] } ], "args": [ @@ -1579,127 +1924,169 @@ "name": "payer", "isMut": true, "isSigner": true, - "docs": ["#1"] + "docs": [ + "#1" + ] }, { "name": "controller", "isMut": true, "isSigner": false, - "docs": ["#2"] + "docs": [ + "#2" + ] }, { "name": "depository", "isMut": true, "isSigner": false, - "docs": ["#3"] + "docs": [ + "#3" + ] }, { "name": "collateralMint", "isMut": false, "isSigner": false, - "docs": ["#4"] + "docs": [ + "#4" + ] }, { "name": "depositoryCollateral", "isMut": true, "isSigner": false, - "docs": ["#5"] + "docs": [ + "#5" + ] }, { "name": "depositoryShares", "isMut": true, "isSigner": false, - "docs": ["#6"] + "docs": [ + "#6" + ] }, { "name": "credixProgramState", "isMut": false, "isSigner": false, - "docs": ["#7"] + "docs": [ + "#7" + ] }, { "name": "credixGlobalMarketState", "isMut": true, "isSigner": false, - "docs": ["#8"] + "docs": [ + "#8" + ] }, { "name": "credixSigningAuthority", "isMut": false, "isSigner": false, - "docs": ["#9"] + "docs": [ + "#9" + ] }, { "name": "credixLiquidityCollateral", "isMut": true, "isSigner": false, - "docs": ["#10"] + "docs": [ + "#10" + ] }, { "name": "credixSharesMint", "isMut": true, "isSigner": false, - "docs": ["#11"] + "docs": [ + "#11" + ] }, { "name": "credixPass", "isMut": true, "isSigner": false, - "docs": ["#12"] + "docs": [ + "#12" + ] }, { "name": "credixTreasuryCollateral", "isMut": true, "isSigner": false, - "docs": ["#13"] + "docs": [ + "#13" + ] }, { "name": "credixMultisigKey", "isMut": false, "isSigner": false, - "docs": ["#14"] + "docs": [ + "#14" + ] }, { "name": "credixMultisigCollateral", "isMut": true, "isSigner": false, - "docs": ["#15"] + "docs": [ + "#15" + ] }, { "name": "profitsBeneficiaryCollateral", "isMut": true, "isSigner": false, - "docs": ["#16"] + "docs": [ + "#16" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "docs": ["#17"] + "docs": [ + "#17" + ] }, { "name": "tokenProgram", "isMut": false, "isSigner": false, - "docs": ["#18"] + "docs": [ + "#18" + ] }, { "name": "associatedTokenProgram", "isMut": false, "isSigner": false, - "docs": ["#19"] + "docs": [ + "#19" + ] }, { "name": "credixProgram", "isMut": false, "isSigner": false, - "docs": ["#20"] + "docs": [ + "#20" + ] }, { "name": "rent", "isMut": false, "isSigner": false, - "docs": ["#21"] + "docs": [ + "#21" + ] } ], "args": [] @@ -1720,91 +2107,121 @@ "name": "controller", "isMut": true, "isSigner": false, - "docs": ["#2"] + "docs": [ + "#2" + ] }, { "name": "identityDepository", "isMut": true, "isSigner": false, - "docs": ["#3"] + "docs": [ + "#3" + ] }, { "name": "mercurialVaultDepository", "isMut": true, "isSigner": false, - "docs": ["#4"] + "docs": [ + "#4" + ] }, { "name": "depository", "isMut": true, "isSigner": false, - "docs": ["#5"] + "docs": [ + "#5" + ] }, { "name": "collateralMint", "isMut": false, "isSigner": false, - "docs": ["#6"] + "docs": [ + "#6" + ] }, { "name": "depositoryShares", "isMut": true, "isSigner": false, - "docs": ["#7"] + "docs": [ + "#7" + ] }, { "name": "credixGlobalMarketState", "isMut": false, "isSigner": false, - "docs": ["#8"] + "docs": [ + "#8" + ] }, { "name": "credixSigningAuthority", "isMut": false, "isSigner": false, - "docs": ["#9"] + "docs": [ + "#9" + ] }, { "name": "credixLiquidityCollateral", "isMut": true, "isSigner": false, - "docs": ["#10"] + "docs": [ + "#10" + ] }, { "name": "credixSharesMint", "isMut": true, "isSigner": false, - "docs": ["#11"] + "docs": [ + "#11" + ] }, { "name": "credixPass", "isMut": false, "isSigner": false, - "docs": ["#12"] + "docs": [ + "#12" + ] }, { "name": "credixWithdrawEpoch", "isMut": true, "isSigner": false, - "docs": ["#13"] + "docs": [ + "#13" + ] }, { "name": "credixWithdrawRequest", "isMut": true, "isSigner": false, - "docs": ["#14"] + "docs": [ + "#14" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "docs": ["#15"] + "docs": [ + "#15" + ] }, { "name": "credixProgram", "isMut": false, "isSigner": false, - "docs": ["#16"] + "docs": [ + "#16" + ] } ], "args": [] @@ -1824,151 +2241,201 @@ "name": "controller", "isMut": true, "isSigner": false, - "docs": ["#2"] + "docs": [ + "#2" + ] }, { "name": "identityDepository", "isMut": true, "isSigner": false, - "docs": ["#3"] + "docs": [ + "#3" + ] }, { "name": "identityDepositoryCollateral", "isMut": true, "isSigner": false, - "docs": ["#4"] + "docs": [ + "#4" + ] }, { "name": "mercurialVaultDepository", "isMut": true, "isSigner": false, - "docs": ["#5"] + "docs": [ + "#5" + ] }, { "name": "depository", "isMut": true, "isSigner": false, - "docs": ["#6"] + "docs": [ + "#6" + ] }, { "name": "collateralMint", "isMut": false, "isSigner": false, - "docs": ["#7"] + "docs": [ + "#7" + ] }, { "name": "depositoryCollateral", "isMut": true, "isSigner": false, - "docs": ["#8"] + "docs": [ + "#8" + ] }, { "name": "depositoryShares", "isMut": true, "isSigner": false, - "docs": ["#9"] + "docs": [ + "#9" + ] }, { "name": "credixProgramState", "isMut": false, "isSigner": false, - "docs": ["#10"] + "docs": [ + "#10" + ] }, { "name": "credixGlobalMarketState", "isMut": true, "isSigner": false, - "docs": ["#11"] + "docs": [ + "#11" + ] }, { "name": "credixSigningAuthority", "isMut": false, "isSigner": false, - "docs": ["#12"] + "docs": [ + "#12" + ] }, { "name": "credixLiquidityCollateral", "isMut": true, "isSigner": false, - "docs": ["#13"] + "docs": [ + "#13" + ] }, { "name": "credixSharesMint", "isMut": true, "isSigner": false, - "docs": ["#14"] + "docs": [ + "#14" + ] }, { "name": "credixPass", "isMut": true, "isSigner": false, - "docs": ["#15"] + "docs": [ + "#15" + ] }, { "name": "credixTreasuryCollateral", "isMut": true, "isSigner": false, - "docs": ["#16"] + "docs": [ + "#16" + ] }, { "name": "credixMultisigKey", "isMut": false, "isSigner": false, - "docs": ["#17"] + "docs": [ + "#17" + ] }, { "name": "credixMultisigCollateral", "isMut": true, "isSigner": false, - "docs": ["#18"] + "docs": [ + "#18" + ] }, { "name": "credixWithdrawEpoch", "isMut": true, "isSigner": false, - "docs": ["#19"] + "docs": [ + "#19" + ] }, { "name": "credixWithdrawRequest", "isMut": true, "isSigner": false, - "docs": ["#20"] + "docs": [ + "#20" + ] }, { "name": "profitsBeneficiaryCollateral", "isMut": true, "isSigner": false, - "docs": ["#21"] + "docs": [ + "#21" + ] }, { "name": "systemProgram", "isMut": false, "isSigner": false, - "docs": ["#22"] + "docs": [ + "#22" + ] }, { "name": "tokenProgram", "isMut": false, "isSigner": false, - "docs": ["#23"] + "docs": [ + "#23" + ] }, { "name": "associatedTokenProgram", "isMut": false, "isSigner": false, - "docs": ["#24"] + "docs": [ + "#24" + ] }, { "name": "credixProgram", "isMut": false, "isSigner": false, - "docs": ["#25"] + "docs": [ + "#25" + ] }, { "name": "rent", "isMut": false, "isSigner": false, - "docs": ["#26"] + "docs": [ + "#26" + ] } ], "args": [] @@ -2044,7 +2511,10 @@ { "name": "unused", "type": { - "array": ["u8", 255] + "array": [ + "u8", + 255 + ] } }, { @@ -2062,7 +2532,10 @@ { "name": "unused3", "type": { - "array": ["u8", 8] + "array": [ + "u8", + 8 + ] } }, { @@ -2072,13 +2545,19 @@ { "name": "unused4", "type": { - "array": ["u8", 8] + "array": [ + "u8", + 8 + ] } }, { "name": "registeredMercurialVaultDepositories", "type": { - "array": ["publicKey", 4] + "array": [ + "publicKey", + 4 + ] } }, { @@ -2088,7 +2567,10 @@ { "name": "registeredCredixLpDepositories", "type": { - "array": ["publicKey", 4] + "array": [ + "publicKey", + 4 + ] } }, { @@ -2126,7 +2608,10 @@ { "name": "reserved", "type": { - "array": ["u8", 128] + "array": [ + "u8", + 128 + ] } } ] @@ -2224,7 +2709,10 @@ { "name": "reserved", "type": { - "array": ["u8", 768] + "array": [ + "u8", + 768 + ] } } ] @@ -2290,7 +2778,10 @@ { "name": "reserved", "type": { - "array": ["u8", 512] + "array": [ + "u8", + 512 + ] } } ] @@ -2388,7 +2879,10 @@ { "name": "reserved", "type": { - "array": ["u8", 588] + "array": [ + "u8", + 588 + ] } } ] @@ -3491,8 +3985,5 @@ "name": "Default", "msg": "Default - Check the source code for more info." } - ], - "metadata": { - "address": "EqMrasrCXsbE6mpXaopUH1qip7auwX4AF5UWWpXaLr6u" - } -} + ] +} \ No newline at end of file diff --git a/target/types/uxd.ts b/target/types/uxd.ts index 39e19ad91..fe8203b02 100644 --- a/target/types/uxd.ts +++ b/target/types/uxd.ts @@ -1,6987 +1,7979 @@ export type Uxd = { - version: '7.3.1'; - name: 'uxd'; - instructions: [ - { - name: 'initializeController'; - docs: [ - 'Initialize a Controller on chain account.', - '', - 'Parameters:', - '- redeemable_mint_decimals: the decimals of the redeemable mint.', - '', - 'Note:', - 'Only one Controller on chain account will ever exist due to the', - 'PDA derivation seed having no variations.', - '', - 'Note:', - 'In the case of UXDProtocol this is the one in charge of the UXD mint,', - 'and it has been locked to a single Controller to ever exist by only', + "version": "7.3.1", + "name": "uxd", + "instructions": [ + { + "name": "initializeController", + "docs": [ + "Initialize a Controller on chain account.", + "", + "Parameters:", + "- redeemable_mint_decimals: the decimals of the redeemable mint.", + "", + "Note:", + "Only one Controller on chain account will ever exist due to the", + "PDA derivation seed having no variations.", + "", + "Note:", + "In the case of UXDProtocol this is the one in charge of the UXD mint,", + "and it has been locked to a single Controller to ever exist by only", "having one possible derivation. (but it's been made generic, and we", - 'could have added the authority to the seed generation for instance).', - '' - ]; - accounts: [ - { - name: 'authority'; - isMut: false; - isSigner: true; - docs: [ - '#1 Authored call accessible only to the signer matching Controller.authority' - ]; - }, - { - name: 'payer'; - isMut: true; - isSigner: true; - docs: ['#2']; - }, - { - name: 'controller'; - isMut: true; - isSigner: false; - docs: [ - '#3 The top level UXDProgram on chain account managing the redeemable mint' - ]; - }, - { - name: 'redeemableMint'; - isMut: true; - isSigner: false; - docs: ['#4 The redeemable mint managed by the `controller` instance']; - }, - { - name: 'systemProgram'; - isMut: false; - isSigner: false; - docs: ['#5 System Program']; - }, - { - name: 'tokenProgram'; - isMut: false; - isSigner: false; - docs: ['#6 Token Program']; - }, - { - name: 'rent'; - isMut: false; - isSigner: false; - docs: ['#7 Rent Sysvar']; + "could have added the authority to the seed generation for instance).", + "" + ], + "accounts": [ + { + "name": "authority", + "isMut": false, + "isSigner": true, + "docs": [ + "#1 Authored call accessible only to the signer matching Controller.authority" + ] + }, + { + "name": "payer", + "isMut": true, + "isSigner": true, + "docs": [ + "#2" + ] + }, + { + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#3 The top level UXDProgram on chain account managing the redeemable mint" + ] + }, + { + "name": "redeemableMint", + "isMut": true, + "isSigner": false, + "docs": [ + "#4 The redeemable mint managed by the `controller` instance" + ] + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#5 System Program" + ] + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#6 Token Program" + ] + }, + { + "name": "rent", + "isMut": false, + "isSigner": false, + "docs": [ + "#7 Rent Sysvar" + ] } - ]; - args: [ + ], + "args": [ { - name: 'redeemableMintDecimals'; - type: 'u8'; + "name": "redeemableMintDecimals", + "type": "u8" } - ]; + ] }, { - name: 'editController'; - accounts: [ + "name": "editController", + "accounts": [ { - name: 'authority'; - isMut: false; - isSigner: true; - docs: [ - '#1 Authored call accessible only to the signer matching Controller.authority' - ]; + "name": "authority", + "isMut": false, + "isSigner": true, + "docs": [ + "#1 Authored call accessible only to the signer matching Controller.authority" + ] }, { - name: 'controller'; - isMut: true; - isSigner: false; - docs: [ - '#2 The top level UXDProgram on chain account managing the redeemable mint' - ]; + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#2 The top level UXDProgram on chain account managing the redeemable mint" + ] } - ]; - args: [ + ], + "args": [ { - name: 'fields'; - type: { - defined: 'EditControllerFields'; - }; + "name": "fields", + "type": { + "defined": "EditControllerFields" + } } - ]; + ] }, { - name: 'editMercurialVaultDepository'; - accounts: [ + "name": "editMercurialVaultDepository", + "accounts": [ { - name: 'authority'; - isMut: false; - isSigner: true; - docs: [ - '#1 Authored call accessible only to the signer matching Controller.authority' - ]; + "name": "authority", + "isMut": false, + "isSigner": true, + "docs": [ + "#1 Authored call accessible only to the signer matching Controller.authority" + ] }, { - name: 'controller'; - isMut: true; - isSigner: false; - docs: [ - '#2 The top level UXDProgram on chain account managing the redeemable mint' - ]; + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#2 The top level UXDProgram on chain account managing the redeemable mint" + ] }, { - name: 'depository'; - isMut: true; - isSigner: false; - docs: [ - '#3 UXDProgram on chain account bound to a Controller instance.', - 'The `MercurialVaultDepository` manages a MercurialVaultAccount for a single Collateral.' - ]; + "name": "depository", + "isMut": true, + "isSigner": false, + "docs": [ + "#3 UXDProgram on chain account bound to a Controller instance.", + "The `MercurialVaultDepository` manages a MercurialVaultAccount for a single Collateral." + ] } - ]; - args: [ + ], + "args": [ { - name: 'fields'; - type: { - defined: 'EditMercurialVaultDepositoryFields'; - }; + "name": "fields", + "type": { + "defined": "EditMercurialVaultDepositoryFields" + } } - ]; + ] }, { - name: 'editIdentityDepository'; - accounts: [ + "name": "editIdentityDepository", + "accounts": [ { - name: 'authority'; - isMut: false; - isSigner: true; - docs: [ - '#1 Authored call accessible only to the signer matching Controller.authority' - ]; + "name": "authority", + "isMut": false, + "isSigner": true, + "docs": [ + "#1 Authored call accessible only to the signer matching Controller.authority" + ] }, { - name: 'controller'; - isMut: true; - isSigner: false; - docs: [ - '#2 The top level UXDProgram on chain account managing the redeemable mint' - ]; + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#2 The top level UXDProgram on chain account managing the redeemable mint" + ] }, { - name: 'depository'; - isMut: true; - isSigner: false; - docs: [ - '#3 UXDProgram on chain account bound to a Controller instance.' - ]; + "name": "depository", + "isMut": true, + "isSigner": false, + "docs": [ + "#3 UXDProgram on chain account bound to a Controller instance." + ] } - ]; - args: [ + ], + "args": [ { - name: 'fields'; - type: { - defined: 'EditIdentityDepositoryFields'; - }; + "name": "fields", + "type": { + "defined": "EditIdentityDepositoryFields" + } } - ]; + ] }, { - name: 'editCredixLpDepository'; - accounts: [ + "name": "editCredixLpDepository", + "accounts": [ { - name: 'authority'; - isMut: false; - isSigner: true; - docs: [ - '#1 Authored call accessible only to the signer matching Controller.authority' - ]; + "name": "authority", + "isMut": false, + "isSigner": true, + "docs": [ + "#1 Authored call accessible only to the signer matching Controller.authority" + ] }, { - name: 'controller'; - isMut: true; - isSigner: false; - docs: [ - '#2 The top level UXDProgram on chain account managing the redeemable mint' - ]; + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#2 The top level UXDProgram on chain account managing the redeemable mint" + ] }, { - name: 'depository'; - isMut: true; - isSigner: false; - docs: ['#3']; + "name": "depository", + "isMut": true, + "isSigner": false, + "docs": [ + "#3" + ] } - ]; - args: [ + ], + "args": [ { - name: 'fields'; - type: { - defined: 'EditCredixLpDepositoryFields'; - }; + "name": "fields", + "type": { + "defined": "EditCredixLpDepositoryFields" + } } - ]; + ] }, { - name: 'mint'; - accounts: [ + "name": "mint", + "accounts": [ { - name: 'user'; - isMut: false; - isSigner: true; - docs: ['#1']; + "name": "user", + "isMut": false, + "isSigner": true, + "docs": [ + "#1" + ] }, { - name: 'payer'; - isMut: true; - isSigner: true; - docs: ['#2']; + "name": "payer", + "isMut": true, + "isSigner": true, + "docs": [ + "#2" + ] }, { - name: 'controller'; - isMut: true; - isSigner: false; - docs: ['#3']; + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#3" + ] }, { - name: 'redeemableMint'; - isMut: true; - isSigner: false; - docs: ['#4']; + "name": "redeemableMint", + "isMut": true, + "isSigner": false, + "docs": [ + "#4" + ] }, { - name: 'collateralMint'; - isMut: false; - isSigner: false; - docs: ['#5']; + "name": "collateralMint", + "isMut": false, + "isSigner": false, + "docs": [ + "#5" + ] }, { - name: 'userRedeemable'; - isMut: true; - isSigner: false; - docs: ['#6']; + "name": "userRedeemable", + "isMut": true, + "isSigner": false, + "docs": [ + "#6" + ] }, { - name: 'userCollateral'; - isMut: true; - isSigner: false; - docs: ['#7']; + "name": "userCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#7" + ] }, { - name: 'identityDepository'; - isMut: true; - isSigner: false; - docs: [ - '#8 - UXDProgram on chain account bound to a Controller instance that represent the blank minting/redeeming' - ]; + "name": "identityDepository", + "isMut": true, + "isSigner": false, + "docs": [ + "#8 - UXDProgram on chain account bound to a Controller instance that represent the blank minting/redeeming" + ] }, { - name: 'identityDepositoryCollateralVault'; - isMut: true; - isSigner: false; - docs: ['#9 - Token account holding the collateral from minting']; + "name": "identityDepositoryCollateralVault", + "isMut": true, + "isSigner": false, + "docs": [ + "#9 - Token account holding the collateral from minting" + ] }, { - name: 'mercurialVaultDepository'; - isMut: true; - isSigner: false; - docs: ['#10']; + "name": "mercurialVaultDepository", + "isMut": true, + "isSigner": false, + "docs": [ + "#10" + ] }, { - name: 'mercurialVaultDepositoryLpTokenVault'; - isMut: true; - isSigner: false; - docs: [ - '#11 - Token account holding the LP tokens minted by depositing collateral on mercurial vault' - ]; + "name": "mercurialVaultDepositoryLpTokenVault", + "isMut": true, + "isSigner": false, + "docs": [ + "#11 - Token account holding the LP tokens minted by depositing collateral on mercurial vault" + ] }, { - name: 'mercurialVaultDepositoryVault'; - isMut: true; - isSigner: false; - docs: ['#12']; + "name": "mercurialVaultDepositoryVault", + "isMut": true, + "isSigner": false, + "docs": [ + "#12" + ] }, { - name: 'mercurialVaultDepositoryVaultLpMint'; - isMut: true; - isSigner: false; - docs: ['#13']; + "name": "mercurialVaultDepositoryVaultLpMint", + "isMut": true, + "isSigner": false, + "docs": [ + "#13" + ] }, { - name: 'mercurialVaultDepositoryCollateralTokenSafe'; - isMut: true; - isSigner: false; - docs: [ - '#14 - Token account owned by the mercurial vault program. Hold the collateral deposited in the mercurial vault.' - ]; + "name": "mercurialVaultDepositoryCollateralTokenSafe", + "isMut": true, + "isSigner": false, + "docs": [ + "#14 - Token account owned by the mercurial vault program. Hold the collateral deposited in the mercurial vault." + ] }, { - name: 'credixLpDepository'; - isMut: true; - isSigner: false; - docs: ['#15']; + "name": "credixLpDepository", + "isMut": true, + "isSigner": false, + "docs": [ + "#15" + ] }, { - name: 'credixLpDepositoryCollateral'; - isMut: true; - isSigner: false; - docs: ['#16']; + "name": "credixLpDepositoryCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#16" + ] }, { - name: 'credixLpDepositoryShares'; - isMut: true; - isSigner: false; - docs: ['#17']; - }, + "name": "credixLpDepositoryShares", + "isMut": true, + "isSigner": false, + "docs": [ + "#17" + ] + }, { - name: 'credixLpDepositoryPass'; - isMut: false; - isSigner: false; - docs: ['#18']; - }, + "name": "credixLpDepositoryPass", + "isMut": false, + "isSigner": false, + "docs": [ + "#18" + ] + }, { - name: 'credixLpDepositoryGlobalMarketState'; - isMut: false; - isSigner: false; - docs: ['#19']; - }, + "name": "credixLpDepositoryGlobalMarketState", + "isMut": false, + "isSigner": false, + "docs": [ + "#19" + ] + }, { - name: 'credixLpDepositorySigningAuthority'; - isMut: false; - isSigner: false; - docs: ['#20 - CHECK: unused by us, checked by credix']; - }, + "name": "credixLpDepositorySigningAuthority", + "isMut": false, + "isSigner": false, + "docs": [ + "#20 - CHECK: unused by us, checked by credix" + ] + }, { - name: 'credixLpDepositoryLiquidityCollateral'; - isMut: true; - isSigner: false; - docs: ['#21']; - }, + "name": "credixLpDepositoryLiquidityCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#21" + ] + }, { - name: 'credixLpDepositorySharesMint'; - isMut: true; - isSigner: false; - docs: ['#22']; - }, + "name": "credixLpDepositorySharesMint", + "isMut": true, + "isSigner": false, + "docs": [ + "#22" + ] + }, { - name: 'systemProgram'; - isMut: false; - isSigner: false; - docs: ['#23']; - }, + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#23" + ] + }, { - name: 'tokenProgram'; - isMut: false; - isSigner: false; - docs: ['#24']; - }, + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#24" + ] + }, { - name: 'associatedTokenProgram'; - isMut: false; - isSigner: false; - docs: ['#25']; - }, + "name": "associatedTokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#25" + ] + }, { - name: 'mercurialVaultProgram'; - isMut: false; - isSigner: false; - docs: ['#26']; - }, + "name": "mercurialVaultProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#26" + ] + }, { - name: 'credixProgram'; - isMut: false; - isSigner: false; - docs: ['#27']; - }, + "name": "credixProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#27" + ] + }, { - name: 'uxdProgram'; - isMut: false; - isSigner: false; - docs: ['#28']; - }, + "name": "uxdProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#28" + ] + }, { - name: 'rent'; - isMut: false; - isSigner: false; - docs: ['#29']; + "name": "rent", + "isMut": false, + "isSigner": false, + "docs": [ + "#29" + ] } - ]; - args: [ + ], + "args": [ { - name: 'collateralAmount'; - type: 'u64'; + "name": "collateralAmount", + "type": "u64" } - ]; + ] }, { - name: 'redeem'; - accounts: [ + "name": "redeem", + "accounts": [ { - name: 'user'; - isMut: false; - isSigner: true; - docs: ['#1']; + "name": "user", + "isMut": false, + "isSigner": true, + "docs": [ + "#1" + ] }, { - name: 'payer'; - isMut: true; - isSigner: true; - docs: ['#2']; + "name": "payer", + "isMut": true, + "isSigner": true, + "docs": [ + "#2" + ] }, { - name: 'controller'; - isMut: true; - isSigner: false; - docs: ['#3']; + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#3" + ] }, { - name: 'redeemableMint'; - isMut: true; - isSigner: false; - docs: ['#4']; + "name": "redeemableMint", + "isMut": true, + "isSigner": false, + "docs": [ + "#4" + ] }, { - name: 'collateralMint'; - isMut: false; - isSigner: false; - docs: ['#5']; + "name": "collateralMint", + "isMut": false, + "isSigner": false, + "docs": [ + "#5" + ] }, { - name: 'userRedeemable'; - isMut: true; - isSigner: false; - docs: ['#6']; + "name": "userRedeemable", + "isMut": true, + "isSigner": false, + "docs": [ + "#6" + ] }, { - name: 'userCollateral'; - isMut: true; - isSigner: false; - docs: ['#7']; + "name": "userCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#7" + ] }, { - name: 'identityDepository'; - isMut: true; - isSigner: false; - docs: [ - '#8 - UXDProgram on chain account bound to a Controller instance that represent the blank minting/redeeming' - ]; + "name": "identityDepository", + "isMut": true, + "isSigner": false, + "docs": [ + "#8 - UXDProgram on chain account bound to a Controller instance that represent the blank minting/redeeming" + ] }, { - name: 'identityDepositoryCollateralVault'; - isMut: true; - isSigner: false; - docs: ['#9 - Token account holding the collateral from minting']; + "name": "identityDepositoryCollateralVault", + "isMut": true, + "isSigner": false, + "docs": [ + "#9 - Token account holding the collateral from minting" + ] }, { - name: 'mercurialVaultDepository'; - isMut: true; - isSigner: false; - docs: ['#10']; + "name": "mercurialVaultDepository", + "isMut": true, + "isSigner": false, + "docs": [ + "#10" + ] }, { - name: 'mercurialVaultDepositoryLpTokenVault'; - isMut: true; - isSigner: false; - docs: [ - '#11 - Token account holding the LP tokens minted by depositing collateral on mercurial vault' - ]; + "name": "mercurialVaultDepositoryLpTokenVault", + "isMut": true, + "isSigner": false, + "docs": [ + "#11 - Token account holding the LP tokens minted by depositing collateral on mercurial vault" + ] }, { - name: 'mercurialVaultDepositoryVault'; - isMut: true; - isSigner: false; - docs: ['#12']; + "name": "mercurialVaultDepositoryVault", + "isMut": true, + "isSigner": false, + "docs": [ + "#12" + ] }, { - name: 'mercurialVaultDepositoryVaultLpMint'; - isMut: true; - isSigner: false; - docs: ['#13']; - }, + "name": "mercurialVaultDepositoryVaultLpMint", + "isMut": true, + "isSigner": false, + "docs": [ + "#13" + ] + }, { - name: 'mercurialVaultDepositoryCollateralTokenSafe'; - isMut: true; - isSigner: false; - docs: [ - '#14 - Token account owned by the mercurial vault program. Hold the collateral deposited in the mercurial vault.' - ]; - }, + "name": "mercurialVaultDepositoryCollateralTokenSafe", + "isMut": true, + "isSigner": false, + "docs": [ + "#14 - Token account owned by the mercurial vault program. Hold the collateral deposited in the mercurial vault." + ] + }, { - name: 'credixLpDepository'; - isMut: true; - isSigner: false; - docs: ['#15']; - }, + "name": "credixLpDepository", + "isMut": true, + "isSigner": false, + "docs": [ + "#15" + ] + }, { - name: 'systemProgram'; - isMut: false; - isSigner: false; - docs: ['#16']; - }, + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#16" + ] + }, { - name: 'tokenProgram'; - isMut: false; - isSigner: false; - docs: ['#17']; - }, + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#17" + ] + }, { - name: 'associatedTokenProgram'; - isMut: false; - isSigner: false; - docs: ['#18']; - }, + "name": "associatedTokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#18" + ] + }, { - name: 'mercurialVaultProgram'; - isMut: false; - isSigner: false; - docs: ['#19']; - }, + "name": "mercurialVaultProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#19" + ] + }, { - name: 'uxdProgram'; - isMut: false; - isSigner: false; - docs: ['#20']; - }, + "name": "uxdProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#20" + ] + }, { - name: 'rent'; - isMut: false; - isSigner: false; - docs: ['#21']; + "name": "rent", + "isMut": false, + "isSigner": false, + "docs": [ + "#21" + ] } - ]; - args: [ + ], + "args": [ { - name: 'redeemableAmount'; - type: 'u64'; + "name": "redeemableAmount", + "type": "u64" } - ]; + ] }, { - name: 'mintWithMercurialVaultDepository'; - accounts: [ - { - name: 'user'; - isMut: false; - isSigner: true; - docs: ['#1']; - }, + "name": "mintWithMercurialVaultDepository", + "accounts": [ { - name: 'payer'; - isMut: true; - isSigner: true; - docs: ['#2']; + "name": "user", + "isMut": false, + "isSigner": true, + "docs": [ + "#1" + ] }, { - name: 'controller'; - isMut: true; - isSigner: false; - docs: ['#3']; + "name": "payer", + "isMut": true, + "isSigner": true, + "docs": [ + "#2" + ] }, { - name: 'depository'; - isMut: true; - isSigner: false; - docs: ['#4']; + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#3" + ] }, { - name: 'redeemableMint'; - isMut: true; - isSigner: false; - docs: ['#5']; + "name": "depository", + "isMut": true, + "isSigner": false, + "docs": [ + "#4" + ] }, { - name: 'userRedeemable'; - isMut: true; - isSigner: false; - docs: ['#6']; + "name": "redeemableMint", + "isMut": true, + "isSigner": false, + "docs": [ + "#5" + ] }, { - name: 'collateralMint'; - isMut: false; - isSigner: false; - docs: ['#7']; + "name": "userRedeemable", + "isMut": true, + "isSigner": false, + "docs": [ + "#6" + ] }, { - name: 'userCollateral'; - isMut: true; - isSigner: false; - docs: ['#8']; + "name": "collateralMint", + "isMut": false, + "isSigner": false, + "docs": [ + "#7" + ] }, { - name: 'depositoryLpTokenVault'; - isMut: true; - isSigner: false; - docs: [ - '#9', - 'Token account holding the LP tokens minted by depositing collateral on mercurial vault' - ]; + "name": "userCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#8" + ] }, { - name: 'mercurialVault'; - isMut: true; - isSigner: false; - docs: ['#10']; + "name": "depositoryLpTokenVault", + "isMut": true, + "isSigner": false, + "docs": [ + "#9", + "Token account holding the LP tokens minted by depositing collateral on mercurial vault" + ] }, { - name: 'mercurialVaultLpMint'; - isMut: true; - isSigner: false; - docs: ['#11']; + "name": "mercurialVault", + "isMut": true, + "isSigner": false, + "docs": [ + "#10" + ] }, { - name: 'mercurialVaultCollateralTokenSafe'; - isMut: true; - isSigner: false; - docs: [ - '#12', - 'Token account owned by the mercurial vault program. Hold the collateral deposited in the mercurial vault.' - ]; + "name": "mercurialVaultLpMint", + "isMut": true, + "isSigner": false, + "docs": [ + "#11" + ] }, { - name: 'mercurialVaultProgram'; - isMut: false; - isSigner: false; - docs: ['#13']; - }, + "name": "mercurialVaultCollateralTokenSafe", + "isMut": true, + "isSigner": false, + "docs": [ + "#12", + "Token account owned by the mercurial vault program. Hold the collateral deposited in the mercurial vault." + ] + }, + { + "name": "mercurialVaultProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#13" + ] + }, { - name: 'systemProgram'; - isMut: false; - isSigner: false; - docs: ['#14']; - }, + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#14" + ] + }, { - name: 'tokenProgram'; - isMut: false; - isSigner: false; - docs: ['#15']; + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#15" + ] } - ]; - args: [ + ], + "args": [ { - name: 'collateralAmount'; - type: 'u64'; + "name": "collateralAmount", + "type": "u64" } - ]; + ] }, { - name: 'registerMercurialVaultDepository'; - accounts: [ + "name": "registerMercurialVaultDepository", + "accounts": [ { - name: 'authority'; - isMut: false; - isSigner: true; - docs: ['#1']; + "name": "authority", + "isMut": false, + "isSigner": true, + "docs": [ + "#1" + ] }, { - name: 'payer'; - isMut: true; - isSigner: true; - docs: ['#2']; + "name": "payer", + "isMut": true, + "isSigner": true, + "docs": [ + "#2" + ] }, { - name: 'controller'; - isMut: true; - isSigner: false; - docs: ['#3']; + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#3" + ] }, { - name: 'depository'; - isMut: true; - isSigner: false; - docs: ['#4']; + "name": "depository", + "isMut": true, + "isSigner": false, + "docs": [ + "#4" + ] }, { - name: 'collateralMint'; - isMut: false; - isSigner: false; - docs: ['#5']; + "name": "collateralMint", + "isMut": false, + "isSigner": false, + "docs": [ + "#5" + ] }, { - name: 'mercurialVault'; - isMut: false; - isSigner: false; - docs: ['#6']; + "name": "mercurialVault", + "isMut": false, + "isSigner": false, + "docs": [ + "#6" + ] }, { - name: 'mercurialVaultLpMint'; - isMut: false; - isSigner: false; - docs: ['#7']; + "name": "mercurialVaultLpMint", + "isMut": false, + "isSigner": false, + "docs": [ + "#7" + ] }, { - name: 'depositoryLpTokenVault'; - isMut: true; - isSigner: false; - docs: [ - '#8', - 'Token account holding the LP tokens minted by depositing collateral on mercurial vault' - ]; + "name": "depositoryLpTokenVault", + "isMut": true, + "isSigner": false, + "docs": [ + "#8", + "Token account holding the LP tokens minted by depositing collateral on mercurial vault" + ] }, { - name: 'systemProgram'; - isMut: false; - isSigner: false; - docs: ['#9']; + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#9" + ] }, { - name: 'tokenProgram'; - isMut: false; - isSigner: false; - docs: ['#10']; + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#10" + ] }, { - name: 'rent'; - isMut: false; - isSigner: false; - docs: ['#11']; + "name": "rent", + "isMut": false, + "isSigner": false, + "docs": [ + "#11" + ] } - ]; - args: [ + ], + "args": [ { - name: 'mintingFeeInBps'; - type: 'u8'; + "name": "mintingFeeInBps", + "type": "u8" }, { - name: 'redeemingFeeInBps'; - type: 'u8'; + "name": "redeemingFeeInBps", + "type": "u8" }, { - name: 'redeemableAmountUnderManagementCap'; - type: 'u128'; + "name": "redeemableAmountUnderManagementCap", + "type": "u128" } - ]; + ] }, { - name: 'redeemFromMercurialVaultDepository'; - accounts: [ + "name": "redeemFromMercurialVaultDepository", + "accounts": [ { - name: 'user'; - isMut: false; - isSigner: true; - docs: ['#1']; + "name": "user", + "isMut": false, + "isSigner": true, + "docs": [ + "#1" + ] }, { - name: 'payer'; - isMut: true; - isSigner: true; - docs: ['#2']; + "name": "payer", + "isMut": true, + "isSigner": true, + "docs": [ + "#2" + ] }, { - name: 'controller'; - isMut: true; - isSigner: false; - docs: ['#3']; + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#3" + ] }, { - name: 'depository'; - isMut: true; - isSigner: false; - docs: ['#4']; + "name": "depository", + "isMut": true, + "isSigner": false, + "docs": [ + "#4" + ] }, { - name: 'redeemableMint'; - isMut: true; - isSigner: false; - docs: ['#5']; + "name": "redeemableMint", + "isMut": true, + "isSigner": false, + "docs": [ + "#5" + ] }, { - name: 'userRedeemable'; - isMut: true; - isSigner: false; - docs: ['#6']; + "name": "userRedeemable", + "isMut": true, + "isSigner": false, + "docs": [ + "#6" + ] }, { - name: 'collateralMint'; - isMut: false; - isSigner: false; - docs: ['#7']; + "name": "collateralMint", + "isMut": false, + "isSigner": false, + "docs": [ + "#7" + ] }, { - name: 'userCollateral'; - isMut: true; - isSigner: false; - docs: ['#8']; + "name": "userCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#8" + ] }, { - name: 'depositoryLpTokenVault'; - isMut: true; - isSigner: false; - docs: [ - '#9', - 'Token account holding the LP tokens minted by depositing collateral on mercurial vault' - ]; + "name": "depositoryLpTokenVault", + "isMut": true, + "isSigner": false, + "docs": [ + "#9", + "Token account holding the LP tokens minted by depositing collateral on mercurial vault" + ] }, { - name: 'mercurialVault'; - isMut: true; - isSigner: false; - docs: ['#10']; + "name": "mercurialVault", + "isMut": true, + "isSigner": false, + "docs": [ + "#10" + ] }, { - name: 'mercurialVaultLpMint'; - isMut: true; - isSigner: false; - docs: ['#11']; + "name": "mercurialVaultLpMint", + "isMut": true, + "isSigner": false, + "docs": [ + "#11" + ] }, { - name: 'mercurialVaultCollateralTokenSafe'; - isMut: true; - isSigner: false; - docs: [ - '#12', - 'Token account owned by the mercurial vault program. Hold the collateral deposited in the mercurial vault.' - ]; - }, + "name": "mercurialVaultCollateralTokenSafe", + "isMut": true, + "isSigner": false, + "docs": [ + "#12", + "Token account owned by the mercurial vault program. Hold the collateral deposited in the mercurial vault." + ] + }, + { + "name": "mercurialVaultProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#13" + ] + }, { - name: 'mercurialVaultProgram'; - isMut: false; - isSigner: false; - docs: ['#13']; - }, + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#14" + ] + }, { - name: 'systemProgram'; - isMut: false; - isSigner: false; - docs: ['#14']; - }, - { - name: 'tokenProgram'; - isMut: false; - isSigner: false; - docs: ['#15']; + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#15" + ] } - ]; - args: [ + ], + "args": [ { - name: 'redeemableAmount'; - type: 'u64'; + "name": "redeemableAmount", + "type": "u64" } - ]; + ] }, { - name: 'collectProfitsOfMercurialVaultDepository'; - accounts: [ + "name": "collectProfitsOfMercurialVaultDepository", + "accounts": [ { - name: 'payer'; - isMut: true; - isSigner: true; - docs: ['#1']; + "name": "payer", + "isMut": true, + "isSigner": true, + "docs": [ + "#1" + ] }, { - name: 'controller'; - isMut: true; - isSigner: false; - docs: ['#2']; + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#2" + ] }, { - name: 'depository'; - isMut: true; - isSigner: false; - docs: ['#3']; + "name": "depository", + "isMut": true, + "isSigner": false, + "docs": [ + "#3" + ] }, { - name: 'collateralMint'; - isMut: false; - isSigner: false; - docs: ['#4']; + "name": "collateralMint", + "isMut": false, + "isSigner": false, + "docs": [ + "#4" + ] }, { - name: 'profitsBeneficiaryCollateral'; - isMut: true; - isSigner: false; - docs: ['#5']; + "name": "profitsBeneficiaryCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#5" + ] }, { - name: 'depositoryLpTokenVault'; - isMut: true; - isSigner: false; - docs: [ - '#6', - 'Token account holding the LP tokens minted by depositing collateral on mercurial vault' - ]; + "name": "depositoryLpTokenVault", + "isMut": true, + "isSigner": false, + "docs": [ + "#6", + "Token account holding the LP tokens minted by depositing collateral on mercurial vault" + ] }, { - name: 'mercurialVault'; - isMut: true; - isSigner: false; - docs: ['#7']; + "name": "mercurialVault", + "isMut": true, + "isSigner": false, + "docs": [ + "#7" + ] }, { - name: 'mercurialVaultLpMint'; - isMut: true; - isSigner: false; - docs: ['#8']; + "name": "mercurialVaultLpMint", + "isMut": true, + "isSigner": false, + "docs": [ + "#8" + ] }, { - name: 'mercurialVaultCollateralTokenSafe'; - isMut: true; - isSigner: false; - docs: [ - '#9', - 'Token account owned by the mercurial vault program. Hold the collateral deposited in the mercurial vault.' - ]; + "name": "mercurialVaultCollateralTokenSafe", + "isMut": true, + "isSigner": false, + "docs": [ + "#9", + "Token account owned by the mercurial vault program. Hold the collateral deposited in the mercurial vault." + ] }, { - name: 'mercurialVaultProgram'; - isMut: false; - isSigner: false; - docs: ['#10']; + "name": "mercurialVaultProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#10" + ] }, { - name: 'systemProgram'; - isMut: false; - isSigner: false; - docs: ['#11']; + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#11" + ] }, { - name: 'tokenProgram'; - isMut: false; - isSigner: false; - docs: ['#12']; + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#12" + ] } - ]; - args: []; + ], + "args": [] }, { - name: 'initializeIdentityDepository'; - accounts: [ + "name": "initializeIdentityDepository", + "accounts": [ { - name: 'authority'; - isMut: false; - isSigner: true; - docs: [ - '#1 Authored call accessible only to the signer matching Controller.authority' - ]; + "name": "authority", + "isMut": false, + "isSigner": true, + "docs": [ + "#1 Authored call accessible only to the signer matching Controller.authority" + ] }, { - name: 'payer'; - isMut: true; - isSigner: true; - docs: ['#2']; + "name": "payer", + "isMut": true, + "isSigner": true, + "docs": [ + "#2" + ] }, { - name: 'controller'; - isMut: true; - isSigner: false; - docs: [ - '#3 The top level UXDProgram on chain account managing the redeemable mint' - ]; + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#3 The top level UXDProgram on chain account managing the redeemable mint" + ] }, { - name: 'depository'; - isMut: true; - isSigner: false; - docs: [ - '#4 UXDProgram on chain account bound to a Controller instance' - ]; + "name": "depository", + "isMut": true, + "isSigner": false, + "docs": [ + "#4 UXDProgram on chain account bound to a Controller instance" + ] }, { - name: 'collateralVault'; - isMut: true; - isSigner: false; - docs: ['#5', 'Token account holding the collateral from minting']; + "name": "collateralVault", + "isMut": true, + "isSigner": false, + "docs": [ + "#5", + "Token account holding the collateral from minting" + ] }, { - name: 'collateralMint'; - isMut: false; - isSigner: false; - docs: ['#6 The collateral mint used by the `depository` instance']; + "name": "collateralMint", + "isMut": false, + "isSigner": false, + "docs": [ + "#6 The collateral mint used by the `depository` instance" + ] }, { - name: 'systemProgram'; - isMut: false; - isSigner: false; - docs: ['#7 System Program']; + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#7 System Program" + ] }, { - name: 'tokenProgram'; - isMut: false; - isSigner: false; - docs: ['#8 Token Program']; + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#8 Token Program" + ] }, { - name: 'rent'; - isMut: false; - isSigner: false; - docs: ['#9 Rent Sysvar']; + "name": "rent", + "isMut": false, + "isSigner": false, + "docs": [ + "#9 Rent Sysvar" + ] } - ]; - args: []; + ], + "args": [] }, { - name: 'mintWithIdentityDepository'; - accounts: [ + "name": "mintWithIdentityDepository", + "accounts": [ { - name: 'user'; - isMut: false; - isSigner: true; - docs: ['#1 Public call accessible to any user']; + "name": "user", + "isMut": false, + "isSigner": true, + "docs": [ + "#1 Public call accessible to any user" + ] }, { - name: 'payer'; - isMut: true; - isSigner: true; - docs: ['#2']; + "name": "payer", + "isMut": true, + "isSigner": true, + "docs": [ + "#2" + ] }, { - name: 'controller'; - isMut: true; - isSigner: false; - docs: [ - '#3 The top level UXDProgram on chain account managing the redeemable mint' - ]; + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#3 The top level UXDProgram on chain account managing the redeemable mint" + ] }, { - name: 'depository'; - isMut: true; - isSigner: false; - docs: [ - '#4 UXDProgram on chain account bound to a Controller instance that represent the blank minting/redeeming' - ]; + "name": "depository", + "isMut": true, + "isSigner": false, + "docs": [ + "#4 UXDProgram on chain account bound to a Controller instance that represent the blank minting/redeeming" + ] }, { - name: 'collateralVault'; - isMut: true; - isSigner: false; - docs: ['#5', 'Token account holding the collateral from minting']; + "name": "collateralVault", + "isMut": true, + "isSigner": false, + "docs": [ + "#5", + "Token account holding the collateral from minting" + ] }, { - name: 'redeemableMint'; - isMut: true; - isSigner: false; - docs: [ - '#6 The redeemable mint managed by the `controller` instance', - 'Tokens will be minted during this instruction' - ]; + "name": "redeemableMint", + "isMut": true, + "isSigner": false, + "docs": [ + "#6 The redeemable mint managed by the `controller` instance", + "Tokens will be minted during this instruction" + ] }, { - name: 'userCollateral'; - isMut: true; - isSigner: false; - docs: [ + "name": "userCollateral", + "isMut": true, + "isSigner": false, + "docs": [ "#7 The `user`'s TA for the `depository` `collateral_mint`", - 'Will be debited during this instruction' - ]; + "Will be debited during this instruction" + ] }, { - name: 'userRedeemable'; - isMut: true; - isSigner: false; - docs: [ + "name": "userRedeemable", + "isMut": true, + "isSigner": false, + "docs": [ "#8 The `user`'s TA for the `controller`'s `redeemable_mint`", - 'Will be credited during this instruction' - ]; + "Will be credited during this instruction" + ] }, { - name: 'systemProgram'; - isMut: false; - isSigner: false; - docs: ['#9']; + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#9" + ] }, { - name: 'tokenProgram'; - isMut: false; - isSigner: false; - docs: ['#10 Token Program']; + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#10 Token Program" + ] } - ]; - args: [ + ], + "args": [ { - name: 'collateralAmount'; - type: 'u64'; + "name": "collateralAmount", + "type": "u64" } - ]; + ] }, { - name: 'redeemFromIdentityDepository'; - accounts: [ + "name": "redeemFromIdentityDepository", + "accounts": [ { - name: 'user'; - isMut: false; - isSigner: true; - docs: ['#1 Public call accessible to any user']; + "name": "user", + "isMut": false, + "isSigner": true, + "docs": [ + "#1 Public call accessible to any user" + ] }, { - name: 'payer'; - isMut: true; - isSigner: true; - docs: ['#2']; + "name": "payer", + "isMut": true, + "isSigner": true, + "docs": [ + "#2" + ] }, { - name: 'controller'; - isMut: true; - isSigner: false; - docs: [ - '#3 The top level UXDProgram on chain account managing the redeemable mint' - ]; + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#3 The top level UXDProgram on chain account managing the redeemable mint" + ] }, { - name: 'depository'; - isMut: true; - isSigner: false; - docs: [ - '#4 UXDProgram on chain account bound to a Controller instance that represent the blank minting/redeeming' - ]; + "name": "depository", + "isMut": true, + "isSigner": false, + "docs": [ + "#4 UXDProgram on chain account bound to a Controller instance that represent the blank minting/redeeming" + ] }, { - name: 'collateralVault'; - isMut: true; - isSigner: false; - docs: ['#5', 'Token account holding the collateral from minting']; + "name": "collateralVault", + "isMut": true, + "isSigner": false, + "docs": [ + "#5", + "Token account holding the collateral from minting" + ] }, { - name: 'redeemableMint'; - isMut: true; - isSigner: false; - docs: [ - '#7 The redeemable mint managed by the `controller` instance', - 'Tokens will be burnt during this instruction' - ]; + "name": "redeemableMint", + "isMut": true, + "isSigner": false, + "docs": [ + "#7 The redeemable mint managed by the `controller` instance", + "Tokens will be burnt during this instruction" + ] }, { - name: 'userCollateral'; - isMut: true; - isSigner: false; - docs: [ + "name": "userCollateral", + "isMut": true, + "isSigner": false, + "docs": [ "#8 The `user`'s ATA for the `depository`'s `collateral_mint`", - 'Will be credited during this instruction' - ]; + "Will be credited during this instruction" + ] }, { - name: 'userRedeemable'; - isMut: true; - isSigner: false; - docs: [ + "name": "userRedeemable", + "isMut": true, + "isSigner": false, + "docs": [ "#9 The `user`'s ATA for the `controller`'s `redeemable_mint`", - 'Will be debited during this instruction' - ]; + "Will be debited during this instruction" + ] }, { - name: 'systemProgram'; - isMut: false; - isSigner: false; - docs: ['#10']; + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#10" + ] }, { - name: 'tokenProgram'; - isMut: false; - isSigner: false; - docs: ['#11']; + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#11" + ] } - ]; - args: [ + ], + "args": [ { - name: 'redeemableAmount'; - type: 'u64'; + "name": "redeemableAmount", + "type": "u64" } - ]; + ] }, { - name: 'registerCredixLpDepository'; - accounts: [ + "name": "registerCredixLpDepository", + "accounts": [ { - name: 'authority'; - isMut: false; - isSigner: true; - docs: ['#1']; + "name": "authority", + "isMut": false, + "isSigner": true, + "docs": [ + "#1" + ] }, { - name: 'payer'; - isMut: true; - isSigner: true; - docs: ['#2']; + "name": "payer", + "isMut": true, + "isSigner": true, + "docs": [ + "#2" + ] }, { - name: 'controller'; - isMut: true; - isSigner: false; - docs: ['#3']; + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#3" + ] }, { - name: 'depository'; - isMut: true; - isSigner: false; - docs: ['#4']; + "name": "depository", + "isMut": true, + "isSigner": false, + "docs": [ + "#4" + ] }, { - name: 'collateralMint'; - isMut: false; - isSigner: false; - docs: ['#5']; + "name": "collateralMint", + "isMut": false, + "isSigner": false, + "docs": [ + "#5" + ] }, { - name: 'depositoryCollateral'; - isMut: true; - isSigner: false; - docs: ['#6']; + "name": "depositoryCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#6" + ] }, { - name: 'depositoryShares'; - isMut: true; - isSigner: false; - docs: ['#7']; + "name": "depositoryShares", + "isMut": true, + "isSigner": false, + "docs": [ + "#7" + ] }, { - name: 'credixProgramState'; - isMut: false; - isSigner: false; - docs: ['#8']; + "name": "credixProgramState", + "isMut": false, + "isSigner": false, + "docs": [ + "#8" + ] }, { - name: 'credixGlobalMarketState'; - isMut: false; - isSigner: false; - docs: ['#9']; + "name": "credixGlobalMarketState", + "isMut": false, + "isSigner": false, + "docs": [ + "#9" + ] }, { - name: 'credixSigningAuthority'; - isMut: false; - isSigner: false; - docs: ['#10']; + "name": "credixSigningAuthority", + "isMut": false, + "isSigner": false, + "docs": [ + "#10" + ] }, { - name: 'credixLiquidityCollateral'; - isMut: false; - isSigner: false; - docs: ['#11']; + "name": "credixLiquidityCollateral", + "isMut": false, + "isSigner": false, + "docs": [ + "#11" + ] }, { - name: 'credixSharesMint'; - isMut: false; - isSigner: false; - docs: ['#12']; + "name": "credixSharesMint", + "isMut": false, + "isSigner": false, + "docs": [ + "#12" + ] }, { - name: 'systemProgram'; - isMut: false; - isSigner: false; - docs: ['#13']; - }, + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#13" + ] + }, { - name: 'tokenProgram'; - isMut: false; - isSigner: false; - docs: ['#14']; - }, + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#14" + ] + }, { - name: 'associatedTokenProgram'; - isMut: false; - isSigner: false; - docs: ['#15']; - }, + "name": "associatedTokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#15" + ] + }, { - name: 'rent'; - isMut: false; - isSigner: false; - docs: ['#16']; + "name": "rent", + "isMut": false, + "isSigner": false, + "docs": [ + "#16" + ] } - ]; - args: [ + ], + "args": [ { - name: 'mintingFeeInBps'; - type: 'u8'; + "name": "mintingFeeInBps", + "type": "u8" }, { - name: 'redeemingFeeInBps'; - type: 'u8'; + "name": "redeemingFeeInBps", + "type": "u8" }, { - name: 'redeemableAmountUnderManagementCap'; - type: 'u128'; + "name": "redeemableAmountUnderManagementCap", + "type": "u128" } - ]; + ] }, { - name: 'mintWithCredixLpDepository'; - accounts: [ + "name": "mintWithCredixLpDepository", + "accounts": [ { - name: 'user'; - isMut: false; - isSigner: true; - docs: ['#1']; + "name": "user", + "isMut": false, + "isSigner": true, + "docs": [ + "#1" + ] }, { - name: 'payer'; - isMut: true; - isSigner: true; - docs: ['#2']; + "name": "payer", + "isMut": true, + "isSigner": true, + "docs": [ + "#2" + ] }, { - name: 'controller'; - isMut: true; - isSigner: false; - docs: ['#3']; + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#3" + ] }, { - name: 'depository'; - isMut: true; - isSigner: false; - docs: ['#4']; + "name": "depository", + "isMut": true, + "isSigner": false, + "docs": [ + "#4" + ] }, { - name: 'redeemableMint'; - isMut: true; - isSigner: false; - docs: ['#5']; + "name": "redeemableMint", + "isMut": true, + "isSigner": false, + "docs": [ + "#5" + ] }, { - name: 'collateralMint'; - isMut: false; - isSigner: false; - docs: ['#6']; + "name": "collateralMint", + "isMut": false, + "isSigner": false, + "docs": [ + "#6" + ] }, { - name: 'userRedeemable'; - isMut: true; - isSigner: false; - docs: ['#7']; + "name": "userRedeemable", + "isMut": true, + "isSigner": false, + "docs": [ + "#7" + ] }, { - name: 'userCollateral'; - isMut: true; - isSigner: false; - docs: ['#8']; + "name": "userCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#8" + ] }, { - name: 'depositoryCollateral'; - isMut: true; - isSigner: false; - docs: ['#9']; + "name": "depositoryCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#9" + ] }, { - name: 'depositoryShares'; - isMut: true; - isSigner: false; - docs: ['#10']; + "name": "depositoryShares", + "isMut": true, + "isSigner": false, + "docs": [ + "#10" + ] }, { - name: 'credixGlobalMarketState'; - isMut: false; - isSigner: false; - docs: ['#11']; + "name": "credixGlobalMarketState", + "isMut": false, + "isSigner": false, + "docs": [ + "#11" + ] }, { - name: 'credixSigningAuthority'; - isMut: false; - isSigner: false; - docs: ['#12']; + "name": "credixSigningAuthority", + "isMut": false, + "isSigner": false, + "docs": [ + "#12" + ] }, { - name: 'credixLiquidityCollateral'; - isMut: true; - isSigner: false; - docs: ['#13']; - }, + "name": "credixLiquidityCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#13" + ] + }, { - name: 'credixSharesMint'; - isMut: true; - isSigner: false; - docs: ['#14']; - }, + "name": "credixSharesMint", + "isMut": true, + "isSigner": false, + "docs": [ + "#14" + ] + }, { - name: 'credixPass'; - isMut: false; - isSigner: false; - docs: ['#15']; - }, + "name": "credixPass", + "isMut": false, + "isSigner": false, + "docs": [ + "#15" + ] + }, { - name: 'systemProgram'; - isMut: false; - isSigner: false; - docs: ['#16']; - }, + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#16" + ] + }, { - name: 'tokenProgram'; - isMut: false; - isSigner: false; - docs: ['#17']; - }, + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#17" + ] + }, { - name: 'associatedTokenProgram'; - isMut: false; - isSigner: false; - docs: ['#18']; - }, + "name": "associatedTokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#18" + ] + }, { - name: 'credixProgram'; - isMut: false; - isSigner: false; - docs: ['#19']; - }, + "name": "credixProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#19" + ] + }, { - name: 'rent'; - isMut: false; - isSigner: false; - docs: ['#20']; + "name": "rent", + "isMut": false, + "isSigner": false, + "docs": [ + "#20" + ] } - ]; - args: [ + ], + "args": [ { - name: 'collateralAmount'; - type: 'u64'; + "name": "collateralAmount", + "type": "u64" } - ]; + ] }, { - name: 'redeemFromCredixLpDepository'; - accounts: [ + "name": "redeemFromCredixLpDepository", + "accounts": [ { - name: 'user'; - isMut: false; - isSigner: true; - docs: ['#1']; + "name": "user", + "isMut": false, + "isSigner": true, + "docs": [ + "#1" + ] }, { - name: 'payer'; - isMut: true; - isSigner: true; - docs: ['#2']; + "name": "payer", + "isMut": true, + "isSigner": true, + "docs": [ + "#2" + ] }, { - name: 'controller'; - isMut: true; - isSigner: false; - docs: ['#3']; + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#3" + ] }, { - name: 'depository'; - isMut: true; - isSigner: false; - docs: ['#4']; + "name": "depository", + "isMut": true, + "isSigner": false, + "docs": [ + "#4" + ] }, { - name: 'redeemableMint'; - isMut: true; - isSigner: false; - docs: ['#5']; + "name": "redeemableMint", + "isMut": true, + "isSigner": false, + "docs": [ + "#5" + ] }, { - name: 'collateralMint'; - isMut: false; - isSigner: false; - docs: ['#6']; + "name": "collateralMint", + "isMut": false, + "isSigner": false, + "docs": [ + "#6" + ] }, { - name: 'userRedeemable'; - isMut: true; - isSigner: false; - docs: ['#7']; + "name": "userRedeemable", + "isMut": true, + "isSigner": false, + "docs": [ + "#7" + ] }, { - name: 'userCollateral'; - isMut: true; - isSigner: false; - docs: ['#8']; + "name": "userCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#8" + ] }, { - name: 'depositoryCollateral'; - isMut: true; - isSigner: false; - docs: ['#9']; + "name": "depositoryCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#9" + ] }, { - name: 'depositoryShares'; - isMut: true; - isSigner: false; - docs: ['#10']; + "name": "depositoryShares", + "isMut": true, + "isSigner": false, + "docs": [ + "#10" + ] }, { - name: 'credixProgramState'; - isMut: false; - isSigner: false; - docs: ['#11']; + "name": "credixProgramState", + "isMut": false, + "isSigner": false, + "docs": [ + "#11" + ] }, { - name: 'credixGlobalMarketState'; - isMut: true; - isSigner: false; - docs: ['#12']; + "name": "credixGlobalMarketState", + "isMut": true, + "isSigner": false, + "docs": [ + "#12" + ] }, { - name: 'credixSigningAuthority'; - isMut: false; - isSigner: false; - docs: ['#13']; - }, + "name": "credixSigningAuthority", + "isMut": false, + "isSigner": false, + "docs": [ + "#13" + ] + }, { - name: 'credixLiquidityCollateral'; - isMut: true; - isSigner: false; - docs: ['#14']; - }, + "name": "credixLiquidityCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#14" + ] + }, { - name: 'credixSharesMint'; - isMut: true; - isSigner: false; - docs: ['#15']; - }, + "name": "credixSharesMint", + "isMut": true, + "isSigner": false, + "docs": [ + "#15" + ] + }, { - name: 'credixPass'; - isMut: false; - isSigner: false; - docs: ['#16']; - }, + "name": "credixPass", + "isMut": false, + "isSigner": false, + "docs": [ + "#16" + ] + }, { - name: 'credixTreasuryCollateral'; - isMut: true; - isSigner: false; - docs: ['#17']; - }, + "name": "credixTreasuryCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#17" + ] + }, { - name: 'credixMultisigKey'; - isMut: false; - isSigner: false; - docs: ['#18']; - }, + "name": "credixMultisigKey", + "isMut": false, + "isSigner": false, + "docs": [ + "#18" + ] + }, { - name: 'credixMultisigCollateral'; - isMut: true; - isSigner: false; - docs: ['#19']; - }, + "name": "credixMultisigCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#19" + ] + }, { - name: 'systemProgram'; - isMut: false; - isSigner: false; - docs: ['#20']; - }, + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#20" + ] + }, { - name: 'tokenProgram'; - isMut: false; - isSigner: false; - docs: ['#21']; - }, + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#21" + ] + }, { - name: 'associatedTokenProgram'; - isMut: false; - isSigner: false; - docs: ['#22']; - }, + "name": "associatedTokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#22" + ] + }, { - name: 'credixProgram'; - isMut: false; - isSigner: false; - docs: ['#23']; - }, + "name": "credixProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#23" + ] + }, { - name: 'rent'; - isMut: false; - isSigner: false; - docs: ['#24']; + "name": "rent", + "isMut": false, + "isSigner": false, + "docs": [ + "#24" + ] } - ]; - args: [ + ], + "args": [ { - name: 'redeemableAmount'; - type: 'u64'; + "name": "redeemableAmount", + "type": "u64" } - ]; + ] }, { - name: 'collectProfitsOfCredixLpDepository'; - accounts: [ + "name": "collectProfitsOfCredixLpDepository", + "accounts": [ { - name: 'payer'; - isMut: true; - isSigner: true; - docs: ['#1']; + "name": "payer", + "isMut": true, + "isSigner": true, + "docs": [ + "#1" + ] }, { - name: 'controller'; - isMut: true; - isSigner: false; - docs: ['#2']; + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#2" + ] }, { - name: 'depository'; - isMut: true; - isSigner: false; - docs: ['#3']; + "name": "depository", + "isMut": true, + "isSigner": false, + "docs": [ + "#3" + ] }, { - name: 'collateralMint'; - isMut: false; - isSigner: false; - docs: ['#4']; + "name": "collateralMint", + "isMut": false, + "isSigner": false, + "docs": [ + "#4" + ] }, { - name: 'depositoryCollateral'; - isMut: true; - isSigner: false; - docs: ['#5']; + "name": "depositoryCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#5" + ] }, { - name: 'depositoryShares'; - isMut: true; - isSigner: false; - docs: ['#6']; + "name": "depositoryShares", + "isMut": true, + "isSigner": false, + "docs": [ + "#6" + ] }, { - name: 'credixProgramState'; - isMut: false; - isSigner: false; - docs: ['#7']; + "name": "credixProgramState", + "isMut": false, + "isSigner": false, + "docs": [ + "#7" + ] }, { - name: 'credixGlobalMarketState'; - isMut: true; - isSigner: false; - docs: ['#8']; + "name": "credixGlobalMarketState", + "isMut": true, + "isSigner": false, + "docs": [ + "#8" + ] }, { - name: 'credixSigningAuthority'; - isMut: false; - isSigner: false; - docs: ['#9']; + "name": "credixSigningAuthority", + "isMut": false, + "isSigner": false, + "docs": [ + "#9" + ] }, { - name: 'credixLiquidityCollateral'; - isMut: true; - isSigner: false; - docs: ['#10']; + "name": "credixLiquidityCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#10" + ] }, { - name: 'credixSharesMint'; - isMut: true; - isSigner: false; - docs: ['#11']; + "name": "credixSharesMint", + "isMut": true, + "isSigner": false, + "docs": [ + "#11" + ] }, { - name: 'credixPass'; - isMut: true; - isSigner: false; - docs: ['#12']; + "name": "credixPass", + "isMut": true, + "isSigner": false, + "docs": [ + "#12" + ] }, { - name: 'credixTreasuryCollateral'; - isMut: true; - isSigner: false; - docs: ['#13']; - }, + "name": "credixTreasuryCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#13" + ] + }, { - name: 'credixMultisigKey'; - isMut: false; - isSigner: false; - docs: ['#14']; - }, + "name": "credixMultisigKey", + "isMut": false, + "isSigner": false, + "docs": [ + "#14" + ] + }, { - name: 'credixMultisigCollateral'; - isMut: true; - isSigner: false; - docs: ['#15']; - }, + "name": "credixMultisigCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#15" + ] + }, { - name: 'profitsBeneficiaryCollateral'; - isMut: true; - isSigner: false; - docs: ['#16']; - }, + "name": "profitsBeneficiaryCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#16" + ] + }, { - name: 'systemProgram'; - isMut: false; - isSigner: false; - docs: ['#17']; - }, + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#17" + ] + }, { - name: 'tokenProgram'; - isMut: false; - isSigner: false; - docs: ['#18']; - }, + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#18" + ] + }, { - name: 'associatedTokenProgram'; - isMut: false; - isSigner: false; - docs: ['#19']; - }, + "name": "associatedTokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#19" + ] + }, { - name: 'credixProgram'; - isMut: false; - isSigner: false; - docs: ['#20']; - }, + "name": "credixProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#20" + ] + }, { - name: 'rent'; - isMut: false; - isSigner: false; - docs: ['#21']; + "name": "rent", + "isMut": false, + "isSigner": false, + "docs": [ + "#21" + ] } - ]; - args: []; + ], + "args": [] }, { - name: 'rebalanceCreateWithdrawRequestFromCredixLpDepository'; - accounts: [ + "name": "rebalanceCreateWithdrawRequestFromCredixLpDepository", + "accounts": [ { - name: 'payer'; - isMut: true; - isSigner: true; - docs: [ - '#1', - 'Permissionless IX that can be called by anyone at any time' - ]; + "name": "payer", + "isMut": true, + "isSigner": true, + "docs": [ + "#1", + "Permissionless IX that can be called by anyone at any time" + ] }, { - name: 'controller'; - isMut: true; - isSigner: false; - docs: ['#2']; + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#2" + ] }, { - name: 'identityDepository'; - isMut: true; - isSigner: false; - docs: ['#3']; + "name": "identityDepository", + "isMut": true, + "isSigner": false, + "docs": [ + "#3" + ] }, { - name: 'mercurialVaultDepository'; - isMut: true; - isSigner: false; - docs: ['#4']; + "name": "mercurialVaultDepository", + "isMut": true, + "isSigner": false, + "docs": [ + "#4" + ] }, { - name: 'depository'; - isMut: true; - isSigner: false; - docs: ['#5']; + "name": "depository", + "isMut": true, + "isSigner": false, + "docs": [ + "#5" + ] }, { - name: 'collateralMint'; - isMut: false; - isSigner: false; - docs: ['#6']; + "name": "collateralMint", + "isMut": false, + "isSigner": false, + "docs": [ + "#6" + ] }, { - name: 'depositoryShares'; - isMut: true; - isSigner: false; - docs: ['#7']; + "name": "depositoryShares", + "isMut": true, + "isSigner": false, + "docs": [ + "#7" + ] }, { - name: 'credixGlobalMarketState'; - isMut: false; - isSigner: false; - docs: ['#8']; + "name": "credixGlobalMarketState", + "isMut": false, + "isSigner": false, + "docs": [ + "#8" + ] }, { - name: 'credixSigningAuthority'; - isMut: false; - isSigner: false; - docs: ['#9']; + "name": "credixSigningAuthority", + "isMut": false, + "isSigner": false, + "docs": [ + "#9" + ] }, { - name: 'credixLiquidityCollateral'; - isMut: true; - isSigner: false; - docs: ['#10']; + "name": "credixLiquidityCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#10" + ] }, { - name: 'credixSharesMint'; - isMut: true; - isSigner: false; - docs: ['#11']; + "name": "credixSharesMint", + "isMut": true, + "isSigner": false, + "docs": [ + "#11" + ] }, { - name: 'credixPass'; - isMut: false; - isSigner: false; - docs: ['#12']; + "name": "credixPass", + "isMut": false, + "isSigner": false, + "docs": [ + "#12" + ] }, { - name: 'credixWithdrawEpoch'; - isMut: true; - isSigner: false; - docs: ['#13']; - }, + "name": "credixWithdrawEpoch", + "isMut": true, + "isSigner": false, + "docs": [ + "#13" + ] + }, { - name: 'credixWithdrawRequest'; - isMut: true; - isSigner: false; - docs: ['#14']; - }, + "name": "credixWithdrawRequest", + "isMut": true, + "isSigner": false, + "docs": [ + "#14" + ] + }, { - name: 'systemProgram'; - isMut: false; - isSigner: false; - docs: ['#15']; - }, + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#15" + ] + }, { - name: 'credixProgram'; - isMut: false; - isSigner: false; - docs: ['#16']; + "name": "credixProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#16" + ] } - ]; - args: []; + ], + "args": [] }, { - name: 'rebalanceRedeemWithdrawRequestFromCredixLpDepository'; - accounts: [ + "name": "rebalanceRedeemWithdrawRequestFromCredixLpDepository", + "accounts": [ { - name: 'payer'; - isMut: true; - isSigner: true; - docs: [ - '#1 // Permissionless IX that can be called by anyone at any time' - ]; + "name": "payer", + "isMut": true, + "isSigner": true, + "docs": [ + "#1 // Permissionless IX that can be called by anyone at any time" + ] }, { - name: 'controller'; - isMut: true; - isSigner: false; - docs: ['#2']; + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#2" + ] }, { - name: 'identityDepository'; - isMut: true; - isSigner: false; - docs: ['#3']; + "name": "identityDepository", + "isMut": true, + "isSigner": false, + "docs": [ + "#3" + ] }, { - name: 'identityDepositoryCollateral'; - isMut: true; - isSigner: false; - docs: ['#4']; + "name": "identityDepositoryCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#4" + ] }, { - name: 'mercurialVaultDepository'; - isMut: true; - isSigner: false; - docs: ['#5']; + "name": "mercurialVaultDepository", + "isMut": true, + "isSigner": false, + "docs": [ + "#5" + ] }, { - name: 'depository'; - isMut: true; - isSigner: false; - docs: ['#6']; + "name": "depository", + "isMut": true, + "isSigner": false, + "docs": [ + "#6" + ] }, { - name: 'collateralMint'; - isMut: false; - isSigner: false; - docs: ['#7']; + "name": "collateralMint", + "isMut": false, + "isSigner": false, + "docs": [ + "#7" + ] }, { - name: 'depositoryCollateral'; - isMut: true; - isSigner: false; - docs: ['#8']; + "name": "depositoryCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#8" + ] }, { - name: 'depositoryShares'; - isMut: true; - isSigner: false; - docs: ['#9']; + "name": "depositoryShares", + "isMut": true, + "isSigner": false, + "docs": [ + "#9" + ] }, { - name: 'credixProgramState'; - isMut: false; - isSigner: false; - docs: ['#10']; + "name": "credixProgramState", + "isMut": false, + "isSigner": false, + "docs": [ + "#10" + ] }, { - name: 'credixGlobalMarketState'; - isMut: true; - isSigner: false; - docs: ['#11']; + "name": "credixGlobalMarketState", + "isMut": true, + "isSigner": false, + "docs": [ + "#11" + ] }, { - name: 'credixSigningAuthority'; - isMut: false; - isSigner: false; - docs: ['#12']; + "name": "credixSigningAuthority", + "isMut": false, + "isSigner": false, + "docs": [ + "#12" + ] }, { - name: 'credixLiquidityCollateral'; - isMut: true; - isSigner: false; - docs: ['#13']; + "name": "credixLiquidityCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#13" + ] }, { - name: 'credixSharesMint'; - isMut: true; - isSigner: false; - docs: ['#14']; - }, + "name": "credixSharesMint", + "isMut": true, + "isSigner": false, + "docs": [ + "#14" + ] + }, { - name: 'credixPass'; - isMut: true; - isSigner: false; - docs: ['#15']; - }, + "name": "credixPass", + "isMut": true, + "isSigner": false, + "docs": [ + "#15" + ] + }, { - name: 'credixTreasuryCollateral'; - isMut: true; - isSigner: false; - docs: ['#16']; - }, + "name": "credixTreasuryCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#16" + ] + }, { - name: 'credixMultisigKey'; - isMut: false; - isSigner: false; - docs: ['#17']; - }, + "name": "credixMultisigKey", + "isMut": false, + "isSigner": false, + "docs": [ + "#17" + ] + }, { - name: 'credixMultisigCollateral'; - isMut: true; - isSigner: false; - docs: ['#18']; - }, + "name": "credixMultisigCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#18" + ] + }, { - name: 'credixWithdrawEpoch'; - isMut: true; - isSigner: false; - docs: ['#19']; - }, + "name": "credixWithdrawEpoch", + "isMut": true, + "isSigner": false, + "docs": [ + "#19" + ] + }, { - name: 'credixWithdrawRequest'; - isMut: true; - isSigner: false; - docs: ['#20']; - }, + "name": "credixWithdrawRequest", + "isMut": true, + "isSigner": false, + "docs": [ + "#20" + ] + }, { - name: 'profitsBeneficiaryCollateral'; - isMut: true; - isSigner: false; - docs: ['#21']; - }, + "name": "profitsBeneficiaryCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#21" + ] + }, { - name: 'systemProgram'; - isMut: false; - isSigner: false; - docs: ['#22']; - }, + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#22" + ] + }, { - name: 'tokenProgram'; - isMut: false; - isSigner: false; - docs: ['#23']; - }, + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#23" + ] + }, { - name: 'associatedTokenProgram'; - isMut: false; - isSigner: false; - docs: ['#24']; - }, + "name": "associatedTokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#24" + ] + }, { - name: 'credixProgram'; - isMut: false; - isSigner: false; - docs: ['#25']; - }, + "name": "credixProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#25" + ] + }, { - name: 'rent'; - isMut: false; - isSigner: false; - docs: ['#26']; + "name": "rent", + "isMut": false, + "isSigner": false, + "docs": [ + "#26" + ] } - ]; - args: []; - }, - { - name: 'freezeProgram'; - docs: [ - 'Freeze or resume all ixs associated with the controller (except this one).', - '', - 'Parameters:', - '- freeze: bool param to flip the `is_frozen` property in the controller', - '', - 'Note:', - 'This is a wildcard to stop the program temporarily when a vulnerability has been detected to allow the team to do servicing work.', - '' - ]; - accounts: [ - { - name: 'authority'; - isMut: false; - isSigner: true; - docs: [ - '#1 Authored call accessible only to the signer matching Controller.authority' - ]; - }, - { - name: 'controller'; - isMut: true; - isSigner: false; - docs: [ - '#2 The top level UXDProgram on chain account managing the redeemable mint' - ]; + ], + "args": [] + }, + { + "name": "freezeProgram", + "docs": [ + "Freeze or resume all ixs associated with the controller (except this one).", + "", + "Parameters:", + "- freeze: bool param to flip the `is_frozen` property in the controller", + "", + "Note:", + "This is a wildcard to stop the program temporarily when a vulnerability has been detected to allow the team to do servicing work.", + "" + ], + "accounts": [ + { + "name": "authority", + "isMut": false, + "isSigner": true, + "docs": [ + "#1 Authored call accessible only to the signer matching Controller.authority" + ] + }, + { + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#2 The top level UXDProgram on chain account managing the redeemable mint" + ] } - ]; - args: [ + ], + "args": [ { - name: 'freeze'; - type: 'bool'; + "name": "freeze", + "type": "bool" } - ]; + ] } - ]; - accounts: [ + ], + "accounts": [ { - name: 'controller'; - type: { - kind: 'struct'; - fields: [ + "name": "controller", + "type": { + "kind": "struct", + "fields": [ { - name: 'bump'; - type: 'u8'; + "name": "bump", + "type": "u8" }, { - name: 'redeemableMintBump'; - type: 'u8'; + "name": "redeemableMintBump", + "type": "u8" }, { - name: 'version'; - type: 'u8'; + "name": "version", + "type": "u8" }, { - name: 'authority'; - type: 'publicKey'; + "name": "authority", + "type": "publicKey" }, { - name: 'redeemableMint'; - type: 'publicKey'; + "name": "redeemableMint", + "type": "publicKey" }, { - name: 'redeemableMintDecimals'; - type: 'u8'; + "name": "redeemableMintDecimals", + "type": "u8" }, { - name: 'unused'; - type: { - array: ['u8', 255]; - }; + "name": "unused", + "type": { + "array": [ + "u8", + 255 + ] + } }, { - name: 'isFrozen'; - type: 'bool'; + "name": "isFrozen", + "type": "bool" }, { - name: 'unused2'; - type: 'u8'; + "name": "unused2", + "type": "u8" }, { - name: 'redeemableGlobalSupplyCap'; - type: 'u128'; + "name": "redeemableGlobalSupplyCap", + "type": "u128" }, { - name: 'unused3'; - type: { - array: ['u8', 8]; - }; + "name": "unused3", + "type": { + "array": [ + "u8", + 8 + ] + } }, { - name: 'redeemableCirculatingSupply'; - type: 'u128'; + "name": "redeemableCirculatingSupply", + "type": "u128" }, { - name: 'unused4'; - type: { - array: ['u8', 8]; - }; + "name": "unused4", + "type": { + "array": [ + "u8", + 8 + ] + } }, { - name: 'registeredMercurialVaultDepositories'; - type: { - array: ['publicKey', 4]; - }; + "name": "registeredMercurialVaultDepositories", + "type": { + "array": [ + "publicKey", + 4 + ] + } }, { - name: 'registeredMercurialVaultDepositoriesCount'; - type: 'u8'; + "name": "registeredMercurialVaultDepositoriesCount", + "type": "u8" }, { - name: 'registeredCredixLpDepositories'; - type: { - array: ['publicKey', 4]; - }; + "name": "registeredCredixLpDepositories", + "type": { + "array": [ + "publicKey", + 4 + ] + } }, { - name: 'registeredCredixLpDepositoriesCount'; - type: 'u8'; + "name": "registeredCredixLpDepositoriesCount", + "type": "u8" }, { - name: 'profitsTotalCollected'; - type: 'u128'; + "name": "profitsTotalCollected", + "type": "u128" }, { - name: 'identityDepositoryWeightBps'; - type: 'u16'; + "name": "identityDepositoryWeightBps", + "type": "u16" }, { - name: 'mercurialVaultDepositoryWeightBps'; - type: 'u16'; + "name": "mercurialVaultDepositoryWeightBps", + "type": "u16" }, { - name: 'credixLpDepositoryWeightBps'; - type: 'u16'; + "name": "credixLpDepositoryWeightBps", + "type": "u16" }, { - name: 'identityDepository'; - type: 'publicKey'; + "name": "identityDepository", + "type": "publicKey" }, { - name: 'mercurialVaultDepository'; - type: 'publicKey'; + "name": "mercurialVaultDepository", + "type": "publicKey" }, { - name: 'credixLpDepository'; - type: 'publicKey'; + "name": "credixLpDepository", + "type": "publicKey" }, { - name: 'reserved'; - type: { - array: ['u8', 128]; - }; + "name": "reserved", + "type": { + "array": [ + "u8", + 128 + ] + } } - ]; - }; + ] + } }, { - name: 'credixLpDepository'; - type: { - kind: 'struct'; - fields: [ + "name": "credixLpDepository", + "type": { + "kind": "struct", + "fields": [ { - name: 'bump'; - type: 'u8'; + "name": "bump", + "type": "u8" }, { - name: 'version'; - type: 'u8'; + "name": "version", + "type": "u8" }, { - name: 'controller'; - type: 'publicKey'; + "name": "controller", + "type": "publicKey" }, { - name: 'collateralMint'; - type: 'publicKey'; + "name": "collateralMint", + "type": "publicKey" }, { - name: 'depositoryCollateral'; - type: 'publicKey'; + "name": "depositoryCollateral", + "type": "publicKey" }, { - name: 'depositoryShares'; - type: 'publicKey'; + "name": "depositoryShares", + "type": "publicKey" }, { - name: 'credixProgramState'; - type: 'publicKey'; + "name": "credixProgramState", + "type": "publicKey" }, { - name: 'credixGlobalMarketState'; - type: 'publicKey'; + "name": "credixGlobalMarketState", + "type": "publicKey" }, { - name: 'credixSigningAuthority'; - type: 'publicKey'; + "name": "credixSigningAuthority", + "type": "publicKey" }, { - name: 'credixLiquidityCollateral'; - type: 'publicKey'; + "name": "credixLiquidityCollateral", + "type": "publicKey" }, { - name: 'credixSharesMint'; - type: 'publicKey'; + "name": "credixSharesMint", + "type": "publicKey" }, { - name: 'redeemableAmountUnderManagementCap'; - type: 'u128'; + "name": "redeemableAmountUnderManagementCap", + "type": "u128" }, { - name: 'mintingFeeInBps'; - type: 'u8'; + "name": "mintingFeeInBps", + "type": "u8" }, { - name: 'redeemingFeeInBps'; - type: 'u8'; + "name": "redeemingFeeInBps", + "type": "u8" }, { - name: 'mintingDisabled'; - type: 'bool'; + "name": "mintingDisabled", + "type": "bool" }, { - name: 'collateralAmountDeposited'; - type: 'u128'; + "name": "collateralAmountDeposited", + "type": "u128" }, { - name: 'redeemableAmountUnderManagement'; - type: 'u128'; + "name": "redeemableAmountUnderManagement", + "type": "u128" }, { - name: 'mintingFeeTotalAccrued'; - type: 'u128'; + "name": "mintingFeeTotalAccrued", + "type": "u128" }, { - name: 'redeemingFeeTotalAccrued'; - type: 'u128'; + "name": "redeemingFeeTotalAccrued", + "type": "u128" }, { - name: 'profitsTotalCollected'; - type: 'u128'; + "name": "profitsTotalCollected", + "type": "u128" }, { - name: 'profitsBeneficiaryCollateral'; - type: 'publicKey'; + "name": "profitsBeneficiaryCollateral", + "type": "publicKey" }, { - name: 'reserved'; - type: { - array: ['u8', 768]; - }; + "name": "reserved", + "type": { + "array": [ + "u8", + 768 + ] + } } - ]; - }; + ] + } }, { - name: 'identityDepository'; - type: { - kind: 'struct'; - fields: [ + "name": "identityDepository", + "type": { + "kind": "struct", + "fields": [ { - name: 'bump'; - type: 'u8'; + "name": "bump", + "type": "u8" }, { - name: 'version'; - type: 'u8'; + "name": "version", + "type": "u8" }, { - name: 'collateralMint'; - type: 'publicKey'; + "name": "collateralMint", + "type": "publicKey" }, { - name: 'collateralMintDecimals'; - type: 'u8'; + "name": "collateralMintDecimals", + "type": "u8" }, { - name: 'collateralVault'; - type: 'publicKey'; + "name": "collateralVault", + "type": "publicKey" }, { - name: 'collateralVaultBump'; - type: 'u8'; + "name": "collateralVaultBump", + "type": "u8" }, { - name: 'collateralAmountDeposited'; - type: 'u128'; + "name": "collateralAmountDeposited", + "type": "u128" }, { - name: 'redeemableAmountUnderManagement'; - type: 'u128'; + "name": "redeemableAmountUnderManagement", + "type": "u128" }, { - name: 'redeemableAmountUnderManagementCap'; - type: 'u128'; + "name": "redeemableAmountUnderManagementCap", + "type": "u128" }, { - name: 'mintingDisabled'; - type: 'bool'; + "name": "mintingDisabled", + "type": "bool" }, { - name: 'mangoCollateralReinjectedWsol'; - type: 'bool'; + "name": "mangoCollateralReinjectedWsol", + "type": "bool" }, { - name: 'mangoCollateralReinjectedBtc'; - type: 'bool'; + "name": "mangoCollateralReinjectedBtc", + "type": "bool" }, { - name: 'mangoCollateralReinjectedEth'; - type: 'bool'; + "name": "mangoCollateralReinjectedEth", + "type": "bool" }, { - name: 'reserved'; - type: { - array: ['u8', 512]; - }; + "name": "reserved", + "type": { + "array": [ + "u8", + 512 + ] + } } - ]; - }; + ] + } }, { - name: 'mercurialVaultDepository'; - type: { - kind: 'struct'; - fields: [ + "name": "mercurialVaultDepository", + "type": { + "kind": "struct", + "fields": [ { - name: 'bump'; - type: 'u8'; + "name": "bump", + "type": "u8" }, { - name: 'version'; - type: 'u8'; + "name": "version", + "type": "u8" }, { - name: 'collateralMint'; - type: 'publicKey'; + "name": "collateralMint", + "type": "publicKey" }, { - name: 'collateralMintDecimals'; - type: 'u8'; + "name": "collateralMintDecimals", + "type": "u8" }, { - name: 'controller'; - type: 'publicKey'; + "name": "controller", + "type": "publicKey" }, { - name: 'collateralAmountDeposited'; - type: 'u128'; + "name": "collateralAmountDeposited", + "type": "u128" }, { - name: 'redeemableAmountUnderManagement'; - type: 'u128'; + "name": "redeemableAmountUnderManagement", + "type": "u128" }, { - name: 'mercurialVault'; - type: 'publicKey'; + "name": "mercurialVault", + "type": "publicKey" }, { - name: 'mercurialVaultLpMint'; - type: 'publicKey'; + "name": "mercurialVaultLpMint", + "type": "publicKey" }, { - name: 'mercurialVaultLpMintDecimals'; - type: 'u8'; + "name": "mercurialVaultLpMintDecimals", + "type": "u8" }, { - name: 'lpTokenVault'; - type: 'publicKey'; + "name": "lpTokenVault", + "type": "publicKey" }, { - name: 'lpTokenVaultBump'; - type: 'u8'; + "name": "lpTokenVaultBump", + "type": "u8" }, { - name: 'mintingFeeInBps'; - type: 'u8'; + "name": "mintingFeeInBps", + "type": "u8" }, { - name: 'redeemingFeeInBps'; - type: 'u8'; + "name": "redeemingFeeInBps", + "type": "u8" }, { - name: 'mintingFeeTotalAccrued'; - type: 'u128'; + "name": "mintingFeeTotalAccrued", + "type": "u128" }, { - name: 'redeemingFeeTotalAccrued'; - type: 'u128'; + "name": "redeemingFeeTotalAccrued", + "type": "u128" }, { - name: 'redeemableAmountUnderManagementCap'; - type: 'u128'; + "name": "redeemableAmountUnderManagementCap", + "type": "u128" }, { - name: 'mintingDisabled'; - type: 'bool'; + "name": "mintingDisabled", + "type": "bool" }, { - name: 'profitsTotalCollected'; - type: 'u128'; + "name": "profitsTotalCollected", + "type": "u128" }, { - name: 'lastProfitsCollectionUnixTimestamp'; - type: 'u64'; + "name": "lastProfitsCollectionUnixTimestamp", + "type": "u64" }, { - name: 'profitsBeneficiaryCollateral'; - type: 'publicKey'; + "name": "profitsBeneficiaryCollateral", + "type": "publicKey" }, { - name: 'reserved'; - type: { - array: ['u8', 588]; - }; + "name": "reserved", + "type": { + "array": [ + "u8", + 588 + ] + } } - ]; - }; + ] + } } - ]; - types: [ + ], + "types": [ { - name: 'EditCredixLpDepositoryFields'; - type: { - kind: 'struct'; - fields: [ + "name": "EditCredixLpDepositoryFields", + "type": { + "kind": "struct", + "fields": [ { - name: 'redeemableAmountUnderManagementCap'; - type: { - option: 'u128'; - }; + "name": "redeemableAmountUnderManagementCap", + "type": { + "option": "u128" + } }, { - name: 'mintingFeeInBps'; - type: { - option: 'u8'; - }; + "name": "mintingFeeInBps", + "type": { + "option": "u8" + } }, { - name: 'redeemingFeeInBps'; - type: { - option: 'u8'; - }; + "name": "redeemingFeeInBps", + "type": { + "option": "u8" + } }, { - name: 'mintingDisabled'; - type: { - option: 'bool'; - }; + "name": "mintingDisabled", + "type": { + "option": "bool" + } }, { - name: 'profitsBeneficiaryCollateral'; - type: { - option: 'publicKey'; - }; + "name": "profitsBeneficiaryCollateral", + "type": { + "option": "publicKey" + } } - ]; - }; + ] + } }, { - name: 'EditDepositoriesRoutingWeightBps'; - type: { - kind: 'struct'; - fields: [ + "name": "EditDepositoriesRoutingWeightBps", + "type": { + "kind": "struct", + "fields": [ { - name: 'identityDepositoryWeightBps'; - type: 'u16'; + "name": "identityDepositoryWeightBps", + "type": "u16" }, { - name: 'mercurialVaultDepositoryWeightBps'; - type: 'u16'; + "name": "mercurialVaultDepositoryWeightBps", + "type": "u16" }, { - name: 'credixLpDepositoryWeightBps'; - type: 'u16'; + "name": "credixLpDepositoryWeightBps", + "type": "u16" } - ]; - }; + ] + } }, { - name: 'EditRouterDepositories'; - type: { - kind: 'struct'; - fields: [ + "name": "EditRouterDepositories", + "type": { + "kind": "struct", + "fields": [ { - name: 'identityDepository'; - type: 'publicKey'; + "name": "identityDepository", + "type": "publicKey" }, { - name: 'mercurialVaultDepository'; - type: 'publicKey'; + "name": "mercurialVaultDepository", + "type": "publicKey" }, { - name: 'credixLpDepository'; - type: 'publicKey'; + "name": "credixLpDepository", + "type": "publicKey" } - ]; - }; + ] + } }, { - name: 'EditControllerFields'; - type: { - kind: 'struct'; - fields: [ + "name": "EditControllerFields", + "type": { + "kind": "struct", + "fields": [ { - name: 'redeemableGlobalSupplyCap'; - type: { - option: 'u128'; - }; + "name": "redeemableGlobalSupplyCap", + "type": { + "option": "u128" + } }, { - name: 'depositoriesRoutingWeightBps'; - type: { - option: { - defined: 'EditDepositoriesRoutingWeightBps'; - }; - }; + "name": "depositoriesRoutingWeightBps", + "type": { + "option": { + "defined": "EditDepositoriesRoutingWeightBps" + } + } }, { - name: 'routerDepositories'; - type: { - option: { - defined: 'EditRouterDepositories'; - }; - }; + "name": "routerDepositories", + "type": { + "option": { + "defined": "EditRouterDepositories" + } + } } - ]; - }; + ] + } }, { - name: 'EditIdentityDepositoryFields'; - type: { - kind: 'struct'; - fields: [ + "name": "EditIdentityDepositoryFields", + "type": { + "kind": "struct", + "fields": [ { - name: 'redeemableAmountUnderManagementCap'; - type: { - option: 'u128'; - }; + "name": "redeemableAmountUnderManagementCap", + "type": { + "option": "u128" + } }, { - name: 'mintingDisabled'; - type: { - option: 'bool'; - }; + "name": "mintingDisabled", + "type": { + "option": "bool" + } } - ]; - }; + ] + } }, { - name: 'EditMercurialVaultDepositoryFields'; - type: { - kind: 'struct'; - fields: [ + "name": "EditMercurialVaultDepositoryFields", + "type": { + "kind": "struct", + "fields": [ { - name: 'redeemableAmountUnderManagementCap'; - type: { - option: 'u128'; - }; + "name": "redeemableAmountUnderManagementCap", + "type": { + "option": "u128" + } }, { - name: 'mintingFeeInBps'; - type: { - option: 'u8'; - }; + "name": "mintingFeeInBps", + "type": { + "option": "u8" + } }, { - name: 'redeemingFeeInBps'; - type: { - option: 'u8'; - }; + "name": "redeemingFeeInBps", + "type": { + "option": "u8" + } }, { - name: 'mintingDisabled'; - type: { - option: 'bool'; - }; + "name": "mintingDisabled", + "type": { + "option": "bool" + } }, { - name: 'profitsBeneficiaryCollateral'; - type: { - option: 'publicKey'; - }; + "name": "profitsBeneficiaryCollateral", + "type": { + "option": "publicKey" + } } - ]; - }; + ] + } } - ]; - events: [ + ], + "events": [ { - name: 'InitializeControllerEvent'; - fields: [ + "name": "InitializeControllerEvent", + "fields": [ { - name: 'version'; - type: 'u8'; - index: false; + "name": "version", + "type": "u8", + "index": false }, { - name: 'controller'; - type: 'publicKey'; - index: false; + "name": "controller", + "type": "publicKey", + "index": false }, { - name: 'authority'; - type: 'publicKey'; - index: false; + "name": "authority", + "type": "publicKey", + "index": false } - ]; + ] }, { - name: 'SetRedeemableGlobalSupplyCapEvent'; - fields: [ + "name": "SetRedeemableGlobalSupplyCapEvent", + "fields": [ { - name: 'version'; - type: 'u8'; - index: false; + "name": "version", + "type": "u8", + "index": false }, { - name: 'controller'; - type: 'publicKey'; - index: false; + "name": "controller", + "type": "publicKey", + "index": false }, { - name: 'redeemableGlobalSupplyCap'; - type: 'u128'; - index: false; + "name": "redeemableGlobalSupplyCap", + "type": "u128", + "index": false } - ]; + ] }, { - name: 'SetRouterDepositoriesWeightBps'; - fields: [ + "name": "SetRouterDepositoriesWeightBps", + "fields": [ { - name: 'controllerVersion'; - type: 'u8'; - index: true; + "name": "controllerVersion", + "type": "u8", + "index": true }, { - name: 'controller'; - type: 'publicKey'; - index: true; + "name": "controller", + "type": "publicKey", + "index": true }, { - name: 'identityDepositoryWeightBps'; - type: 'u16'; - index: false; + "name": "identityDepositoryWeightBps", + "type": "u16", + "index": false }, { - name: 'mercurialVaultDepositoryWeightBps'; - type: 'u16'; - index: false; + "name": "mercurialVaultDepositoryWeightBps", + "type": "u16", + "index": false }, { - name: 'credixLpDepositoryWeightBps'; - type: 'u16'; - index: false; + "name": "credixLpDepositoryWeightBps", + "type": "u16", + "index": false } - ]; + ] }, { - name: 'SetRouterDepositories'; - fields: [ + "name": "SetRouterDepositories", + "fields": [ { - name: 'controllerVersion'; - type: 'u8'; - index: true; + "name": "controllerVersion", + "type": "u8", + "index": true }, { - name: 'controller'; - type: 'publicKey'; - index: true; + "name": "controller", + "type": "publicKey", + "index": true }, { - name: 'identityDepository'; - type: 'publicKey'; - index: false; + "name": "identityDepository", + "type": "publicKey", + "index": false }, { - name: 'mercurialVaultDepository'; - type: 'publicKey'; - index: false; + "name": "mercurialVaultDepository", + "type": "publicKey", + "index": false }, { - name: 'credixLpDepository'; - type: 'publicKey'; - index: false; + "name": "credixLpDepository", + "type": "publicKey", + "index": false } - ]; + ] }, { - name: 'RegisterMercurialVaultDepositoryEvent'; - fields: [ + "name": "RegisterMercurialVaultDepositoryEvent", + "fields": [ { - name: 'version'; - type: 'u8'; - index: true; + "name": "version", + "type": "u8", + "index": true }, { - name: 'depositoryVersion'; - type: 'u8'; - index: true; + "name": "depositoryVersion", + "type": "u8", + "index": true }, { - name: 'controller'; - type: 'publicKey'; - index: true; + "name": "controller", + "type": "publicKey", + "index": true }, { - name: 'depository'; - type: 'publicKey'; - index: true; + "name": "depository", + "type": "publicKey", + "index": true }, { - name: 'mercurialVault'; - type: 'publicKey'; - index: false; + "name": "mercurialVault", + "type": "publicKey", + "index": false }, { - name: 'depositoryLpTokenVault'; - type: 'publicKey'; - index: false; + "name": "depositoryLpTokenVault", + "type": "publicKey", + "index": false }, { - name: 'collateralMint'; - type: 'publicKey'; - index: false; + "name": "collateralMint", + "type": "publicKey", + "index": false } - ]; + ] }, { - name: 'SetDepositoryRedeemableAmountUnderManagementCapEvent'; - fields: [ + "name": "SetDepositoryRedeemableAmountUnderManagementCapEvent", + "fields": [ { - name: 'version'; - type: 'u8'; - index: true; + "name": "version", + "type": "u8", + "index": true }, { - name: 'controller'; - type: 'publicKey'; - index: true; + "name": "controller", + "type": "publicKey", + "index": true }, { - name: 'depository'; - type: 'publicKey'; - index: true; + "name": "depository", + "type": "publicKey", + "index": true }, { - name: 'redeemableAmountUnderManagementCap'; - type: 'u128'; - index: true; + "name": "redeemableAmountUnderManagementCap", + "type": "u128", + "index": true } - ]; + ] }, { - name: 'SetDepositoryMintingFeeInBpsEvent'; - fields: [ + "name": "SetDepositoryMintingFeeInBpsEvent", + "fields": [ { - name: 'version'; - type: 'u8'; - index: true; + "name": "version", + "type": "u8", + "index": true }, { - name: 'controller'; - type: 'publicKey'; - index: true; + "name": "controller", + "type": "publicKey", + "index": true }, { - name: 'depository'; - type: 'publicKey'; - index: true; + "name": "depository", + "type": "publicKey", + "index": true }, { - name: 'mintingFeeInBps'; - type: 'u8'; - index: true; + "name": "mintingFeeInBps", + "type": "u8", + "index": true } - ]; + ] }, { - name: 'SetDepositoryRedeemingFeeInBpsEvent'; - fields: [ + "name": "SetDepositoryRedeemingFeeInBpsEvent", + "fields": [ { - name: 'version'; - type: 'u8'; - index: true; + "name": "version", + "type": "u8", + "index": true }, { - name: 'controller'; - type: 'publicKey'; - index: true; + "name": "controller", + "type": "publicKey", + "index": true }, { - name: 'depository'; - type: 'publicKey'; - index: true; + "name": "depository", + "type": "publicKey", + "index": true }, { - name: 'redeemingFeeInBps'; - type: 'u8'; - index: true; + "name": "redeemingFeeInBps", + "type": "u8", + "index": true } - ]; + ] }, { - name: 'SetDepositoryMintingDisabledEvent'; - fields: [ + "name": "SetDepositoryMintingDisabledEvent", + "fields": [ { - name: 'version'; - type: 'u8'; - index: true; + "name": "version", + "type": "u8", + "index": true }, { - name: 'controller'; - type: 'publicKey'; - index: true; + "name": "controller", + "type": "publicKey", + "index": true }, { - name: 'depository'; - type: 'publicKey'; - index: true; + "name": "depository", + "type": "publicKey", + "index": true }, { - name: 'mintingDisabled'; - type: 'bool'; - index: true; + "name": "mintingDisabled", + "type": "bool", + "index": true } - ]; + ] }, { - name: 'SetDepositoryProfitsBeneficiaryCollateralEvent'; - fields: [ + "name": "SetDepositoryProfitsBeneficiaryCollateralEvent", + "fields": [ { - name: 'version'; - type: 'u8'; - index: true; + "name": "version", + "type": "u8", + "index": true }, { - name: 'controller'; - type: 'publicKey'; - index: true; + "name": "controller", + "type": "publicKey", + "index": true }, { - name: 'depository'; - type: 'publicKey'; - index: true; + "name": "depository", + "type": "publicKey", + "index": true }, { - name: 'profitsBeneficiaryCollateral'; - type: 'publicKey'; - index: true; + "name": "profitsBeneficiaryCollateral", + "type": "publicKey", + "index": true } - ]; + ] }, { - name: 'InitializeIdentityDepositoryEvent'; - fields: [ + "name": "InitializeIdentityDepositoryEvent", + "fields": [ { - name: 'version'; - type: 'u8'; - index: false; + "name": "version", + "type": "u8", + "index": false }, { - name: 'depositoryVersion'; - type: 'u8'; - index: true; + "name": "depositoryVersion", + "type": "u8", + "index": true }, { - name: 'controller'; - type: 'publicKey'; - index: true; + "name": "controller", + "type": "publicKey", + "index": true }, { - name: 'depository'; - type: 'publicKey'; - index: true; + "name": "depository", + "type": "publicKey", + "index": true }, { - name: 'collateralMint'; - type: 'publicKey'; - index: false; + "name": "collateralMint", + "type": "publicKey", + "index": false } - ]; + ] }, { - name: 'MintWithIdentityDepositoryEvent'; - fields: [ + "name": "MintWithIdentityDepositoryEvent", + "fields": [ { - name: 'version'; - type: 'u8'; - index: false; + "name": "version", + "type": "u8", + "index": false }, { - name: 'controller'; - type: 'publicKey'; - index: true; + "name": "controller", + "type": "publicKey", + "index": true }, { - name: 'depository'; - type: 'publicKey'; - index: true; + "name": "depository", + "type": "publicKey", + "index": true }, { - name: 'user'; - type: 'publicKey'; - index: false; + "name": "user", + "type": "publicKey", + "index": false }, { - name: 'collateralAmount'; - type: 'u64'; - index: false; + "name": "collateralAmount", + "type": "u64", + "index": false } - ]; + ] }, { - name: 'RedeemFromIdentityDepositoryEvent'; - fields: [ + "name": "RedeemFromIdentityDepositoryEvent", + "fields": [ { - name: 'version'; - type: 'u8'; - index: false; + "name": "version", + "type": "u8", + "index": false }, { - name: 'controller'; - type: 'publicKey'; - index: true; + "name": "controller", + "type": "publicKey", + "index": true }, { - name: 'depository'; - type: 'publicKey'; - index: true; + "name": "depository", + "type": "publicKey", + "index": true }, { - name: 'user'; - type: 'publicKey'; - index: false; + "name": "user", + "type": "publicKey", + "index": false }, { - name: 'redeemableAmount'; - type: 'u64'; - index: false; + "name": "redeemableAmount", + "type": "u64", + "index": false } - ]; + ] }, { - name: 'RegisterCredixLpDepositoryEvent'; - fields: [ + "name": "RegisterCredixLpDepositoryEvent", + "fields": [ { - name: 'controllerVersion'; - type: 'u8'; - index: true; + "name": "controllerVersion", + "type": "u8", + "index": true }, { - name: 'depositoryVersion'; - type: 'u8'; - index: true; + "name": "depositoryVersion", + "type": "u8", + "index": true }, { - name: 'controller'; - type: 'publicKey'; - index: true; + "name": "controller", + "type": "publicKey", + "index": true }, { - name: 'depository'; - type: 'publicKey'; - index: true; + "name": "depository", + "type": "publicKey", + "index": true }, { - name: 'collateralMint'; - type: 'publicKey'; - index: false; + "name": "collateralMint", + "type": "publicKey", + "index": false }, { - name: 'credixGlobalMarketState'; - type: 'publicKey'; - index: false; + "name": "credixGlobalMarketState", + "type": "publicKey", + "index": false } - ]; + ] }, { - name: 'MintWithCredixLpDepositoryEvent'; - fields: [ + "name": "MintWithCredixLpDepositoryEvent", + "fields": [ { - name: 'controllerVersion'; - type: 'u8'; - index: true; + "name": "controllerVersion", + "type": "u8", + "index": true }, { - name: 'depositoryVersion'; - type: 'u8'; - index: true; + "name": "depositoryVersion", + "type": "u8", + "index": true }, { - name: 'controller'; - type: 'publicKey'; - index: true; + "name": "controller", + "type": "publicKey", + "index": true }, { - name: 'depository'; - type: 'publicKey'; - index: true; + "name": "depository", + "type": "publicKey", + "index": true }, { - name: 'user'; - type: 'publicKey'; - index: true; + "name": "user", + "type": "publicKey", + "index": true }, { - name: 'collateralAmount'; - type: 'u64'; - index: false; + "name": "collateralAmount", + "type": "u64", + "index": false }, { - name: 'redeemableAmount'; - type: 'u64'; - index: false; + "name": "redeemableAmount", + "type": "u64", + "index": false }, { - name: 'mintingFeePaid'; - type: 'u64'; - index: false; + "name": "mintingFeePaid", + "type": "u64", + "index": false } - ]; + ] }, { - name: 'RedeemFromCredixLpDepositoryEvent'; - fields: [ + "name": "RedeemFromCredixLpDepositoryEvent", + "fields": [ { - name: 'controllerVersion'; - type: 'u8'; - index: true; + "name": "controllerVersion", + "type": "u8", + "index": true }, { - name: 'depositoryVersion'; - type: 'u8'; - index: true; + "name": "depositoryVersion", + "type": "u8", + "index": true }, { - name: 'controller'; - type: 'publicKey'; - index: true; + "name": "controller", + "type": "publicKey", + "index": true }, { - name: 'depository'; - type: 'publicKey'; - index: true; + "name": "depository", + "type": "publicKey", + "index": true }, { - name: 'user'; - type: 'publicKey'; - index: true; + "name": "user", + "type": "publicKey", + "index": true }, { - name: 'collateralAmount'; - type: 'u64'; - index: false; + "name": "collateralAmount", + "type": "u64", + "index": false }, { - name: 'redeemableAmount'; - type: 'u64'; - index: false; + "name": "redeemableAmount", + "type": "u64", + "index": false }, { - name: 'redeemingFeePaid'; - type: 'u64'; - index: false; + "name": "redeemingFeePaid", + "type": "u64", + "index": false } - ]; + ] }, { - name: 'CollectProfitsOfCredixLpDepositoryEvent'; - fields: [ + "name": "CollectProfitsOfCredixLpDepositoryEvent", + "fields": [ { - name: 'controllerVersion'; - type: 'u8'; - index: true; + "name": "controllerVersion", + "type": "u8", + "index": true }, { - name: 'depositoryVersion'; - type: 'u8'; - index: true; + "name": "depositoryVersion", + "type": "u8", + "index": true }, { - name: 'controller'; - type: 'publicKey'; - index: true; + "name": "controller", + "type": "publicKey", + "index": true }, { - name: 'depository'; - type: 'publicKey'; - index: true; + "name": "depository", + "type": "publicKey", + "index": true }, { - name: 'collateralAmount'; - type: 'u64'; - index: false; + "name": "collateralAmount", + "type": "u64", + "index": false } - ]; + ] }, { - name: 'RebalanceCreateWithdrawRequestFromCredixLpDepositoryEvent'; - fields: [ + "name": "RebalanceCreateWithdrawRequestFromCredixLpDepositoryEvent", + "fields": [ { - name: 'controllerVersion'; - type: 'u8'; - index: true; + "name": "controllerVersion", + "type": "u8", + "index": true }, { - name: 'depositoryVersion'; - type: 'u8'; - index: true; + "name": "depositoryVersion", + "type": "u8", + "index": true }, { - name: 'controller'; - type: 'publicKey'; - index: true; + "name": "controller", + "type": "publicKey", + "index": true }, { - name: 'depository'; - type: 'publicKey'; - index: true; + "name": "depository", + "type": "publicKey", + "index": true }, { - name: 'overflowValue'; - type: 'u64'; - index: false; + "name": "overflowValue", + "type": "u64", + "index": false }, { - name: 'profitsCollateralAmount'; - type: 'u64'; - index: false; + "name": "profitsCollateralAmount", + "type": "u64", + "index": false }, { - name: 'requestedCollateralAmount'; - type: 'u64'; - index: false; + "name": "requestedCollateralAmount", + "type": "u64", + "index": false } - ]; + ] }, { - name: 'RebalanceRedeemWithdrawRequestFromCredixLpDepositoryEvent'; - fields: [ + "name": "RebalanceRedeemWithdrawRequestFromCredixLpDepositoryEvent", + "fields": [ { - name: 'controllerVersion'; - type: 'u8'; - index: true; + "name": "controllerVersion", + "type": "u8", + "index": true }, { - name: 'depositoryVersion'; - type: 'u8'; - index: true; + "name": "depositoryVersion", + "type": "u8", + "index": true }, { - name: 'controller'; - type: 'publicKey'; - index: true; + "name": "controller", + "type": "publicKey", + "index": true }, { - name: 'depository'; - type: 'publicKey'; - index: true; + "name": "depository", + "type": "publicKey", + "index": true }, { - name: 'overflowValue'; - type: 'u64'; - index: false; + "name": "overflowValue", + "type": "u64", + "index": false }, { - name: 'profitsCollateralAmount'; - type: 'u64'; - index: false; + "name": "profitsCollateralAmount", + "type": "u64", + "index": false }, { - name: 'requestedCollateralAmount'; - type: 'u64'; - index: false; + "name": "requestedCollateralAmount", + "type": "u64", + "index": false } - ]; + ] }, { - name: 'CollectProfitsOfMercurialVaultDepositoryEvent'; - fields: [ + "name": "CollectProfitsOfMercurialVaultDepositoryEvent", + "fields": [ { - name: 'controllerVersion'; - type: 'u8'; - index: true; + "name": "controllerVersion", + "type": "u8", + "index": true }, { - name: 'depositoryVersion'; - type: 'u8'; - index: true; + "name": "depositoryVersion", + "type": "u8", + "index": true }, { - name: 'controller'; - type: 'publicKey'; - index: true; + "name": "controller", + "type": "publicKey", + "index": true }, { - name: 'depository'; - type: 'publicKey'; - index: true; + "name": "depository", + "type": "publicKey", + "index": true }, { - name: 'collateralAmount'; - type: 'u64'; - index: false; + "name": "collateralAmount", + "type": "u64", + "index": false } - ]; + ] }, { - name: 'FreezeProgramEvent'; - fields: [ + "name": "FreezeProgramEvent", + "fields": [ { - name: 'version'; - type: 'u8'; - index: false; + "name": "version", + "type": "u8", + "index": false }, { - name: 'controller'; - type: 'publicKey'; - index: false; + "name": "controller", + "type": "publicKey", + "index": false }, { - name: 'isFrozen'; - type: 'bool'; - index: false; + "name": "isFrozen", + "type": "bool", + "index": false } - ]; + ] } - ]; - errors: [ + ], + "errors": [ { - code: 6000; - name: 'InvalidRedeemableMintDecimals'; - msg: 'The redeemable mint decimals must be between 0 and 9 (inclusive).'; + "code": 6000, + "name": "InvalidRedeemableMintDecimals", + "msg": "The redeemable mint decimals must be between 0 and 9 (inclusive)." }, { - code: 6001; - name: 'InvalidRedeemableGlobalSupplyCap'; - msg: 'Redeemable global supply above.'; + "code": 6001, + "name": "InvalidRedeemableGlobalSupplyCap", + "msg": "Redeemable global supply above." }, { - code: 6002; - name: 'InvalidDepositoriesWeightBps'; - msg: 'Depositories weights do not add up to 100%.'; + "code": 6002, + "name": "InvalidDepositoriesWeightBps", + "msg": "Depositories weights do not add up to 100%." }, { - code: 6003; - name: 'InvalidDepositoriesVector'; - msg: 'Depositories vector passed as parameter is not of the expected length'; + "code": 6003, + "name": "InvalidDepositoriesVector", + "msg": "Depositories vector passed as parameter is not of the expected length" }, { - code: 6004; - name: 'InvalidCollateralAmount'; - msg: 'Collateral amount cannot be 0'; + "code": 6004, + "name": "InvalidCollateralAmount", + "msg": "Collateral amount cannot be 0" }, { - code: 6005; - name: 'InvalidRedeemableAmount'; - msg: 'Redeemable amount must be > 0 in order to redeem.'; + "code": 6005, + "name": "InvalidRedeemableAmount", + "msg": "Redeemable amount must be > 0 in order to redeem." }, { - code: 6006; - name: 'InsufficientCollateralAmount'; - msg: 'The balance of the collateral ATA is not enough to fulfill the mint operation.'; + "code": 6006, + "name": "InsufficientCollateralAmount", + "msg": "The balance of the collateral ATA is not enough to fulfill the mint operation." }, { - code: 6007; - name: 'InsufficientRedeemableAmount'; - msg: 'The balance of the redeemable ATA is not enough to fulfill the redeem operation.'; + "code": 6007, + "name": "InsufficientRedeemableAmount", + "msg": "The balance of the redeemable ATA is not enough to fulfill the redeem operation." }, { - code: 6008; - name: 'DepositoriesTargerRedeemableAmountReached'; - msg: 'Minting amount would go past the depositories target redeemable amount.'; + "code": 6008, + "name": "DepositoriesTargerRedeemableAmountReached", + "msg": "Minting amount would go past the depositories target redeemable amount." }, { - code: 6009; - name: 'RedeemableGlobalSupplyCapReached'; - msg: 'Minting amount would go past the Redeemable Global Supply Cap.'; + "code": 6009, + "name": "RedeemableGlobalSupplyCapReached", + "msg": "Minting amount would go past the Redeemable Global Supply Cap." }, { - code: 6010; - name: 'RedeemableMercurialVaultAmountUnderManagementCap'; - msg: 'Minting amount would go past the mercurial vault depository Redeemable Amount Under Management Cap.'; + "code": 6010, + "name": "RedeemableMercurialVaultAmountUnderManagementCap", + "msg": "Minting amount would go past the mercurial vault depository Redeemable Amount Under Management Cap." }, { - code: 6011; - name: 'RedeemableCredixLpAmountUnderManagementCap'; - msg: 'Minting amount would go past the credix lp depository Redeemable Amount Under Management Cap.'; + "code": 6011, + "name": "RedeemableCredixLpAmountUnderManagementCap", + "msg": "Minting amount would go past the credix lp depository Redeemable Amount Under Management Cap." }, { - code: 6012; - name: 'MathError'; - msg: 'Math error.'; + "code": 6012, + "name": "MathError", + "msg": "Math error." }, { - code: 6013; - name: 'SlippageReached'; - msg: "The order couldn't be executed with the provided slippage."; + "code": 6013, + "name": "SlippageReached", + "msg": "The order couldn't be executed with the provided slippage." }, { - code: 6014; - name: 'BumpError'; - msg: 'A bump was expected but is missing.'; + "code": 6014, + "name": "BumpError", + "msg": "A bump was expected but is missing." }, { - code: 6015; - name: 'MintingDisabled'; - msg: 'Minting is disabled for the current depository.'; + "code": 6015, + "name": "MintingDisabled", + "msg": "Minting is disabled for the current depository." }, { - code: 6016; - name: 'CollateralDepositHasRemainingDust'; - msg: 'Collateral deposit left some value unaccounted for.'; + "code": 6016, + "name": "CollateralDepositHasRemainingDust", + "msg": "Collateral deposit left some value unaccounted for." }, { - code: 6017; - name: 'CollateralDepositAmountsDoesntMatch'; - msg: "Collateral deposit didn't result in the correct amounts being moved."; + "code": 6017, + "name": "CollateralDepositAmountsDoesntMatch", + "msg": "Collateral deposit didn't result in the correct amounts being moved." }, { - code: 6018; - name: 'CollateralDepositDoesntMatchTokenValue'; - msg: "Received token of which the value doesn't match the deposited collateral."; + "code": 6018, + "name": "CollateralDepositDoesntMatchTokenValue", + "msg": "Received token of which the value doesn't match the deposited collateral." }, { - code: 6019; - name: 'InvalidMercurialVaultLpMint'; - msg: "The mercurial vault lp mint does not match the Depository's one."; + "code": 6019, + "name": "InvalidMercurialVaultLpMint", + "msg": "The mercurial vault lp mint does not match the Depository's one." }, { - code: 6020; - name: 'MaxNumberOfMercurialVaultDepositoriesRegisteredReached'; - msg: 'Cannot register more mercurial vault depositories, the limit has been reached.'; + "code": 6020, + "name": "MaxNumberOfMercurialVaultDepositoriesRegisteredReached", + "msg": "Cannot register more mercurial vault depositories, the limit has been reached." }, { - code: 6021; - name: 'MaxNumberOfCredixLpDepositoriesRegisteredReached'; - msg: 'Cannot register more credix lp depositories, the limit has been reached.'; + "code": 6021, + "name": "MaxNumberOfCredixLpDepositoriesRegisteredReached", + "msg": "Cannot register more credix lp depositories, the limit has been reached." }, { - code: 6022; - name: 'MercurialVaultDoNotMatchCollateral'; - msg: 'The provided collateral do not match the provided mercurial vault token.'; + "code": 6022, + "name": "MercurialVaultDoNotMatchCollateral", + "msg": "The provided collateral do not match the provided mercurial vault token." }, { - code: 6023; - name: 'CredixLpDoNotMatchCollateral'; - msg: 'The provided collateral do not match the provided credix lp token.'; + "code": 6023, + "name": "CredixLpDoNotMatchCollateral", + "msg": "The provided collateral do not match the provided credix lp token." }, { - code: 6024; - name: 'CollateralMintEqualToRedeemableMint'; - msg: 'Collateral mint should be different than redeemable mint.'; + "code": 6024, + "name": "CollateralMintEqualToRedeemableMint", + "msg": "Collateral mint should be different than redeemable mint." }, { - code: 6025; - name: 'CollateralMintNotAllowed'; - msg: 'Provided collateral mint is not allowed.'; + "code": 6025, + "name": "CollateralMintNotAllowed", + "msg": "Provided collateral mint is not allowed." }, { - code: 6026; - name: 'MinimumMintedRedeemableAmountError'; - msg: 'Mint resulted to 0 redeemable token being minted.'; + "code": 6026, + "name": "MinimumMintedRedeemableAmountError", + "msg": "Mint resulted to 0 redeemable token being minted." }, { - code: 6027; - name: 'MaximumMintedRedeemableAmountError'; - msg: 'Mint resulted into too much redeemable token being minted.'; + "code": 6027, + "name": "MaximumMintedRedeemableAmountError", + "msg": "Mint resulted into too much redeemable token being minted." }, { - code: 6028; - name: 'MinimumRedeemedCollateralAmountError'; - msg: 'Redeem resulted to 0 collateral token being redeemed.'; + "code": 6028, + "name": "MinimumRedeemedCollateralAmountError", + "msg": "Redeem resulted to 0 collateral token being redeemed." }, { - code: 6029; - name: 'MaximumRedeemedCollateralAmountError'; - msg: 'Redeem resulted into too much collateral token being redeemed.'; + "code": 6029, + "name": "MaximumRedeemedCollateralAmountError", + "msg": "Redeem resulted into too much collateral token being redeemed." }, { - code: 6030; - name: 'InvalidDepositoryLpTokenVault'; - msg: "The depository lp token vault does not match the Depository's one."; + "code": 6030, + "name": "InvalidDepositoryLpTokenVault", + "msg": "The depository lp token vault does not match the Depository's one." }, { - code: 6031; - name: 'InvalidAuthority'; - msg: 'Only the Program initializer authority can access this instructions.'; + "code": 6031, + "name": "InvalidAuthority", + "msg": "Only the Program initializer authority can access this instructions." }, { - code: 6032; - name: 'InvalidController'; - msg: "The Depository's controller doesn't match the provided Controller."; + "code": 6032, + "name": "InvalidController", + "msg": "The Depository's controller doesn't match the provided Controller." }, { - code: 6033; - name: 'InvalidDepository'; - msg: 'The Depository provided is not registered with the Controller.'; + "code": 6033, + "name": "InvalidDepository", + "msg": "The Depository provided is not registered with the Controller." }, { - code: 6034; - name: 'InvalidCollateralMint'; - msg: "The provided collateral mint does not match the depository's collateral mint."; + "code": 6034, + "name": "InvalidCollateralMint", + "msg": "The provided collateral mint does not match the depository's collateral mint." }, { - code: 6035; - name: 'InvalidRedeemableMint'; - msg: "The Redeemable Mint provided does not match the Controller's one."; + "code": 6035, + "name": "InvalidRedeemableMint", + "msg": "The Redeemable Mint provided does not match the Controller's one." }, { - code: 6036; - name: 'InvalidOwner'; - msg: 'The provided token account is not owner by the expected party.'; + "code": 6036, + "name": "InvalidOwner", + "msg": "The provided token account is not owner by the expected party." }, { - code: 6037; - name: 'InvalidDepositoryCollateral'; - msg: "The provided depository collateral does not match the depository's one."; + "code": 6037, + "name": "InvalidDepositoryCollateral", + "msg": "The provided depository collateral does not match the depository's one." }, { - code: 6038; - name: 'InvalidDepositoryShares'; - msg: "The provided depository shares does not match the depository's one."; + "code": 6038, + "name": "InvalidDepositoryShares", + "msg": "The provided depository shares does not match the depository's one." }, { - code: 6039; - name: 'InvalidProfitsBeneficiaryCollateral'; - msg: "The Profits beneficiary collateral provided does not match the depository's one."; + "code": 6039, + "name": "InvalidProfitsBeneficiaryCollateral", + "msg": "The Profits beneficiary collateral provided does not match the depository's one." }, { - code: 6040; - name: 'InvalidMercurialVault'; - msg: "The provided mercurial vault does not match the Depository's one."; + "code": 6040, + "name": "InvalidMercurialVault", + "msg": "The provided mercurial vault does not match the Depository's one." }, { - code: 6041; - name: 'InvalidMercurialVaultCollateralTokenSafe'; - msg: 'The provided mercurial vault collateral token safe does not match the mercurial vault one.'; + "code": 6041, + "name": "InvalidMercurialVaultCollateralTokenSafe", + "msg": "The provided mercurial vault collateral token safe does not match the mercurial vault one." }, { - code: 6042; - name: 'RedeemableIdentityDepositoryAmountUnderManagementCap'; - msg: 'Minting amount would go past the identity depository Redeemable Amount Under Management Cap.'; + "code": 6042, + "name": "RedeemableIdentityDepositoryAmountUnderManagementCap", + "msg": "Minting amount would go past the identity depository Redeemable Amount Under Management Cap." }, { - code: 6043; - name: 'ProgramAlreadyFrozenOrResumed'; - msg: 'Program is already frozen/resumed.'; + "code": 6043, + "name": "ProgramAlreadyFrozenOrResumed", + "msg": "Program is already frozen/resumed." }, { - code: 6044; - name: 'ProgramFrozen'; - msg: 'The program is currently in Frozen state.'; + "code": 6044, + "name": "ProgramFrozen", + "msg": "The program is currently in Frozen state." }, { - code: 6045; - name: 'InvalidCredixProgramState'; - msg: "The Credix ProgramState isn't the Depository one."; + "code": 6045, + "name": "InvalidCredixProgramState", + "msg": "The Credix ProgramState isn't the Depository one." }, { - code: 6046; - name: 'InvalidCredixGlobalMarketState'; - msg: "The Credix GlobalMarketState isn't the Depository one."; + "code": 6046, + "name": "InvalidCredixGlobalMarketState", + "msg": "The Credix GlobalMarketState isn't the Depository one." }, { - code: 6047; - name: 'InvalidCredixSigningAuthority'; - msg: "The Credix SigningAuthority isn't the Depository one."; + "code": 6047, + "name": "InvalidCredixSigningAuthority", + "msg": "The Credix SigningAuthority isn't the Depository one." }, { - code: 6048; - name: 'InvalidCredixLiquidityCollateral'; - msg: "The Credix LiquidityCollateral isn't the Depository one."; + "code": 6048, + "name": "InvalidCredixLiquidityCollateral", + "msg": "The Credix LiquidityCollateral isn't the Depository one." }, { - code: 6049; - name: 'InvalidCredixSharesMint'; - msg: "The Credix SharesMint isn't the Depository one."; + "code": 6049, + "name": "InvalidCredixSharesMint", + "msg": "The Credix SharesMint isn't the Depository one." }, { - code: 6050; - name: 'InvalidCredixPass'; - msg: "The Credix Pass isn't the one owned by the correct depository."; + "code": 6050, + "name": "InvalidCredixPass", + "msg": "The Credix Pass isn't the one owned by the correct depository." }, { - code: 6051; - name: 'InvalidCredixPassNoFees'; - msg: "The Credix Pass doesn't have the fees exemption."; + "code": 6051, + "name": "InvalidCredixPassNoFees", + "msg": "The Credix Pass doesn't have the fees exemption." }, { - code: 6052; - name: 'InvalidCredixMultisigKey'; - msg: "The Credix Multisig Key isn't the ProgramState one."; + "code": 6052, + "name": "InvalidCredixMultisigKey", + "msg": "The Credix Multisig Key isn't the ProgramState one." }, { - code: 6053; - name: 'InvalidCredixTreasuryCollateral'; - msg: "The Credix TreasuryCollateral isn't the GlobalMarketState one."; + "code": 6053, + "name": "InvalidCredixTreasuryCollateral", + "msg": "The Credix TreasuryCollateral isn't the GlobalMarketState one." }, { - code: 6054; - name: 'InvalidCredixWithdrawEpochRequestPhase'; - msg: "The Credix WithdrawEpoch isn't in its request phase."; + "code": 6054, + "name": "InvalidCredixWithdrawEpochRequestPhase", + "msg": "The Credix WithdrawEpoch isn't in its request phase." }, { - code: 6055; - name: 'InvalidCredixWithdrawEpochRedeemPhase'; - msg: "The Credix WithdrawEpoch isn't in its redeem phase."; + "code": 6055, + "name": "InvalidCredixWithdrawEpochRedeemPhase", + "msg": "The Credix WithdrawEpoch isn't in its redeem phase." }, { - code: 6056; - name: 'Default'; - msg: 'Default - Check the source code for more info.'; + "code": 6056, + "name": "Default", + "msg": "Default - Check the source code for more info." } - ]; + ] }; export const IDL: Uxd = { - version: '7.3.1', - name: 'uxd', - instructions: [ - { - name: 'initializeController', - docs: [ - 'Initialize a Controller on chain account.', - '', - 'Parameters:', - '- redeemable_mint_decimals: the decimals of the redeemable mint.', - '', - 'Note:', - 'Only one Controller on chain account will ever exist due to the', - 'PDA derivation seed having no variations.', - '', - 'Note:', - 'In the case of UXDProtocol this is the one in charge of the UXD mint,', - 'and it has been locked to a single Controller to ever exist by only', + "version": "7.3.1", + "name": "uxd", + "instructions": [ + { + "name": "initializeController", + "docs": [ + "Initialize a Controller on chain account.", + "", + "Parameters:", + "- redeemable_mint_decimals: the decimals of the redeemable mint.", + "", + "Note:", + "Only one Controller on chain account will ever exist due to the", + "PDA derivation seed having no variations.", + "", + "Note:", + "In the case of UXDProtocol this is the one in charge of the UXD mint,", + "and it has been locked to a single Controller to ever exist by only", "having one possible derivation. (but it's been made generic, and we", - 'could have added the authority to the seed generation for instance).', - '', + "could have added the authority to the seed generation for instance).", + "" ], - accounts: [ - { - name: 'authority', - isMut: false, - isSigner: true, - docs: [ - '#1 Authored call accessible only to the signer matching Controller.authority', - ], - }, - { - name: 'payer', - isMut: true, - isSigner: true, - docs: ['#2'], - }, - { - name: 'controller', - isMut: true, - isSigner: false, - docs: [ - '#3 The top level UXDProgram on chain account managing the redeemable mint', - ], - }, - { - name: 'redeemableMint', - isMut: true, - isSigner: false, - docs: ['#4 The redeemable mint managed by the `controller` instance'], - }, - { - name: 'systemProgram', - isMut: false, - isSigner: false, - docs: ['#5 System Program'], - }, - { - name: 'tokenProgram', - isMut: false, - isSigner: false, - docs: ['#6 Token Program'], - }, - { - name: 'rent', - isMut: false, - isSigner: false, - docs: ['#7 Rent Sysvar'], - }, + "accounts": [ + { + "name": "authority", + "isMut": false, + "isSigner": true, + "docs": [ + "#1 Authored call accessible only to the signer matching Controller.authority" + ] + }, + { + "name": "payer", + "isMut": true, + "isSigner": true, + "docs": [ + "#2" + ] + }, + { + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#3 The top level UXDProgram on chain account managing the redeemable mint" + ] + }, + { + "name": "redeemableMint", + "isMut": true, + "isSigner": false, + "docs": [ + "#4 The redeemable mint managed by the `controller` instance" + ] + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#5 System Program" + ] + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#6 Token Program" + ] + }, + { + "name": "rent", + "isMut": false, + "isSigner": false, + "docs": [ + "#7 Rent Sysvar" + ] + } ], - args: [ + "args": [ { - name: 'redeemableMintDecimals', - type: 'u8', - }, - ], + "name": "redeemableMintDecimals", + "type": "u8" + } + ] }, { - name: 'editController', - accounts: [ + "name": "editController", + "accounts": [ { - name: 'authority', - isMut: false, - isSigner: true, - docs: [ - '#1 Authored call accessible only to the signer matching Controller.authority', - ], + "name": "authority", + "isMut": false, + "isSigner": true, + "docs": [ + "#1 Authored call accessible only to the signer matching Controller.authority" + ] }, { - name: 'controller', - isMut: true, - isSigner: false, - docs: [ - '#2 The top level UXDProgram on chain account managing the redeemable mint', - ], - }, + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#2 The top level UXDProgram on chain account managing the redeemable mint" + ] + } ], - args: [ + "args": [ { - name: 'fields', - type: { - defined: 'EditControllerFields', - }, - }, - ], + "name": "fields", + "type": { + "defined": "EditControllerFields" + } + } + ] }, { - name: 'editMercurialVaultDepository', - accounts: [ + "name": "editMercurialVaultDepository", + "accounts": [ { - name: 'authority', - isMut: false, - isSigner: true, - docs: [ - '#1 Authored call accessible only to the signer matching Controller.authority', - ], + "name": "authority", + "isMut": false, + "isSigner": true, + "docs": [ + "#1 Authored call accessible only to the signer matching Controller.authority" + ] }, { - name: 'controller', - isMut: true, - isSigner: false, - docs: [ - '#2 The top level UXDProgram on chain account managing the redeemable mint', - ], + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#2 The top level UXDProgram on chain account managing the redeemable mint" + ] }, { - name: 'depository', - isMut: true, - isSigner: false, - docs: [ - '#3 UXDProgram on chain account bound to a Controller instance.', - 'The `MercurialVaultDepository` manages a MercurialVaultAccount for a single Collateral.', - ], - }, + "name": "depository", + "isMut": true, + "isSigner": false, + "docs": [ + "#3 UXDProgram on chain account bound to a Controller instance.", + "The `MercurialVaultDepository` manages a MercurialVaultAccount for a single Collateral." + ] + } ], - args: [ + "args": [ { - name: 'fields', - type: { - defined: 'EditMercurialVaultDepositoryFields', - }, - }, - ], + "name": "fields", + "type": { + "defined": "EditMercurialVaultDepositoryFields" + } + } + ] }, { - name: 'editIdentityDepository', - accounts: [ + "name": "editIdentityDepository", + "accounts": [ { - name: 'authority', - isMut: false, - isSigner: true, - docs: [ - '#1 Authored call accessible only to the signer matching Controller.authority', - ], + "name": "authority", + "isMut": false, + "isSigner": true, + "docs": [ + "#1 Authored call accessible only to the signer matching Controller.authority" + ] }, { - name: 'controller', - isMut: true, - isSigner: false, - docs: [ - '#2 The top level UXDProgram on chain account managing the redeemable mint', - ], + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#2 The top level UXDProgram on chain account managing the redeemable mint" + ] }, { - name: 'depository', - isMut: true, - isSigner: false, - docs: [ - '#3 UXDProgram on chain account bound to a Controller instance.', - ], - }, + "name": "depository", + "isMut": true, + "isSigner": false, + "docs": [ + "#3 UXDProgram on chain account bound to a Controller instance." + ] + } ], - args: [ + "args": [ { - name: 'fields', - type: { - defined: 'EditIdentityDepositoryFields', - }, - }, - ], + "name": "fields", + "type": { + "defined": "EditIdentityDepositoryFields" + } + } + ] }, { - name: 'editCredixLpDepository', - accounts: [ + "name": "editCredixLpDepository", + "accounts": [ { - name: 'authority', - isMut: false, - isSigner: true, - docs: [ - '#1 Authored call accessible only to the signer matching Controller.authority', - ], + "name": "authority", + "isMut": false, + "isSigner": true, + "docs": [ + "#1 Authored call accessible only to the signer matching Controller.authority" + ] }, { - name: 'controller', - isMut: true, - isSigner: false, - docs: [ - '#2 The top level UXDProgram on chain account managing the redeemable mint', - ], + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#2 The top level UXDProgram on chain account managing the redeemable mint" + ] }, { - name: 'depository', - isMut: true, - isSigner: false, - docs: ['#3'], - }, + "name": "depository", + "isMut": true, + "isSigner": false, + "docs": [ + "#3" + ] + } ], - args: [ + "args": [ { - name: 'fields', - type: { - defined: 'EditCredixLpDepositoryFields', - }, - }, - ], + "name": "fields", + "type": { + "defined": "EditCredixLpDepositoryFields" + } + } + ] }, { - name: 'mint', - accounts: [ + "name": "mint", + "accounts": [ { - name: 'user', - isMut: false, - isSigner: true, - docs: ['#1'], + "name": "user", + "isMut": false, + "isSigner": true, + "docs": [ + "#1" + ] }, { - name: 'payer', - isMut: true, - isSigner: true, - docs: ['#2'], + "name": "payer", + "isMut": true, + "isSigner": true, + "docs": [ + "#2" + ] }, { - name: 'controller', - isMut: true, - isSigner: false, - docs: ['#3'], + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#3" + ] }, { - name: 'redeemableMint', - isMut: true, - isSigner: false, - docs: ['#4'], + "name": "redeemableMint", + "isMut": true, + "isSigner": false, + "docs": [ + "#4" + ] }, { - name: 'collateralMint', - isMut: false, - isSigner: false, - docs: ['#5'], + "name": "collateralMint", + "isMut": false, + "isSigner": false, + "docs": [ + "#5" + ] }, { - name: 'userRedeemable', - isMut: true, - isSigner: false, - docs: ['#6'], + "name": "userRedeemable", + "isMut": true, + "isSigner": false, + "docs": [ + "#6" + ] }, { - name: 'userCollateral', - isMut: true, - isSigner: false, - docs: ['#7'], + "name": "userCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#7" + ] }, { - name: 'identityDepository', - isMut: true, - isSigner: false, - docs: [ - '#8 - UXDProgram on chain account bound to a Controller instance that represent the blank minting/redeeming', - ], + "name": "identityDepository", + "isMut": true, + "isSigner": false, + "docs": [ + "#8 - UXDProgram on chain account bound to a Controller instance that represent the blank minting/redeeming" + ] }, { - name: 'identityDepositoryCollateralVault', - isMut: true, - isSigner: false, - docs: ['#9 - Token account holding the collateral from minting'], + "name": "identityDepositoryCollateralVault", + "isMut": true, + "isSigner": false, + "docs": [ + "#9 - Token account holding the collateral from minting" + ] }, { - name: 'mercurialVaultDepository', - isMut: true, - isSigner: false, - docs: ['#10'], + "name": "mercurialVaultDepository", + "isMut": true, + "isSigner": false, + "docs": [ + "#10" + ] }, { - name: 'mercurialVaultDepositoryLpTokenVault', - isMut: true, - isSigner: false, - docs: [ - '#11 - Token account holding the LP tokens minted by depositing collateral on mercurial vault', - ], + "name": "mercurialVaultDepositoryLpTokenVault", + "isMut": true, + "isSigner": false, + "docs": [ + "#11 - Token account holding the LP tokens minted by depositing collateral on mercurial vault" + ] }, { - name: 'mercurialVaultDepositoryVault', - isMut: true, - isSigner: false, - docs: ['#12'], + "name": "mercurialVaultDepositoryVault", + "isMut": true, + "isSigner": false, + "docs": [ + "#12" + ] }, { - name: 'mercurialVaultDepositoryVaultLpMint', - isMut: true, - isSigner: false, - docs: ['#13'], + "name": "mercurialVaultDepositoryVaultLpMint", + "isMut": true, + "isSigner": false, + "docs": [ + "#13" + ] }, { - name: 'mercurialVaultDepositoryCollateralTokenSafe', - isMut: true, - isSigner: false, - docs: [ - '#14 - Token account owned by the mercurial vault program. Hold the collateral deposited in the mercurial vault.', - ], + "name": "mercurialVaultDepositoryCollateralTokenSafe", + "isMut": true, + "isSigner": false, + "docs": [ + "#14 - Token account owned by the mercurial vault program. Hold the collateral deposited in the mercurial vault." + ] }, { - name: 'credixLpDepository', - isMut: true, - isSigner: false, - docs: ['#15'], + "name": "credixLpDepository", + "isMut": true, + "isSigner": false, + "docs": [ + "#15" + ] }, { - name: 'credixLpDepositoryCollateral', - isMut: true, - isSigner: false, - docs: ['#16'], + "name": "credixLpDepositoryCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#16" + ] }, { - name: 'credixLpDepositoryShares', - isMut: true, - isSigner: false, - docs: ['#17'], - }, + "name": "credixLpDepositoryShares", + "isMut": true, + "isSigner": false, + "docs": [ + "#17" + ] + }, { - name: 'credixLpDepositoryPass', - isMut: false, - isSigner: false, - docs: ['#18'], - }, + "name": "credixLpDepositoryPass", + "isMut": false, + "isSigner": false, + "docs": [ + "#18" + ] + }, { - name: 'credixLpDepositoryGlobalMarketState', - isMut: false, - isSigner: false, - docs: ['#19'], - }, + "name": "credixLpDepositoryGlobalMarketState", + "isMut": false, + "isSigner": false, + "docs": [ + "#19" + ] + }, { - name: 'credixLpDepositorySigningAuthority', - isMut: false, - isSigner: false, - docs: ['#20 - CHECK: unused by us, checked by credix'], - }, + "name": "credixLpDepositorySigningAuthority", + "isMut": false, + "isSigner": false, + "docs": [ + "#20 - CHECK: unused by us, checked by credix" + ] + }, { - name: 'credixLpDepositoryLiquidityCollateral', - isMut: true, - isSigner: false, - docs: ['#21'], - }, + "name": "credixLpDepositoryLiquidityCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#21" + ] + }, { - name: 'credixLpDepositorySharesMint', - isMut: true, - isSigner: false, - docs: ['#22'], - }, + "name": "credixLpDepositorySharesMint", + "isMut": true, + "isSigner": false, + "docs": [ + "#22" + ] + }, { - name: 'systemProgram', - isMut: false, - isSigner: false, - docs: ['#23'], - }, + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#23" + ] + }, { - name: 'tokenProgram', - isMut: false, - isSigner: false, - docs: ['#24'], - }, + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#24" + ] + }, { - name: 'associatedTokenProgram', - isMut: false, - isSigner: false, - docs: ['#25'], - }, + "name": "associatedTokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#25" + ] + }, { - name: 'mercurialVaultProgram', - isMut: false, - isSigner: false, - docs: ['#26'], - }, + "name": "mercurialVaultProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#26" + ] + }, { - name: 'credixProgram', - isMut: false, - isSigner: false, - docs: ['#27'], - }, + "name": "credixProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#27" + ] + }, { - name: 'uxdProgram', - isMut: false, - isSigner: false, - docs: ['#28'], - }, + "name": "uxdProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#28" + ] + }, { - name: 'rent', - isMut: false, - isSigner: false, - docs: ['#29'], - }, + "name": "rent", + "isMut": false, + "isSigner": false, + "docs": [ + "#29" + ] + } ], - args: [ + "args": [ { - name: 'collateralAmount', - type: 'u64', - }, - ], + "name": "collateralAmount", + "type": "u64" + } + ] }, { - name: 'redeem', - accounts: [ + "name": "redeem", + "accounts": [ { - name: 'user', - isMut: false, - isSigner: true, - docs: ['#1'], + "name": "user", + "isMut": false, + "isSigner": true, + "docs": [ + "#1" + ] }, { - name: 'payer', - isMut: true, - isSigner: true, - docs: ['#2'], + "name": "payer", + "isMut": true, + "isSigner": true, + "docs": [ + "#2" + ] }, { - name: 'controller', - isMut: true, - isSigner: false, - docs: ['#3'], + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#3" + ] }, { - name: 'redeemableMint', - isMut: true, - isSigner: false, - docs: ['#4'], + "name": "redeemableMint", + "isMut": true, + "isSigner": false, + "docs": [ + "#4" + ] }, { - name: 'collateralMint', - isMut: false, - isSigner: false, - docs: ['#5'], + "name": "collateralMint", + "isMut": false, + "isSigner": false, + "docs": [ + "#5" + ] }, { - name: 'userRedeemable', - isMut: true, - isSigner: false, - docs: ['#6'], + "name": "userRedeemable", + "isMut": true, + "isSigner": false, + "docs": [ + "#6" + ] }, { - name: 'userCollateral', - isMut: true, - isSigner: false, - docs: ['#7'], + "name": "userCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#7" + ] }, { - name: 'identityDepository', - isMut: true, - isSigner: false, - docs: [ - '#8 - UXDProgram on chain account bound to a Controller instance that represent the blank minting/redeeming', - ], + "name": "identityDepository", + "isMut": true, + "isSigner": false, + "docs": [ + "#8 - UXDProgram on chain account bound to a Controller instance that represent the blank minting/redeeming" + ] }, { - name: 'identityDepositoryCollateralVault', - isMut: true, - isSigner: false, - docs: ['#9 - Token account holding the collateral from minting'], + "name": "identityDepositoryCollateralVault", + "isMut": true, + "isSigner": false, + "docs": [ + "#9 - Token account holding the collateral from minting" + ] }, { - name: 'mercurialVaultDepository', - isMut: true, - isSigner: false, - docs: ['#10'], + "name": "mercurialVaultDepository", + "isMut": true, + "isSigner": false, + "docs": [ + "#10" + ] }, { - name: 'mercurialVaultDepositoryLpTokenVault', - isMut: true, - isSigner: false, - docs: [ - '#11 - Token account holding the LP tokens minted by depositing collateral on mercurial vault', - ], + "name": "mercurialVaultDepositoryLpTokenVault", + "isMut": true, + "isSigner": false, + "docs": [ + "#11 - Token account holding the LP tokens minted by depositing collateral on mercurial vault" + ] }, { - name: 'mercurialVaultDepositoryVault', - isMut: true, - isSigner: false, - docs: ['#12'], + "name": "mercurialVaultDepositoryVault", + "isMut": true, + "isSigner": false, + "docs": [ + "#12" + ] }, { - name: 'mercurialVaultDepositoryVaultLpMint', - isMut: true, - isSigner: false, - docs: ['#13'], - }, + "name": "mercurialVaultDepositoryVaultLpMint", + "isMut": true, + "isSigner": false, + "docs": [ + "#13" + ] + }, { - name: 'mercurialVaultDepositoryCollateralTokenSafe', - isMut: true, - isSigner: false, - docs: [ - '#14 - Token account owned by the mercurial vault program. Hold the collateral deposited in the mercurial vault.', - ], - }, + "name": "mercurialVaultDepositoryCollateralTokenSafe", + "isMut": true, + "isSigner": false, + "docs": [ + "#14 - Token account owned by the mercurial vault program. Hold the collateral deposited in the mercurial vault." + ] + }, { - name: 'credixLpDepository', - isMut: true, - isSigner: false, - docs: ['#15'], - }, + "name": "credixLpDepository", + "isMut": true, + "isSigner": false, + "docs": [ + "#15" + ] + }, { - name: 'systemProgram', - isMut: false, - isSigner: false, - docs: ['#16'], - }, + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#16" + ] + }, { - name: 'tokenProgram', - isMut: false, - isSigner: false, - docs: ['#17'], - }, + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#17" + ] + }, { - name: 'associatedTokenProgram', - isMut: false, - isSigner: false, - docs: ['#18'], - }, + "name": "associatedTokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#18" + ] + }, { - name: 'mercurialVaultProgram', - isMut: false, - isSigner: false, - docs: ['#19'], - }, + "name": "mercurialVaultProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#19" + ] + }, { - name: 'uxdProgram', - isMut: false, - isSigner: false, - docs: ['#20'], - }, + "name": "uxdProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#20" + ] + }, { - name: 'rent', - isMut: false, - isSigner: false, - docs: ['#21'], - }, + "name": "rent", + "isMut": false, + "isSigner": false, + "docs": [ + "#21" + ] + } ], - args: [ + "args": [ { - name: 'redeemableAmount', - type: 'u64', - }, - ], + "name": "redeemableAmount", + "type": "u64" + } + ] }, { - name: 'mintWithMercurialVaultDepository', - accounts: [ + "name": "mintWithMercurialVaultDepository", + "accounts": [ { - name: 'user', - isMut: false, - isSigner: true, - docs: ['#1'], + "name": "user", + "isMut": false, + "isSigner": true, + "docs": [ + "#1" + ] }, { - name: 'payer', - isMut: true, - isSigner: true, - docs: ['#2'], + "name": "payer", + "isMut": true, + "isSigner": true, + "docs": [ + "#2" + ] }, { - name: 'controller', - isMut: true, - isSigner: false, - docs: ['#3'], + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#3" + ] }, { - name: 'depository', - isMut: true, - isSigner: false, - docs: ['#4'], + "name": "depository", + "isMut": true, + "isSigner": false, + "docs": [ + "#4" + ] }, { - name: 'redeemableMint', - isMut: true, - isSigner: false, - docs: ['#5'], + "name": "redeemableMint", + "isMut": true, + "isSigner": false, + "docs": [ + "#5" + ] }, { - name: 'userRedeemable', - isMut: true, - isSigner: false, - docs: ['#6'], + "name": "userRedeemable", + "isMut": true, + "isSigner": false, + "docs": [ + "#6" + ] }, { - name: 'collateralMint', - isMut: false, - isSigner: false, - docs: ['#7'], + "name": "collateralMint", + "isMut": false, + "isSigner": false, + "docs": [ + "#7" + ] }, { - name: 'userCollateral', - isMut: true, - isSigner: false, - docs: ['#8'], + "name": "userCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#8" + ] }, { - name: 'depositoryLpTokenVault', - isMut: true, - isSigner: false, - docs: [ - '#9', - 'Token account holding the LP tokens minted by depositing collateral on mercurial vault', - ], + "name": "depositoryLpTokenVault", + "isMut": true, + "isSigner": false, + "docs": [ + "#9", + "Token account holding the LP tokens minted by depositing collateral on mercurial vault" + ] }, { - name: 'mercurialVault', - isMut: true, - isSigner: false, - docs: ['#10'], + "name": "mercurialVault", + "isMut": true, + "isSigner": false, + "docs": [ + "#10" + ] }, { - name: 'mercurialVaultLpMint', - isMut: true, - isSigner: false, - docs: ['#11'], + "name": "mercurialVaultLpMint", + "isMut": true, + "isSigner": false, + "docs": [ + "#11" + ] }, { - name: 'mercurialVaultCollateralTokenSafe', - isMut: true, - isSigner: false, - docs: [ - '#12', - 'Token account owned by the mercurial vault program. Hold the collateral deposited in the mercurial vault.', - ], - }, - { - name: 'mercurialVaultProgram', - isMut: false, - isSigner: false, - docs: ['#13'], - }, + "name": "mercurialVaultCollateralTokenSafe", + "isMut": true, + "isSigner": false, + "docs": [ + "#12", + "Token account owned by the mercurial vault program. Hold the collateral deposited in the mercurial vault." + ] + }, + { + "name": "mercurialVaultProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#13" + ] + }, { - name: 'systemProgram', - isMut: false, - isSigner: false, - docs: ['#14'], - }, + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#14" + ] + }, { - name: 'tokenProgram', - isMut: false, - isSigner: false, - docs: ['#15'], - }, + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#15" + ] + } ], - args: [ + "args": [ { - name: 'collateralAmount', - type: 'u64', - }, - ], + "name": "collateralAmount", + "type": "u64" + } + ] }, { - name: 'registerMercurialVaultDepository', - accounts: [ + "name": "registerMercurialVaultDepository", + "accounts": [ { - name: 'authority', - isMut: false, - isSigner: true, - docs: ['#1'], + "name": "authority", + "isMut": false, + "isSigner": true, + "docs": [ + "#1" + ] }, { - name: 'payer', - isMut: true, - isSigner: true, - docs: ['#2'], + "name": "payer", + "isMut": true, + "isSigner": true, + "docs": [ + "#2" + ] }, { - name: 'controller', - isMut: true, - isSigner: false, - docs: ['#3'], + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#3" + ] }, { - name: 'depository', - isMut: true, - isSigner: false, - docs: ['#4'], + "name": "depository", + "isMut": true, + "isSigner": false, + "docs": [ + "#4" + ] }, { - name: 'collateralMint', - isMut: false, - isSigner: false, - docs: ['#5'], + "name": "collateralMint", + "isMut": false, + "isSigner": false, + "docs": [ + "#5" + ] }, { - name: 'mercurialVault', - isMut: false, - isSigner: false, - docs: ['#6'], + "name": "mercurialVault", + "isMut": false, + "isSigner": false, + "docs": [ + "#6" + ] }, { - name: 'mercurialVaultLpMint', - isMut: false, - isSigner: false, - docs: ['#7'], + "name": "mercurialVaultLpMint", + "isMut": false, + "isSigner": false, + "docs": [ + "#7" + ] }, { - name: 'depositoryLpTokenVault', - isMut: true, - isSigner: false, - docs: [ - '#8', - 'Token account holding the LP tokens minted by depositing collateral on mercurial vault', - ], + "name": "depositoryLpTokenVault", + "isMut": true, + "isSigner": false, + "docs": [ + "#8", + "Token account holding the LP tokens minted by depositing collateral on mercurial vault" + ] }, { - name: 'systemProgram', - isMut: false, - isSigner: false, - docs: ['#9'], + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#9" + ] }, { - name: 'tokenProgram', - isMut: false, - isSigner: false, - docs: ['#10'], + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#10" + ] }, { - name: 'rent', - isMut: false, - isSigner: false, - docs: ['#11'], - }, + "name": "rent", + "isMut": false, + "isSigner": false, + "docs": [ + "#11" + ] + } ], - args: [ + "args": [ { - name: 'mintingFeeInBps', - type: 'u8', + "name": "mintingFeeInBps", + "type": "u8" }, { - name: 'redeemingFeeInBps', - type: 'u8', + "name": "redeemingFeeInBps", + "type": "u8" }, { - name: 'redeemableAmountUnderManagementCap', - type: 'u128', - }, - ], + "name": "redeemableAmountUnderManagementCap", + "type": "u128" + } + ] }, { - name: 'redeemFromMercurialVaultDepository', - accounts: [ - { - name: 'user', - isMut: false, - isSigner: true, - docs: ['#1'], - }, + "name": "redeemFromMercurialVaultDepository", + "accounts": [ { - name: 'payer', - isMut: true, - isSigner: true, - docs: ['#2'], + "name": "user", + "isMut": false, + "isSigner": true, + "docs": [ + "#1" + ] }, { - name: 'controller', - isMut: true, - isSigner: false, - docs: ['#3'], + "name": "payer", + "isMut": true, + "isSigner": true, + "docs": [ + "#2" + ] }, { - name: 'depository', - isMut: true, - isSigner: false, - docs: ['#4'], + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#3" + ] }, { - name: 'redeemableMint', - isMut: true, - isSigner: false, - docs: ['#5'], + "name": "depository", + "isMut": true, + "isSigner": false, + "docs": [ + "#4" + ] }, { - name: 'userRedeemable', - isMut: true, - isSigner: false, - docs: ['#6'], + "name": "redeemableMint", + "isMut": true, + "isSigner": false, + "docs": [ + "#5" + ] }, { - name: 'collateralMint', - isMut: false, - isSigner: false, - docs: ['#7'], + "name": "userRedeemable", + "isMut": true, + "isSigner": false, + "docs": [ + "#6" + ] }, { - name: 'userCollateral', - isMut: true, - isSigner: false, - docs: ['#8'], + "name": "collateralMint", + "isMut": false, + "isSigner": false, + "docs": [ + "#7" + ] }, { - name: 'depositoryLpTokenVault', - isMut: true, - isSigner: false, - docs: [ - '#9', - 'Token account holding the LP tokens minted by depositing collateral on mercurial vault', - ], + "name": "userCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#8" + ] }, { - name: 'mercurialVault', - isMut: true, - isSigner: false, - docs: ['#10'], + "name": "depositoryLpTokenVault", + "isMut": true, + "isSigner": false, + "docs": [ + "#9", + "Token account holding the LP tokens minted by depositing collateral on mercurial vault" + ] }, { - name: 'mercurialVaultLpMint', - isMut: true, - isSigner: false, - docs: ['#11'], + "name": "mercurialVault", + "isMut": true, + "isSigner": false, + "docs": [ + "#10" + ] }, { - name: 'mercurialVaultCollateralTokenSafe', - isMut: true, - isSigner: false, - docs: [ - '#12', - 'Token account owned by the mercurial vault program. Hold the collateral deposited in the mercurial vault.', - ], + "name": "mercurialVaultLpMint", + "isMut": true, + "isSigner": false, + "docs": [ + "#11" + ] }, { - name: 'mercurialVaultProgram', - isMut: false, - isSigner: false, - docs: ['#13'], - }, + "name": "mercurialVaultCollateralTokenSafe", + "isMut": true, + "isSigner": false, + "docs": [ + "#12", + "Token account owned by the mercurial vault program. Hold the collateral deposited in the mercurial vault." + ] + }, + { + "name": "mercurialVaultProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#13" + ] + }, { - name: 'systemProgram', - isMut: false, - isSigner: false, - docs: ['#14'], - }, + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#14" + ] + }, { - name: 'tokenProgram', - isMut: false, - isSigner: false, - docs: ['#15'], - }, + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#15" + ] + } ], - args: [ + "args": [ { - name: 'redeemableAmount', - type: 'u64', - }, - ], + "name": "redeemableAmount", + "type": "u64" + } + ] }, { - name: 'collectProfitsOfMercurialVaultDepository', - accounts: [ + "name": "collectProfitsOfMercurialVaultDepository", + "accounts": [ { - name: 'payer', - isMut: true, - isSigner: true, - docs: ['#1'], + "name": "payer", + "isMut": true, + "isSigner": true, + "docs": [ + "#1" + ] }, { - name: 'controller', - isMut: true, - isSigner: false, - docs: ['#2'], + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#2" + ] }, { - name: 'depository', - isMut: true, - isSigner: false, - docs: ['#3'], + "name": "depository", + "isMut": true, + "isSigner": false, + "docs": [ + "#3" + ] }, { - name: 'collateralMint', - isMut: false, - isSigner: false, - docs: ['#4'], + "name": "collateralMint", + "isMut": false, + "isSigner": false, + "docs": [ + "#4" + ] }, { - name: 'profitsBeneficiaryCollateral', - isMut: true, - isSigner: false, - docs: ['#5'], + "name": "profitsBeneficiaryCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#5" + ] }, { - name: 'depositoryLpTokenVault', - isMut: true, - isSigner: false, - docs: [ - '#6', - 'Token account holding the LP tokens minted by depositing collateral on mercurial vault', - ], + "name": "depositoryLpTokenVault", + "isMut": true, + "isSigner": false, + "docs": [ + "#6", + "Token account holding the LP tokens minted by depositing collateral on mercurial vault" + ] }, { - name: 'mercurialVault', - isMut: true, - isSigner: false, - docs: ['#7'], + "name": "mercurialVault", + "isMut": true, + "isSigner": false, + "docs": [ + "#7" + ] }, { - name: 'mercurialVaultLpMint', - isMut: true, - isSigner: false, - docs: ['#8'], + "name": "mercurialVaultLpMint", + "isMut": true, + "isSigner": false, + "docs": [ + "#8" + ] }, { - name: 'mercurialVaultCollateralTokenSafe', - isMut: true, - isSigner: false, - docs: [ - '#9', - 'Token account owned by the mercurial vault program. Hold the collateral deposited in the mercurial vault.', - ], + "name": "mercurialVaultCollateralTokenSafe", + "isMut": true, + "isSigner": false, + "docs": [ + "#9", + "Token account owned by the mercurial vault program. Hold the collateral deposited in the mercurial vault." + ] }, { - name: 'mercurialVaultProgram', - isMut: false, - isSigner: false, - docs: ['#10'], + "name": "mercurialVaultProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#10" + ] }, { - name: 'systemProgram', - isMut: false, - isSigner: false, - docs: ['#11'], + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#11" + ] }, { - name: 'tokenProgram', - isMut: false, - isSigner: false, - docs: ['#12'], - }, + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#12" + ] + } ], - args: [], + "args": [] }, { - name: 'initializeIdentityDepository', - accounts: [ + "name": "initializeIdentityDepository", + "accounts": [ { - name: 'authority', - isMut: false, - isSigner: true, - docs: [ - '#1 Authored call accessible only to the signer matching Controller.authority', - ], + "name": "authority", + "isMut": false, + "isSigner": true, + "docs": [ + "#1 Authored call accessible only to the signer matching Controller.authority" + ] }, { - name: 'payer', - isMut: true, - isSigner: true, - docs: ['#2'], + "name": "payer", + "isMut": true, + "isSigner": true, + "docs": [ + "#2" + ] }, { - name: 'controller', - isMut: true, - isSigner: false, - docs: [ - '#3 The top level UXDProgram on chain account managing the redeemable mint', - ], + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#3 The top level UXDProgram on chain account managing the redeemable mint" + ] }, { - name: 'depository', - isMut: true, - isSigner: false, - docs: [ - '#4 UXDProgram on chain account bound to a Controller instance', - ], + "name": "depository", + "isMut": true, + "isSigner": false, + "docs": [ + "#4 UXDProgram on chain account bound to a Controller instance" + ] }, { - name: 'collateralVault', - isMut: true, - isSigner: false, - docs: ['#5', 'Token account holding the collateral from minting'], + "name": "collateralVault", + "isMut": true, + "isSigner": false, + "docs": [ + "#5", + "Token account holding the collateral from minting" + ] }, { - name: 'collateralMint', - isMut: false, - isSigner: false, - docs: ['#6 The collateral mint used by the `depository` instance'], + "name": "collateralMint", + "isMut": false, + "isSigner": false, + "docs": [ + "#6 The collateral mint used by the `depository` instance" + ] }, { - name: 'systemProgram', - isMut: false, - isSigner: false, - docs: ['#7 System Program'], + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#7 System Program" + ] }, { - name: 'tokenProgram', - isMut: false, - isSigner: false, - docs: ['#8 Token Program'], + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#8 Token Program" + ] }, { - name: 'rent', - isMut: false, - isSigner: false, - docs: ['#9 Rent Sysvar'], - }, + "name": "rent", + "isMut": false, + "isSigner": false, + "docs": [ + "#9 Rent Sysvar" + ] + } ], - args: [], + "args": [] }, { - name: 'mintWithIdentityDepository', - accounts: [ + "name": "mintWithIdentityDepository", + "accounts": [ { - name: 'user', - isMut: false, - isSigner: true, - docs: ['#1 Public call accessible to any user'], + "name": "user", + "isMut": false, + "isSigner": true, + "docs": [ + "#1 Public call accessible to any user" + ] }, { - name: 'payer', - isMut: true, - isSigner: true, - docs: ['#2'], + "name": "payer", + "isMut": true, + "isSigner": true, + "docs": [ + "#2" + ] }, { - name: 'controller', - isMut: true, - isSigner: false, - docs: [ - '#3 The top level UXDProgram on chain account managing the redeemable mint', - ], + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#3 The top level UXDProgram on chain account managing the redeemable mint" + ] }, { - name: 'depository', - isMut: true, - isSigner: false, - docs: [ - '#4 UXDProgram on chain account bound to a Controller instance that represent the blank minting/redeeming', - ], + "name": "depository", + "isMut": true, + "isSigner": false, + "docs": [ + "#4 UXDProgram on chain account bound to a Controller instance that represent the blank minting/redeeming" + ] }, { - name: 'collateralVault', - isMut: true, - isSigner: false, - docs: ['#5', 'Token account holding the collateral from minting'], + "name": "collateralVault", + "isMut": true, + "isSigner": false, + "docs": [ + "#5", + "Token account holding the collateral from minting" + ] }, { - name: 'redeemableMint', - isMut: true, - isSigner: false, - docs: [ - '#6 The redeemable mint managed by the `controller` instance', - 'Tokens will be minted during this instruction', - ], + "name": "redeemableMint", + "isMut": true, + "isSigner": false, + "docs": [ + "#6 The redeemable mint managed by the `controller` instance", + "Tokens will be minted during this instruction" + ] }, { - name: 'userCollateral', - isMut: true, - isSigner: false, - docs: [ + "name": "userCollateral", + "isMut": true, + "isSigner": false, + "docs": [ "#7 The `user`'s TA for the `depository` `collateral_mint`", - 'Will be debited during this instruction', - ], + "Will be debited during this instruction" + ] }, { - name: 'userRedeemable', - isMut: true, - isSigner: false, - docs: [ + "name": "userRedeemable", + "isMut": true, + "isSigner": false, + "docs": [ "#8 The `user`'s TA for the `controller`'s `redeemable_mint`", - 'Will be credited during this instruction', - ], + "Will be credited during this instruction" + ] }, { - name: 'systemProgram', - isMut: false, - isSigner: false, - docs: ['#9'], + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#9" + ] }, { - name: 'tokenProgram', - isMut: false, - isSigner: false, - docs: ['#10 Token Program'], - }, + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#10 Token Program" + ] + } ], - args: [ + "args": [ { - name: 'collateralAmount', - type: 'u64', - }, - ], + "name": "collateralAmount", + "type": "u64" + } + ] }, { - name: 'redeemFromIdentityDepository', - accounts: [ + "name": "redeemFromIdentityDepository", + "accounts": [ { - name: 'user', - isMut: false, - isSigner: true, - docs: ['#1 Public call accessible to any user'], + "name": "user", + "isMut": false, + "isSigner": true, + "docs": [ + "#1 Public call accessible to any user" + ] }, { - name: 'payer', - isMut: true, - isSigner: true, - docs: ['#2'], + "name": "payer", + "isMut": true, + "isSigner": true, + "docs": [ + "#2" + ] }, { - name: 'controller', - isMut: true, - isSigner: false, - docs: [ - '#3 The top level UXDProgram on chain account managing the redeemable mint', - ], + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#3 The top level UXDProgram on chain account managing the redeemable mint" + ] }, { - name: 'depository', - isMut: true, - isSigner: false, - docs: [ - '#4 UXDProgram on chain account bound to a Controller instance that represent the blank minting/redeeming', - ], + "name": "depository", + "isMut": true, + "isSigner": false, + "docs": [ + "#4 UXDProgram on chain account bound to a Controller instance that represent the blank minting/redeeming" + ] }, { - name: 'collateralVault', - isMut: true, - isSigner: false, - docs: ['#5', 'Token account holding the collateral from minting'], + "name": "collateralVault", + "isMut": true, + "isSigner": false, + "docs": [ + "#5", + "Token account holding the collateral from minting" + ] }, { - name: 'redeemableMint', - isMut: true, - isSigner: false, - docs: [ - '#7 The redeemable mint managed by the `controller` instance', - 'Tokens will be burnt during this instruction', - ], + "name": "redeemableMint", + "isMut": true, + "isSigner": false, + "docs": [ + "#7 The redeemable mint managed by the `controller` instance", + "Tokens will be burnt during this instruction" + ] }, { - name: 'userCollateral', - isMut: true, - isSigner: false, - docs: [ + "name": "userCollateral", + "isMut": true, + "isSigner": false, + "docs": [ "#8 The `user`'s ATA for the `depository`'s `collateral_mint`", - 'Will be credited during this instruction', - ], + "Will be credited during this instruction" + ] }, { - name: 'userRedeemable', - isMut: true, - isSigner: false, - docs: [ + "name": "userRedeemable", + "isMut": true, + "isSigner": false, + "docs": [ "#9 The `user`'s ATA for the `controller`'s `redeemable_mint`", - 'Will be debited during this instruction', - ], + "Will be debited during this instruction" + ] }, { - name: 'systemProgram', - isMut: false, - isSigner: false, - docs: ['#10'], + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#10" + ] }, { - name: 'tokenProgram', - isMut: false, - isSigner: false, - docs: ['#11'], - }, + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#11" + ] + } ], - args: [ + "args": [ { - name: 'redeemableAmount', - type: 'u64', - }, - ], + "name": "redeemableAmount", + "type": "u64" + } + ] }, { - name: 'registerCredixLpDepository', - accounts: [ + "name": "registerCredixLpDepository", + "accounts": [ { - name: 'authority', - isMut: false, - isSigner: true, - docs: ['#1'], + "name": "authority", + "isMut": false, + "isSigner": true, + "docs": [ + "#1" + ] }, { - name: 'payer', - isMut: true, - isSigner: true, - docs: ['#2'], + "name": "payer", + "isMut": true, + "isSigner": true, + "docs": [ + "#2" + ] }, { - name: 'controller', - isMut: true, - isSigner: false, - docs: ['#3'], + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#3" + ] }, { - name: 'depository', - isMut: true, - isSigner: false, - docs: ['#4'], + "name": "depository", + "isMut": true, + "isSigner": false, + "docs": [ + "#4" + ] }, { - name: 'collateralMint', - isMut: false, - isSigner: false, - docs: ['#5'], + "name": "collateralMint", + "isMut": false, + "isSigner": false, + "docs": [ + "#5" + ] }, { - name: 'depositoryCollateral', - isMut: true, - isSigner: false, - docs: ['#6'], + "name": "depositoryCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#6" + ] }, { - name: 'depositoryShares', - isMut: true, - isSigner: false, - docs: ['#7'], + "name": "depositoryShares", + "isMut": true, + "isSigner": false, + "docs": [ + "#7" + ] }, { - name: 'credixProgramState', - isMut: false, - isSigner: false, - docs: ['#8'], + "name": "credixProgramState", + "isMut": false, + "isSigner": false, + "docs": [ + "#8" + ] }, { - name: 'credixGlobalMarketState', - isMut: false, - isSigner: false, - docs: ['#9'], + "name": "credixGlobalMarketState", + "isMut": false, + "isSigner": false, + "docs": [ + "#9" + ] }, { - name: 'credixSigningAuthority', - isMut: false, - isSigner: false, - docs: ['#10'], + "name": "credixSigningAuthority", + "isMut": false, + "isSigner": false, + "docs": [ + "#10" + ] }, { - name: 'credixLiquidityCollateral', - isMut: false, - isSigner: false, - docs: ['#11'], + "name": "credixLiquidityCollateral", + "isMut": false, + "isSigner": false, + "docs": [ + "#11" + ] }, { - name: 'credixSharesMint', - isMut: false, - isSigner: false, - docs: ['#12'], + "name": "credixSharesMint", + "isMut": false, + "isSigner": false, + "docs": [ + "#12" + ] }, { - name: 'systemProgram', - isMut: false, - isSigner: false, - docs: ['#13'], - }, + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#13" + ] + }, { - name: 'tokenProgram', - isMut: false, - isSigner: false, - docs: ['#14'], - }, + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#14" + ] + }, { - name: 'associatedTokenProgram', - isMut: false, - isSigner: false, - docs: ['#15'], - }, + "name": "associatedTokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#15" + ] + }, { - name: 'rent', - isMut: false, - isSigner: false, - docs: ['#16'], - }, + "name": "rent", + "isMut": false, + "isSigner": false, + "docs": [ + "#16" + ] + } ], - args: [ + "args": [ { - name: 'mintingFeeInBps', - type: 'u8', + "name": "mintingFeeInBps", + "type": "u8" }, { - name: 'redeemingFeeInBps', - type: 'u8', + "name": "redeemingFeeInBps", + "type": "u8" }, { - name: 'redeemableAmountUnderManagementCap', - type: 'u128', - }, - ], + "name": "redeemableAmountUnderManagementCap", + "type": "u128" + } + ] }, { - name: 'mintWithCredixLpDepository', - accounts: [ + "name": "mintWithCredixLpDepository", + "accounts": [ { - name: 'user', - isMut: false, - isSigner: true, - docs: ['#1'], + "name": "user", + "isMut": false, + "isSigner": true, + "docs": [ + "#1" + ] }, { - name: 'payer', - isMut: true, - isSigner: true, - docs: ['#2'], + "name": "payer", + "isMut": true, + "isSigner": true, + "docs": [ + "#2" + ] }, { - name: 'controller', - isMut: true, - isSigner: false, - docs: ['#3'], + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#3" + ] }, { - name: 'depository', - isMut: true, - isSigner: false, - docs: ['#4'], + "name": "depository", + "isMut": true, + "isSigner": false, + "docs": [ + "#4" + ] }, { - name: 'redeemableMint', - isMut: true, - isSigner: false, - docs: ['#5'], + "name": "redeemableMint", + "isMut": true, + "isSigner": false, + "docs": [ + "#5" + ] }, { - name: 'collateralMint', - isMut: false, - isSigner: false, - docs: ['#6'], + "name": "collateralMint", + "isMut": false, + "isSigner": false, + "docs": [ + "#6" + ] }, { - name: 'userRedeemable', - isMut: true, - isSigner: false, - docs: ['#7'], + "name": "userRedeemable", + "isMut": true, + "isSigner": false, + "docs": [ + "#7" + ] }, { - name: 'userCollateral', - isMut: true, - isSigner: false, - docs: ['#8'], + "name": "userCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#8" + ] }, { - name: 'depositoryCollateral', - isMut: true, - isSigner: false, - docs: ['#9'], + "name": "depositoryCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#9" + ] }, { - name: 'depositoryShares', - isMut: true, - isSigner: false, - docs: ['#10'], + "name": "depositoryShares", + "isMut": true, + "isSigner": false, + "docs": [ + "#10" + ] }, { - name: 'credixGlobalMarketState', - isMut: false, - isSigner: false, - docs: ['#11'], + "name": "credixGlobalMarketState", + "isMut": false, + "isSigner": false, + "docs": [ + "#11" + ] }, { - name: 'credixSigningAuthority', - isMut: false, - isSigner: false, - docs: ['#12'], + "name": "credixSigningAuthority", + "isMut": false, + "isSigner": false, + "docs": [ + "#12" + ] }, { - name: 'credixLiquidityCollateral', - isMut: true, - isSigner: false, - docs: ['#13'], - }, + "name": "credixLiquidityCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#13" + ] + }, { - name: 'credixSharesMint', - isMut: true, - isSigner: false, - docs: ['#14'], - }, + "name": "credixSharesMint", + "isMut": true, + "isSigner": false, + "docs": [ + "#14" + ] + }, { - name: 'credixPass', - isMut: false, - isSigner: false, - docs: ['#15'], - }, + "name": "credixPass", + "isMut": false, + "isSigner": false, + "docs": [ + "#15" + ] + }, { - name: 'systemProgram', - isMut: false, - isSigner: false, - docs: ['#16'], - }, + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#16" + ] + }, { - name: 'tokenProgram', - isMut: false, - isSigner: false, - docs: ['#17'], - }, + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#17" + ] + }, { - name: 'associatedTokenProgram', - isMut: false, - isSigner: false, - docs: ['#18'], - }, + "name": "associatedTokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#18" + ] + }, { - name: 'credixProgram', - isMut: false, - isSigner: false, - docs: ['#19'], - }, + "name": "credixProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#19" + ] + }, { - name: 'rent', - isMut: false, - isSigner: false, - docs: ['#20'], - }, + "name": "rent", + "isMut": false, + "isSigner": false, + "docs": [ + "#20" + ] + } ], - args: [ + "args": [ { - name: 'collateralAmount', - type: 'u64', - }, - ], + "name": "collateralAmount", + "type": "u64" + } + ] }, { - name: 'redeemFromCredixLpDepository', - accounts: [ + "name": "redeemFromCredixLpDepository", + "accounts": [ { - name: 'user', - isMut: false, - isSigner: true, - docs: ['#1'], + "name": "user", + "isMut": false, + "isSigner": true, + "docs": [ + "#1" + ] }, { - name: 'payer', - isMut: true, - isSigner: true, - docs: ['#2'], + "name": "payer", + "isMut": true, + "isSigner": true, + "docs": [ + "#2" + ] }, { - name: 'controller', - isMut: true, - isSigner: false, - docs: ['#3'], + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#3" + ] }, { - name: 'depository', - isMut: true, - isSigner: false, - docs: ['#4'], + "name": "depository", + "isMut": true, + "isSigner": false, + "docs": [ + "#4" + ] }, { - name: 'redeemableMint', - isMut: true, - isSigner: false, - docs: ['#5'], + "name": "redeemableMint", + "isMut": true, + "isSigner": false, + "docs": [ + "#5" + ] }, { - name: 'collateralMint', - isMut: false, - isSigner: false, - docs: ['#6'], + "name": "collateralMint", + "isMut": false, + "isSigner": false, + "docs": [ + "#6" + ] }, { - name: 'userRedeemable', - isMut: true, - isSigner: false, - docs: ['#7'], + "name": "userRedeemable", + "isMut": true, + "isSigner": false, + "docs": [ + "#7" + ] }, { - name: 'userCollateral', - isMut: true, - isSigner: false, - docs: ['#8'], + "name": "userCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#8" + ] }, { - name: 'depositoryCollateral', - isMut: true, - isSigner: false, - docs: ['#9'], + "name": "depositoryCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#9" + ] }, { - name: 'depositoryShares', - isMut: true, - isSigner: false, - docs: ['#10'], + "name": "depositoryShares", + "isMut": true, + "isSigner": false, + "docs": [ + "#10" + ] }, { - name: 'credixProgramState', - isMut: false, - isSigner: false, - docs: ['#11'], + "name": "credixProgramState", + "isMut": false, + "isSigner": false, + "docs": [ + "#11" + ] }, { - name: 'credixGlobalMarketState', - isMut: true, - isSigner: false, - docs: ['#12'], + "name": "credixGlobalMarketState", + "isMut": true, + "isSigner": false, + "docs": [ + "#12" + ] }, { - name: 'credixSigningAuthority', - isMut: false, - isSigner: false, - docs: ['#13'], - }, + "name": "credixSigningAuthority", + "isMut": false, + "isSigner": false, + "docs": [ + "#13" + ] + }, { - name: 'credixLiquidityCollateral', - isMut: true, - isSigner: false, - docs: ['#14'], - }, + "name": "credixLiquidityCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#14" + ] + }, { - name: 'credixSharesMint', - isMut: true, - isSigner: false, - docs: ['#15'], - }, + "name": "credixSharesMint", + "isMut": true, + "isSigner": false, + "docs": [ + "#15" + ] + }, { - name: 'credixPass', - isMut: false, - isSigner: false, - docs: ['#16'], - }, + "name": "credixPass", + "isMut": false, + "isSigner": false, + "docs": [ + "#16" + ] + }, { - name: 'credixTreasuryCollateral', - isMut: true, - isSigner: false, - docs: ['#17'], - }, + "name": "credixTreasuryCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#17" + ] + }, { - name: 'credixMultisigKey', - isMut: false, - isSigner: false, - docs: ['#18'], - }, + "name": "credixMultisigKey", + "isMut": false, + "isSigner": false, + "docs": [ + "#18" + ] + }, { - name: 'credixMultisigCollateral', - isMut: true, - isSigner: false, - docs: ['#19'], - }, + "name": "credixMultisigCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#19" + ] + }, { - name: 'systemProgram', - isMut: false, - isSigner: false, - docs: ['#20'], - }, + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#20" + ] + }, { - name: 'tokenProgram', - isMut: false, - isSigner: false, - docs: ['#21'], - }, + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#21" + ] + }, { - name: 'associatedTokenProgram', - isMut: false, - isSigner: false, - docs: ['#22'], - }, + "name": "associatedTokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#22" + ] + }, { - name: 'credixProgram', - isMut: false, - isSigner: false, - docs: ['#23'], - }, + "name": "credixProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#23" + ] + }, { - name: 'rent', - isMut: false, - isSigner: false, - docs: ['#24'], - }, + "name": "rent", + "isMut": false, + "isSigner": false, + "docs": [ + "#24" + ] + } ], - args: [ + "args": [ { - name: 'redeemableAmount', - type: 'u64', - }, - ], + "name": "redeemableAmount", + "type": "u64" + } + ] }, { - name: 'collectProfitsOfCredixLpDepository', - accounts: [ + "name": "collectProfitsOfCredixLpDepository", + "accounts": [ { - name: 'payer', - isMut: true, - isSigner: true, - docs: ['#1'], + "name": "payer", + "isMut": true, + "isSigner": true, + "docs": [ + "#1" + ] }, { - name: 'controller', - isMut: true, - isSigner: false, - docs: ['#2'], + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#2" + ] }, { - name: 'depository', - isMut: true, - isSigner: false, - docs: ['#3'], + "name": "depository", + "isMut": true, + "isSigner": false, + "docs": [ + "#3" + ] }, { - name: 'collateralMint', - isMut: false, - isSigner: false, - docs: ['#4'], + "name": "collateralMint", + "isMut": false, + "isSigner": false, + "docs": [ + "#4" + ] }, { - name: 'depositoryCollateral', - isMut: true, - isSigner: false, - docs: ['#5'], + "name": "depositoryCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#5" + ] }, { - name: 'depositoryShares', - isMut: true, - isSigner: false, - docs: ['#6'], + "name": "depositoryShares", + "isMut": true, + "isSigner": false, + "docs": [ + "#6" + ] }, { - name: 'credixProgramState', - isMut: false, - isSigner: false, - docs: ['#7'], + "name": "credixProgramState", + "isMut": false, + "isSigner": false, + "docs": [ + "#7" + ] }, { - name: 'credixGlobalMarketState', - isMut: true, - isSigner: false, - docs: ['#8'], + "name": "credixGlobalMarketState", + "isMut": true, + "isSigner": false, + "docs": [ + "#8" + ] }, { - name: 'credixSigningAuthority', - isMut: false, - isSigner: false, - docs: ['#9'], + "name": "credixSigningAuthority", + "isMut": false, + "isSigner": false, + "docs": [ + "#9" + ] }, { - name: 'credixLiquidityCollateral', - isMut: true, - isSigner: false, - docs: ['#10'], + "name": "credixLiquidityCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#10" + ] }, { - name: 'credixSharesMint', - isMut: true, - isSigner: false, - docs: ['#11'], + "name": "credixSharesMint", + "isMut": true, + "isSigner": false, + "docs": [ + "#11" + ] }, { - name: 'credixPass', - isMut: true, - isSigner: false, - docs: ['#12'], + "name": "credixPass", + "isMut": true, + "isSigner": false, + "docs": [ + "#12" + ] }, { - name: 'credixTreasuryCollateral', - isMut: true, - isSigner: false, - docs: ['#13'], - }, + "name": "credixTreasuryCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#13" + ] + }, { - name: 'credixMultisigKey', - isMut: false, - isSigner: false, - docs: ['#14'], - }, + "name": "credixMultisigKey", + "isMut": false, + "isSigner": false, + "docs": [ + "#14" + ] + }, { - name: 'credixMultisigCollateral', - isMut: true, - isSigner: false, - docs: ['#15'], - }, + "name": "credixMultisigCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#15" + ] + }, { - name: 'profitsBeneficiaryCollateral', - isMut: true, - isSigner: false, - docs: ['#16'], - }, + "name": "profitsBeneficiaryCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#16" + ] + }, { - name: 'systemProgram', - isMut: false, - isSigner: false, - docs: ['#17'], - }, + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#17" + ] + }, { - name: 'tokenProgram', - isMut: false, - isSigner: false, - docs: ['#18'], - }, + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#18" + ] + }, { - name: 'associatedTokenProgram', - isMut: false, - isSigner: false, - docs: ['#19'], - }, + "name": "associatedTokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#19" + ] + }, { - name: 'credixProgram', - isMut: false, - isSigner: false, - docs: ['#20'], - }, + "name": "credixProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#20" + ] + }, { - name: 'rent', - isMut: false, - isSigner: false, - docs: ['#21'], - }, + "name": "rent", + "isMut": false, + "isSigner": false, + "docs": [ + "#21" + ] + } ], - args: [], + "args": [] }, { - name: 'rebalanceCreateWithdrawRequestFromCredixLpDepository', - accounts: [ + "name": "rebalanceCreateWithdrawRequestFromCredixLpDepository", + "accounts": [ { - name: 'payer', - isMut: true, - isSigner: true, - docs: [ - '#1', - 'Permissionless IX that can be called by anyone at any time', - ], + "name": "payer", + "isMut": true, + "isSigner": true, + "docs": [ + "#1", + "Permissionless IX that can be called by anyone at any time" + ] }, { - name: 'controller', - isMut: true, - isSigner: false, - docs: ['#2'], + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#2" + ] }, { - name: 'identityDepository', - isMut: true, - isSigner: false, - docs: ['#3'], + "name": "identityDepository", + "isMut": true, + "isSigner": false, + "docs": [ + "#3" + ] }, { - name: 'mercurialVaultDepository', - isMut: true, - isSigner: false, - docs: ['#4'], + "name": "mercurialVaultDepository", + "isMut": true, + "isSigner": false, + "docs": [ + "#4" + ] }, { - name: 'depository', - isMut: true, - isSigner: false, - docs: ['#5'], + "name": "depository", + "isMut": true, + "isSigner": false, + "docs": [ + "#5" + ] }, { - name: 'collateralMint', - isMut: false, - isSigner: false, - docs: ['#6'], + "name": "collateralMint", + "isMut": false, + "isSigner": false, + "docs": [ + "#6" + ] }, { - name: 'depositoryShares', - isMut: true, - isSigner: false, - docs: ['#7'], + "name": "depositoryShares", + "isMut": true, + "isSigner": false, + "docs": [ + "#7" + ] }, { - name: 'credixGlobalMarketState', - isMut: false, - isSigner: false, - docs: ['#8'], + "name": "credixGlobalMarketState", + "isMut": false, + "isSigner": false, + "docs": [ + "#8" + ] }, { - name: 'credixSigningAuthority', - isMut: false, - isSigner: false, - docs: ['#9'], + "name": "credixSigningAuthority", + "isMut": false, + "isSigner": false, + "docs": [ + "#9" + ] }, { - name: 'credixLiquidityCollateral', - isMut: true, - isSigner: false, - docs: ['#10'], + "name": "credixLiquidityCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#10" + ] }, { - name: 'credixSharesMint', - isMut: true, - isSigner: false, - docs: ['#11'], + "name": "credixSharesMint", + "isMut": true, + "isSigner": false, + "docs": [ + "#11" + ] }, { - name: 'credixPass', - isMut: false, - isSigner: false, - docs: ['#12'], + "name": "credixPass", + "isMut": false, + "isSigner": false, + "docs": [ + "#12" + ] }, { - name: 'credixWithdrawEpoch', - isMut: true, - isSigner: false, - docs: ['#13'], - }, + "name": "credixWithdrawEpoch", + "isMut": true, + "isSigner": false, + "docs": [ + "#13" + ] + }, { - name: 'credixWithdrawRequest', - isMut: true, - isSigner: false, - docs: ['#14'], - }, + "name": "credixWithdrawRequest", + "isMut": true, + "isSigner": false, + "docs": [ + "#14" + ] + }, { - name: 'systemProgram', - isMut: false, - isSigner: false, - docs: ['#15'], - }, + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#15" + ] + }, { - name: 'credixProgram', - isMut: false, - isSigner: false, - docs: ['#16'], - }, + "name": "credixProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#16" + ] + } ], - args: [], + "args": [] }, { - name: 'rebalanceRedeemWithdrawRequestFromCredixLpDepository', - accounts: [ + "name": "rebalanceRedeemWithdrawRequestFromCredixLpDepository", + "accounts": [ { - name: 'payer', - isMut: true, - isSigner: true, - docs: [ - '#1 // Permissionless IX that can be called by anyone at any time', - ], + "name": "payer", + "isMut": true, + "isSigner": true, + "docs": [ + "#1 // Permissionless IX that can be called by anyone at any time" + ] }, { - name: 'controller', - isMut: true, - isSigner: false, - docs: ['#2'], + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#2" + ] }, { - name: 'identityDepository', - isMut: true, - isSigner: false, - docs: ['#3'], + "name": "identityDepository", + "isMut": true, + "isSigner": false, + "docs": [ + "#3" + ] }, { - name: 'identityDepositoryCollateral', - isMut: true, - isSigner: false, - docs: ['#4'], + "name": "identityDepositoryCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#4" + ] }, { - name: 'mercurialVaultDepository', - isMut: true, - isSigner: false, - docs: ['#5'], + "name": "mercurialVaultDepository", + "isMut": true, + "isSigner": false, + "docs": [ + "#5" + ] }, { - name: 'depository', - isMut: true, - isSigner: false, - docs: ['#6'], + "name": "depository", + "isMut": true, + "isSigner": false, + "docs": [ + "#6" + ] }, { - name: 'collateralMint', - isMut: false, - isSigner: false, - docs: ['#7'], + "name": "collateralMint", + "isMut": false, + "isSigner": false, + "docs": [ + "#7" + ] }, { - name: 'depositoryCollateral', - isMut: true, - isSigner: false, - docs: ['#8'], + "name": "depositoryCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#8" + ] }, { - name: 'depositoryShares', - isMut: true, - isSigner: false, - docs: ['#9'], + "name": "depositoryShares", + "isMut": true, + "isSigner": false, + "docs": [ + "#9" + ] }, { - name: 'credixProgramState', - isMut: false, - isSigner: false, - docs: ['#10'], + "name": "credixProgramState", + "isMut": false, + "isSigner": false, + "docs": [ + "#10" + ] }, { - name: 'credixGlobalMarketState', - isMut: true, - isSigner: false, - docs: ['#11'], + "name": "credixGlobalMarketState", + "isMut": true, + "isSigner": false, + "docs": [ + "#11" + ] }, { - name: 'credixSigningAuthority', - isMut: false, - isSigner: false, - docs: ['#12'], + "name": "credixSigningAuthority", + "isMut": false, + "isSigner": false, + "docs": [ + "#12" + ] }, { - name: 'credixLiquidityCollateral', - isMut: true, - isSigner: false, - docs: ['#13'], + "name": "credixLiquidityCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#13" + ] }, { - name: 'credixSharesMint', - isMut: true, - isSigner: false, - docs: ['#14'], - }, + "name": "credixSharesMint", + "isMut": true, + "isSigner": false, + "docs": [ + "#14" + ] + }, { - name: 'credixPass', - isMut: true, - isSigner: false, - docs: ['#15'], - }, + "name": "credixPass", + "isMut": true, + "isSigner": false, + "docs": [ + "#15" + ] + }, { - name: 'credixTreasuryCollateral', - isMut: true, - isSigner: false, - docs: ['#16'], - }, + "name": "credixTreasuryCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#16" + ] + }, { - name: 'credixMultisigKey', - isMut: false, - isSigner: false, - docs: ['#17'], - }, + "name": "credixMultisigKey", + "isMut": false, + "isSigner": false, + "docs": [ + "#17" + ] + }, { - name: 'credixMultisigCollateral', - isMut: true, - isSigner: false, - docs: ['#18'], - }, + "name": "credixMultisigCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#18" + ] + }, { - name: 'credixWithdrawEpoch', - isMut: true, - isSigner: false, - docs: ['#19'], - }, + "name": "credixWithdrawEpoch", + "isMut": true, + "isSigner": false, + "docs": [ + "#19" + ] + }, { - name: 'credixWithdrawRequest', - isMut: true, - isSigner: false, - docs: ['#20'], - }, + "name": "credixWithdrawRequest", + "isMut": true, + "isSigner": false, + "docs": [ + "#20" + ] + }, { - name: 'profitsBeneficiaryCollateral', - isMut: true, - isSigner: false, - docs: ['#21'], - }, + "name": "profitsBeneficiaryCollateral", + "isMut": true, + "isSigner": false, + "docs": [ + "#21" + ] + }, { - name: 'systemProgram', - isMut: false, - isSigner: false, - docs: ['#22'], - }, + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#22" + ] + }, { - name: 'tokenProgram', - isMut: false, - isSigner: false, - docs: ['#23'], - }, + "name": "tokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#23" + ] + }, { - name: 'associatedTokenProgram', - isMut: false, - isSigner: false, - docs: ['#24'], - }, + "name": "associatedTokenProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#24" + ] + }, { - name: 'credixProgram', - isMut: false, - isSigner: false, - docs: ['#25'], - }, + "name": "credixProgram", + "isMut": false, + "isSigner": false, + "docs": [ + "#25" + ] + }, { - name: 'rent', - isMut: false, - isSigner: false, - docs: ['#26'], - }, + "name": "rent", + "isMut": false, + "isSigner": false, + "docs": [ + "#26" + ] + } ], - args: [], - }, - { - name: 'freezeProgram', - docs: [ - 'Freeze or resume all ixs associated with the controller (except this one).', - '', - 'Parameters:', - '- freeze: bool param to flip the `is_frozen` property in the controller', - '', - 'Note:', - 'This is a wildcard to stop the program temporarily when a vulnerability has been detected to allow the team to do servicing work.', - '', + "args": [] + }, + { + "name": "freezeProgram", + "docs": [ + "Freeze or resume all ixs associated with the controller (except this one).", + "", + "Parameters:", + "- freeze: bool param to flip the `is_frozen` property in the controller", + "", + "Note:", + "This is a wildcard to stop the program temporarily when a vulnerability has been detected to allow the team to do servicing work.", + "" ], - accounts: [ - { - name: 'authority', - isMut: false, - isSigner: true, - docs: [ - '#1 Authored call accessible only to the signer matching Controller.authority', - ], - }, - { - name: 'controller', - isMut: true, - isSigner: false, - docs: [ - '#2 The top level UXDProgram on chain account managing the redeemable mint', - ], - }, + "accounts": [ + { + "name": "authority", + "isMut": false, + "isSigner": true, + "docs": [ + "#1 Authored call accessible only to the signer matching Controller.authority" + ] + }, + { + "name": "controller", + "isMut": true, + "isSigner": false, + "docs": [ + "#2 The top level UXDProgram on chain account managing the redeemable mint" + ] + } ], - args: [ + "args": [ { - name: 'freeze', - type: 'bool', - }, - ], - }, + "name": "freeze", + "type": "bool" + } + ] + } ], - accounts: [ + "accounts": [ { - name: 'controller', - type: { - kind: 'struct', - fields: [ + "name": "controller", + "type": { + "kind": "struct", + "fields": [ { - name: 'bump', - type: 'u8', + "name": "bump", + "type": "u8" }, { - name: 'redeemableMintBump', - type: 'u8', + "name": "redeemableMintBump", + "type": "u8" }, { - name: 'version', - type: 'u8', + "name": "version", + "type": "u8" }, { - name: 'authority', - type: 'publicKey', + "name": "authority", + "type": "publicKey" }, { - name: 'redeemableMint', - type: 'publicKey', + "name": "redeemableMint", + "type": "publicKey" }, { - name: 'redeemableMintDecimals', - type: 'u8', + "name": "redeemableMintDecimals", + "type": "u8" }, { - name: 'unused', - type: { - array: ['u8', 255], - }, + "name": "unused", + "type": { + "array": [ + "u8", + 255 + ] + } }, { - name: 'isFrozen', - type: 'bool', + "name": "isFrozen", + "type": "bool" }, { - name: 'unused2', - type: 'u8', + "name": "unused2", + "type": "u8" }, { - name: 'redeemableGlobalSupplyCap', - type: 'u128', + "name": "redeemableGlobalSupplyCap", + "type": "u128" }, { - name: 'unused3', - type: { - array: ['u8', 8], - }, + "name": "unused3", + "type": { + "array": [ + "u8", + 8 + ] + } }, { - name: 'redeemableCirculatingSupply', - type: 'u128', + "name": "redeemableCirculatingSupply", + "type": "u128" }, { - name: 'unused4', - type: { - array: ['u8', 8], - }, + "name": "unused4", + "type": { + "array": [ + "u8", + 8 + ] + } }, { - name: 'registeredMercurialVaultDepositories', - type: { - array: ['publicKey', 4], - }, + "name": "registeredMercurialVaultDepositories", + "type": { + "array": [ + "publicKey", + 4 + ] + } }, { - name: 'registeredMercurialVaultDepositoriesCount', - type: 'u8', + "name": "registeredMercurialVaultDepositoriesCount", + "type": "u8" }, { - name: 'registeredCredixLpDepositories', - type: { - array: ['publicKey', 4], - }, + "name": "registeredCredixLpDepositories", + "type": { + "array": [ + "publicKey", + 4 + ] + } }, { - name: 'registeredCredixLpDepositoriesCount', - type: 'u8', + "name": "registeredCredixLpDepositoriesCount", + "type": "u8" }, { - name: 'profitsTotalCollected', - type: 'u128', + "name": "profitsTotalCollected", + "type": "u128" }, { - name: 'identityDepositoryWeightBps', - type: 'u16', + "name": "identityDepositoryWeightBps", + "type": "u16" }, { - name: 'mercurialVaultDepositoryWeightBps', - type: 'u16', + "name": "mercurialVaultDepositoryWeightBps", + "type": "u16" }, { - name: 'credixLpDepositoryWeightBps', - type: 'u16', + "name": "credixLpDepositoryWeightBps", + "type": "u16" }, { - name: 'identityDepository', - type: 'publicKey', + "name": "identityDepository", + "type": "publicKey" }, { - name: 'mercurialVaultDepository', - type: 'publicKey', + "name": "mercurialVaultDepository", + "type": "publicKey" }, { - name: 'credixLpDepository', - type: 'publicKey', + "name": "credixLpDepository", + "type": "publicKey" }, { - name: 'reserved', - type: { - array: ['u8', 128], - }, - }, - ], - }, + "name": "reserved", + "type": { + "array": [ + "u8", + 128 + ] + } + } + ] + } }, { - name: 'credixLpDepository', - type: { - kind: 'struct', - fields: [ + "name": "credixLpDepository", + "type": { + "kind": "struct", + "fields": [ { - name: 'bump', - type: 'u8', + "name": "bump", + "type": "u8" }, { - name: 'version', - type: 'u8', + "name": "version", + "type": "u8" }, { - name: 'controller', - type: 'publicKey', + "name": "controller", + "type": "publicKey" }, { - name: 'collateralMint', - type: 'publicKey', + "name": "collateralMint", + "type": "publicKey" }, { - name: 'depositoryCollateral', - type: 'publicKey', + "name": "depositoryCollateral", + "type": "publicKey" }, { - name: 'depositoryShares', - type: 'publicKey', + "name": "depositoryShares", + "type": "publicKey" }, { - name: 'credixProgramState', - type: 'publicKey', + "name": "credixProgramState", + "type": "publicKey" }, { - name: 'credixGlobalMarketState', - type: 'publicKey', + "name": "credixGlobalMarketState", + "type": "publicKey" }, { - name: 'credixSigningAuthority', - type: 'publicKey', + "name": "credixSigningAuthority", + "type": "publicKey" }, { - name: 'credixLiquidityCollateral', - type: 'publicKey', + "name": "credixLiquidityCollateral", + "type": "publicKey" }, { - name: 'credixSharesMint', - type: 'publicKey', + "name": "credixSharesMint", + "type": "publicKey" }, { - name: 'redeemableAmountUnderManagementCap', - type: 'u128', + "name": "redeemableAmountUnderManagementCap", + "type": "u128" }, { - name: 'mintingFeeInBps', - type: 'u8', + "name": "mintingFeeInBps", + "type": "u8" }, { - name: 'redeemingFeeInBps', - type: 'u8', + "name": "redeemingFeeInBps", + "type": "u8" }, { - name: 'mintingDisabled', - type: 'bool', + "name": "mintingDisabled", + "type": "bool" }, { - name: 'collateralAmountDeposited', - type: 'u128', + "name": "collateralAmountDeposited", + "type": "u128" }, { - name: 'redeemableAmountUnderManagement', - type: 'u128', + "name": "redeemableAmountUnderManagement", + "type": "u128" }, { - name: 'mintingFeeTotalAccrued', - type: 'u128', + "name": "mintingFeeTotalAccrued", + "type": "u128" }, { - name: 'redeemingFeeTotalAccrued', - type: 'u128', + "name": "redeemingFeeTotalAccrued", + "type": "u128" }, { - name: 'profitsTotalCollected', - type: 'u128', + "name": "profitsTotalCollected", + "type": "u128" }, { - name: 'profitsBeneficiaryCollateral', - type: 'publicKey', + "name": "profitsBeneficiaryCollateral", + "type": "publicKey" }, { - name: 'reserved', - type: { - array: ['u8', 768], - }, - }, - ], - }, + "name": "reserved", + "type": { + "array": [ + "u8", + 768 + ] + } + } + ] + } }, { - name: 'identityDepository', - type: { - kind: 'struct', - fields: [ + "name": "identityDepository", + "type": { + "kind": "struct", + "fields": [ { - name: 'bump', - type: 'u8', + "name": "bump", + "type": "u8" }, { - name: 'version', - type: 'u8', + "name": "version", + "type": "u8" }, { - name: 'collateralMint', - type: 'publicKey', + "name": "collateralMint", + "type": "publicKey" }, { - name: 'collateralMintDecimals', - type: 'u8', + "name": "collateralMintDecimals", + "type": "u8" }, { - name: 'collateralVault', - type: 'publicKey', + "name": "collateralVault", + "type": "publicKey" }, { - name: 'collateralVaultBump', - type: 'u8', + "name": "collateralVaultBump", + "type": "u8" }, { - name: 'collateralAmountDeposited', - type: 'u128', + "name": "collateralAmountDeposited", + "type": "u128" }, { - name: 'redeemableAmountUnderManagement', - type: 'u128', + "name": "redeemableAmountUnderManagement", + "type": "u128" }, { - name: 'redeemableAmountUnderManagementCap', - type: 'u128', + "name": "redeemableAmountUnderManagementCap", + "type": "u128" }, { - name: 'mintingDisabled', - type: 'bool', + "name": "mintingDisabled", + "type": "bool" }, { - name: 'mangoCollateralReinjectedWsol', - type: 'bool', + "name": "mangoCollateralReinjectedWsol", + "type": "bool" }, { - name: 'mangoCollateralReinjectedBtc', - type: 'bool', + "name": "mangoCollateralReinjectedBtc", + "type": "bool" }, { - name: 'mangoCollateralReinjectedEth', - type: 'bool', + "name": "mangoCollateralReinjectedEth", + "type": "bool" }, { - name: 'reserved', - type: { - array: ['u8', 512], - }, - }, - ], - }, + "name": "reserved", + "type": { + "array": [ + "u8", + 512 + ] + } + } + ] + } }, { - name: 'mercurialVaultDepository', - type: { - kind: 'struct', - fields: [ + "name": "mercurialVaultDepository", + "type": { + "kind": "struct", + "fields": [ { - name: 'bump', - type: 'u8', + "name": "bump", + "type": "u8" }, { - name: 'version', - type: 'u8', + "name": "version", + "type": "u8" }, { - name: 'collateralMint', - type: 'publicKey', + "name": "collateralMint", + "type": "publicKey" }, { - name: 'collateralMintDecimals', - type: 'u8', + "name": "collateralMintDecimals", + "type": "u8" }, { - name: 'controller', - type: 'publicKey', + "name": "controller", + "type": "publicKey" }, { - name: 'collateralAmountDeposited', - type: 'u128', + "name": "collateralAmountDeposited", + "type": "u128" }, { - name: 'redeemableAmountUnderManagement', - type: 'u128', + "name": "redeemableAmountUnderManagement", + "type": "u128" }, { - name: 'mercurialVault', - type: 'publicKey', + "name": "mercurialVault", + "type": "publicKey" }, { - name: 'mercurialVaultLpMint', - type: 'publicKey', + "name": "mercurialVaultLpMint", + "type": "publicKey" }, { - name: 'mercurialVaultLpMintDecimals', - type: 'u8', + "name": "mercurialVaultLpMintDecimals", + "type": "u8" }, { - name: 'lpTokenVault', - type: 'publicKey', + "name": "lpTokenVault", + "type": "publicKey" }, { - name: 'lpTokenVaultBump', - type: 'u8', + "name": "lpTokenVaultBump", + "type": "u8" }, { - name: 'mintingFeeInBps', - type: 'u8', + "name": "mintingFeeInBps", + "type": "u8" }, { - name: 'redeemingFeeInBps', - type: 'u8', + "name": "redeemingFeeInBps", + "type": "u8" }, { - name: 'mintingFeeTotalAccrued', - type: 'u128', + "name": "mintingFeeTotalAccrued", + "type": "u128" }, { - name: 'redeemingFeeTotalAccrued', - type: 'u128', + "name": "redeemingFeeTotalAccrued", + "type": "u128" }, { - name: 'redeemableAmountUnderManagementCap', - type: 'u128', + "name": "redeemableAmountUnderManagementCap", + "type": "u128" }, { - name: 'mintingDisabled', - type: 'bool', + "name": "mintingDisabled", + "type": "bool" }, { - name: 'profitsTotalCollected', - type: 'u128', + "name": "profitsTotalCollected", + "type": "u128" }, { - name: 'lastProfitsCollectionUnixTimestamp', - type: 'u64', + "name": "lastProfitsCollectionUnixTimestamp", + "type": "u64" }, { - name: 'profitsBeneficiaryCollateral', - type: 'publicKey', + "name": "profitsBeneficiaryCollateral", + "type": "publicKey" }, { - name: 'reserved', - type: { - array: ['u8', 588], - }, - }, - ], - }, - }, + "name": "reserved", + "type": { + "array": [ + "u8", + 588 + ] + } + } + ] + } + } ], - types: [ + "types": [ { - name: 'EditCredixLpDepositoryFields', - type: { - kind: 'struct', - fields: [ + "name": "EditCredixLpDepositoryFields", + "type": { + "kind": "struct", + "fields": [ { - name: 'redeemableAmountUnderManagementCap', - type: { - option: 'u128', - }, + "name": "redeemableAmountUnderManagementCap", + "type": { + "option": "u128" + } }, { - name: 'mintingFeeInBps', - type: { - option: 'u8', - }, + "name": "mintingFeeInBps", + "type": { + "option": "u8" + } }, { - name: 'redeemingFeeInBps', - type: { - option: 'u8', - }, + "name": "redeemingFeeInBps", + "type": { + "option": "u8" + } }, { - name: 'mintingDisabled', - type: { - option: 'bool', - }, + "name": "mintingDisabled", + "type": { + "option": "bool" + } }, { - name: 'profitsBeneficiaryCollateral', - type: { - option: 'publicKey', - }, - }, - ], - }, + "name": "profitsBeneficiaryCollateral", + "type": { + "option": "publicKey" + } + } + ] + } }, { - name: 'EditDepositoriesRoutingWeightBps', - type: { - kind: 'struct', - fields: [ + "name": "EditDepositoriesRoutingWeightBps", + "type": { + "kind": "struct", + "fields": [ { - name: 'identityDepositoryWeightBps', - type: 'u16', + "name": "identityDepositoryWeightBps", + "type": "u16" }, { - name: 'mercurialVaultDepositoryWeightBps', - type: 'u16', + "name": "mercurialVaultDepositoryWeightBps", + "type": "u16" }, { - name: 'credixLpDepositoryWeightBps', - type: 'u16', - }, - ], - }, + "name": "credixLpDepositoryWeightBps", + "type": "u16" + } + ] + } }, { - name: 'EditRouterDepositories', - type: { - kind: 'struct', - fields: [ + "name": "EditRouterDepositories", + "type": { + "kind": "struct", + "fields": [ { - name: 'identityDepository', - type: 'publicKey', + "name": "identityDepository", + "type": "publicKey" }, { - name: 'mercurialVaultDepository', - type: 'publicKey', + "name": "mercurialVaultDepository", + "type": "publicKey" }, { - name: 'credixLpDepository', - type: 'publicKey', - }, - ], - }, + "name": "credixLpDepository", + "type": "publicKey" + } + ] + } }, { - name: 'EditControllerFields', - type: { - kind: 'struct', - fields: [ + "name": "EditControllerFields", + "type": { + "kind": "struct", + "fields": [ { - name: 'redeemableGlobalSupplyCap', - type: { - option: 'u128', - }, + "name": "redeemableGlobalSupplyCap", + "type": { + "option": "u128" + } }, { - name: 'depositoriesRoutingWeightBps', - type: { - option: { - defined: 'EditDepositoriesRoutingWeightBps', - }, - }, + "name": "depositoriesRoutingWeightBps", + "type": { + "option": { + "defined": "EditDepositoriesRoutingWeightBps" + } + } }, { - name: 'routerDepositories', - type: { - option: { - defined: 'EditRouterDepositories', - }, - }, - }, - ], - }, + "name": "routerDepositories", + "type": { + "option": { + "defined": "EditRouterDepositories" + } + } + } + ] + } }, { - name: 'EditIdentityDepositoryFields', - type: { - kind: 'struct', - fields: [ + "name": "EditIdentityDepositoryFields", + "type": { + "kind": "struct", + "fields": [ { - name: 'redeemableAmountUnderManagementCap', - type: { - option: 'u128', - }, + "name": "redeemableAmountUnderManagementCap", + "type": { + "option": "u128" + } }, { - name: 'mintingDisabled', - type: { - option: 'bool', - }, - }, - ], - }, + "name": "mintingDisabled", + "type": { + "option": "bool" + } + } + ] + } }, { - name: 'EditMercurialVaultDepositoryFields', - type: { - kind: 'struct', - fields: [ + "name": "EditMercurialVaultDepositoryFields", + "type": { + "kind": "struct", + "fields": [ { - name: 'redeemableAmountUnderManagementCap', - type: { - option: 'u128', - }, + "name": "redeemableAmountUnderManagementCap", + "type": { + "option": "u128" + } }, { - name: 'mintingFeeInBps', - type: { - option: 'u8', - }, + "name": "mintingFeeInBps", + "type": { + "option": "u8" + } }, { - name: 'redeemingFeeInBps', - type: { - option: 'u8', - }, + "name": "redeemingFeeInBps", + "type": { + "option": "u8" + } }, { - name: 'mintingDisabled', - type: { - option: 'bool', - }, + "name": "mintingDisabled", + "type": { + "option": "bool" + } }, { - name: 'profitsBeneficiaryCollateral', - type: { - option: 'publicKey', - }, - }, - ], - }, - }, + "name": "profitsBeneficiaryCollateral", + "type": { + "option": "publicKey" + } + } + ] + } + } ], - events: [ + "events": [ { - name: 'InitializeControllerEvent', - fields: [ + "name": "InitializeControllerEvent", + "fields": [ { - name: 'version', - type: 'u8', - index: false, + "name": "version", + "type": "u8", + "index": false }, { - name: 'controller', - type: 'publicKey', - index: false, + "name": "controller", + "type": "publicKey", + "index": false }, { - name: 'authority', - type: 'publicKey', - index: false, - }, - ], + "name": "authority", + "type": "publicKey", + "index": false + } + ] }, { - name: 'SetRedeemableGlobalSupplyCapEvent', - fields: [ + "name": "SetRedeemableGlobalSupplyCapEvent", + "fields": [ { - name: 'version', - type: 'u8', - index: false, + "name": "version", + "type": "u8", + "index": false }, { - name: 'controller', - type: 'publicKey', - index: false, + "name": "controller", + "type": "publicKey", + "index": false }, { - name: 'redeemableGlobalSupplyCap', - type: 'u128', - index: false, - }, - ], + "name": "redeemableGlobalSupplyCap", + "type": "u128", + "index": false + } + ] }, { - name: 'SetRouterDepositoriesWeightBps', - fields: [ + "name": "SetRouterDepositoriesWeightBps", + "fields": [ { - name: 'controllerVersion', - type: 'u8', - index: true, + "name": "controllerVersion", + "type": "u8", + "index": true }, { - name: 'controller', - type: 'publicKey', - index: true, + "name": "controller", + "type": "publicKey", + "index": true }, { - name: 'identityDepositoryWeightBps', - type: 'u16', - index: false, + "name": "identityDepositoryWeightBps", + "type": "u16", + "index": false }, { - name: 'mercurialVaultDepositoryWeightBps', - type: 'u16', - index: false, + "name": "mercurialVaultDepositoryWeightBps", + "type": "u16", + "index": false }, { - name: 'credixLpDepositoryWeightBps', - type: 'u16', - index: false, - }, - ], + "name": "credixLpDepositoryWeightBps", + "type": "u16", + "index": false + } + ] }, { - name: 'SetRouterDepositories', - fields: [ + "name": "SetRouterDepositories", + "fields": [ { - name: 'controllerVersion', - type: 'u8', - index: true, + "name": "controllerVersion", + "type": "u8", + "index": true }, { - name: 'controller', - type: 'publicKey', - index: true, + "name": "controller", + "type": "publicKey", + "index": true }, { - name: 'identityDepository', - type: 'publicKey', - index: false, + "name": "identityDepository", + "type": "publicKey", + "index": false }, { - name: 'mercurialVaultDepository', - type: 'publicKey', - index: false, + "name": "mercurialVaultDepository", + "type": "publicKey", + "index": false }, { - name: 'credixLpDepository', - type: 'publicKey', - index: false, - }, - ], + "name": "credixLpDepository", + "type": "publicKey", + "index": false + } + ] }, { - name: 'RegisterMercurialVaultDepositoryEvent', - fields: [ + "name": "RegisterMercurialVaultDepositoryEvent", + "fields": [ { - name: 'version', - type: 'u8', - index: true, + "name": "version", + "type": "u8", + "index": true }, { - name: 'depositoryVersion', - type: 'u8', - index: true, + "name": "depositoryVersion", + "type": "u8", + "index": true }, { - name: 'controller', - type: 'publicKey', - index: true, + "name": "controller", + "type": "publicKey", + "index": true }, { - name: 'depository', - type: 'publicKey', - index: true, + "name": "depository", + "type": "publicKey", + "index": true }, { - name: 'mercurialVault', - type: 'publicKey', - index: false, + "name": "mercurialVault", + "type": "publicKey", + "index": false }, { - name: 'depositoryLpTokenVault', - type: 'publicKey', - index: false, + "name": "depositoryLpTokenVault", + "type": "publicKey", + "index": false }, { - name: 'collateralMint', - type: 'publicKey', - index: false, - }, - ], + "name": "collateralMint", + "type": "publicKey", + "index": false + } + ] }, { - name: 'SetDepositoryRedeemableAmountUnderManagementCapEvent', - fields: [ + "name": "SetDepositoryRedeemableAmountUnderManagementCapEvent", + "fields": [ { - name: 'version', - type: 'u8', - index: true, + "name": "version", + "type": "u8", + "index": true }, { - name: 'controller', - type: 'publicKey', - index: true, + "name": "controller", + "type": "publicKey", + "index": true }, { - name: 'depository', - type: 'publicKey', - index: true, + "name": "depository", + "type": "publicKey", + "index": true }, { - name: 'redeemableAmountUnderManagementCap', - type: 'u128', - index: true, - }, - ], + "name": "redeemableAmountUnderManagementCap", + "type": "u128", + "index": true + } + ] }, { - name: 'SetDepositoryMintingFeeInBpsEvent', - fields: [ + "name": "SetDepositoryMintingFeeInBpsEvent", + "fields": [ { - name: 'version', - type: 'u8', - index: true, + "name": "version", + "type": "u8", + "index": true }, { - name: 'controller', - type: 'publicKey', - index: true, + "name": "controller", + "type": "publicKey", + "index": true }, { - name: 'depository', - type: 'publicKey', - index: true, + "name": "depository", + "type": "publicKey", + "index": true }, { - name: 'mintingFeeInBps', - type: 'u8', - index: true, - }, - ], + "name": "mintingFeeInBps", + "type": "u8", + "index": true + } + ] }, { - name: 'SetDepositoryRedeemingFeeInBpsEvent', - fields: [ + "name": "SetDepositoryRedeemingFeeInBpsEvent", + "fields": [ { - name: 'version', - type: 'u8', - index: true, + "name": "version", + "type": "u8", + "index": true }, { - name: 'controller', - type: 'publicKey', - index: true, + "name": "controller", + "type": "publicKey", + "index": true }, { - name: 'depository', - type: 'publicKey', - index: true, + "name": "depository", + "type": "publicKey", + "index": true }, { - name: 'redeemingFeeInBps', - type: 'u8', - index: true, - }, - ], + "name": "redeemingFeeInBps", + "type": "u8", + "index": true + } + ] }, { - name: 'SetDepositoryMintingDisabledEvent', - fields: [ + "name": "SetDepositoryMintingDisabledEvent", + "fields": [ { - name: 'version', - type: 'u8', - index: true, + "name": "version", + "type": "u8", + "index": true }, { - name: 'controller', - type: 'publicKey', - index: true, + "name": "controller", + "type": "publicKey", + "index": true }, { - name: 'depository', - type: 'publicKey', - index: true, + "name": "depository", + "type": "publicKey", + "index": true }, { - name: 'mintingDisabled', - type: 'bool', - index: true, - }, - ], + "name": "mintingDisabled", + "type": "bool", + "index": true + } + ] }, { - name: 'SetDepositoryProfitsBeneficiaryCollateralEvent', - fields: [ + "name": "SetDepositoryProfitsBeneficiaryCollateralEvent", + "fields": [ { - name: 'version', - type: 'u8', - index: true, + "name": "version", + "type": "u8", + "index": true }, { - name: 'controller', - type: 'publicKey', - index: true, + "name": "controller", + "type": "publicKey", + "index": true }, { - name: 'depository', - type: 'publicKey', - index: true, + "name": "depository", + "type": "publicKey", + "index": true }, { - name: 'profitsBeneficiaryCollateral', - type: 'publicKey', - index: true, - }, - ], + "name": "profitsBeneficiaryCollateral", + "type": "publicKey", + "index": true + } + ] }, { - name: 'InitializeIdentityDepositoryEvent', - fields: [ + "name": "InitializeIdentityDepositoryEvent", + "fields": [ { - name: 'version', - type: 'u8', - index: false, + "name": "version", + "type": "u8", + "index": false }, { - name: 'depositoryVersion', - type: 'u8', - index: true, + "name": "depositoryVersion", + "type": "u8", + "index": true }, { - name: 'controller', - type: 'publicKey', - index: true, + "name": "controller", + "type": "publicKey", + "index": true }, { - name: 'depository', - type: 'publicKey', - index: true, + "name": "depository", + "type": "publicKey", + "index": true }, { - name: 'collateralMint', - type: 'publicKey', - index: false, - }, - ], + "name": "collateralMint", + "type": "publicKey", + "index": false + } + ] }, { - name: 'MintWithIdentityDepositoryEvent', - fields: [ + "name": "MintWithIdentityDepositoryEvent", + "fields": [ { - name: 'version', - type: 'u8', - index: false, + "name": "version", + "type": "u8", + "index": false }, { - name: 'controller', - type: 'publicKey', - index: true, + "name": "controller", + "type": "publicKey", + "index": true }, { - name: 'depository', - type: 'publicKey', - index: true, + "name": "depository", + "type": "publicKey", + "index": true }, { - name: 'user', - type: 'publicKey', - index: false, + "name": "user", + "type": "publicKey", + "index": false }, { - name: 'collateralAmount', - type: 'u64', - index: false, - }, - ], + "name": "collateralAmount", + "type": "u64", + "index": false + } + ] }, { - name: 'RedeemFromIdentityDepositoryEvent', - fields: [ + "name": "RedeemFromIdentityDepositoryEvent", + "fields": [ { - name: 'version', - type: 'u8', - index: false, + "name": "version", + "type": "u8", + "index": false }, { - name: 'controller', - type: 'publicKey', - index: true, + "name": "controller", + "type": "publicKey", + "index": true }, { - name: 'depository', - type: 'publicKey', - index: true, + "name": "depository", + "type": "publicKey", + "index": true }, { - name: 'user', - type: 'publicKey', - index: false, + "name": "user", + "type": "publicKey", + "index": false }, { - name: 'redeemableAmount', - type: 'u64', - index: false, - }, - ], + "name": "redeemableAmount", + "type": "u64", + "index": false + } + ] }, { - name: 'RegisterCredixLpDepositoryEvent', - fields: [ + "name": "RegisterCredixLpDepositoryEvent", + "fields": [ { - name: 'controllerVersion', - type: 'u8', - index: true, + "name": "controllerVersion", + "type": "u8", + "index": true }, { - name: 'depositoryVersion', - type: 'u8', - index: true, + "name": "depositoryVersion", + "type": "u8", + "index": true }, { - name: 'controller', - type: 'publicKey', - index: true, + "name": "controller", + "type": "publicKey", + "index": true }, { - name: 'depository', - type: 'publicKey', - index: true, + "name": "depository", + "type": "publicKey", + "index": true }, { - name: 'collateralMint', - type: 'publicKey', - index: false, + "name": "collateralMint", + "type": "publicKey", + "index": false }, { - name: 'credixGlobalMarketState', - type: 'publicKey', - index: false, - }, - ], + "name": "credixGlobalMarketState", + "type": "publicKey", + "index": false + } + ] }, { - name: 'MintWithCredixLpDepositoryEvent', - fields: [ + "name": "MintWithCredixLpDepositoryEvent", + "fields": [ { - name: 'controllerVersion', - type: 'u8', - index: true, + "name": "controllerVersion", + "type": "u8", + "index": true }, { - name: 'depositoryVersion', - type: 'u8', - index: true, + "name": "depositoryVersion", + "type": "u8", + "index": true }, { - name: 'controller', - type: 'publicKey', - index: true, + "name": "controller", + "type": "publicKey", + "index": true }, { - name: 'depository', - type: 'publicKey', - index: true, + "name": "depository", + "type": "publicKey", + "index": true }, { - name: 'user', - type: 'publicKey', - index: true, + "name": "user", + "type": "publicKey", + "index": true }, { - name: 'collateralAmount', - type: 'u64', - index: false, + "name": "collateralAmount", + "type": "u64", + "index": false }, { - name: 'redeemableAmount', - type: 'u64', - index: false, + "name": "redeemableAmount", + "type": "u64", + "index": false }, { - name: 'mintingFeePaid', - type: 'u64', - index: false, - }, - ], + "name": "mintingFeePaid", + "type": "u64", + "index": false + } + ] }, { - name: 'RedeemFromCredixLpDepositoryEvent', - fields: [ + "name": "RedeemFromCredixLpDepositoryEvent", + "fields": [ { - name: 'controllerVersion', - type: 'u8', - index: true, + "name": "controllerVersion", + "type": "u8", + "index": true }, { - name: 'depositoryVersion', - type: 'u8', - index: true, + "name": "depositoryVersion", + "type": "u8", + "index": true }, { - name: 'controller', - type: 'publicKey', - index: true, + "name": "controller", + "type": "publicKey", + "index": true }, { - name: 'depository', - type: 'publicKey', - index: true, + "name": "depository", + "type": "publicKey", + "index": true }, { - name: 'user', - type: 'publicKey', - index: true, + "name": "user", + "type": "publicKey", + "index": true }, { - name: 'collateralAmount', - type: 'u64', - index: false, + "name": "collateralAmount", + "type": "u64", + "index": false }, { - name: 'redeemableAmount', - type: 'u64', - index: false, + "name": "redeemableAmount", + "type": "u64", + "index": false }, { - name: 'redeemingFeePaid', - type: 'u64', - index: false, - }, - ], + "name": "redeemingFeePaid", + "type": "u64", + "index": false + } + ] }, { - name: 'CollectProfitsOfCredixLpDepositoryEvent', - fields: [ + "name": "CollectProfitsOfCredixLpDepositoryEvent", + "fields": [ { - name: 'controllerVersion', - type: 'u8', - index: true, + "name": "controllerVersion", + "type": "u8", + "index": true }, { - name: 'depositoryVersion', - type: 'u8', - index: true, + "name": "depositoryVersion", + "type": "u8", + "index": true }, { - name: 'controller', - type: 'publicKey', - index: true, + "name": "controller", + "type": "publicKey", + "index": true }, { - name: 'depository', - type: 'publicKey', - index: true, + "name": "depository", + "type": "publicKey", + "index": true }, { - name: 'collateralAmount', - type: 'u64', - index: false, - }, - ], + "name": "collateralAmount", + "type": "u64", + "index": false + } + ] }, { - name: 'RebalanceCreateWithdrawRequestFromCredixLpDepositoryEvent', - fields: [ + "name": "RebalanceCreateWithdrawRequestFromCredixLpDepositoryEvent", + "fields": [ { - name: 'controllerVersion', - type: 'u8', - index: true, + "name": "controllerVersion", + "type": "u8", + "index": true }, { - name: 'depositoryVersion', - type: 'u8', - index: true, + "name": "depositoryVersion", + "type": "u8", + "index": true }, { - name: 'controller', - type: 'publicKey', - index: true, + "name": "controller", + "type": "publicKey", + "index": true }, { - name: 'depository', - type: 'publicKey', - index: true, + "name": "depository", + "type": "publicKey", + "index": true }, { - name: 'overflowValue', - type: 'u64', - index: false, + "name": "overflowValue", + "type": "u64", + "index": false }, { - name: 'profitsCollateralAmount', - type: 'u64', - index: false, + "name": "profitsCollateralAmount", + "type": "u64", + "index": false }, { - name: 'requestedCollateralAmount', - type: 'u64', - index: false, - }, - ], + "name": "requestedCollateralAmount", + "type": "u64", + "index": false + } + ] }, { - name: 'RebalanceRedeemWithdrawRequestFromCredixLpDepositoryEvent', - fields: [ + "name": "RebalanceRedeemWithdrawRequestFromCredixLpDepositoryEvent", + "fields": [ { - name: 'controllerVersion', - type: 'u8', - index: true, + "name": "controllerVersion", + "type": "u8", + "index": true }, { - name: 'depositoryVersion', - type: 'u8', - index: true, + "name": "depositoryVersion", + "type": "u8", + "index": true }, { - name: 'controller', - type: 'publicKey', - index: true, + "name": "controller", + "type": "publicKey", + "index": true }, { - name: 'depository', - type: 'publicKey', - index: true, + "name": "depository", + "type": "publicKey", + "index": true }, { - name: 'overflowValue', - type: 'u64', - index: false, + "name": "overflowValue", + "type": "u64", + "index": false }, { - name: 'profitsCollateralAmount', - type: 'u64', - index: false, + "name": "profitsCollateralAmount", + "type": "u64", + "index": false }, { - name: 'requestedCollateralAmount', - type: 'u64', - index: false, - }, - ], + "name": "requestedCollateralAmount", + "type": "u64", + "index": false + } + ] }, { - name: 'CollectProfitsOfMercurialVaultDepositoryEvent', - fields: [ + "name": "CollectProfitsOfMercurialVaultDepositoryEvent", + "fields": [ { - name: 'controllerVersion', - type: 'u8', - index: true, + "name": "controllerVersion", + "type": "u8", + "index": true }, { - name: 'depositoryVersion', - type: 'u8', - index: true, + "name": "depositoryVersion", + "type": "u8", + "index": true }, { - name: 'controller', - type: 'publicKey', - index: true, + "name": "controller", + "type": "publicKey", + "index": true }, { - name: 'depository', - type: 'publicKey', - index: true, + "name": "depository", + "type": "publicKey", + "index": true }, { - name: 'collateralAmount', - type: 'u64', - index: false, - }, - ], + "name": "collateralAmount", + "type": "u64", + "index": false + } + ] }, { - name: 'FreezeProgramEvent', - fields: [ + "name": "FreezeProgramEvent", + "fields": [ { - name: 'version', - type: 'u8', - index: false, + "name": "version", + "type": "u8", + "index": false }, { - name: 'controller', - type: 'publicKey', - index: false, + "name": "controller", + "type": "publicKey", + "index": false }, { - name: 'isFrozen', - type: 'bool', - index: false, - }, - ], - }, + "name": "isFrozen", + "type": "bool", + "index": false + } + ] + } ], - errors: [ + "errors": [ { - code: 6000, - name: 'InvalidRedeemableMintDecimals', - msg: 'The redeemable mint decimals must be between 0 and 9 (inclusive).', + "code": 6000, + "name": "InvalidRedeemableMintDecimals", + "msg": "The redeemable mint decimals must be between 0 and 9 (inclusive)." }, { - code: 6001, - name: 'InvalidRedeemableGlobalSupplyCap', - msg: 'Redeemable global supply above.', + "code": 6001, + "name": "InvalidRedeemableGlobalSupplyCap", + "msg": "Redeemable global supply above." }, { - code: 6002, - name: 'InvalidDepositoriesWeightBps', - msg: 'Depositories weights do not add up to 100%.', + "code": 6002, + "name": "InvalidDepositoriesWeightBps", + "msg": "Depositories weights do not add up to 100%." }, { - code: 6003, - name: 'InvalidDepositoriesVector', - msg: 'Depositories vector passed as parameter is not of the expected length', + "code": 6003, + "name": "InvalidDepositoriesVector", + "msg": "Depositories vector passed as parameter is not of the expected length" }, { - code: 6004, - name: 'InvalidCollateralAmount', - msg: 'Collateral amount cannot be 0', + "code": 6004, + "name": "InvalidCollateralAmount", + "msg": "Collateral amount cannot be 0" }, { - code: 6005, - name: 'InvalidRedeemableAmount', - msg: 'Redeemable amount must be > 0 in order to redeem.', + "code": 6005, + "name": "InvalidRedeemableAmount", + "msg": "Redeemable amount must be > 0 in order to redeem." }, { - code: 6006, - name: 'InsufficientCollateralAmount', - msg: 'The balance of the collateral ATA is not enough to fulfill the mint operation.', + "code": 6006, + "name": "InsufficientCollateralAmount", + "msg": "The balance of the collateral ATA is not enough to fulfill the mint operation." }, { - code: 6007, - name: 'InsufficientRedeemableAmount', - msg: 'The balance of the redeemable ATA is not enough to fulfill the redeem operation.', + "code": 6007, + "name": "InsufficientRedeemableAmount", + "msg": "The balance of the redeemable ATA is not enough to fulfill the redeem operation." }, { - code: 6008, - name: 'DepositoriesTargerRedeemableAmountReached', - msg: 'Minting amount would go past the depositories target redeemable amount.', + "code": 6008, + "name": "DepositoriesTargerRedeemableAmountReached", + "msg": "Minting amount would go past the depositories target redeemable amount." }, { - code: 6009, - name: 'RedeemableGlobalSupplyCapReached', - msg: 'Minting amount would go past the Redeemable Global Supply Cap.', + "code": 6009, + "name": "RedeemableGlobalSupplyCapReached", + "msg": "Minting amount would go past the Redeemable Global Supply Cap." }, { - code: 6010, - name: 'RedeemableMercurialVaultAmountUnderManagementCap', - msg: 'Minting amount would go past the mercurial vault depository Redeemable Amount Under Management Cap.', + "code": 6010, + "name": "RedeemableMercurialVaultAmountUnderManagementCap", + "msg": "Minting amount would go past the mercurial vault depository Redeemable Amount Under Management Cap." }, { - code: 6011, - name: 'RedeemableCredixLpAmountUnderManagementCap', - msg: 'Minting amount would go past the credix lp depository Redeemable Amount Under Management Cap.', + "code": 6011, + "name": "RedeemableCredixLpAmountUnderManagementCap", + "msg": "Minting amount would go past the credix lp depository Redeemable Amount Under Management Cap." }, { - code: 6012, - name: 'MathError', - msg: 'Math error.', + "code": 6012, + "name": "MathError", + "msg": "Math error." }, { - code: 6013, - name: 'SlippageReached', - msg: "The order couldn't be executed with the provided slippage.", + "code": 6013, + "name": "SlippageReached", + "msg": "The order couldn't be executed with the provided slippage." }, { - code: 6014, - name: 'BumpError', - msg: 'A bump was expected but is missing.', + "code": 6014, + "name": "BumpError", + "msg": "A bump was expected but is missing." }, { - code: 6015, - name: 'MintingDisabled', - msg: 'Minting is disabled for the current depository.', + "code": 6015, + "name": "MintingDisabled", + "msg": "Minting is disabled for the current depository." }, { - code: 6016, - name: 'CollateralDepositHasRemainingDust', - msg: 'Collateral deposit left some value unaccounted for.', + "code": 6016, + "name": "CollateralDepositHasRemainingDust", + "msg": "Collateral deposit left some value unaccounted for." }, { - code: 6017, - name: 'CollateralDepositAmountsDoesntMatch', - msg: "Collateral deposit didn't result in the correct amounts being moved.", + "code": 6017, + "name": "CollateralDepositAmountsDoesntMatch", + "msg": "Collateral deposit didn't result in the correct amounts being moved." }, { - code: 6018, - name: 'CollateralDepositDoesntMatchTokenValue', - msg: "Received token of which the value doesn't match the deposited collateral.", + "code": 6018, + "name": "CollateralDepositDoesntMatchTokenValue", + "msg": "Received token of which the value doesn't match the deposited collateral." }, { - code: 6019, - name: 'InvalidMercurialVaultLpMint', - msg: "The mercurial vault lp mint does not match the Depository's one.", + "code": 6019, + "name": "InvalidMercurialVaultLpMint", + "msg": "The mercurial vault lp mint does not match the Depository's one." }, { - code: 6020, - name: 'MaxNumberOfMercurialVaultDepositoriesRegisteredReached', - msg: 'Cannot register more mercurial vault depositories, the limit has been reached.', + "code": 6020, + "name": "MaxNumberOfMercurialVaultDepositoriesRegisteredReached", + "msg": "Cannot register more mercurial vault depositories, the limit has been reached." }, { - code: 6021, - name: 'MaxNumberOfCredixLpDepositoriesRegisteredReached', - msg: 'Cannot register more credix lp depositories, the limit has been reached.', + "code": 6021, + "name": "MaxNumberOfCredixLpDepositoriesRegisteredReached", + "msg": "Cannot register more credix lp depositories, the limit has been reached." }, { - code: 6022, - name: 'MercurialVaultDoNotMatchCollateral', - msg: 'The provided collateral do not match the provided mercurial vault token.', + "code": 6022, + "name": "MercurialVaultDoNotMatchCollateral", + "msg": "The provided collateral do not match the provided mercurial vault token." }, { - code: 6023, - name: 'CredixLpDoNotMatchCollateral', - msg: 'The provided collateral do not match the provided credix lp token.', + "code": 6023, + "name": "CredixLpDoNotMatchCollateral", + "msg": "The provided collateral do not match the provided credix lp token." }, { - code: 6024, - name: 'CollateralMintEqualToRedeemableMint', - msg: 'Collateral mint should be different than redeemable mint.', + "code": 6024, + "name": "CollateralMintEqualToRedeemableMint", + "msg": "Collateral mint should be different than redeemable mint." }, { - code: 6025, - name: 'CollateralMintNotAllowed', - msg: 'Provided collateral mint is not allowed.', + "code": 6025, + "name": "CollateralMintNotAllowed", + "msg": "Provided collateral mint is not allowed." }, { - code: 6026, - name: 'MinimumMintedRedeemableAmountError', - msg: 'Mint resulted to 0 redeemable token being minted.', + "code": 6026, + "name": "MinimumMintedRedeemableAmountError", + "msg": "Mint resulted to 0 redeemable token being minted." }, { - code: 6027, - name: 'MaximumMintedRedeemableAmountError', - msg: 'Mint resulted into too much redeemable token being minted.', + "code": 6027, + "name": "MaximumMintedRedeemableAmountError", + "msg": "Mint resulted into too much redeemable token being minted." }, { - code: 6028, - name: 'MinimumRedeemedCollateralAmountError', - msg: 'Redeem resulted to 0 collateral token being redeemed.', + "code": 6028, + "name": "MinimumRedeemedCollateralAmountError", + "msg": "Redeem resulted to 0 collateral token being redeemed." }, { - code: 6029, - name: 'MaximumRedeemedCollateralAmountError', - msg: 'Redeem resulted into too much collateral token being redeemed.', + "code": 6029, + "name": "MaximumRedeemedCollateralAmountError", + "msg": "Redeem resulted into too much collateral token being redeemed." }, { - code: 6030, - name: 'InvalidDepositoryLpTokenVault', - msg: "The depository lp token vault does not match the Depository's one.", + "code": 6030, + "name": "InvalidDepositoryLpTokenVault", + "msg": "The depository lp token vault does not match the Depository's one." }, { - code: 6031, - name: 'InvalidAuthority', - msg: 'Only the Program initializer authority can access this instructions.', + "code": 6031, + "name": "InvalidAuthority", + "msg": "Only the Program initializer authority can access this instructions." }, { - code: 6032, - name: 'InvalidController', - msg: "The Depository's controller doesn't match the provided Controller.", + "code": 6032, + "name": "InvalidController", + "msg": "The Depository's controller doesn't match the provided Controller." }, { - code: 6033, - name: 'InvalidDepository', - msg: 'The Depository provided is not registered with the Controller.', + "code": 6033, + "name": "InvalidDepository", + "msg": "The Depository provided is not registered with the Controller." }, { - code: 6034, - name: 'InvalidCollateralMint', - msg: "The provided collateral mint does not match the depository's collateral mint.", + "code": 6034, + "name": "InvalidCollateralMint", + "msg": "The provided collateral mint does not match the depository's collateral mint." }, { - code: 6035, - name: 'InvalidRedeemableMint', - msg: "The Redeemable Mint provided does not match the Controller's one.", + "code": 6035, + "name": "InvalidRedeemableMint", + "msg": "The Redeemable Mint provided does not match the Controller's one." }, { - code: 6036, - name: 'InvalidOwner', - msg: 'The provided token account is not owner by the expected party.', + "code": 6036, + "name": "InvalidOwner", + "msg": "The provided token account is not owner by the expected party." }, { - code: 6037, - name: 'InvalidDepositoryCollateral', - msg: "The provided depository collateral does not match the depository's one.", + "code": 6037, + "name": "InvalidDepositoryCollateral", + "msg": "The provided depository collateral does not match the depository's one." }, { - code: 6038, - name: 'InvalidDepositoryShares', - msg: "The provided depository shares does not match the depository's one.", + "code": 6038, + "name": "InvalidDepositoryShares", + "msg": "The provided depository shares does not match the depository's one." }, { - code: 6039, - name: 'InvalidProfitsBeneficiaryCollateral', - msg: "The Profits beneficiary collateral provided does not match the depository's one.", + "code": 6039, + "name": "InvalidProfitsBeneficiaryCollateral", + "msg": "The Profits beneficiary collateral provided does not match the depository's one." }, { - code: 6040, - name: 'InvalidMercurialVault', - msg: "The provided mercurial vault does not match the Depository's one.", + "code": 6040, + "name": "InvalidMercurialVault", + "msg": "The provided mercurial vault does not match the Depository's one." }, { - code: 6041, - name: 'InvalidMercurialVaultCollateralTokenSafe', - msg: 'The provided mercurial vault collateral token safe does not match the mercurial vault one.', + "code": 6041, + "name": "InvalidMercurialVaultCollateralTokenSafe", + "msg": "The provided mercurial vault collateral token safe does not match the mercurial vault one." }, { - code: 6042, - name: 'RedeemableIdentityDepositoryAmountUnderManagementCap', - msg: 'Minting amount would go past the identity depository Redeemable Amount Under Management Cap.', + "code": 6042, + "name": "RedeemableIdentityDepositoryAmountUnderManagementCap", + "msg": "Minting amount would go past the identity depository Redeemable Amount Under Management Cap." }, { - code: 6043, - name: 'ProgramAlreadyFrozenOrResumed', - msg: 'Program is already frozen/resumed.', + "code": 6043, + "name": "ProgramAlreadyFrozenOrResumed", + "msg": "Program is already frozen/resumed." }, { - code: 6044, - name: 'ProgramFrozen', - msg: 'The program is currently in Frozen state.', + "code": 6044, + "name": "ProgramFrozen", + "msg": "The program is currently in Frozen state." }, { - code: 6045, - name: 'InvalidCredixProgramState', - msg: "The Credix ProgramState isn't the Depository one.", + "code": 6045, + "name": "InvalidCredixProgramState", + "msg": "The Credix ProgramState isn't the Depository one." }, { - code: 6046, - name: 'InvalidCredixGlobalMarketState', - msg: "The Credix GlobalMarketState isn't the Depository one.", + "code": 6046, + "name": "InvalidCredixGlobalMarketState", + "msg": "The Credix GlobalMarketState isn't the Depository one." }, { - code: 6047, - name: 'InvalidCredixSigningAuthority', - msg: "The Credix SigningAuthority isn't the Depository one.", + "code": 6047, + "name": "InvalidCredixSigningAuthority", + "msg": "The Credix SigningAuthority isn't the Depository one." }, { - code: 6048, - name: 'InvalidCredixLiquidityCollateral', - msg: "The Credix LiquidityCollateral isn't the Depository one.", + "code": 6048, + "name": "InvalidCredixLiquidityCollateral", + "msg": "The Credix LiquidityCollateral isn't the Depository one." }, { - code: 6049, - name: 'InvalidCredixSharesMint', - msg: "The Credix SharesMint isn't the Depository one.", + "code": 6049, + "name": "InvalidCredixSharesMint", + "msg": "The Credix SharesMint isn't the Depository one." }, { - code: 6050, - name: 'InvalidCredixPass', - msg: "The Credix Pass isn't the one owned by the correct depository.", + "code": 6050, + "name": "InvalidCredixPass", + "msg": "The Credix Pass isn't the one owned by the correct depository." }, { - code: 6051, - name: 'InvalidCredixPassNoFees', - msg: "The Credix Pass doesn't have the fees exemption.", + "code": 6051, + "name": "InvalidCredixPassNoFees", + "msg": "The Credix Pass doesn't have the fees exemption." }, { - code: 6052, - name: 'InvalidCredixMultisigKey', - msg: "The Credix Multisig Key isn't the ProgramState one.", + "code": 6052, + "name": "InvalidCredixMultisigKey", + "msg": "The Credix Multisig Key isn't the ProgramState one." }, { - code: 6053, - name: 'InvalidCredixTreasuryCollateral', - msg: "The Credix TreasuryCollateral isn't the GlobalMarketState one.", + "code": 6053, + "name": "InvalidCredixTreasuryCollateral", + "msg": "The Credix TreasuryCollateral isn't the GlobalMarketState one." }, { - code: 6054, - name: 'InvalidCredixWithdrawEpochRequestPhase', - msg: "The Credix WithdrawEpoch isn't in its request phase.", + "code": 6054, + "name": "InvalidCredixWithdrawEpochRequestPhase", + "msg": "The Credix WithdrawEpoch isn't in its request phase." }, { - code: 6055, - name: 'InvalidCredixWithdrawEpochRedeemPhase', - msg: "The Credix WithdrawEpoch isn't in its redeem phase.", + "code": 6055, + "name": "InvalidCredixWithdrawEpochRedeemPhase", + "msg": "The Credix WithdrawEpoch isn't in its redeem phase." }, { - code: 6056, - name: 'Default', - msg: 'Default - Check the source code for more info.', - }, - ], + "code": 6056, + "name": "Default", + "msg": "Default - Check the source code for more info." + } + ] };