diff --git a/CHANGELOG.md b/CHANGELOG.md index acc3dd22..693b1dae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -340,6 +340,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fix position liquidity withdraw to position owner, instead of customized fee owner +### Changed + +- Bump to anchor 0.29.0 + +## @meteora-ag/dlmm [1.0.45] - PR #83 ## @mercurial-finance/dynamic-amm-sdk [1.0.32] - PR #58 diff --git a/Cargo.lock b/Cargo.lock index 1397ae33..5417018f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12,12 +12,27 @@ dependencies = [ "regex", ] +[[package]] +name = "addr2line" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +dependencies = [ + "gimli", +] + [[package]] name = "adler" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + [[package]] name = "aead" version = "0.4.3" @@ -56,42 +71,37 @@ dependencies = [ [[package]] name = "ahash" -version = "0.7.6" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ - "getrandom 0.2.10", + "getrandom 0.2.15", "once_cell", "version_check", ] [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if", - "getrandom 0.2.10", + "getrandom 0.2.15", "once_cell", "version_check", + "zerocopy", ] [[package]] name = "aho-corasick" -version = "1.0.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] -[[package]] -name = "aliasable" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" - [[package]] name = "alloc-no-stdlib" version = "2.0.4" @@ -109,87 +119,79 @@ dependencies = [ [[package]] name = "anchor-attribute-access-control" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faa5be5b72abea167f87c868379ba3c2be356bfca9e6f474fd055fa0f7eeb4f2" +checksum = "e5f619f1d04f53621925ba8a2e633ba5a6081f2ae14758cbb67f38fd823e0a3e" dependencies = [ "anchor-syn", - "anyhow", - "proc-macro2 1.0.63", - "quote 1.0.29", - "regex", + "proc-macro2", + "quote", "syn 1.0.109", ] [[package]] name = "anchor-attribute-account" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f468970344c7c9f9d03b4da854fd7c54f21305059f53789d0045c1dd803f0018" +checksum = "e7f2a3e1df4685f18d12a943a9f2a7456305401af21a07c9fe076ef9ecd6e400" dependencies = [ "anchor-syn", - "anyhow", - "bs58 0.5.0", - "proc-macro2 1.0.63", - "quote 1.0.29", - "rustversion", + "bs58 0.5.1", + "proc-macro2", + "quote", "syn 1.0.109", ] [[package]] name = "anchor-attribute-constant" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59948e7f9ef8144c2aefb3f32a40c5fce2798baeec765ba038389e82301017ef" +checksum = "9423945cb55627f0b30903288e78baf6f62c6c8ab28fb344b6b25f1ffee3dca7" dependencies = [ "anchor-syn", - "proc-macro2 1.0.63", + "quote", "syn 1.0.109", ] [[package]] name = "anchor-attribute-error" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc753c9d1c7981cb8948cf7e162fb0f64558999c0413058e2d43df1df5448086" +checksum = "93ed12720033cc3c3bf3cfa293349c2275cd5ab99936e33dd4bf283aaad3e241" dependencies = [ "anchor-syn", - "proc-macro2 1.0.63", - "quote 1.0.29", + "quote", "syn 1.0.109", ] [[package]] name = "anchor-attribute-event" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f38b4e172ba1b52078f53fdc9f11e3dc0668ad27997838a0aad2d148afac8c97" +checksum = "eef4dc0371eba2d8c8b54794b0b0eb786a234a559b77593d6f80825b6d2c77a2" dependencies = [ "anchor-syn", - "anyhow", - "proc-macro2 1.0.63", - "quote 1.0.29", + "proc-macro2", + "quote", "syn 1.0.109", ] [[package]] name = "anchor-attribute-program" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eebd21543606ab61e2d83d9da37d24d3886a49f390f9c43a1964735e8c0f0d5" +checksum = "b18c4f191331e078d4a6a080954d1576241c29c56638783322a18d308ab27e4f" dependencies = [ "anchor-syn", - "anyhow", - "proc-macro2 1.0.63", - "quote 1.0.29", + "quote", "syn 1.0.109", ] [[package]] name = "anchor-client" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8434a6bf33efba0c93157f7fa2fafac658cb26ab75396886dcedd87c2a8ad445" +checksum = "cb48c4a7911038da546dc752655a29fa49f6bd50ebc1edca218bac8da1012acd" dependencies = [ "anchor-lang", "anyhow", @@ -206,33 +208,44 @@ dependencies = [ [[package]] name = "anchor-derive-accounts" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec4720d899b3686396cced9508f23dab420f1308344456ec78ef76f98fda42af" +checksum = "5de10d6e9620d3bcea56c56151cad83c5992f50d5960b3a9bebc4a50390ddc3c" dependencies = [ "anchor-syn", - "anyhow", - "proc-macro2 1.0.63", - "quote 1.0.29", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-derive-serde" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4e2e5be518ec6053d90a2a7f26843dbee607583c779e6c8395951b9739bdfbe" +dependencies = [ + "anchor-syn", + "borsh-derive-internal 0.10.3", + "proc-macro2", + "quote", "syn 1.0.109", ] [[package]] name = "anchor-derive-space" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f495e85480bd96ddeb77b71d499247c7d4e8b501e75ecb234e9ef7ae7bd6552a" +checksum = "1ecc31d19fa54840e74b7a979d44bcea49d70459de846088a1d71e87ba53c419" dependencies = [ - "proc-macro2 1.0.63", - "quote 1.0.29", + "proc-macro2", + "quote", "syn 1.0.109", ] [[package]] name = "anchor-lang" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d2d4b20100f1310a774aba3471ef268e5c4ba4d5c28c0bbe663c2658acbc414" +checksum = "35da4785497388af0553586d55ebdc08054a8b1724720ef2749d313494f2b8ad" dependencies = [ "anchor-attribute-access-control", "anchor-attribute-account", @@ -241,44 +254,47 @@ dependencies = [ "anchor-attribute-event", "anchor-attribute-program", "anchor-derive-accounts", + "anchor-derive-serde", "anchor-derive-space", "arrayref", "base64 0.13.1", "bincode", "borsh 0.10.3", "bytemuck", - "getrandom 0.2.10", + "getrandom 0.2.15", "solana-program", "thiserror", ] [[package]] name = "anchor-spl" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78f860599da1c2354e7234c768783049eb42e2f54509ecfc942d2e0076a2da7b" +checksum = "6c4fd6e43b2ca6220d2ef1641539e678bfc31b6cc393cf892b373b5997b6a39a" dependencies = [ "anchor-lang", + "mpl-token-metadata", "solana-program", "spl-associated-token-account", + "spl-memo", "spl-token", "spl-token-2022", ] [[package]] name = "anchor-syn" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a125e4b0cc046cfec58f5aa25038e34cf440151d58f0db3afc55308251fe936d" +checksum = "d9101b84702fed2ea57bd22992f75065da5648017135b844283a2f6d74f27825" dependencies = [ "anyhow", - "bs58 0.5.0", + "bs58 0.5.1", "heck 0.3.3", - "proc-macro2 1.0.63", - "quote 1.0.29", + "proc-macro2", + "quote", "serde", "serde_json", - "sha2 0.10.7", + "sha2 0.10.8", "syn 1.0.109", "thiserror", ] @@ -309,57 +325,58 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.4" +version = "0.6.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.4" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" [[package]] name = "anstyle-parse" -version = "0.2.2" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.1" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" dependencies = [ "anstyle", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "anyhow" -version = "1.0.71" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "ark-bn254" @@ -402,7 +419,7 @@ dependencies = [ "derivative", "digest 0.10.7", "itertools", - "num-bigint 0.4.3", + "num-bigint 0.4.6", "num-traits", "paste", "rustc_version", @@ -415,7 +432,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" dependencies = [ - "quote 1.0.29", + "quote", "syn 1.0.109", ] @@ -425,10 +442,10 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" dependencies = [ - "num-bigint 0.4.3", + "num-bigint 0.4.6", "num-traits", - "proc-macro2 1.0.63", - "quote 1.0.29", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -454,7 +471,7 @@ dependencies = [ "ark-serialize-derive", "ark-std", "digest 0.10.7", - "num-bigint 0.4.3", + "num-bigint 0.4.6", ] [[package]] @@ -463,8 +480,8 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" dependencies = [ - "proc-macro2 1.0.63", - "quote 1.0.29", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -478,23 +495,17 @@ dependencies = [ "rand 0.8.5", ] -[[package]] -name = "array-bytes" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ad284aeb45c13f2fb4f084de4a420ebf447423bdf9386c0540ce33cb3ef4b8c" - [[package]] name = "arrayref" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" +checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a" [[package]] name = "arrayvec" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "ascii" @@ -524,8 +535,8 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" dependencies = [ - "proc-macro2 1.0.63", - "quote 1.0.29", + "proc-macro2", + "quote", "syn 1.0.109", "synstructure", ] @@ -536,8 +547,8 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" dependencies = [ - "proc-macro2 1.0.63", - "quote 1.0.29", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -560,9 +571,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.3.15" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942c7cd7ae39e91bde4820d74132e9862e62c2f386c3aa90ccf55949f5bad63a" +checksum = "fec134f64e2bc57411226dfc4e52dec859ddfc7e711fc5e07b612584f000e4aa" dependencies = [ "brotli", "flate2", @@ -583,13 +594,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.74" +version = "0.1.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" +checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" dependencies = [ - "proc-macro2 1.0.63", - "quote 1.0.29", - "syn 2.0.23", + "proc-macro2", + "quote", + "syn 2.0.77", ] [[package]] @@ -605,9 +616,24 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "backtrace" +version = "0.3.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide 0.7.4", + "object", + "rustc-demangle", +] [[package]] name = "base64" @@ -623,9 +649,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.4" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64ct" @@ -643,25 +669,19 @@ dependencies = [ ] [[package]] -name = "bit-set" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.6.3" +name = "bitflags" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "1.3.2" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +dependencies = [ + "serde", +] [[package]] name = "bitmaps" @@ -686,9 +706,9 @@ dependencies = [ [[package]] name = "blake3" -version = "1.4.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "199c42ab6972d92c9f8995f086273d25c42fc0f7b2a1fcefba465c1352d25ba5" +checksum = "30cca6d3674597c30ddf2c587bf8d9d65c9a84d2326d941cc79c9842dfe0ef52" dependencies = [ "arrayref", "arrayvec", @@ -743,6 +763,16 @@ dependencies = [ "hashbrown 0.13.2", ] +[[package]] +name = "borsh" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6362ed55def622cddc70a4746a68554d7b687713770de539e59a739b249f8ed" +dependencies = [ + "borsh-derive 1.5.1", + "cfg_aliases", +] + [[package]] name = "borsh-derive" version = "0.9.3" @@ -752,7 +782,7 @@ dependencies = [ "borsh-derive-internal 0.9.3", "borsh-schema-derive-internal 0.9.3", "proc-macro-crate 0.1.5", - "proc-macro2 1.0.63", + "proc-macro2", "syn 1.0.109", ] @@ -765,18 +795,32 @@ dependencies = [ "borsh-derive-internal 0.10.3", "borsh-schema-derive-internal 0.10.3", "proc-macro-crate 0.1.5", - "proc-macro2 1.0.63", + "proc-macro2", "syn 1.0.109", ] +[[package]] +name = "borsh-derive" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3ef8005764f53cd4dca619f5bf64cafd4664dada50ece25e4d81de54c80cc0b" +dependencies = [ + "once_cell", + "proc-macro-crate 3.2.0", + "proc-macro2", + "quote", + "syn 2.0.77", + "syn_derive", +] + [[package]] name = "borsh-derive-internal" version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" dependencies = [ - "proc-macro2 1.0.63", - "quote 1.0.29", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -786,8 +830,8 @@ version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "afb438156919598d2c7bad7e1c0adf3d26ed3840dbc010db1a882a65583ca2fb" dependencies = [ - "proc-macro2 1.0.63", - "quote 1.0.29", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -797,8 +841,8 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" dependencies = [ - "proc-macro2 1.0.63", - "quote 1.0.29", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -808,16 +852,16 @@ version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "634205cc43f74a1b9046ef87c4540ebda95696ec0f315024860cad7c5b0f5ccd" dependencies = [ - "proc-macro2 1.0.63", - "quote 1.0.29", + "proc-macro2", + "quote", "syn 1.0.109", ] [[package]] name = "brotli" -version = "3.4.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "516074a47ef4bce09577a3b379392300159ce5b1ba2e501ff1c819950066100f" +checksum = "74f7971dbd9326d58187408ab83117d8ac1bb9c17b085fdacd1cf2f598719b6b" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -826,9 +870,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "2.5.1" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e2e4afe60d7dd600fdd3de8d0f08c2b7ec039712e3b6137ff98b7004e82de4f" +checksum = "9a45bd2e4095a8b518033b128020dd4a55aab1c0a381ba4404a472630f4bc362" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -842,18 +886,18 @@ checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" [[package]] name = "bs58" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" dependencies = [ "tinyvec", ] [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bv" @@ -867,9 +911,9 @@ dependencies = [ [[package]] name = "bytecheck" -version = "0.6.11" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6372023ac861f6e6dc89c8344a8f398fb42aaba2b5dbc649ca0c0e9dbcb627" +checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2" dependencies = [ "bytecheck_derive", "ptr_meta", @@ -878,67 +922,46 @@ dependencies = [ [[package]] name = "bytecheck_derive" -version = "0.6.11" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7ec4c6f261935ad534c0c22dbef2201b45918860eb1c574b972bd213a76af61" +checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" dependencies = [ - "proc-macro2 1.0.63", - "quote 1.0.29", + "proc-macro2", + "quote", "syn 1.0.109", ] [[package]] name = "bytemuck" -version = "1.13.1" +version = "1.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" +checksum = "773d90827bc3feecfb67fab12e24de0749aad83c74b9504ecde46237b5cd24e2" dependencies = [ "bytemuck_derive", ] [[package]] name = "bytemuck_derive" -version = "1.4.1" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdde5c9cd29ebd706ce1b35600920a33550e402fc998a2e53ad3b42c3c47a192" +checksum = "0cc8b54b395f2fcfbb3d90c47b01c7f444d94d05bdeb775811dec868ac3bbc26" dependencies = [ - "proc-macro2 1.0.63", - "quote 1.0.29", - "syn 2.0.23", + "proc-macro2", + "quote", + "syn 2.0.77", ] [[package]] name = "byteorder" -version = "1.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" - -[[package]] -name = "bytes" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" - -[[package]] -name = "bzip2" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" -dependencies = [ - "bzip2-sys", - "libc", -] +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] -name = "bzip2-sys" -version = "0.1.11+1.0.8" +name = "bytes" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" -dependencies = [ - "cc", - "libc", - "pkg-config", -] +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" [[package]] name = "caps" @@ -952,11 +975,13 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.79" +version = "1.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "57b6a275aa2903740dc87da01c62040406b8812552e97129a63ea8850a17c6e6" dependencies = [ "jobserver", + "libc", + "shlex", ] [[package]] @@ -965,11 +990,17 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "chrono" -version = "0.4.31" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", @@ -977,16 +1008,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.48.1", -] - -[[package]] -name = "chrono-humanize" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799627e6b4d27827a814e837b9d8a504832086081806d45b1afa34dc982b023b" -dependencies = [ - "chrono", + "windows-targets 0.52.6", ] [[package]] @@ -1006,7 +1028,7 @@ checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" dependencies = [ "ansi_term", "atty", - "bitflags", + "bitflags 1.3.2", "strsim 0.8.0", "textwrap 0.11.0", "unicode-width", @@ -1020,20 +1042,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" dependencies = [ "atty", - "bitflags", + "bitflags 1.3.2", "clap_lex 0.2.4", "indexmap 1.9.3", "once_cell", "strsim 0.10.0", "termcolor", - "textwrap 0.16.0", + "textwrap 0.16.1", ] [[package]] name = "clap" -version = "4.4.7" +version = "4.5.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac495e00dcec98c83465d5ad66c5c4fabd652fd6686e7c6269b117e729a6f17b" +checksum = "ed6719fffa43d0d87e5fd8caeab59be1554fb028cd30edc88fc4369b17971019" dependencies = [ "clap_builder", "clap_derive", @@ -1041,26 +1063,26 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.7" +version = "4.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c77ed9a32a62e6ca27175d00d29d05ca32e396ea1eb5fb01d8256b669cec7663" +checksum = "216aec2b177652e3846684cbfe25c9964d18ec45234f0f5da5157b207ed1aab6" dependencies = [ "anstream", "anstyle", - "clap_lex 0.6.0", - "strsim 0.10.0", + "clap_lex 0.7.2", + "strsim 0.11.1", ] [[package]] name = "clap_derive" -version = "4.4.7" +version = "4.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" +checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" dependencies = [ - "heck 0.4.1", - "proc-macro2 1.0.63", - "quote 1.0.29", - "syn 2.0.23", + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.77", ] [[package]] @@ -1074,9 +1096,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.6.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" [[package]] name = "cli" @@ -1087,23 +1109,22 @@ dependencies = [ "anchor-spl", "anyhow", "bincode", - "clap 4.4.7", + "clap 4.5.16", "commons", "lb_clmm", - "mpl-token-metadata", - "proptest", "rand 0.8.5", "rust_decimal", "shellexpand", "spl-associated-token-account", + "spl-transfer-hook-interface", "tokio", ] [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" [[package]] name = "combine" @@ -1131,24 +1152,24 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "2.3.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f057a694a54f12365049b0958a1685bb52d567f5593b355fbf685838e873d400" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" dependencies = [ "crossbeam-utils", ] [[package]] name = "console" -version = "0.15.7" +version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" dependencies = [ "encode_unicode", "lazy_static", "libc", "unicode-width", - "windows-sys 0.45.0", + "windows-sys 0.52.0", ] [[package]] @@ -1179,15 +1200,15 @@ checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" [[package]] name = "constant_time_eq" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" +checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" [[package]] name = "core-foundation" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -1195,70 +1216,61 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.9" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad" dependencies = [ "libc", ] [[package]] name = "crc32fast" -version = "1.3.2" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] [[package]] name = "crossbeam-channel" -version = "0.5.8" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" dependencies = [ - "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.15" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "autocfg", - "cfg-if", "crossbeam-utils", - "memoffset 0.9.0", - "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crunchy" @@ -1311,9 +1323,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.1" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0558d22a7b463ed0241e993f76f09f30b126687447751a8638587b864e4b3944" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ "darling_core", "darling_macro", @@ -1321,27 +1333,27 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.1" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab8bfa2e259f8ee1ce5e97824a3c55ec4404a0d772ca7fa96bf19f0752a046eb" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" dependencies = [ "fnv", "ident_case", - "proc-macro2 1.0.63", - "quote 1.0.29", - "strsim 0.10.0", - "syn 2.0.23", + "proc-macro2", + "quote", + "strsim 0.11.1", + "syn 2.0.77", ] [[package]] name = "darling_macro" -version = "0.20.1" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29a358ff9f12ec09c3e61fef9b5a9902623a695a46a917b07f269bff1445611a" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", - "quote 1.0.29", - "syn 2.0.23", + "quote", + "syn 2.0.77", ] [[package]] @@ -1352,14 +1364,13 @@ checksum = "e77a43b28d0668df09411cb0bc9a8c2adc40f9a048afe863e05fd43251e8e39c" dependencies = [ "cfg-if", "num_cpus", - "rayon", ] [[package]] name = "data-encoding" -version = "2.4.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" [[package]] name = "der" @@ -1379,16 +1390,19 @@ dependencies = [ "asn1-rs", "displaydoc", "nom", - "num-bigint 0.4.3", + "num-bigint 0.4.6", "num-traits", "rusticata-macros", ] [[package]] name = "deranged" -version = "0.3.9" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] [[package]] name = "derivation-path" @@ -1402,8 +1416,8 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ - "proc-macro2 1.0.63", - "quote 1.0.29", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -1439,15 +1453,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "dir-diff" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7ad16bf5f84253b50d6557681c58c3ab67c47c77d39fed9aeb56e947290bd10" -dependencies = [ - "walkdir", -] - [[package]] name = "dirs" version = "5.0.1" @@ -1471,36 +1476,36 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ - "proc-macro2 1.0.63", - "quote 1.0.29", - "syn 2.0.23", + "proc-macro2", + "quote", + "syn 2.0.77", ] [[package]] -name = "dlopen" -version = "0.1.8" +name = "dlopen2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71e80ad39f814a9abe68583cd50a2d45c8a67561c3361ab8da240587dda80937" +checksum = "09b4f5f101177ff01b8ec4ecc81eead416a8aa42819a2869311b3420fa114ffa" dependencies = [ - "dlopen_derive", - "lazy_static", + "dlopen2_derive", "libc", + "once_cell", "winapi", ] [[package]] -name = "dlopen_derive" -version = "0.1.4" +name = "dlopen2_derive" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f236d9e1b1fbd81cea0f9cbdc8dcc7e8ebcd80e6659cd7cb2ad5f6c05946c581" +checksum = "a6cbae11b3de8fce2a456e8ea3dada226b35fe791f0dc1d360c0941f0bb681f3" dependencies = [ - "libc", - "quote 0.6.13", - "syn 0.15.44", + "proc-macro2", + "quote", + "syn 2.0.77", ] [[package]] @@ -1541,26 +1546,14 @@ dependencies = [ "derivation-path", "ed25519-dalek", "hmac 0.12.1", - "sha2 0.10.7", -] - -[[package]] -name = "educe" -version = "0.4.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f0042ff8246a363dbe77d2ceedb073339e85a804b9a47636c6e016a9a32c05f" -dependencies = [ - "enum-ordinalize", - "proc-macro2 1.0.63", - "quote 1.0.29", - "syn 1.0.109", + "sha2 0.10.8", ] [[package]] name = "either" -version = "1.8.1" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "encode_unicode" @@ -1570,44 +1563,31 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "encoding_rs" -version = "0.8.33" +version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ "cfg-if", ] [[package]] name = "enum-iterator" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7add3873b5dd076766ee79c8e406ad1a472c385476b9e38849f8eec24f1be689" +checksum = "9fd242f399be1da0a5354aa462d57b4ab2b4ee0683cc552f7c007d2d12d36e94" dependencies = [ "enum-iterator-derive", ] [[package]] name = "enum-iterator-derive" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eecf8589574ce9b895052fa12d69af7a233f99e6107f5cb8dd1044f2a17bfdcb" -dependencies = [ - "proc-macro2 1.0.63", - "quote 1.0.29", - "syn 2.0.23", -] - -[[package]] -name = "enum-ordinalize" -version = "3.1.15" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bf1fa3f06bbff1ea5b1a9c7b14aa992a39657db60a2759457328d7e058f49ee" +checksum = "a1ab991c1362ac86c61ab6f556cff143daa22e5a15e4e189df818b2fd19fe65b" dependencies = [ - "num-bigint 0.4.3", - "num-traits", - "proc-macro2 1.0.63", - "quote 1.0.29", - "syn 2.0.23", + "proc-macro2", + "quote", + "syn 2.0.77", ] [[package]] @@ -1625,29 +1605,18 @@ dependencies = [ [[package]] name = "equivalent" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88bffebc5d80432c9b140ee17875ff173a8ab62faad5b257da912bd2f6c1c0a1" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[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" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ - "cc", "libc", + "windows-sys 0.52.0", ] [[package]] @@ -1658,12 +1627,9 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "fastrand" -version = "1.9.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "feature-probe" @@ -1671,26 +1637,14 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835a3dc7d1ec9e75e2b5fb4ba75396837112d2060b03f7d43bc1897c7f7211da" -[[package]] -name = "filetime" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", -] - [[package]] name = "flate2" -version = "1.0.28" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" dependencies = [ "crc32fast", - "miniz_oxide", + "miniz_oxide 0.8.0", ] [[package]] @@ -1701,9 +1655,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] @@ -1716,9 +1670,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -1731,9 +1685,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -1741,15 +1695,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -1758,38 +1712,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-macro" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ - "proc-macro2 1.0.63", - "quote 1.0.29", - "syn 2.0.23", + "proc-macro2", + "quote", + "syn 2.0.77", ] [[package]] name = "futures-sink" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-channel", "futures-core", @@ -1839,9 +1793,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "js-sys", @@ -1850,6 +1804,12 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "gimli" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" + [[package]] name = "goblin" version = "0.5.4" @@ -1863,9 +1823,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.21" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" dependencies = [ "bytes", "fnv", @@ -1873,10 +1833,10 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 1.9.3", + "indexmap 2.5.0", "slab", "tokio", - "tokio-util 0.7.2", + "tokio-util", "tracing", ] @@ -1895,7 +1855,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" dependencies = [ - "ahash 0.7.6", + "ahash 0.7.8", ] [[package]] @@ -1904,7 +1864,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash 0.7.6", + "ahash 0.7.8", ] [[package]] @@ -1913,14 +1873,14 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.3", + "ahash 0.8.6", ] [[package]] name = "hashbrown" -version = "0.14.0" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" [[package]] name = "heck" @@ -1933,9 +1893,9 @@ dependencies = [ [[package]] name = "heck" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" @@ -1948,9 +1908,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.2" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "histogram" @@ -1990,9 +1950,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.9" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ "bytes", "fnv", @@ -2001,9 +1961,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", "http", @@ -2012,9 +1972,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" [[package]] name = "httpdate" @@ -2030,9 +1990,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.27" +version = "0.14.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" dependencies = [ "bytes", "futures-channel", @@ -2054,22 +2014,23 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.23.2" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ + "futures-util", "http", "hyper", - "rustls 0.20.9", + "rustls", "tokio", "tokio-rustls", ] [[package]] name = "iana-time-zone" -version = "0.1.58" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -2096,9 +2057,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -2120,12 +2081,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "index_list" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70891286cb8e844fdfcf1178b47569699f9e20b5ecc4b45a6240a64771444638" - [[package]] name = "indexmap" version = "1.9.3" @@ -2138,19 +2093,19 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" dependencies = [ "equivalent", - "hashbrown 0.14.0", + "hashbrown 0.14.5", ] [[package]] name = "indicatif" -version = "0.17.7" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb28741c9db9a713d93deb3bb9515c20788cef5815265bee4980e87bde7e0f25" +checksum = "763a5a8f45087d6bcea4222e7b72c291a054edf80e4ef6efd2a4979878c7bea3" dependencies = [ "console", "instant", @@ -2161,30 +2116,25 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" 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.2", - "libc", - "windows-sys 0.48.0", -] - [[package]] name = "ipnet" version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + [[package]] name = "itertools" version = "0.10.5" @@ -2196,24 +2146,24 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.8" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b02a5381cc465bd3041d84623d0fa3b66738b52b8e2fc3bab8ad63ab032f4a" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jobserver" -version = "0.1.26" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" dependencies = [ "wasm-bindgen", ] @@ -2235,52 +2185,49 @@ dependencies = [ [[package]] name = "keccak" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" dependencies = [ "cpufeatures", ] [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "lb_clmm" -version = "0.8.0" +version = "0.9.0" dependencies = [ "anchor-lang", "anchor-spl", - "assert_matches", - "async-trait", "bytemuck", - "mpl-token-metadata", "num-integer", "num-traits", "num_enum 0.7.1", - "proptest", - "rand 0.7.3", "ruint", "solana-program", - "solana-program-test", - "solana-sdk", - "uint", + "spl-transfer-hook-interface", ] [[package]] name = "libc" -version = "0.2.147" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] -name = "libm" -version = "0.2.7" +name = "libredox" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.6.0", + "libc", +] [[package]] name = "libsecp256k1" @@ -2331,55 +2278,37 @@ dependencies = [ ] [[package]] -name = "linux-raw-sys" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" - -[[package]] -name = "lock_api" -version = "0.4.10" +name = "light-poseidon" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +checksum = "a5b439809cdfc0d86ecc7317f1724df13dfa665df48991b79e90e689411451f7" dependencies = [ - "autocfg", - "scopeguard", + "ark-bn254", + "ark-ff", + "thiserror", ] [[package]] -name = "log" -version = "0.4.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" - -[[package]] -name = "lru" -version = "0.7.8" +name = "linux-raw-sys" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999beba7b6e8345721bd280141ed958096a2e4abdf74f67ff4ce49b4b54e47a" -dependencies = [ - "hashbrown 0.12.3", -] +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] -name = "lz4" -version = "1.24.0" +name = "lock_api" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e9e2dd86df36ce760a60f6ff6ad526f7ba1f14ba0356f8254fb6905e6494df1" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ - "libc", - "lz4-sys", + "autocfg", + "scopeguard", ] [[package]] -name = "lz4-sys" -version = "1.9.4" +name = "log" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d27b317e207b10f69f5e75494119e391a96f48861ae870d1da6edac98ca900" -dependencies = [ - "cc", - "libc", -] +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "market_making" @@ -2389,9 +2318,8 @@ dependencies = [ "anchor-lang", "anchor-spl", "anyhow", - "bs58 0.5.0", - "chrono", - "clap 4.4.7", + "bs58 0.5.1", + "clap 4.5.16", "env_logger", "hyper", "lb_clmm", @@ -2399,18 +2327,16 @@ dependencies = [ "routerify", "serde", "serde_json", - "shellexpand", "solana-transaction-status", "spl-associated-token-account", "tokio", - "ureq", ] [[package]] name = "memchr" -version = "2.5.0" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memmap2" @@ -2432,9 +2358,9 @@ dependencies = [ [[package]] name = "memoffset" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" dependencies = [ "autocfg", ] @@ -2465,64 +2391,42 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", ] [[package]] -name = "mio" -version = "0.7.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" -dependencies = [ - "libc", - "log", - "miow", - "ntapi", - "winapi", -] - -[[package]] -name = "miow" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" -dependencies = [ - "winapi", -] - -[[package]] -name = "modular-bitfield" -version = "0.11.2" +name = "miniz_oxide" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a53d79ba8304ac1c4f9eb3b9d281f21f7be9d4626f72ce7df4ad8fbde4f38a74" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" dependencies = [ - "modular-bitfield-impl", - "static_assertions", + "adler2", ] [[package]] -name = "modular-bitfield-impl" -version = "0.11.2" +name = "mio" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a7d5f7076603ebc68de2dc6a650ec331a062a13abaa346975be747bbfa4b789" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ - "proc-macro2 1.0.63", - "quote 1.0.29", - "syn 1.0.109", + "hermit-abi 0.3.9", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.52.0", ] [[package]] name = "mpl-token-metadata" -version = "3.0.1" +version = "3.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "651388b8ccae4805f240ebd495172eb44ea10153e018623b628df7034e042a96" +checksum = "ba8ee05284d79b367ae8966d558e1a305a781fc80c9df51f37775169117ba64f" dependencies = [ "borsh 0.10.3", - "num-derive", + "num-derive 0.3.3", "num-traits", "solana-program", "thiserror", @@ -2534,7 +2438,7 @@ version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cfg-if", "libc", "memoffset 0.7.1", @@ -2551,15 +2455,6 @@ dependencies = [ "minimal-lexical", ] -[[package]] -name = "ntapi" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" -dependencies = [ - "winapi", -] - [[package]] name = "num" version = "0.2.1" @@ -2587,11 +2482,10 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.3" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ - "autocfg", "num-integer", "num-traits", ] @@ -2606,32 +2500,48 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "num-derive" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" dependencies = [ - "proc-macro2 1.0.63", - "quote 1.0.29", + "proc-macro2", + "quote", "syn 1.0.109", ] +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + [[package]] name = "num-integer" -version = "0.1.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "autocfg", "num-traits", ] [[package]] name = "num-iter" -version = "0.1.43" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" dependencies = [ "autocfg", "num-integer", @@ -2652,12 +2562,11 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.16" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", - "libm", ] [[package]] @@ -2666,19 +2575,10 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.2", + "hermit-abi 0.3.9", "libc", ] -[[package]] -name = "num_enum" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" -dependencies = [ - "num_enum_derive 0.5.11", -] - [[package]] name = "num_enum" version = "0.6.1" @@ -2697,18 +2597,6 @@ dependencies = [ "num_enum_derive 0.7.1", ] -[[package]] -name = "num_enum_derive" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" -dependencies = [ - "proc-macro-crate 1.3.1", - "proc-macro2 1.0.63", - "quote 1.0.29", - "syn 1.0.109", -] - [[package]] name = "num_enum_derive" version = "0.6.1" @@ -2716,9 +2604,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" dependencies = [ "proc-macro-crate 1.3.1", - "proc-macro2 1.0.63", - "quote 1.0.29", - "syn 2.0.23", + "proc-macro2", + "quote", + "syn 2.0.77", ] [[package]] @@ -2728,9 +2616,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c11e44798ad209ccdd91fc192f0526a369a01234f7373e1b141c96d7cee4f0e" dependencies = [ "proc-macro-crate 1.3.1", - "proc-macro2 1.0.63", - "quote 1.0.29", - "syn 2.0.23", + "proc-macro2", + "quote", + "syn 2.0.77", ] [[package]] @@ -2739,6 +2627,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" +[[package]] +name = "object" +version = "0.36.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" +dependencies = [ + "memchr", +] + [[package]] name = "oid-registry" version = "0.6.1" @@ -2750,15 +2647,15 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "opaque-debug" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "openssl-probe" @@ -2766,25 +2663,6 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" -[[package]] -name = "opentelemetry" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6105e89802af13fdf48c49d7646d3b533a70e536d818aae7e78ba0433d01acb8" -dependencies = [ - "async-trait", - "crossbeam-channel", - "futures-channel", - "futures-executor", - "futures-util", - "js-sys", - "lazy_static", - "percent-encoding", - "pin-project", - "rand 0.8.5", - "thiserror", -] - [[package]] name = "option-ext" version = "0.2.0" @@ -2797,82 +2675,34 @@ version = "6.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" -[[package]] -name = "ouroboros" -version = "0.15.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1358bd1558bd2a083fed428ffeda486fbfb323e698cdda7794259d592ca72db" -dependencies = [ - "aliasable", - "ouroboros_macro", -] - -[[package]] -name = "ouroboros_macro" -version = "0.15.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f7d21ccd03305a674437ee1248f3ab5d4b1db095cf1caf49f1713ddf61956b7" -dependencies = [ - "Inflector", - "proc-macro-error", - "proc-macro2 1.0.63", - "quote 1.0.29", - "syn 1.0.109", -] - -[[package]] -name = "parking_lot" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" -dependencies = [ - "instant", - "lock_api", - "parking_lot_core 0.8.6", -] - [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", - "parking_lot_core 0.9.8", -] - -[[package]] -name = "parking_lot_core" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" -dependencies = [ - "cfg-if", - "instant", - "libc", - "redox_syscall 0.2.16", - "smallvec", - "winapi", + "parking_lot_core", ] [[package]] name = "parking_lot_core" -version = "0.9.8" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.3.5", + "redox_syscall", "smallvec", - "windows-targets 0.48.1", + "windows-targets 0.52.6", ] [[package]] name = "paste" -version = "1.0.13" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4b27ab7be369122c218afc2079489cdcb4b517c0a3fc386ff11e1fedfcc2b35" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pbkdf2" @@ -2903,9 +2733,9 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "percentage" @@ -2916,31 +2746,11 @@ dependencies = [ "num", ] -[[package]] -name = "pin-project" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" -dependencies = [ - "proc-macro2 1.0.63", - "quote 1.0.29", - "syn 2.0.23", -] - [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -2961,9 +2771,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "plain" @@ -2985,15 +2795,24 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.5.1" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265" + +[[package]] +name = "powerfmt" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bccab0e7fd7cc19f820a1c8c91720af652d0c88dc9664dd72aef2614f04af3b" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] name = "proc-macro-crate" @@ -3011,7 +2830,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ "once_cell", - "toml_edit", + "toml_edit 0.19.15", +] + +[[package]] +name = "proc-macro-crate" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" +dependencies = [ + "toml_edit 0.22.20", ] [[package]] @@ -3021,9 +2849,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", - "proc-macro2 1.0.63", - "quote 1.0.29", - "syn 1.0.109", + "proc-macro2", + "quote", "version_check", ] @@ -3033,49 +2860,20 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "proc-macro2 1.0.63", - "quote 1.0.29", + "proc-macro2", + "quote", "version_check", ] [[package]] name = "proc-macro2" -version = "0.4.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" -dependencies = [ - "unicode-xid 0.1.0", -] - -[[package]] -name = "proc-macro2" -version = "1.0.63" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] -[[package]] -name = "proptest" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e35c06b98bf36aba164cc17cb25f7e232f5c4aeea73baa14b8a9f0d92dbfa65" -dependencies = [ - "bit-set", - "bitflags", - "byteorder", - "lazy_static", - "num-traits", - "rand 0.8.5", - "rand_chacha 0.3.1", - "rand_xorshift", - "regex-syntax 0.6.29", - "rusty-fork", - "tempfile", - "unarray", -] - [[package]] name = "ptr_meta" version = "0.1.4" @@ -3091,8 +2889,8 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" dependencies = [ - "proc-macro2 1.0.63", - "quote 1.0.29", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -3106,77 +2904,71 @@ dependencies = [ ] [[package]] -name = "quick-error" -version = "1.2.3" +name = "qualifier_attr" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" +checksum = "9e2e25ee72f5b24d773cae88422baddefff7714f97aab68d96fe2b6fc4a28fb2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] [[package]] name = "quinn" -version = "0.9.4" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e8b432585672228923edbbf64b8b12c14e1112f62e88737655b4a083dbcd78e" +checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75" dependencies = [ "bytes", "pin-project-lite", "quinn-proto", "quinn-udp", "rustc-hash", - "rustls 0.20.9", + "rustls", "thiserror", "tokio", "tracing", - "webpki", ] [[package]] name = "quinn-proto" -version = "0.9.6" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94b0b33c13a79f669c85defaf4c275dc86a0c0372807d0ca3d78e0bb87274863" +checksum = "141bf7dfde2fbc246bfd3fe12f2455aa24b0fbd9af535d8c86c7bd1381ff2b1a" dependencies = [ "bytes", "rand 0.8.5", "ring 0.16.20", "rustc-hash", - "rustls 0.20.9", + "rustls", "rustls-native-certs", "slab", "thiserror", "tinyvec", "tracing", - "webpki", ] [[package]] name = "quinn-udp" -version = "0.3.2" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "641538578b21f5e5c8ea733b736895576d0fe329bb883b937db6f4d163dbaaf4" +checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" dependencies = [ + "bytes", "libc", - "quinn-proto", "socket2", "tracing", - "windows-sys 0.42.0", -] - -[[package]] -name = "quote" -version = "0.6.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" -dependencies = [ - "proc-macro2 0.4.30", + "windows-sys 0.48.0", ] [[package]] name = "quote" -version = "1.0.29" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ - "proc-macro2 1.0.63", + "proc-macro2", ] [[package]] @@ -3244,7 +3036,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.10", + "getrandom 0.2.15", ] [[package]] @@ -3257,28 +3049,19 @@ dependencies = [ ] [[package]] -name = "rand_xorshift" -version = "0.3.0" +name = "rand_xoshiro" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" -dependencies = [ - "rand_core 0.6.4", -] - -[[package]] -name = "rand_xoshiro" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa" +checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa" dependencies = [ "rand_core 0.6.4", ] [[package]] name = "rayon" -version = "1.7.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ "either", "rayon-core", @@ -3286,14 +3069,12 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.11.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ - "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "num_cpus", ] [[package]] @@ -3310,94 +3091,70 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags", -] - -[[package]] -name = "redox_syscall" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" -dependencies = [ - "bitflags", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" dependencies = [ - "bitflags", + "bitflags 2.6.0", ] [[package]] name = "redox_users" -version = "0.4.3" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ - "getrandom 0.2.10", - "redox_syscall 0.2.16", + "getrandom 0.2.15", + "libredox", "thiserror", ] [[package]] name = "regex" -version = "1.9.0" +version = "1.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89089e897c013b3deb627116ae56a6955a72b8bed395c9526af31c9fe528b484" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ "aho-corasick", "memchr", "regex-automata", - "regex-syntax 0.7.3", + "regex-syntax", ] [[package]] name = "regex-automata" -version = "0.3.0" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa250384981ea14565685dea16a9ccc4d1c541a13f82b9c168572264d1df8c56" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.3", + "regex-syntax", ] [[package]] name = "regex-syntax" -version = "0.6.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - -[[package]] -name = "regex-syntax" -version = "0.7.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab07dc67230e4a4718e70fd5c20055a4334b121f1f9db8fe63ef39ce9b8c846" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "rend" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2571463863a6bd50c32f94402933f03457a3fbaf697a707c5be741e459f08fd" +checksum = "71fe3824f5629716b1589be05dacd749f6aa084c87e00e016714a8cdfccc997c" dependencies = [ "bytecheck", ] [[package]] name = "reqwest" -version = "0.11.17" +version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13293b639a097af28fc8a90f22add145a9c954e49d77da06263d58cf44d5fb91" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ "async-compression", - "base64 0.21.4", + "base64 0.21.7", "bytes", "encoding_rs", "futures-core", @@ -3414,20 +3171,22 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.20.9", + "rustls", "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", + "sync_wrapper", + "system-configuration", "tokio", "tokio-rustls", - "tokio-util 0.7.2", + "tokio-util", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots 0.22.6", + "webpki-roots 0.25.4", "winreg", ] @@ -3448,26 +3207,28 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.3" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9babe80d5c16becf6594aa32ad2be8fe08498e7ae60b77de8df700e67f191d7e" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", - "getrandom 0.2.10", + "cfg-if", + "getrandom 0.2.15", "libc", "spin 0.9.8", "untrusted 0.9.0", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "rkyv" -version = "0.7.42" +version = "0.7.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0200c8230b013893c0b2d6213d6ec64ed2b9be2e0e016682b7224ff82cff5c58" +checksum = "9008cd6385b9e161d8229e1f6549dd23c3d022f132a2ea37ac3a10ac4935779b" dependencies = [ "bitvec", "bytecheck", + "bytes", "hashbrown 0.12.3", "ptr_meta", "rend", @@ -3479,12 +3240,12 @@ dependencies = [ [[package]] name = "rkyv_derive" -version = "0.7.42" +version = "0.7.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2e06b915b5c230a17d7a736d1e2e63ee753c256a8614ef3f5147b13a4f5541d" +checksum = "503d1d27590a2b0a3a4ca4c94755aa2875657196ecbf401a42eff41d7de532c0" dependencies = [ - "proc-macro2 1.0.63", - "quote 1.0.29", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -3503,23 +3264,23 @@ dependencies = [ [[package]] name = "rpassword" -version = "7.2.0" +version = "7.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6678cf63ab3491898c0d021b493c94c9b221d91295294a2a5746eacbe5928322" +checksum = "80472be3c897911d0137b2d2b9055faf6eeac5b14e324073d83bc17b191d7e3f" dependencies = [ "libc", "rtoolbox", - "winapi", + "windows-sys 0.48.0", ] [[package]] name = "rtoolbox" -version = "0.0.1" +version = "0.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "034e22c514f5c0cb8a10ff341b9b048b5ceb21591f31c8f44c43b960f9b3524a" +checksum = "c247d24e63230cdb56463ae328478bd5eac8b8faa8c69461a77e8e323afac90e" dependencies = [ "libc", - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -3534,18 +3295,18 @@ dependencies = [ [[package]] name = "ruint-macro" -version = "1.1.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e666a5496a0b2186dbcd0ff6106e29e093c15591bde62c20d3842007c6978a09" +checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" [[package]] name = "rust_decimal" -version = "1.32.0" +version = "1.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c4216490d5a413bc6d10fa4742bd7d4955941d062c0ef873141d6b0e7b30fd" +checksum = "b082d80e3e3cc52b2ed634388d436fe1f4de6af5786cc2de9ba9737527bdf555" dependencies = [ "arrayvec", - "borsh 0.10.3", + "borsh 1.5.1", "bytes", "num-traits", "rand 0.8.5", @@ -3556,9 +3317,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" @@ -3566,17 +3327,11 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" -[[package]] -name = "rustc-hex" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" - [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ "semver", ] @@ -3592,38 +3347,25 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.23" +version = "0.38.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" +checksum = "a85d50532239da68e9addb745ba38ff4612a242c1c7ceea689c4bc7c2f43c36f" dependencies = [ - "bitflags", + "bitflags 2.6.0", "errno", - "io-lifetimes", "libc", "linux-raw-sys", - "windows-sys 0.48.0", -] - -[[package]] -name = "rustls" -version = "0.20.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" -dependencies = [ - "log", - "ring 0.16.20", - "sct", - "webpki", + "windows-sys 0.52.0", ] [[package]] name = "rustls" -version = "0.21.10" +version = "0.21.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", - "ring 0.17.3", + "ring 0.17.8", "rustls-webpki", "sct", ] @@ -3642,11 +3384,11 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "base64 0.21.4", + "base64 0.21.7", ] [[package]] @@ -3655,57 +3397,36 @@ version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.17.3", + "ring 0.17.8", "untrusted 0.9.0", ] [[package]] name = "rustversion" -version = "1.0.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc31bd9b61a32c31f9650d18add92aa83a49ba979c143eefd27fe7177b05bd5f" - -[[package]] -name = "rusty-fork" -version = "0.3.0" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" -dependencies = [ - "fnv", - "quick-error", - "tempfile", - "wait-timeout", -] +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "ryu" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe232bdf6be8c8de797b22184ee71118d63780ea42ac85b61d1baa6d3b782ae9" - -[[package]] -name = "same-file" -version = "1.0.6" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "schannel" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "scroll" @@ -3722,9 +3443,9 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1db149f81d46d2deba7cd3c50772474707729550221e69588478ebf9ada425ae" dependencies = [ - "proc-macro2 1.0.63", - "quote 1.0.29", - "syn 2.0.23", + "proc-macro2", + "quote", + "syn 2.0.77", ] [[package]] @@ -3733,7 +3454,7 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.17.3", + "ring 0.17.8", "untrusted 0.9.0", ] @@ -3745,11 +3466,11 @@ checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" [[package]] name = "security-framework" -version = "2.9.2" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags", + "bitflags 2.6.0", "core-foundation", "core-foundation-sys", "libc", @@ -3758,9 +3479,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.9.1" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" dependencies = [ "core-foundation-sys", "libc", @@ -3768,46 +3489,47 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.17" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.167" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7daf513456463b42aa1d94cff7e0c24d682b429f020b9afa4f5ba5c40a22b237" +checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" dependencies = [ "serde_derive", ] [[package]] name = "serde_bytes" -version = "0.11.11" +version = "0.11.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a16be4fe5320ade08736447e3198294a5ea9a6d44dde6f35f0a5e06859c427a" +checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" dependencies = [ "serde", ] [[package]] name = "serde_derive" -version = "1.0.167" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b69b106b68bc8054f0e974e70d19984040f8a5cf9215ca82626ea4853f82c4b9" +checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" dependencies = [ - "proc-macro2 1.0.63", - "quote 1.0.29", - "syn 2.0.23", + "proc-macro2", + "quote", + "syn 2.0.77", ] [[package]] name = "serde_json" -version = "1.0.100" +version = "1.0.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e14e89be7aa4c4b78bdbdc9eb5bf8517829a600ae8eaa39a6e1d960b5185c" +checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] @@ -3841,16 +3563,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" dependencies = [ "darling", - "proc-macro2 1.0.63", - "quote 1.0.29", - "syn 2.0.23", + "proc-macro2", + "quote", + "syn 2.0.77", ] [[package]] -name = "sha-1" -version = "0.10.1" +name = "sha1" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", "cpufeatures", @@ -3872,9 +3594,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.7" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", @@ -3903,15 +3625,6 @@ dependencies = [ "keccak", ] -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - [[package]] name = "shell-words" version = "1.1.0" @@ -3927,11 +3640,17 @@ dependencies = [ "dirs", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] @@ -3969,28 +3688,28 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.0" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.4.9" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "winapi", + "windows-sys 0.52.0", ] [[package]] name = "solana-account-decoder" -version = "1.16.15" +version = "1.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "850d5d9dc8fa6ea42f4e61c78e296bbbce5a3531ff4cb3c58ef36ee31781049c" +checksum = "8ec4cebccef07b65c46854b62237a29e7ccc92ef21ef1c90be346f9de0c4e7a4" dependencies = [ "Inflector", - "base64 0.21.4", + "base64 0.21.7", "bincode", "bs58 0.4.0", "bv", @@ -3998,129 +3717,24 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "solana-address-lookup-table-program", "solana-config-program", "solana-sdk", "spl-token", "spl-token-2022", + "spl-token-metadata-interface", "thiserror", "zstd", ] -[[package]] -name = "solana-address-lookup-table-program" -version = "1.16.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a7f867cde478a078d4c4ceb113f4f9ac7e29c2efea98f80a2b30cdcd7be83c5" -dependencies = [ - "bincode", - "bytemuck", - "log", - "num-derive", - "num-traits", - "rustc_version", - "serde", - "solana-frozen-abi", - "solana-frozen-abi-macro", - "solana-program", - "solana-program-runtime", - "solana-sdk", - "thiserror", -] - -[[package]] -name = "solana-banks-client" -version = "1.16.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a46f22d9f8a0b253165260f44c360dd6a2a49b2731f18cbfda818e3ae0ad9112" -dependencies = [ - "borsh 0.10.3", - "futures", - "solana-banks-interface", - "solana-program", - "solana-sdk", - "tarpc", - "thiserror", - "tokio", - "tokio-serde", -] - -[[package]] -name = "solana-banks-interface" -version = "1.16.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "068d206e9fb611684b61c95b7692d099a89b28e6e376fa0f17620198539de371" -dependencies = [ - "serde", - "solana-sdk", - "tarpc", -] - -[[package]] -name = "solana-banks-server" -version = "1.16.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e04de401b9177ef6016f24693b871e9f7c47b49a98e3ee1b794f2ae2cfa2438" -dependencies = [ - "bincode", - "crossbeam-channel", - "futures", - "solana-banks-interface", - "solana-client", - "solana-runtime", - "solana-sdk", - "solana-send-transaction-service", - "tarpc", - "tokio", - "tokio-serde", -] - -[[package]] -name = "solana-bpf-loader-program" -version = "1.16.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1eaf42dbfe8a42b80e24f2c087a3935d6e7bb49886313b006d88fb04fdc2a02f" -dependencies = [ - "bincode", - "byteorder", - "libsecp256k1", - "log", - "rand 0.7.3", - "solana-measure", - "solana-program-runtime", - "solana-sdk", - "solana-zk-token-sdk", - "solana_rbpf", - "thiserror", -] - -[[package]] -name = "solana-bucket-map" -version = "1.16.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e050e58ea0c422f9db10d987b2a10992f103209454f70d54f6208b14ec5546a0" -dependencies = [ - "bv", - "log", - "memmap2", - "modular-bitfield", - "num_enum 0.6.1", - "rand 0.7.3", - "solana-measure", - "solana-sdk", - "tempfile", -] - [[package]] name = "solana-clap-utils" -version = "1.16.15" +version = "1.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c99636da9a4acad58d0e8142e36395ece48fc41c396e297e702b6a789b190f" +checksum = "089f1edd0e325e5664f33b11df131ff47ed93cd74d75a2d434c8b7f9e976267a" dependencies = [ "chrono", "clap 2.34.0", "rpassword", - "solana-perf", "solana-remote-wallet", "solana-sdk", "thiserror", @@ -4131,19 +3745,19 @@ dependencies = [ [[package]] name = "solana-client" -version = "1.16.15" +version = "1.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acc7a437165d8fcfac3c63963e394f0ea497b5d2a75159bb3a1ed75dbeb36a7e" +checksum = "6d4eb6c673b6a8768ba687d620d02ec544d86525ce6d7e3858e9730463ed41b4" dependencies = [ "async-trait", "bincode", + "dashmap", "futures", "futures-util", - "indexmap 1.9.3", + "indexmap 2.5.0", "indicatif", "log", "quinn", - "rand 0.7.3", "rayon", "solana-connection-cache", "solana-measure", @@ -4162,21 +3776,11 @@ dependencies = [ "tokio", ] -[[package]] -name = "solana-compute-budget-program" -version = "1.16.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98c90fdaafdc41a4ba0a760af5491bd79f02d1d1eae6926b7796561681c843e4" -dependencies = [ - "solana-program-runtime", - "solana-sdk", -] - [[package]] name = "solana-config-program" -version = "1.16.15" +version = "1.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6f9f2201c7e526581511fa6525e281518be5cabaee82bd5b29fe4b78744148d" +checksum = "98d262cd78922735637ef0ccf179e43bc0acd430f9004cd7e987e95d04b44f47" dependencies = [ "bincode", "chrono", @@ -4188,16 +3792,17 @@ dependencies = [ [[package]] name = "solana-connection-cache" -version = "1.16.15" +version = "1.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ee52de352e10e53b252df0815d685a9c6f3e8d3baa0f65e214dfcd247db0e21" +checksum = "84f1aa4f1d78bdf5f76f4f351d05c0b861025c8b4e46503d8c2aa8d97a7139d4" dependencies = [ "async-trait", "bincode", + "crossbeam-channel", "futures-util", - "indexmap 1.9.3", + "indexmap 2.5.0", "log", - "rand 0.7.3", + "rand 0.8.5", "rayon", "rcgen", "solana-measure", @@ -4209,11 +3814,11 @@ dependencies = [ [[package]] name = "solana-frozen-abi" -version = "1.16.15" +version = "1.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "361cc834e5fbbe1a73f1d904fcb8ab052a665e5be6061bd1ba7ab478d7d17c9c" +checksum = "92dc68e28d42991c6579079f9be29e2e30fb20474cbcd7be1d97e052081c8050" dependencies = [ - "ahash 0.8.3", + "ahash 0.8.6", "blake3", "block-buffer 0.10.4", "bs58 0.4.0", @@ -4222,19 +3827,16 @@ dependencies = [ "cc", "either", "generic-array", - "getrandom 0.1.16", "im", "lazy_static", "log", "memmap2", - "once_cell", - "rand_core 0.6.4", "rustc_version", "serde", "serde_bytes", "serde_derive", "serde_json", - "sha2 0.10.7", + "sha2 0.10.8", "solana-frozen-abi-macro", "subtle", "thiserror", @@ -4242,35 +3844,21 @@ dependencies = [ [[package]] name = "solana-frozen-abi-macro" -version = "1.16.15" +version = "1.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "575d875dc050689f9f88c542e292e295e2f081d4e96e0df297981e45cbad8824" +checksum = "999084a6d587bc79a059eb4c34c2e1419913612bb6224bb95660567c0f12449d" dependencies = [ - "proc-macro2 1.0.63", - "quote 1.0.29", + "proc-macro2", + "quote", "rustc_version", - "syn 2.0.23", -] - -[[package]] -name = "solana-loader-v4-program" -version = "1.16.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4f1e56ce753307a1b169ad2ef3b9af024c93d4db6f6cd6659794c57635f32ff" -dependencies = [ - "log", - "rand 0.7.3", - "solana-measure", - "solana-program-runtime", - "solana-sdk", - "solana_rbpf", + "syn 2.0.77", ] [[package]] name = "solana-logger" -version = "1.16.15" +version = "1.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c00faf7aa6a3f47c542bd45d2d7f13af9a382d993e647976a676fe1b0eec4eb2" +checksum = "84a56a1696678acd5237565c3092354c923f84dc1fbcd9b824c91fbfefc10740" dependencies = [ "env_logger", "lazy_static", @@ -4279,9 +3867,9 @@ dependencies = [ [[package]] name = "solana-measure" -version = "1.16.15" +version = "1.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e19c6e1b35df3c212619a7995ae3576fa92ab15ecfc065899f21385cbe45c95" +checksum = "cad3ae58ed767c409a792b045b4580c96b658b1672f4389f4dca7ca6a124693c" dependencies = [ "log", "solana-sdk", @@ -4289,9 +3877,9 @@ dependencies = [ [[package]] name = "solana-metrics" -version = "1.16.15" +version = "1.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10e62760a5f87d836169eb3bb446bae174181db07d2c8016be36de49c04fd432" +checksum = "9b6764575759cf274c7579df7d3b8c45d4859706c9da4a1964110ab6e622c5e9" dependencies = [ "crossbeam-channel", "gethostname", @@ -4299,20 +3887,21 @@ dependencies = [ "log", "reqwest", "solana-sdk", + "thiserror", ] [[package]] name = "solana-net-utils" -version = "1.16.15" +version = "1.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308c4c36c634d418589cf1df121d143819feff81932de81640de3d64878934eb" +checksum = "8570303599bc8c05b66550b919344dfde14dc79b17fa0c1d743a9c6dd7bac040" dependencies = [ "bincode", "clap 3.2.25", "crossbeam-channel", "log", "nix", - "rand 0.7.3", + "rand 0.8.5", "serde", "serde_derive", "socket2", @@ -4325,25 +3914,27 @@ dependencies = [ [[package]] name = "solana-perf" -version = "1.16.15" +version = "1.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4d44a4998ba6d9b37e89399d9ce2812e84489dd4665df619fb23366e1c2ec1b" +checksum = "68c658d1eff3672cb97c3501b9838fe1afdcac65d456c3e74b4c46f5245c8b05" dependencies = [ - "ahash 0.8.3", + "ahash 0.8.6", "bincode", "bv", "caps", "curve25519-dalek", - "dlopen", - "dlopen_derive", + "dlopen2", "fnv", "lazy_static", "libc", "log", "nix", - "rand 0.7.3", + "rand 0.8.5", "rayon", + "rustc_version", "serde", + "solana-frozen-abi", + "solana-frozen-abi-macro", "solana-metrics", "solana-rayon-threadlimit", "solana-sdk", @@ -4352,18 +3943,17 @@ dependencies = [ [[package]] name = "solana-program" -version = "1.16.15" +version = "1.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9863ff5c6e828015bec331c26fb53e48352a264a9be682e7e078d2c3b3e93b46" +checksum = "5e9aa19fa728ed701584c398607f26c773ede20e1c38e4a6c3ae79ed56521374" dependencies = [ "ark-bn254", "ark-ec", "ark-ff", "ark-serialize", - "array-bytes", - "base64 0.21.4", + "base64 0.21.7", "bincode", - "bitflags", + "bitflags 2.6.0", "blake3", "borsh 0.10.3", "borsh 0.9.3", @@ -4374,27 +3964,27 @@ dependencies = [ "console_error_panic_hook", "console_log", "curve25519-dalek", - "getrandom 0.2.10", + "getrandom 0.2.15", "itertools", "js-sys", "lazy_static", "libc", "libsecp256k1", + "light-poseidon", "log", - "memoffset 0.9.0", - "num-bigint 0.4.3", - "num-derive", + "memoffset 0.9.1", + "num-bigint 0.4.6", + "num-derive 0.3.3", "num-traits", - "parking_lot 0.12.1", - "rand 0.7.3", - "rand_chacha 0.2.2", + "parking_lot", + "rand 0.8.5", "rustc_version", "rustversion", "serde", "serde_bytes", "serde_derive", "serde_json", - "sha2 0.10.7", + "sha2 0.10.8", "sha3 0.10.8", "solana-frozen-abi", "solana-frozen-abi-macro", @@ -4407,21 +3997,21 @@ dependencies = [ [[package]] name = "solana-program-runtime" -version = "1.16.15" +version = "1.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05813d4d2e141ab4449cf684cc5b05512dfaabb7251561c5bb1ccf1e4221b210" +checksum = "27f91b73c2c061b3e5f85345879a932460ff946ab363eb25166b751944e6f6dc" dependencies = [ - "base64 0.21.4", + "base64 0.21.7", "bincode", "eager", "enum-iterator", "itertools", "libc", "log", - "num-derive", + "num-derive 0.3.3", "num-traits", "percentage", - "rand 0.7.3", + "rand 0.8.5", "rustc_version", "serde", "solana-frozen-abi", @@ -4433,38 +4023,11 @@ dependencies = [ "thiserror", ] -[[package]] -name = "solana-program-test" -version = "1.16.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff9f8e67fdf7306ae8ff3bb546534ecf064e6ed38e0489fee3579fa1016bd645" -dependencies = [ - "assert_matches", - "async-trait", - "base64 0.21.4", - "bincode", - "chrono-humanize", - "crossbeam-channel", - "log", - "serde", - "solana-banks-client", - "solana-banks-interface", - "solana-banks-server", - "solana-bpf-loader-program", - "solana-logger", - "solana-program-runtime", - "solana-runtime", - "solana-sdk", - "solana-vote-program", - "thiserror", - "tokio", -] - [[package]] name = "solana-pubsub-client" -version = "1.16.15" +version = "1.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cd0753cdde1710f50d58bd40a45e58f5368a25dabff6b18ba635c3d6959a558" +checksum = "78b3939e4174d01c3bd9ef1385122de065e11fc6d660649388fae61effc2e0fa" dependencies = [ "crossbeam-channel", "futures-util", @@ -4487,9 +4050,9 @@ dependencies = [ [[package]] name = "solana-quic-client" -version = "1.16.15" +version = "1.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212d96abde446eaa903d16961cfd3a6e98dc0d680b9edd61c39938c61548d53e" +checksum = "fdd2ba399377ec18fe9bd45cb290bb92668df8adba1f884d4b6adab8e0c27ed5" dependencies = [ "async-mutex", "async-trait", @@ -4499,9 +4062,8 @@ dependencies = [ "log", "quinn", "quinn-proto", - "quinn-udp", "rcgen", - "rustls 0.20.9", + "rustls", "solana-connection-cache", "solana-measure", "solana-metrics", @@ -4515,9 +4077,9 @@ dependencies = [ [[package]] name = "solana-rayon-threadlimit" -version = "1.16.15" +version = "1.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82ab62fc62458271d746678a3f5625e1654e3cb42a8f318ef4f1ea25991bb085" +checksum = "ada8292386cdf61aff5f9d00670abeefa3310b391f1a50c760c34c1ea52ea1a1" dependencies = [ "lazy_static", "num_cpus", @@ -4525,16 +4087,16 @@ dependencies = [ [[package]] name = "solana-remote-wallet" -version = "1.16.15" +version = "1.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "863f10b8c2a893d1ec85b3ae8020c714512a67302b80c24dde0016eea4034a7c" +checksum = "ad77919e1081817f5b38b29ac74d93348aa653b5f987ee53d281fba206b7bd26" dependencies = [ "console", "dialoguer", "log", - "num-derive", + "num-derive 0.3.3", "num-traits", - "parking_lot 0.12.1", + "parking_lot", "qstring", "semver", "solana-sdk", @@ -4544,12 +4106,12 @@ dependencies = [ [[package]] name = "solana-rpc-client" -version = "1.16.15" +version = "1.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df04998cef2d0fe1291599b69acafc7f8cd87305d7f1525c8ae10aef1cc5411c" +checksum = "f681deb63fe05f365dddb4c3d2f596cf2cc54a81d6fb24746503c284b35266f8" dependencies = [ "async-trait", - "base64 0.21.4", + "base64 0.21.7", "bincode", "bs58 0.4.0", "indicatif", @@ -4570,11 +4132,11 @@ dependencies = [ [[package]] name = "solana-rpc-client-api" -version = "1.16.15" +version = "1.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e2912ddbff841fbce1e30b0b9a420993c63b6cc7866e5f0af3740fcd6d85bb8" +checksum = "be2823b1ffc18604c8f0ef6c6a4da24e4da6f420aea09f5afe57f6594044ebb8" dependencies = [ - "base64 0.21.4", + "base64 0.21.7", "bs58 0.4.0", "jsonrpc-core", "reqwest", @@ -4592,9 +4154,9 @@ dependencies = [ [[package]] name = "solana-rpc-client-nonce-utils" -version = "1.16.15" +version = "1.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d31100f6cc340dd322f57d00a334fa0a96f628ba86b04fcda1f84307deb14c31" +checksum = "fc934849ef622beff13951b9a49a350e9d9d30a80dfa5f98043b516a08dfe64a" dependencies = [ "clap 2.34.0", "solana-clap-utils", @@ -4604,86 +4166,17 @@ dependencies = [ ] [[package]] -name = "solana-runtime" -version = "1.16.15" +name = "solana-sdk" +version = "1.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebf6db318fd94457b1e69a481dcf43c6fd4f44e264b35f2489f0a1c6f7736e50" +checksum = "774c2379f8aaa8b5877029410dacd4e663d167cb93b09b2f3c2647c63df4f2eb" dependencies = [ - "arrayref", + "assert_matches", + "base64 0.21.7", "bincode", - "blake3", - "bv", - "bytemuck", - "byteorder", - "bzip2", - "crossbeam-channel", - "dashmap", - "dir-diff", - "flate2", - "fnv", - "im", - "index_list", - "itertools", - "lazy_static", - "log", - "lru", - "lz4", - "memmap2", - "modular-bitfield", - "num-derive", - "num-traits", - "num_cpus", - "num_enum 0.6.1", - "once_cell", - "ouroboros", - "percentage", - "rand 0.7.3", - "rayon", - "regex", - "rustc_version", - "serde", - "serde_derive", - "solana-address-lookup-table-program", - "solana-bpf-loader-program", - "solana-bucket-map", - "solana-compute-budget-program", - "solana-config-program", - "solana-frozen-abi", - "solana-frozen-abi-macro", - "solana-loader-v4-program", - "solana-measure", - "solana-metrics", - "solana-perf", - "solana-program-runtime", - "solana-rayon-threadlimit", - "solana-sdk", - "solana-stake-program", - "solana-system-program", - "solana-vote-program", - "solana-zk-token-proof-program", - "solana-zk-token-sdk", - "static_assertions", - "strum", - "strum_macros", - "symlink", - "tar", - "tempfile", - "thiserror", - "zstd", -] - -[[package]] -name = "solana-sdk" -version = "1.16.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "621e6973766420162541b26e7974783d32d5471571610da30c5bb0b6263046c9" -dependencies = [ - "assert_matches", - "base64 0.21.4", - "bincode", - "bitflags", - "borsh 0.10.3", - "bs58 0.4.0", + "bitflags 2.6.0", + "borsh 0.10.3", + "bs58 0.4.0", "bytemuck", "byteorder", "chrono", @@ -4699,13 +4192,14 @@ dependencies = [ "libsecp256k1", "log", "memmap2", - "num-derive", + "num-derive 0.3.3", "num-traits", "num_enum 0.6.1", "pbkdf2 0.11.0", "qstring", + "qualifier_attr", "rand 0.7.3", - "rand_chacha 0.2.2", + "rand 0.8.5", "rustc_version", "rustversion", "serde", @@ -4713,7 +4207,7 @@ dependencies = [ "serde_derive", "serde_json", "serde_with", - "sha2 0.10.7", + "sha2 0.10.8", "sha3 0.10.8", "solana-frozen-abi", "solana-frozen-abi-macro", @@ -4727,60 +4221,29 @@ dependencies = [ [[package]] name = "solana-sdk-macro" -version = "1.16.15" +version = "1.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd177a74fb3a0a362f1292c027d668eff609ac189f08b78158324587a0a4f8d1" +checksum = "015ca49e4cec213f034468b5d1fd2faea554be32e2144c90c409304121d781e6" dependencies = [ "bs58 0.4.0", - "proc-macro2 1.0.63", - "quote 1.0.29", + "proc-macro2", + "quote", "rustversion", - "syn 2.0.23", -] - -[[package]] -name = "solana-send-transaction-service" -version = "1.16.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f275f96dd61f421bda5c9cde7698d85348824f7fa2a8c4544ad24692ac50cd8" -dependencies = [ - "crossbeam-channel", - "log", - "solana-client", - "solana-measure", - "solana-metrics", - "solana-runtime", - "solana-sdk", - "solana-tpu-client", -] - -[[package]] -name = "solana-stake-program" -version = "1.16.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5421decf09671329c4786ed209acfe986bb51272f91e13e4744b13a69c800680" -dependencies = [ - "bincode", - "log", - "rustc_version", - "solana-config-program", - "solana-program-runtime", - "solana-sdk", - "solana-vote-program", + "syn 2.0.77", ] [[package]] name = "solana-streamer" -version = "1.16.15" +version = "1.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3942a60afb0282b07ef0f3c32078145ab7545cbed2cac98f1ec4b9f63016df62" +checksum = "af376501d990f281b9249c5072ceef73bd5fc10700e877b27c1737b14cf447a2" dependencies = [ "async-channel", "bytes", "crossbeam-channel", "futures-util", "histogram", - "indexmap 1.9.3", + "indexmap 2.5.0", "itertools", "libc", "log", @@ -4790,10 +4253,9 @@ dependencies = [ "pkcs8", "quinn", "quinn-proto", - "quinn-udp", - "rand 0.7.3", + "rand 0.8.5", "rcgen", - "rustls 0.20.9", + "rustls", "solana-metrics", "solana-perf", "solana-sdk", @@ -4802,25 +4264,11 @@ dependencies = [ "x509-parser", ] -[[package]] -name = "solana-system-program" -version = "1.16.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6101d189dc10a96388c695ca1d9f23f74f0fd96330f6adefafd7d6999a20ff6e" -dependencies = [ - "bincode", - "log", - "serde", - "serde_derive", - "solana-program-runtime", - "solana-sdk", -] - [[package]] name = "solana-thin-client" -version = "1.16.15" +version = "1.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d712aaf7701a4504521fc09f1743c647edf596e3852a64f6d66b2e5a822388f8" +checksum = "749ba2ec60049a0c855fd971757465b82f5b99962f0c106f3bf83db2e8265637" dependencies = [ "bincode", "log", @@ -4833,17 +4281,16 @@ dependencies = [ [[package]] name = "solana-tpu-client" -version = "1.16.15" +version = "1.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48cb32f7443f80cb45e244d514a706b030b5a71ef86b0436c1d39cbfff5491b4" +checksum = "8aa49abe807db6f2a4e6ff5e5ade1835940f1ee311bbb94bfd9d05abf959ea62" dependencies = [ "async-trait", "bincode", "futures-util", - "indexmap 1.9.3", + "indexmap 2.5.0", "indicatif", "log", - "rand 0.7.3", "rayon", "solana-connection-cache", "solana-measure", @@ -4858,14 +4305,14 @@ dependencies = [ [[package]] name = "solana-transaction-status" -version = "1.16.15" +version = "1.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8aed485ddb4268b4e4ec64012016cd54ba3a4142377a99706fc3ab7768eb2bea" +checksum = "884c541fae17c7cd3dd851f9e05a5adf3afd1b18122839fb4a3604feb4129386" dependencies = [ "Inflector", - "base64 0.21.4", + "base64 0.21.7", "bincode", - "borsh 0.9.3", + "borsh 0.10.3", "bs58 0.4.0", "lazy_static", "log", @@ -4873,7 +4320,6 @@ dependencies = [ "serde_derive", "serde_json", "solana-account-decoder", - "solana-address-lookup-table-program", "solana-sdk", "spl-associated-token-account", "spl-memo", @@ -4884,9 +4330,9 @@ dependencies = [ [[package]] name = "solana-udp-client" -version = "1.16.15" +version = "1.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c92798affef44c1ae2a694006209608044e99106b7945966d53586f5a95d9e2" +checksum = "dfa91410ff195d0b7a4e46f4cef9cf3699961ee02654fe0ca590c01958ca59fe" dependencies = [ "async-trait", "solana-connection-cache", @@ -4899,9 +4345,9 @@ dependencies = [ [[package]] name = "solana-version" -version = "1.16.15" +version = "1.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a80a20dfea2afed91761ab3fecc8f96b973a742dc7728f3e343711efe6e8e05f" +checksum = "45ced655d4e15fe1d52b4ecfb93c656dab933b2fd414a6879981e0ab1c854010" dependencies = [ "log", "rustc_version", @@ -4915,13 +4361,13 @@ dependencies = [ [[package]] name = "solana-vote-program" -version = "1.16.15" +version = "1.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab8b719e077cc9e42b8965dd06ff6b5f09fa2a436f2297efdcf471c05d187a6c" +checksum = "aa36601af633b2854b2e38ceb7604f50f7e5739a150d57865ebb6e586ed142f6" dependencies = [ "bincode", "log", - "num-derive", + "num-derive 0.3.3", "num-traits", "rustc_version", "serde", @@ -4935,29 +4381,14 @@ dependencies = [ "thiserror", ] -[[package]] -name = "solana-zk-token-proof-program" -version = "1.16.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5404829f9236ac760a943a4e2f16be6f180ce4a07e1bbb9d538dcfa62b98888c" -dependencies = [ - "bytemuck", - "getrandom 0.1.16", - "num-derive", - "num-traits", - "solana-program-runtime", - "solana-sdk", - "solana-zk-token-sdk", -] - [[package]] name = "solana-zk-token-sdk" -version = "1.16.15" +version = "1.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61aabdec9fe1b311dce5d21fa5bd58fbaa985e8003e0d0aedf3795113aacc1ea" +checksum = "40f5be2f291d3a1692fc878dc98a841032df7672ba0878bbef43677e705b19cd" dependencies = [ "aes-gcm-siv", - "base64 0.21.4", + "base64 0.21.7", "bincode", "bytemuck", "byteorder", @@ -4966,7 +4397,7 @@ dependencies = [ "itertools", "lazy_static", "merlin", - "num-derive", + "num-derive 0.3.3", "num-traits", "rand 0.7.3", "serde", @@ -4981,9 +4412,9 @@ dependencies = [ [[package]] name = "solana_rbpf" -version = "0.6.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17d4ba1e58947346e360fabde0697029d36ba83c42f669199b16a8931313cf29" +checksum = "103318aa365ff7caa8cf534f2246b5eb7e5b34668736d52b1266b143f7a21196" dependencies = [ "byteorder", "combine", @@ -5022,13 +4453,13 @@ dependencies = [ [[package]] name = "spl-associated-token-account" -version = "1.1.3" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978dba3bcbe88d0c2c58366c254d9ea41c5f73357e72fc0bdee4d6b5fc99c8f4" +checksum = "385e31c29981488f2820b2022d8e731aae3b02e6e18e2fd854e4c9a94dc44fc3" dependencies = [ "assert_matches", - "borsh 0.9.3", - "num-derive", + "borsh 0.10.3", + "num-derive 0.4.2", "num-traits", "solana-program", "spl-token", @@ -5036,53 +4467,181 @@ dependencies = [ "thiserror", ] +[[package]] +name = "spl-discriminator" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cce5d563b58ef1bb2cdbbfe0dfb9ffdc24903b10ae6a4df2d8f425ece375033f" +dependencies = [ + "bytemuck", + "solana-program", + "spl-discriminator-derive", +] + +[[package]] +name = "spl-discriminator-derive" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07fd7858fc4ff8fb0e34090e41d7eb06a823e1057945c26d480bfc21d2338a93" +dependencies = [ + "quote", + "spl-discriminator-syn", + "syn 2.0.77", +] + +[[package]] +name = "spl-discriminator-syn" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18fea7be851bd98d10721782ea958097c03a0c2a07d8d4997041d0ece6319a63" +dependencies = [ + "proc-macro2", + "quote", + "sha2 0.10.8", + "syn 2.0.77", + "thiserror", +] + [[package]] name = "spl-memo" -version = "3.0.1" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f180b03318c3dbab3ef4e1e4d46d5211ae3c780940dd0a28695aba4b59a75a" +dependencies = [ + "solana-program", +] + +[[package]] +name = "spl-pod" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2881dddfca792737c0706fa0175345ab282b1b0879c7d877bad129645737c079" +dependencies = [ + "borsh 0.10.3", + "bytemuck", + "solana-program", + "solana-zk-token-sdk", + "spl-program-error", +] + +[[package]] +name = "spl-program-error" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd0dc6f70db6bacea7ff25870b016a65ba1d1b6013536f08e4fd79a8f9005325" +checksum = "249e0318493b6bcf27ae9902600566c689b7dfba9f1bdff5893e92253374e78c" dependencies = [ + "num-derive 0.4.2", + "num-traits", "solana-program", + "spl-program-error-derive", + "thiserror", +] + +[[package]] +name = "spl-program-error-derive" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1845dfe71fd68f70382232742e758557afe973ae19e6c06807b2c30f5d5cb474" +dependencies = [ + "proc-macro2", + "quote", + "sha2 0.10.8", + "syn 2.0.77", +] + +[[package]] +name = "spl-tlv-account-resolution" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "062e148d3eab7b165582757453632ffeef490c02c86a48bfdb4988f63eefb3b9" +dependencies = [ + "bytemuck", + "solana-program", + "spl-discriminator", + "spl-pod", + "spl-program-error", + "spl-type-length-value", ] [[package]] name = "spl-token" -version = "3.5.0" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e85e168a785e82564160dcb87b2a8e04cee9bfd1f4d488c729d53d6a4bd300d" +checksum = "08459ba1b8f7c1020b4582c4edf0f5c7511a5e099a7a97570c9698d4f2337060" dependencies = [ "arrayref", "bytemuck", - "num-derive", + "num-derive 0.3.3", "num-traits", - "num_enum 0.5.11", + "num_enum 0.6.1", "solana-program", "thiserror", ] [[package]] name = "spl-token-2022" -version = "0.6.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0043b590232c400bad5ee9eb983ced003d15163c4c5d56b090ac6d9a57457b47" +checksum = "e4abf34a65ba420584a0c35f3903f8d727d1f13ababbdc3f714c6b065a686e86" dependencies = [ "arrayref", "bytemuck", - "num-derive", + "num-derive 0.4.2", "num-traits", - "num_enum 0.5.11", + "num_enum 0.7.1", "solana-program", "solana-zk-token-sdk", "spl-memo", + "spl-pod", "spl-token", + "spl-token-metadata-interface", + "spl-transfer-hook-interface", + "spl-type-length-value", "thiserror", ] [[package]] -name = "static_assertions" -version = "1.1.0" +name = "spl-token-metadata-interface" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c16ce3ba6979645fb7627aa1e435576172dd63088dc7848cb09aa331fa1fe4f" +dependencies = [ + "borsh 0.10.3", + "solana-program", + "spl-discriminator", + "spl-pod", + "spl-program-error", + "spl-type-length-value", +] + +[[package]] +name = "spl-transfer-hook-interface" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "051d31803f873cabe71aec3c1b849f35248beae5d19a347d93a5c9cccc5d5a9b" +dependencies = [ + "arrayref", + "bytemuck", + "solana-program", + "spl-discriminator", + "spl-pod", + "spl-program-error", + "spl-tlv-account-resolution", + "spl-type-length-value", +] + +[[package]] +name = "spl-type-length-value" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +checksum = "a468e6f6371f9c69aae760186ea9f1a01c2908351b06a5e0026d21cfc4d7ecac" +dependencies = [ + "bytemuck", + "solana-program", + "spl-discriminator", + "spl-pod", + "spl-program-error", +] [[package]] name = "strsim" @@ -5097,26 +4656,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] -name = "strum" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" -dependencies = [ - "strum_macros", -] - -[[package]] -name = "strum_macros" -version = "0.24.3" +name = "strsim" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" -dependencies = [ - "heck 0.4.1", - "proc-macro2 1.0.63", - "quote 1.0.29", - "rustversion", - "syn 1.0.109", -] +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "subtle" @@ -5124,128 +4667,103 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" -[[package]] -name = "symlink" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7973cce6668464ea31f176d85b13c7ab3bba2cb3b77a2ed26abd7801688010a" - [[package]] name = "syn" -version = "0.15.44" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "unicode-xid 0.1.0", + "proc-macro2", + "quote", + "unicode-ident", ] [[package]] name = "syn" -version = "1.0.109" +version = "2.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" dependencies = [ - "proc-macro2 1.0.63", - "quote 1.0.29", + "proc-macro2", + "quote", "unicode-ident", ] [[package]] -name = "syn" -version = "2.0.23" +name = "syn_derive" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59fb7d6d8281a51045d62b8eb3a7d1ce347b76f312af50cd3dc0af39c87c1737" +checksum = "1329189c02ff984e9736652b1631330da25eaa6bc639089ed4915d25446cbe7b" dependencies = [ - "proc-macro2 1.0.63", - "quote 1.0.29", - "unicode-ident", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.77", ] +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + [[package]] name = "synstructure" version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ - "proc-macro2 1.0.63", - "quote 1.0.29", + "proc-macro2", + "quote", "syn 1.0.109", - "unicode-xid 0.2.4", + "unicode-xid", ] [[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - -[[package]] -name = "tar" -version = "0.4.40" +name = "system-configuration" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ - "filetime", - "libc", - "xattr", + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", ] [[package]] -name = "tarpc" -version = "0.29.0" +name = "system-configuration-sys" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c38a012bed6fb9681d3bf71ffaa4f88f3b4b9ed3198cda6e4c8462d24d4bb80" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" dependencies = [ - "anyhow", - "fnv", - "futures", - "humantime", - "opentelemetry", - "pin-project", - "rand 0.8.5", - "serde", - "static_assertions", - "tarpc-plugins", - "thiserror", - "tokio", - "tokio-serde", - "tokio-util 0.6.10", - "tracing", - "tracing-opentelemetry", + "core-foundation-sys", + "libc", ] [[package]] -name = "tarpc-plugins" -version = "0.12.0" +name = "tap" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee42b4e559f17bce0385ebf511a7beb67d5cc33c12c96b7f4e9789919d9c10f" -dependencies = [ - "proc-macro2 1.0.63", - "quote 1.0.29", - "syn 1.0.109", -] +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.6.0" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" +checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" dependencies = [ - "autocfg", "cfg-if", "fastrand", - "redox_syscall 0.3.5", + "once_cell", "rustix", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] name = "termcolor" -version = "1.1.3" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ "winapi-util", ] @@ -5261,48 +4779,40 @@ dependencies = [ [[package]] name = "textwrap" -version = "0.16.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" +checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" [[package]] name = "thiserror" -version = "1.0.43" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a35fc5b8971143ca348fa6df4f024d4d55264f3468c71ad1c2f365b0a4d58c42" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "463fe12d7993d3b327787537ce8dd4dfa058de32fc2b195ef3cde03dc4771e8f" -dependencies = [ - "proc-macro2 1.0.63", - "quote 1.0.29", - "syn 2.0.23", -] - -[[package]] -name = "thread_local" -version = "1.1.7" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ - "cfg-if", - "once_cell", + "proc-macro2", + "quote", + "syn 2.0.77", ] [[package]] name = "time" -version = "0.3.26" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a79d09ac6b08c1ab3906a2f7cc2e81a0e27c7ae89c63812df75e52bef0751e07" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", + "num-conv", + "powerfmt", "serde", "time-core", "time-macros", @@ -5310,16 +4820,17 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.12" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75c65469ed6b3a4809d987a41eb1dc918e9bc1d92211cbad7ae82931846f7451" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ + "num-conv", "time-core", ] @@ -5344,9 +4855,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] @@ -5359,67 +4870,48 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.14.1" +version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9d0183f6f6001549ab68f8c7585093bb732beefbcf6d23a10b9b95c73a1dd49" +checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" dependencies = [ - "autocfg", + "backtrace", "bytes", "libc", - "memchr", "mio", - "num_cpus", - "once_cell", - "parking_lot 0.11.2", + "parking_lot", "pin-project-lite", "signal-hook-registry", + "socket2", "tokio-macros", - "winapi", + "windows-sys 0.52.0", ] [[package]] name = "tokio-macros" -version = "1.8.2" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ - "proc-macro2 1.0.63", - "quote 1.0.29", - "syn 1.0.109", + "proc-macro2", + "quote", + "syn 2.0.77", ] [[package]] name = "tokio-rustls" -version = "0.23.4" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.20.9", + "rustls", "tokio", - "webpki", -] - -[[package]] -name = "tokio-serde" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "911a61637386b789af998ee23f50aa30d5fd7edcec8d6d3dedae5e5815205466" -dependencies = [ - "bincode", - "bytes", - "educe", - "futures-core", - "futures-sink", - "pin-project", - "serde", - "serde_json", ] [[package]] name = "tokio-stream" -version = "0.1.12" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb52b74f05dbf495a8fba459fdc331812b96aa086d9eb78101fa0d4569c3313" +checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" dependencies = [ "futures-core", "pin-project-lite", @@ -5428,47 +4920,30 @@ dependencies = [ [[package]] name = "tokio-tungstenite" -version = "0.17.2" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f714dd15bead90401d77e04243611caec13726c2408afd5b31901dfcdcb3b181" +checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" dependencies = [ "futures-util", "log", - "rustls 0.20.9", + "rustls", "tokio", "tokio-rustls", "tungstenite", - "webpki", - "webpki-roots 0.22.6", -] - -[[package]] -name = "tokio-util" -version = "0.6.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "log", - "pin-project-lite", - "slab", - "tokio", + "webpki-roots 0.25.4", ] [[package]] name = "tokio-util" -version = "0.7.2" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f988a1a1adc2fb21f9c12aa96441da33a1728193ae0b95d2be22dbd17fcb4e5c" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", - "tracing", ] [[package]] @@ -5482,26 +4957,37 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.3" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" [[package]] name = "toml_edit" -version = "0.19.12" +version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c500344a19072298cd05a7224b3c0c629348b78692bf48466c5238656e315a78" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.5.0", "toml_datetime", - "winnow", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.22.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" +dependencies = [ + "indexmap 2.5.0", + "toml_datetime", + "winnow 0.6.18", ] [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -5521,9 +5007,9 @@ version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ - "proc-macro2 1.0.63", - "quote 1.0.29", - "syn 2.0.23", + "proc-macro2", + "quote", + "syn 2.0.77", ] [[package]] @@ -5533,129 +5019,79 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", - "valuable", -] - -[[package]] -name = "tracing-opentelemetry" -version = "0.17.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbbe89715c1dbbb790059e2565353978564924ee85017b5fff365c872ff6721f" -dependencies = [ - "once_cell", - "opentelemetry", - "tracing", - "tracing-core", - "tracing-subscriber", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" -dependencies = [ - "sharded-slab", - "thread_local", - "tracing-core", ] [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tungstenite" -version = "0.17.3" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e27992fd6a8c29ee7eef28fc78349aa244134e10ad447ce3b9f0ac0ed0fa4ce0" +checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" dependencies = [ - "base64 0.13.1", "byteorder", "bytes", + "data-encoding", "http", "httparse", "log", "rand 0.8.5", - "rustls 0.20.9", - "sha-1", + "rustls", + "sha1", "thiserror", "url", "utf-8", - "webpki", - "webpki-roots 0.22.6", + "webpki-roots 0.24.0", ] [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" - -[[package]] -name = "uint" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9db035e67dfaf7edd9aebfe8676afcd63eed53c8a4044fed514c8cccf1835177" -dependencies = [ - "byteorder", - "crunchy", - "rustc-hex", - "static_assertions", -] - -[[package]] -name = "unarray" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" -version = "1.0.10" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22049a19f4a68748a168c0fc439f9516686aa045927ff767eca0a85101fb6e73" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] [[package]] name = "unicode-segmentation" -version = "1.10.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-width" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" - -[[package]] -name = "unicode-xid" -version = "0.1.0" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "unicode-xid" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +checksum = "229730647fbc343e3a80e463c1db7f78f3855d3f3739bee0dda773c9a037c90a" [[package]] name = "universal-hash" @@ -5688,24 +5124,6 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" -[[package]] -name = "ureq" -version = "2.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cdd25c339e200129fe4de81451814e5228c9b771d57378817d6117cc2b3f97" -dependencies = [ - "base64 0.21.4", - "flate2", - "log", - "once_cell", - "rustls 0.21.10", - "rustls-webpki", - "serde", - "serde_json", - "url", - "webpki-roots 0.25.3", -] - [[package]] name = "uriparse" version = "0.6.4" @@ -5718,9 +5136,9 @@ dependencies = [ [[package]] name = "url" -version = "2.4.1" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", @@ -5735,21 +5153,15 @@ checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ad59a7560b41a70d191093a945f0b87bc1deeda46fb237479708a1d6b6cdfc" - -[[package]] -name = "valuable" -version = "0.1.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" [[package]] name = "vec_map" @@ -5759,9 +5171,9 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "void" @@ -5769,25 +5181,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" -[[package]] -name = "wait-timeout" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" -dependencies = [ - "libc", -] - -[[package]] -name = "walkdir" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" -dependencies = [ - "same-file", - "winapi-util", -] - [[package]] name = "want" version = "0.3.1" @@ -5811,34 +5204,35 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" dependencies = [ "bumpalo", "log", "once_cell", - "proc-macro2 1.0.63", - "quote 1.0.29", - "syn 2.0.23", + "proc-macro2", + "quote", + "syn 2.0.77", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.37" +version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" dependencies = [ "cfg-if", "js-sys", @@ -5848,67 +5242,57 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" dependencies = [ - "quote 1.0.29", + "quote", "wasm-bindgen-macro-support", ] [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ - "proc-macro2 1.0.63", - "quote 1.0.29", - "syn 2.0.23", + "proc-macro2", + "quote", + "syn 2.0.77", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" dependencies = [ "js-sys", "wasm-bindgen", ] -[[package]] -name = "webpki" -version = "0.22.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" -dependencies = [ - "ring 0.17.3", - "untrusted 0.9.0", -] - [[package]] name = "webpki-roots" -version = "0.22.6" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" +checksum = "b291546d5d9d1eab74f069c77749f2cb8504a12caa20f0f2de93ddbf6f411888" dependencies = [ - "webpki", + "rustls-webpki", ] [[package]] name = "webpki-roots" -version = "0.25.3" +version = "0.25.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "winapi" @@ -5928,11 +5312,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "winapi", + "windows-sys 0.59.0", ] [[package]] @@ -5943,35 +5327,11 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-core" -version = "0.50.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af6041b3f84485c21b57acdc0fee4f4f0c93f426053dc05fa5d6fc262537bbff" -dependencies = [ - "windows-targets 0.48.1", -] - -[[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", -] - -[[package]] -name = "windows-sys" -version = "0.45.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.42.2", + "windows-targets 0.52.6", ] [[package]] @@ -5980,7 +5340,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.1", + "windows-targets 0.48.5", ] [[package]] @@ -5989,196 +5349,165 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.6", ] [[package]] -name = "windows-targets" -version = "0.42.2" +name = "windows-sys" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" 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.52.6", ] [[package]] name = "windows-targets" -version = "0.48.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" - -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] -name = "windows_i686_msvc" -version = "0.42.2" +name = "windows_i686_gnullvm" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] -name = "windows_x86_64_msvc" -version = "0.52.0" +name = "winnow" +version = "0.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] [[package]] name = "winnow" -version = "0.4.8" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9482fe6ceabdf32f3966bfdd350ba69256a97c30253dc616fe0005af24f164e" +checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" dependencies = [ "memchr", ] [[package]] name = "winreg" -version = "0.10.1" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "winapi", + "cfg-if", + "windows-sys 0.48.0", ] [[package]] @@ -6209,21 +5538,33 @@ dependencies = [ ] [[package]] -name = "xattr" -version = "1.1.1" +name = "yasna" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc6ab6ec1907d1a901cdbcd2bd4cb9e7d64ce5c9739cbb97d3c391acd8c7fae" +checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" dependencies = [ - "libc", + "time", ] [[package]] -name = "yasna" -version = "0.5.2" +name = "zerocopy" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "time", + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", ] [[package]] @@ -6241,9 +5582,9 @@ version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ - "proc-macro2 1.0.63", - "quote 1.0.29", - "syn 2.0.23", + "proc-macro2", + "quote", + "syn 2.0.77", ] [[package]] @@ -6267,9 +5608,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.9+zstd.1.5.5" +version = "2.0.13+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" +checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" dependencies = [ "cc", "pkg-config", diff --git a/Cargo.toml b/Cargo.toml index 03c24bc0..a3fbb7cf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,27 +2,25 @@ members = ["programs/*", "cli", "market_making", "commons"] [workspace.dependencies] -anchor-lang = "0.28.0" -anchor-spl = "0.28.0" -anchor-client = "0.28.0" +anchor-lang = "0.29.0" +anchor-spl = "0.29.0" +anchor-client = "0.29.0" clap = "4.3.3" anyhow = "1.0.71" shellexpand = "3.1.0" rust_decimal = "1.31.0" -spl-associated-token-account = "1" -mpl-token-metadata = "3.0.1" rand = "0.8.5" -tokio = "~1.14.1" +tokio = "1.20.0" serde_json = "1.0.48" serde = "1.0.104" -solana-transaction-status = "1.16.12" +solana-transaction-status = "=1.17.3" +spl-associated-token-account = "2.2.0" +spl-transfer-hook-interface = "0.3.0" env_logger = "0.9.0" log = "0.4.17" bs58 = "0.5.0" -chrono = "0.4.31" hyper = "0.14.17" routerify = "3" -ureq = "2.0.0" bincode = "1.3.3" commons = { path = "./commons" } diff --git a/artifacts/lb_clmm.so b/artifacts/lb_clmm.so index 0c123d1f..b42e249f 100755 Binary files a/artifacts/lb_clmm.so and b/artifacts/lb_clmm.so differ diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 039615a3..ddf45a63 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -10,18 +10,15 @@ authors = ["tian "] [dependencies] commons = { workspace = true } anchor-lang = { workspace = true } -anchor-spl = { workspace = true } +anchor-spl = { workspace = true, features = ["metadata"] } anchor-client = { workspace = true, features = ["async"] } clap = { workspace = true, features = ["derive"] } anyhow = { workspace = true } shellexpand = { workspace = true } rust_decimal = { workspace = true, features = ["maths"] } lb_clmm = { path = "../programs/lb_clmm", features = ["cpi"] } -spl-associated-token-account = { workspace = true } -mpl-token-metadata = { workspace = true } rand = { workspace = true } tokio = { workspace = true, features = ["full", "parking_lot"] } bincode = { workspace = true } - -[dev-dependencies] -proptest = "1.2.0" +spl-associated-token-account = { workspace = true } +spl-transfer-hook-interface = { workspace = true } diff --git a/cli/src/instructions/add_liquidity.rs b/cli/src/instructions/add_liquidity.rs index 6174a09e..fc52f811 100644 --- a/cli/src/instructions/add_liquidity.rs +++ b/cli/src/instructions/add_liquidity.rs @@ -2,14 +2,23 @@ use std::ops::Deref; use anchor_client::solana_client::rpc_config::RpcSendTransactionConfig; use anchor_client::solana_sdk::compute_budget::ComputeBudgetInstruction; +use anchor_client::solana_sdk::instruction::Instruction; use anchor_client::{solana_sdk::pubkey::Pubkey, solana_sdk::signer::Signer, Program}; +use anchor_lang::{InstructionData, ToAccountMetas}; use anyhow::*; use lb_clmm::accounts; use lb_clmm::instruction; use lb_clmm::instructions::add_liquidity::{BinLiquidityDistribution, LiquidityParameter}; - -use crate::instructions::utils::{get_bin_arrays_for_position, get_or_create_ata}; +use lb_clmm::state::position::PositionV2; +use lb_clmm::utils::remaining_accounts_util::{ + AccountsType, RemainingAccountsInfo, RemainingAccountsSlice, +}; + +use crate::instructions::utils::{ + get_bin_array_account_meta_by_bin_range, get_extra_account_metas_for_transfer_hook, + get_or_create_ata, +}; use lb_clmm::constants::BASIS_POINT_MAX; use lb_clmm::state::lb_pair::LbPair; use lb_clmm::utils::pda::{derive_bin_array_bitmap_extension, derive_event_authority_pda}; @@ -37,6 +46,19 @@ pub async fn add_liquidity + Clone>( } = params; let lb_pair_state: LbPair = program.account(lb_pair).await?; + let position_state: PositionV2 = program.account(position).await?; + + let mint_x_owner = program + .async_rpc() + .get_account(&lb_pair_state.token_x_mint) + .await + .map(|acc| acc.owner)?; + + let mint_y_owner = program + .async_rpc() + .get_account(&lb_pair_state.token_y_mint) + .await + .map(|acc| acc.owner)?; let bin_liquidity_distribution = bin_liquidity_distribution .into_iter() @@ -47,13 +69,12 @@ pub async fn add_liquidity + Clone>( }) .collect::>(); - let [bin_array_lower, bin_array_upper] = get_bin_arrays_for_position(program, position).await?; - let user_token_x = get_or_create_ata( program, transaction_config, lb_pair_state.token_x_mint, program.payer(), + mint_x_owner, ) .await?; @@ -62,10 +83,10 @@ pub async fn add_liquidity + Clone>( transaction_config, lb_pair_state.token_y_mint, program.payer(), + mint_y_owner, ) .await?; - // TODO: id and price slippage let (bin_array_bitmap_extension, _bump) = derive_bin_array_bitmap_extension(lb_pair); let bin_array_bitmap_extension = if program .rpc() @@ -79,9 +100,7 @@ pub async fn add_liquidity + Clone>( let (event_authority, _bump) = derive_event_authority_pda(); - let accounts = accounts::ModifyLiquidity { - bin_array_lower, - bin_array_upper, + let mut ix_accounts = accounts::ModifyLiquidity2 { lb_pair, bin_array_bitmap_extension, position, @@ -92,28 +111,66 @@ pub async fn add_liquidity + Clone>( sender: program.payer(), user_token_x, user_token_y, - // TODO: token 2022 - token_x_program: anchor_spl::token::ID, - token_y_program: anchor_spl::token::ID, + token_x_program: mint_x_owner, + token_y_program: mint_y_owner, event_authority, program: lb_clmm::ID, - }; + memo_program: anchor_spl::memo::ID, + } + .to_account_metas(None); + + let mut remaining_accounts_info = RemainingAccountsInfo { slices: vec![] }; + + let transfer_hook_x_accounts = + get_extra_account_metas_for_transfer_hook(lb_pair_state.token_x_mint, program.async_rpc()) + .await?; + + remaining_accounts_info.slices.push(RemainingAccountsSlice { + accounts_type: AccountsType::TransferHookX, + length: transfer_hook_x_accounts.len() as u8, + }); - let ix = instruction::AddLiquidity { + let transfer_hook_y_accounts = + get_extra_account_metas_for_transfer_hook(lb_pair_state.token_y_mint, program.async_rpc()) + .await?; + + remaining_accounts_info.slices.push(RemainingAccountsSlice { + accounts_type: AccountsType::TransferHookY, + length: transfer_hook_y_accounts.len() as u8, + }); + + let bin_arrays = get_bin_array_account_meta_by_bin_range( + lb_pair, + position_state.lower_bin_id, + position_state.upper_bin_id, + )?; + + ix_accounts.extend(transfer_hook_x_accounts); + ix_accounts.extend(transfer_hook_y_accounts); + ix_accounts.extend(bin_arrays); + + let ix_data = instruction::AddLiquidity2 { liquidity_parameter: LiquidityParameter { amount_x, amount_y, bin_liquidity_dist: bin_liquidity_distribution, }, - }; + remaining_accounts_info, + } + .data(); let compute_budget_ix = ComputeBudgetInstruction::set_compute_unit_limit(1_400_000); + let ix = Instruction { + program_id: lb_clmm::ID, + accounts: ix_accounts, + data: ix_data, + }; + let request_builder = program.request(); let signature = request_builder .instruction(compute_budget_ix) - .accounts(accounts) - .args(ix) + .instruction(ix) .send_with_spinner_and_config(transaction_config) .await; diff --git a/cli/src/instructions/claim_fee.rs b/cli/src/instructions/claim_fee.rs index 8f68cffd..def2fb2f 100644 --- a/cli/src/instructions/claim_fee.rs +++ b/cli/src/instructions/claim_fee.rs @@ -1,13 +1,24 @@ -use super::utils::{get_bin_arrays_for_position, get_or_create_ata}; +use crate::instructions::utils::get_bin_array_account_meta_by_bin_range; +use crate::instructions::utils::get_extra_account_metas_for_transfer_hook; + +use super::utils::get_or_create_ata; +use anchor_client::solana_sdk::instruction::Instruction; use anchor_client::{ solana_client::rpc_config::RpcSendTransactionConfig, solana_sdk::signer::Signer, Program, }; use anchor_lang::prelude::Pubkey; +use anchor_lang::InstructionData; +use anchor_lang::ToAccountMetas; +use anchor_spl::memo; use anyhow::*; use lb_clmm::accounts; use lb_clmm::instruction; -use lb_clmm::state::{lb_pair::LbPair, position::Position}; +use lb_clmm::state::lb_pair::LbPair; +use lb_clmm::state::position::PositionV2; use lb_clmm::utils::pda::derive_event_authority_pda; +use lb_clmm::utils::remaining_accounts_util::AccountsType; +use lb_clmm::utils::remaining_accounts_util::RemainingAccountsInfo; +use lb_clmm::utils::remaining_accounts_util::RemainingAccountsSlice; use std::ops::Deref; pub async fn claim_fee + Clone>( @@ -15,51 +26,105 @@ pub async fn claim_fee + Clone>( program: &Program, transaction_config: RpcSendTransactionConfig, ) -> Result<()> { - let position_state: Position = program.account(position).await?; + let position_state: PositionV2 = program.account(position).await?; let lb_pair_state: LbPair = program.account(position_state.lb_pair).await?; + let mint_x_owner = program + .async_rpc() + .get_account(&lb_pair_state.token_x_mint) + .await + .map(|acc| acc.owner)?; + + let mint_y_owner = program + .async_rpc() + .get_account(&lb_pair_state.token_y_mint) + .await + .map(|acc| acc.owner)?; + let user_token_x = get_or_create_ata( program, transaction_config, lb_pair_state.token_x_mint, program.payer(), + mint_x_owner, ) .await?; + let user_token_y = get_or_create_ata( program, transaction_config, lb_pair_state.token_y_mint, program.payer(), + mint_y_owner, ) .await?; - let [bin_array_lower, bin_array_upper] = get_bin_arrays_for_position(program, position).await?; - let (event_authority, _bump) = derive_event_authority_pda(); - let accounts = accounts::ClaimFee { - bin_array_lower, - bin_array_upper, + let mut ix_accounts = accounts::ClaimFee2 { lb_pair: position_state.lb_pair, sender: program.payer(), position, reserve_x: lb_pair_state.reserve_x, reserve_y: lb_pair_state.reserve_y, - token_program: anchor_spl::token::ID, token_x_mint: lb_pair_state.token_x_mint, token_y_mint: lb_pair_state.token_y_mint, user_token_x, user_token_y, event_authority, program: lb_clmm::ID, - }; + token_program_x: mint_x_owner, + token_program_y: mint_y_owner, + memo_program: memo::ID, + } + .to_account_metas(None); + + let mut remaining_accounts_info = RemainingAccountsInfo { slices: vec![] }; + + let transfer_hook_x_accounts = + get_extra_account_metas_for_transfer_hook(lb_pair_state.token_x_mint, program.async_rpc()) + .await?; - let ix = instruction::ClaimFee {}; + remaining_accounts_info.slices.push(RemainingAccountsSlice { + accounts_type: AccountsType::TransferHookX, + length: transfer_hook_x_accounts.len() as u8, + }); + + let transfer_hook_y_accounts = + get_extra_account_metas_for_transfer_hook(lb_pair_state.token_y_mint, program.async_rpc()) + .await?; + + remaining_accounts_info.slices.push(RemainingAccountsSlice { + accounts_type: AccountsType::TransferHookY, + length: transfer_hook_y_accounts.len() as u8, + }); + + let bin_arrays = get_bin_array_account_meta_by_bin_range( + position_state.lb_pair, + position_state.lower_bin_id, + position_state.upper_bin_id, + )?; + + ix_accounts.extend(transfer_hook_x_accounts); + ix_accounts.extend(transfer_hook_y_accounts); + ix_accounts.extend(bin_arrays); + + let ix_data = instruction::ClaimFee2 { + min_bin_id: position_state.lower_bin_id, + max_bin_id: position_state.upper_bin_id, + remaining_accounts_slice: remaining_accounts_info, + } + .data(); + + let ix = Instruction { + data: ix_data, + accounts: ix_accounts, + program_id: lb_clmm::ID, + }; let request_builder = program.request(); let signature = request_builder - .accounts(accounts) - .args(ix) + .instruction(ix) .send_with_spinner_and_config(transaction_config) .await; diff --git a/cli/src/instructions/claim_reward.rs b/cli/src/instructions/claim_reward.rs index 6bf38958..8021b060 100644 --- a/cli/src/instructions/claim_reward.rs +++ b/cli/src/instructions/claim_reward.rs @@ -1,11 +1,21 @@ -use crate::instructions::utils::{get_bin_arrays_for_position, get_or_create_ata}; +use crate::instructions::utils::{ + get_bin_array_account_meta_by_bin_range, get_bin_arrays_for_position, + get_extra_account_metas_for_transfer_hook, get_or_create_ata, +}; use anchor_client::solana_client::rpc_config::RpcSendTransactionConfig; +use anchor_client::solana_sdk::instruction::Instruction; use anchor_client::{solana_sdk::pubkey::Pubkey, solana_sdk::signer::Signer, Program}; +use anchor_lang::{InstructionData, ToAccountMetas}; +use anchor_spl::memo; use anyhow::*; use lb_clmm::accounts; use lb_clmm::instruction; use lb_clmm::state::lb_pair::LbPair; +use lb_clmm::state::position::PositionV2; use lb_clmm::utils::pda::*; +use lb_clmm::utils::remaining_accounts_util::{ + AccountsType, RemainingAccountsInfo, RemainingAccountsSlice, +}; use std::ops::Deref; #[derive(Debug)] @@ -28,36 +38,74 @@ pub async fn claim_reward + Clone>( let (reward_vault, _bump) = derive_reward_vault_pda(lb_pair, reward_index); let lb_pair_state: LbPair = program.account(lb_pair).await?; + let position_state: PositionV2 = program.account(position).await?; + let reward_info = lb_pair_state.reward_infos[reward_index as usize]; let reward_mint = reward_info.mint; - let user_token_account = - get_or_create_ata(program, transaction_config, reward_mint, program.payer()).await?; + let token_program = program.async_rpc().get_account(&reward_mint).await?.owner; - let [bin_array_lower, bin_array_upper] = get_bin_arrays_for_position(program, position).await?; + let user_token_account = get_or_create_ata( + program, + transaction_config, + reward_mint, + program.payer(), + token_program, + ) + .await?; let (event_authority, _bump) = derive_event_authority_pda(); - let accounts = accounts::ClaimReward { - bin_array_lower, - bin_array_upper, + let mut ix_accounts = accounts::ClaimReward2 { lb_pair, reward_vault, reward_mint, - token_program: anchor_spl::token::ID, + token_program, position, user_token_account, sender: program.payer(), event_authority, program: lb_clmm::ID, - }; + memo_program: memo::ID, + } + .to_account_metas(None); + + let mut remaining_accounts_info = RemainingAccountsInfo { slices: vec![] }; + + let transfer_hook_reward_accounts = + get_extra_account_metas_for_transfer_hook(reward_mint, program.async_rpc()).await?; + + remaining_accounts_info.slices.push(RemainingAccountsSlice { + accounts_type: AccountsType::TransferHookReward, + length: transfer_hook_reward_accounts.len() as u8, + }); - let ix = instruction::ClaimReward { reward_index }; + let bin_arrays = get_bin_array_account_meta_by_bin_range( + position_state.lb_pair, + position_state.lower_bin_id, + position_state.upper_bin_id, + )?; + + ix_accounts.extend(transfer_hook_reward_accounts); + ix_accounts.extend(bin_arrays); + + let ix_data = instruction::ClaimReward2 { + reward_index, + remaining_accounts_info, + min_bin_id: position_state.lower_bin_id, + max_bin_id: position_state.upper_bin_id, + } + .data(); + + let ix = Instruction { + program_id: lb_clmm::ID, + accounts: ix_accounts, + data: ix_data, + }; let request_builder = program.request(); let signature = request_builder - .accounts(accounts) - .args(ix) + .instruction(ix) .send_with_spinner_and_config(transaction_config) .await; diff --git a/cli/src/instructions/fund_reward.rs b/cli/src/instructions/fund_reward.rs index 11aec20f..b5beb70e 100644 --- a/cli/src/instructions/fund_reward.rs +++ b/cli/src/instructions/fund_reward.rs @@ -1,12 +1,17 @@ -use crate::instructions::utils::get_or_create_ata; +use crate::instructions::utils::{get_extra_account_metas_for_transfer_hook, get_or_create_ata}; use anchor_client::solana_client::rpc_config::RpcSendTransactionConfig; +use anchor_client::solana_sdk::instruction::Instruction; use anchor_client::{solana_sdk::pubkey::Pubkey, solana_sdk::signer::Signer, Program}; +use anchor_lang::{InstructionData, ToAccountMetas}; use anyhow::*; use lb_clmm::accounts; use lb_clmm::instruction; use lb_clmm::state::bin::BinArray; use lb_clmm::state::lb_pair::LbPair; use lb_clmm::utils::pda::*; +use lb_clmm::utils::remaining_accounts_util::{ + AccountsType, RemainingAccountsInfo, RemainingAccountsSlice, +}; use std::ops::Deref; #[derive(Debug)] @@ -32,39 +37,69 @@ pub async fn fund_reward + Clone>( &lb_clmm::ID, ); let lb_pair_state: LbPair = program.account(lb_pair).await?; + let reward_info = lb_pair_state.reward_infos[reward_index as usize]; let reward_mint = reward_info.mint; - let funder_token_account = - get_or_create_ata(program, transaction_config, reward_mint, program.payer()).await?; + let token_program = program.async_rpc().get_account(&reward_mint).await?.owner; + + let funder_token_account = get_or_create_ata( + program, + transaction_config, + reward_mint, + program.payer(), + reward_mint, + ) + .await?; let active_bin_array_idx = BinArray::bin_id_to_bin_array_index(lb_pair_state.active_id)?; let (bin_array, _bump) = derive_bin_array_pda(lb_pair, active_bin_array_idx as i64); let (event_authority, _bump) = derive_event_authority_pda(); - let accounts = accounts::FundReward { + let mut ix_accounts = accounts::FundReward { lb_pair, reward_vault, reward_mint, funder: program.payer(), funder_token_account, bin_array, - token_program: anchor_spl::token::ID, + token_program, event_authority, program: lb_clmm::ID, - }; + } + .to_account_metas(None); - let ix = instruction::FundReward { + let mut remaining_accounts_info = RemainingAccountsInfo { slices: vec![] }; + + let transfer_hook_reward_accounts = + get_extra_account_metas_for_transfer_hook(lb_pair_state.token_x_mint, program.async_rpc()) + .await?; + + remaining_accounts_info.slices.push(RemainingAccountsSlice { + accounts_type: AccountsType::TransferHookReward, + length: transfer_hook_reward_accounts.len() as u8, + }); + + ix_accounts.extend(transfer_hook_reward_accounts); + + let ix_data = instruction::FundReward { reward_index, amount: funding_amount, carry_forward: true, + remaining_accounts_info, + } + .data(); + + let ix = Instruction { + program_id: lb_clmm::ID, + accounts: ix_accounts, + data: ix_data, }; let request_builder = program.request(); let signature = request_builder - .accounts(accounts) - .args(ix) + .instruction(ix) .send_with_spinner_and_config(transaction_config) .await; diff --git a/cli/src/instructions/initialize_lb_pair.rs b/cli/src/instructions/initialize_lb_pair.rs index 0b1b61c0..bdf65f72 100644 --- a/cli/src/instructions/initialize_lb_pair.rs +++ b/cli/src/instructions/initialize_lb_pair.rs @@ -35,6 +35,40 @@ pub async fn initialize_lb_pair + Clone>( let token_mint_base: Mint = program.account(token_mint_x).await?; let token_mint_quote: Mint = program.account(token_mint_y).await?; + let token_programs = program + .async_rpc() + .get_multiple_accounts(&[token_mint_x, token_mint_y]) + .await? + .into_iter() + .map(|account| Some(account?.owner)) + .collect::>>() + .context("Missing token mint account")?; + + let [token_x_program, token_y_program] = token_programs.as_slice() else { + bail!("Missing token program accounts"); + }; + + let token_badge_keys = [token_mint_x, token_mint_y] + .into_iter() + .map(|key| derive_token_badge_pda(key).0) + .collect::>(); + + let token_badge_accounts = program + .async_rpc() + .get_multiple_accounts(&token_badge_keys) + .await?; + + let token_badges = token_badge_accounts + .into_iter() + .zip(token_badge_keys) + .into_iter() + .map(|(account, key)| Some(account.map_or(lb_clmm::ID, |_| key))) + .collect::>(); + + let [token_x_badge, token_y_badge] = token_badges.as_slice() else { + bail!("Invalid derived token badge"); + }; + let price_per_lamport = price_per_token_to_per_lamport( initial_price, token_mint_base.decimals, @@ -65,7 +99,7 @@ pub async fn initialize_lb_pair + Clone>( let (event_authority, _bump) = derive_event_authority_pda(); - let accounts = accounts::InitializeLbPair { + let accounts = accounts::InitializeLbPair2 { lb_pair, bin_array_bitmap_extension: None, reserve_x, @@ -77,7 +111,10 @@ pub async fn initialize_lb_pair + Clone>( preset_parameter, rent: anchor_client::solana_sdk::sysvar::rent::ID, system_program: anchor_client::solana_sdk::system_program::ID, - token_program: anchor_spl::token::ID, + token_program_x: *token_x_program, + token_program_y: *token_y_program, + token_badge_x: *token_x_badge, + token_badge_y: *token_y_badge, event_authority, program: lb_clmm::ID, }; diff --git a/cli/src/instructions/initialize_permission_lb_pair.rs b/cli/src/instructions/initialize_permission_lb_pair.rs index 3a320f8d..957e61ab 100644 --- a/cli/src/instructions/initialize_permission_lb_pair.rs +++ b/cli/src/instructions/initialize_permission_lb_pair.rs @@ -48,6 +48,40 @@ pub async fn initialize_permission_lb_pair + Clon let token_mint_base: Mint = program.account(token_mint_x).await?; let token_mint_quote: Mint = program.account(token_mint_y).await?; + let token_programs = program + .async_rpc() + .get_multiple_accounts(&[token_mint_x, token_mint_y]) + .await? + .into_iter() + .map(|account| Some(account?.owner)) + .collect::>>() + .context("Missing token mint account")?; + + let [token_x_program, token_y_program] = token_programs.as_slice() else { + bail!("Missing token program accounts"); + }; + + let token_badge_keys = [token_mint_x, token_mint_y] + .into_iter() + .map(|key| derive_token_badge_pda(key).0) + .collect::>(); + + let token_badge_accounts = program + .async_rpc() + .get_multiple_accounts(&token_badge_keys) + .await?; + + let token_badges = token_badge_accounts + .into_iter() + .zip(token_badge_keys) + .into_iter() + .map(|(account, key)| Some(account.map_or(lb_clmm::ID, |_| key))) + .collect::>(); + + let [token_x_badge, token_y_badge] = token_badges.as_slice() else { + bail!("Invalid derived token badge"); + }; + let price_per_lamport = price_per_token_to_per_lamport( initial_price, token_mint_base.decimals, @@ -82,7 +116,10 @@ pub async fn initialize_permission_lb_pair + Clon admin: program.payer(), rent: anchor_client::solana_sdk::sysvar::rent::ID, system_program: anchor_client::solana_sdk::system_program::ID, - token_program: anchor_spl::token::ID, + token_badge_x: *token_x_badge, + token_badge_y: *token_y_badge, + token_program_x: *token_x_program, + token_program_y: *token_y_program, event_authority, program: lb_clmm::ID, base: base_keypair.pubkey(), diff --git a/cli/src/instructions/initialize_position.rs b/cli/src/instructions/initialize_position.rs index 85bf61c8..af00fac1 100644 --- a/cli/src/instructions/initialize_position.rs +++ b/cli/src/instructions/initialize_position.rs @@ -6,11 +6,11 @@ use anchor_client::{solana_sdk::pubkey::Pubkey, solana_sdk::signer::Signer, Prog use anchor_lang::prelude::AccountMeta; use anchor_lang::ToAccountMetas; +use anchor_spl::metadata::mpl_token_metadata::accounts::Metadata; use anyhow::*; use lb_clmm::accounts; use lb_clmm::instruction; use lb_clmm::utils::pda::derive_event_authority_pda; -use mpl_token_metadata::accounts::Metadata; use spl_associated_token_account::get_associated_token_address; #[derive(Debug)] diff --git a/cli/src/instructions/initialize_reward.rs b/cli/src/instructions/initialize_reward.rs index 8b4384e7..4a58e3c8 100644 --- a/cli/src/instructions/initialize_reward.rs +++ b/cli/src/instructions/initialize_reward.rs @@ -1,6 +1,6 @@ use anchor_client::solana_client::rpc_config::RpcSendTransactionConfig; use anchor_client::{solana_sdk::pubkey::Pubkey, solana_sdk::signer::Signer, Program}; -use lb_clmm::utils::pda::derive_event_authority_pda; +use lb_clmm::utils::pda::{derive_event_authority_pda, derive_token_badge_pda}; use std::ops::Deref; use anyhow::*; @@ -36,6 +36,16 @@ pub async fn initialize_reward + Clone>( let (event_authority, _bump) = derive_event_authority_pda(); + let (reward_token_badge, _bump) = derive_token_badge_pda(reward_mint); + + let reward_token_badge = program + .async_rpc() + .get_account(&reward_token_badge) + .await + .map(|_| reward_token_badge) + .or_else(|_| Ok(lb_clmm::ID)) + .ok(); + let accounts = accounts::InitializeReward { lb_pair, reward_vault, @@ -46,6 +56,7 @@ pub async fn initialize_reward + Clone>( system_program: anchor_client::solana_sdk::system_program::ID, event_authority, program: lb_clmm::ID, + token_badge: reward_token_badge, }; let ix: instruction::InitializeReward = instruction::InitializeReward { diff --git a/cli/src/instructions/remove_liquidity.rs b/cli/src/instructions/remove_liquidity.rs index 795ab347..98dc0db9 100644 --- a/cli/src/instructions/remove_liquidity.rs +++ b/cli/src/instructions/remove_liquidity.rs @@ -3,17 +3,27 @@ use std::ops::Deref; use anchor_client::solana_client::rpc_config::RpcSendTransactionConfig; use anchor_client::solana_sdk::compute_budget::ComputeBudgetInstruction; +use anchor_client::solana_sdk::instruction::Instruction; use anchor_client::{solana_sdk::pubkey::Pubkey, solana_sdk::signer::Signer, Program}; - +use anchor_lang::InstructionData; +use anchor_lang::ToAccountMetas; +use anchor_spl::memo; use anyhow::*; use lb_clmm::accounts; use lb_clmm::constants::BASIS_POINT_MAX; use lb_clmm::instruction; use lb_clmm::instructions::remove_liquidity::BinLiquidityReduction; use lb_clmm::state::lb_pair::LbPair; +use lb_clmm::state::position::PositionV2; use lb_clmm::utils::pda::{derive_bin_array_bitmap_extension, derive_event_authority_pda}; +use lb_clmm::utils::remaining_accounts_util::{ + AccountsType, RemainingAccountsInfo, RemainingAccountsSlice, +}; -use crate::instructions::utils::{get_bin_arrays_for_position, get_or_create_ata}; +use crate::instructions::utils::{ + get_bin_array_account_meta_by_bin_range, get_extra_account_metas_for_transfer_hook, + get_or_create_ata, +}; pub struct RemoveLiquidityParameters { pub lb_pair: Pubkey, @@ -33,14 +43,26 @@ pub async fn remove_liquidity + Clone>( } = params; let lb_pair_state: LbPair = program.account(lb_pair).await?; + let position_state: PositionV2 = program.account(position).await?; + + let mint_x_owner = program + .async_rpc() + .get_account(&lb_pair_state.token_x_mint) + .await + .map(|acc| acc.owner)?; - let [bin_array_lower, bin_array_upper] = get_bin_arrays_for_position(program, position).await?; + let mint_y_owner = program + .async_rpc() + .get_account(&lb_pair_state.token_y_mint) + .await + .map(|acc| acc.owner)?; let user_token_x = get_or_create_ata( program, transaction_config, lb_pair_state.token_x_mint, program.payer(), + mint_x_owner, ) .await?; @@ -49,6 +71,7 @@ pub async fn remove_liquidity + Clone>( transaction_config, lb_pair_state.token_y_mint, program.payer(), + mint_y_owner, ) .await?; @@ -66,9 +89,7 @@ pub async fn remove_liquidity + Clone>( let (event_authority, _bump) = derive_event_authority_pda(); - let accounts = accounts::ModifyLiquidity { - bin_array_lower, - bin_array_upper, + let mut ix_accounts = accounts::ModifyLiquidity2 { lb_pair, bin_array_bitmap_extension, position, @@ -79,11 +100,43 @@ pub async fn remove_liquidity + Clone>( sender: program.payer(), user_token_x, user_token_y, - token_x_program: anchor_spl::token::ID, - token_y_program: anchor_spl::token::ID, + token_x_program: mint_x_owner, + token_y_program: mint_y_owner, event_authority, program: lb_clmm::ID, - }; + memo_program: memo::ID, + } + .to_account_metas(None); + + let mut remaining_accounts_info = RemainingAccountsInfo { slices: vec![] }; + + let transfer_hook_x_accounts = + get_extra_account_metas_for_transfer_hook(lb_pair_state.token_x_mint, program.async_rpc()) + .await?; + + remaining_accounts_info.slices.push(RemainingAccountsSlice { + accounts_type: AccountsType::TransferHookX, + length: transfer_hook_x_accounts.len() as u8, + }); + + let transfer_hook_y_accounts = + get_extra_account_metas_for_transfer_hook(lb_pair_state.token_y_mint, program.async_rpc()) + .await?; + + remaining_accounts_info.slices.push(RemainingAccountsSlice { + accounts_type: AccountsType::TransferHookY, + length: transfer_hook_y_accounts.len() as u8, + }); + + let bin_arrays = get_bin_array_account_meta_by_bin_range( + position_state.lb_pair, + position_state.lower_bin_id, + position_state.upper_bin_id, + )?; + + ix_accounts.extend(transfer_hook_x_accounts); + ix_accounts.extend(transfer_hook_y_accounts); + ix_accounts.extend(bin_arrays); let bin_liquidity_removal = bin_liquidity_removal .into_iter() @@ -93,8 +146,16 @@ pub async fn remove_liquidity + Clone>( }) .collect::>(); - let ix = instruction::RemoveLiquidity { + let ix_data = instruction::RemoveLiquidity2 { bin_liquidity_removal, + remaining_accounts_info, + } + .data(); + + let ix = Instruction { + data: ix_data, + accounts: ix_accounts, + program_id: lb_clmm::ID, }; let compute_budget_ix = ComputeBudgetInstruction::set_compute_unit_limit(1_400_000); @@ -102,8 +163,7 @@ pub async fn remove_liquidity + Clone>( let request_builder = program.request(); let signature = request_builder .instruction(compute_budget_ix) - .accounts(accounts) - .args(ix) + .instruction(ix) .send_with_spinner_and_config(transaction_config) .await; diff --git a/cli/src/instructions/remove_liquidity_by_price_range.rs b/cli/src/instructions/remove_liquidity_by_price_range.rs index 22a966f0..203af3df 100644 --- a/cli/src/instructions/remove_liquidity_by_price_range.rs +++ b/cli/src/instructions/remove_liquidity_by_price_range.rs @@ -1,4 +1,7 @@ -use crate::instructions::utils::get_or_create_ata; +use crate::instructions::utils::{ + get_bin_array_account_meta_by_bin_range, get_extra_account_metas_for_transfer_hook, + get_or_create_ata, +}; use crate::math::{get_id_from_price, price_per_token_to_per_lamport}; use anchor_client::solana_client::rpc_config::RpcSendTransactionConfig; use anchor_client::solana_sdk::compute_budget::ComputeBudgetInstruction; @@ -6,6 +9,7 @@ use anchor_client::solana_sdk::instruction::Instruction; use anchor_client::{solana_sdk::pubkey::Pubkey, solana_sdk::signer::Signer, Program}; use anchor_lang::InstructionData; use anchor_lang::ToAccountMetas; +use anchor_spl::memo; use anchor_spl::token::Mint; use anyhow::*; use lb_clmm::accounts; @@ -14,8 +18,11 @@ use lb_clmm::instruction; use lb_clmm::math::u128x128_math::Rounding; use lb_clmm::state::bin::BinArray; use lb_clmm::state::lb_pair::LbPair; -use lb_clmm::state::position::Position; +use lb_clmm::state::position::PositionV2; use lb_clmm::utils::pda::*; +use lb_clmm::utils::remaining_accounts_util::{ + AccountsType, RemainingAccountsInfo, RemainingAccountsSlice, +}; use std::ops::Deref; use std::result::Result::Ok; @@ -45,6 +52,19 @@ pub async fn remove_liquidity_by_price_range + Cl let token_mint_base: Mint = program.account(lb_pair_state.token_x_mint).await?; let token_mint_quote: Mint = program.account(lb_pair_state.token_y_mint).await?; + let token_programs = program + .async_rpc() + .get_multiple_accounts(&[lb_pair_state.token_x_mint, lb_pair_state.token_y_mint]) + .await? + .into_iter() + .map(|account| Some(account?.owner)) + .collect::>>() + .context("Missing token mint account")?; + + let [token_x_program, token_y_program] = token_programs.as_slice() else { + bail!("Missing token program accounts"); + }; + let min_price_per_lamport = price_per_token_to_per_lamport( min_price, token_mint_base.decimals, @@ -65,33 +85,18 @@ pub async fn remove_liquidity_by_price_range + Cl assert!(min_active_id < max_active_id); - println!("go here"); let width = MAX_BIN_PER_POSITION as i32; for i in min_active_id..=max_active_id { let (position, _bump) = derive_position_pda(lb_pair, base_position_key, i, width); - // if program.rpc().get_account_data(&position).is_ok() { - // let position_state: Position = program.account(position)?; - // println!("{position_state:?}"); - // } - // continue; - - match program.account::(position).await { + match program.account::(position).await { Ok(position_state) => { - let lower_bin_array_idx = - BinArray::bin_id_to_bin_array_index(position_state.lower_bin_id)?; - let upper_bin_array_idx = - lower_bin_array_idx.checked_add(1).context("MathOverflow")?; - - let (bin_array_lower, _bump) = - derive_bin_array_pda(lb_pair, lower_bin_array_idx.into()); - let (bin_array_upper, _bump) = - derive_bin_array_pda(lb_pair, upper_bin_array_idx.into()); let user_token_x = get_or_create_ata( program, transaction_config, lb_pair_state.token_x_mint, program.payer(), + *token_x_program, ) .await?; @@ -100,71 +105,53 @@ pub async fn remove_liquidity_by_price_range + Cl transaction_config, lb_pair_state.token_y_mint, program.payer(), + *token_y_program, ) .await?; + let (event_authority, _bump) = derive_event_authority_pda(); + let remove_all_liquidity_ix = create_remove_all_liquidity_ix( + lb_pair, + position, + user_token_x, + user_token_y, + *token_x_program, + *token_y_program, + event_authority, + &lb_pair_state, + &position_state, + program, + ) + .await?; + + let claim_fee_ix = create_claim_fee_ix( + lb_pair, + position, + user_token_x, + user_token_y, + *token_x_program, + *token_y_program, + event_authority, + &lb_pair_state, + &position_state, + program, + ) + .await?; + + let close_position_ix = create_close_position_ix( + lb_pair, + position, + event_authority, + &position_state, + program, + )?; + let instructions = vec![ ComputeBudgetInstruction::set_compute_unit_limit(1_400_000), - Instruction { - program_id: lb_clmm::ID, - accounts: accounts::ModifyLiquidity { - bin_array_lower, - bin_array_upper, - lb_pair, - bin_array_bitmap_extension: None, - position, - reserve_x: lb_pair_state.reserve_x, - reserve_y: lb_pair_state.reserve_y, - token_x_mint: lb_pair_state.token_x_mint, - token_y_mint: lb_pair_state.token_y_mint, - sender: program.payer(), - user_token_x, - user_token_y, - token_x_program: anchor_spl::token::ID, - token_y_program: anchor_spl::token::ID, - event_authority, - program: lb_clmm::ID, - } - .to_account_metas(None), - data: instruction::RemoveAllLiquidity {}.data(), - }, - Instruction { - program_id: lb_clmm::ID, - accounts: accounts::ClaimFee { - bin_array_lower, - bin_array_upper, - lb_pair, - sender: program.payer(), - position, - reserve_x: lb_pair_state.reserve_x, - reserve_y: lb_pair_state.reserve_y, - token_program: anchor_spl::token::ID, - token_x_mint: lb_pair_state.token_x_mint, - token_y_mint: lb_pair_state.token_y_mint, - user_token_x, - user_token_y, - event_authority, - program: lb_clmm::ID, - } - .to_account_metas(None), - data: instruction::ClaimFee {}.data(), - }, - Instruction { - program_id: lb_clmm::ID, - accounts: accounts::ClosePosition { - lb_pair, - position, - bin_array_lower, - bin_array_upper, - rent_receiver: program.payer(), - sender: program.payer(), - event_authority, - program: lb_clmm::ID, - } - .to_account_metas(None), - data: instruction::ClosePosition {}.data(), - }, + remove_all_liquidity_ix, + claim_fee_ix, + close_position_ix, ]; let builder = program.request(); @@ -174,10 +161,194 @@ pub async fn remove_liquidity_by_price_range + Cl let signature = builder .send_with_spinner_and_config(transaction_config) .await?; - println!("close popsition min_bin_id {i} {signature}"); + println!("close position min_bin_id {i} {signature}"); } Err(_err) => continue, } } Ok(()) } + +fn create_close_position_ix + Clone>( + lb_pair: Pubkey, + position: Pubkey, + event_authority: Pubkey, + position_state: &PositionV2, + program: &Program, +) -> Result { + let lower_bin_array_idx = BinArray::bin_id_to_bin_array_index(position_state.lower_bin_id)?; + let upper_bin_array_idx = lower_bin_array_idx.checked_add(1).context("MathOverflow")?; + + let (bin_array_lower, _bump) = derive_bin_array_pda(lb_pair, lower_bin_array_idx.into()); + let (bin_array_upper, _bump) = derive_bin_array_pda(lb_pair, upper_bin_array_idx.into()); + + let ix_accounts = accounts::ClosePosition { + lb_pair, + position, + bin_array_lower, + bin_array_upper, + rent_receiver: program.payer(), + sender: program.payer(), + event_authority, + program: lb_clmm::ID, + } + .to_account_metas(None); + + let ix_data = instruction::ClaimFee {}.data(); + + Ok(Instruction { + program_id: lb_clmm::ID, + accounts: ix_accounts, + data: ix_data, + }) +} + +async fn create_claim_fee_ix + Clone>( + lb_pair: Pubkey, + position: Pubkey, + user_token_x: Pubkey, + user_token_y: Pubkey, + token_x_program: Pubkey, + token_y_program: Pubkey, + event_authority: Pubkey, + lb_pair_state: &LbPair, + position_state: &PositionV2, + program: &Program, +) -> Result { + let mut ix_accounts = accounts::ClaimFee2 { + lb_pair, + sender: program.payer(), + position, + reserve_x: lb_pair_state.reserve_x, + reserve_y: lb_pair_state.reserve_y, + token_x_mint: lb_pair_state.token_x_mint, + token_y_mint: lb_pair_state.token_y_mint, + token_program_x: token_x_program, + token_program_y: token_y_program, + user_token_x, + user_token_y, + event_authority, + program: lb_clmm::ID, + memo_program: memo::ID, + } + .to_account_metas(None); + + let mut remaining_accounts_info = RemainingAccountsInfo { slices: vec![] }; + + let transfer_hook_x_accounts = + get_extra_account_metas_for_transfer_hook(lb_pair_state.token_x_mint, program.async_rpc()) + .await?; + + remaining_accounts_info.slices.push(RemainingAccountsSlice { + accounts_type: AccountsType::TransferHookX, + length: transfer_hook_x_accounts.len() as u8, + }); + + let transfer_hook_y_accounts = + get_extra_account_metas_for_transfer_hook(lb_pair_state.token_y_mint, program.async_rpc()) + .await?; + + remaining_accounts_info.slices.push(RemainingAccountsSlice { + accounts_type: AccountsType::TransferHookY, + length: transfer_hook_y_accounts.len() as u8, + }); + + let bin_arrays = get_bin_array_account_meta_by_bin_range( + position_state.lb_pair, + position_state.lower_bin_id, + position_state.upper_bin_id, + )?; + + ix_accounts.extend(transfer_hook_x_accounts); + ix_accounts.extend(transfer_hook_y_accounts); + ix_accounts.extend(bin_arrays); + + let ix_data = instruction::ClaimFee2 { + min_bin_id: position_state.lower_bin_id, + max_bin_id: position_state.upper_bin_id, + remaining_accounts_slice: remaining_accounts_info, + } + .data(); + + Ok(Instruction { + program_id: lb_clmm::ID, + accounts: ix_accounts, + data: ix_data, + }) +} + +async fn create_remove_all_liquidity_ix + Clone>( + lb_pair: Pubkey, + position: Pubkey, + user_token_x: Pubkey, + user_token_y: Pubkey, + token_x_program: Pubkey, + token_y_program: Pubkey, + event_authority: Pubkey, + lb_pair_state: &LbPair, + position_state: &PositionV2, + program: &Program, +) -> Result { + let mut ix_accounts = accounts::ModifyLiquidity2 { + lb_pair, + bin_array_bitmap_extension: None, + position, + reserve_x: lb_pair_state.reserve_x, + reserve_y: lb_pair_state.reserve_y, + token_x_mint: lb_pair_state.token_x_mint, + token_y_mint: lb_pair_state.token_y_mint, + sender: program.payer(), + user_token_x, + user_token_y, + token_x_program, + token_y_program, + event_authority, + program: lb_clmm::ID, + memo_program: memo::ID, + } + .to_account_metas(None); + + let mut remaining_accounts_info = RemainingAccountsInfo { slices: vec![] }; + + let transfer_hook_x_accounts = + get_extra_account_metas_for_transfer_hook(lb_pair_state.token_x_mint, program.async_rpc()) + .await?; + + remaining_accounts_info.slices.push(RemainingAccountsSlice { + accounts_type: AccountsType::TransferHookX, + length: transfer_hook_x_accounts.len() as u8, + }); + + let transfer_hook_y_accounts = + get_extra_account_metas_for_transfer_hook(lb_pair_state.token_y_mint, program.async_rpc()) + .await?; + + remaining_accounts_info.slices.push(RemainingAccountsSlice { + accounts_type: AccountsType::TransferHookY, + length: transfer_hook_y_accounts.len() as u8, + }); + + let bin_arrays = get_bin_array_account_meta_by_bin_range( + position_state.lb_pair, + position_state.lower_bin_id, + position_state.upper_bin_id, + )?; + + ix_accounts.extend(transfer_hook_x_accounts); + ix_accounts.extend(transfer_hook_y_accounts); + ix_accounts.extend(bin_arrays); + + let ix_data = instruction::RemoveLiquidityByRange2 { + from_bin_id: position_state.lower_bin_id, + to_bin_id: position_state.upper_bin_id, + bps_to_remove: 10_000, + remaining_accounts_info, + } + .data(); + + Ok(Instruction { + program_id: lb_clmm::ID, + accounts: ix_accounts, + data: ix_data, + }) +} diff --git a/cli/src/instructions/seed_liquidity.rs b/cli/src/instructions/seed_liquidity.rs index 087f8e94..c5955aaa 100644 --- a/cli/src/instructions/seed_liquidity.rs +++ b/cli/src/instructions/seed_liquidity.rs @@ -1,6 +1,9 @@ use std::ops::Deref; -use crate::instructions::utils::get_or_create_ata; +use crate::instructions::utils::{ + get_bin_array_account_meta_by_bin_range, get_extra_account_metas_for_transfer_hook, + get_or_create_ata, +}; use crate::math::{ get_id_from_price, price_per_lamport_to_price_per_token, price_per_token_to_per_lamport, }; @@ -11,7 +14,8 @@ use anchor_client::solana_sdk::signature::Keypair; use anchor_client::{solana_sdk::pubkey::Pubkey, solana_sdk::signer::Signer, Program}; use anchor_lang::InstructionData; use anchor_lang::ToAccountMetas; -use anchor_spl::token::{Mint, TokenAccount}; +use anchor_spl::memo; +use anchor_spl::token_interface::{Mint, TokenAccount}; use anyhow::*; use lb_clmm::accounts; use lb_clmm::constants::{BASIS_POINT_MAX, MAX_BIN_PER_POSITION}; @@ -22,6 +26,9 @@ use lb_clmm::state::bin::BinArray; use lb_clmm::state::lb_pair::LbPair; use lb_clmm::state::position::PositionV2; use lb_clmm::utils::pda::*; +use lb_clmm::utils::remaining_accounts_util::{ + AccountsType, RemainingAccountsInfo, RemainingAccountsSlice, +}; use rust_decimal::prelude::{FromPrimitive, ToPrimitive}; use rust_decimal::{Decimal, MathematicalOps}; @@ -49,9 +56,30 @@ pub async fn seed_liquidity + Clone>( let lb_pair_state: LbPair = program.account(lb_pair).await?; let bin_step = lb_pair_state.bin_step; + let token_programs = program + .async_rpc() + .get_multiple_accounts(&[lb_pair_state.token_x_mint, lb_pair_state.token_y_mint]) + .await? + .into_iter() + .map(|account| Some(account?.owner)) + .collect::>>() + .context("Missing token mint account")?; + + let [token_x_program, token_y_program] = token_programs.as_slice() else { + bail!("Missing token program accounts"); + }; + let token_mint_base: Mint = program.account(lb_pair_state.token_x_mint).await?; let token_mint_quote: Mint = program.account(lb_pair_state.token_y_mint).await?; + let transfer_hook_x_accounts = + get_extra_account_metas_for_transfer_hook(lb_pair_state.token_x_mint, program.async_rpc()) + .await?; + + let transfer_hook_y_accounts = + get_extra_account_metas_for_transfer_hook(lb_pair_state.token_y_mint, program.async_rpc()) + .await?; + // convert to wei amount let amount = amount .checked_mul(10u64.pow(token_mint_base.decimals as u32)) @@ -94,6 +122,7 @@ pub async fn seed_liquidity + Clone>( transaction_config, lb_pair_state.token_x_mint, program.payer(), + *token_x_program, ) .await?; @@ -102,6 +131,7 @@ pub async fn seed_liquidity + Clone>( transaction_config, lb_pair_state.token_y_mint, program.payer(), + *token_y_program, ) .await?; @@ -185,9 +215,6 @@ pub async fn seed_liquidity + Clone>( let mut instructions = vec![ComputeBudgetInstruction::set_compute_unit_limit(1_400_000)]; - let (bin_array_lower, _bump) = derive_bin_array_pda(lb_pair, lower_bin_array_idx.into()); - let (bin_array_upper, _bump) = derive_bin_array_pda(lb_pair, upper_bin_array_idx.into()); - let mut bin_amounts = vec![]; let mut position_total_amount = 0; @@ -217,35 +244,58 @@ pub async fn seed_liquidity + Clone>( }); } + let mut accounts = accounts::ModifyLiquidity2 { + lb_pair, + position, + bin_array_bitmap_extension: None, + sender: program.payer(), + event_authority, + program: lb_clmm::ID, + reserve_x: lb_pair_state.reserve_x, + reserve_y: lb_pair_state.reserve_y, + token_x_mint: lb_pair_state.token_x_mint, + token_y_mint: lb_pair_state.token_y_mint, + user_token_x, + user_token_y, + token_x_program: *token_x_program, + token_y_program: *token_y_program, + memo_program: memo::ID, + } + .to_account_metas(None); + + let mut remaining_accounts_info = RemainingAccountsInfo { slices: vec![] }; + + remaining_accounts_info.slices.push(RemainingAccountsSlice { + accounts_type: AccountsType::TransferHookX, + length: transfer_hook_x_accounts.len() as u8, + }); + + remaining_accounts_info.slices.push(RemainingAccountsSlice { + accounts_type: AccountsType::TransferHookY, + length: transfer_hook_y_accounts.len() as u8, + }); + + let bin_arrays = + get_bin_array_account_meta_by_bin_range(lb_pair, lower_bin_id, upper_bin_id)?; + + accounts.extend(transfer_hook_x_accounts.clone()); + accounts.extend(transfer_hook_y_accounts.clone()); + accounts.extend(bin_arrays); + + let data = instruction::AddLiquidity2 { + liquidity_parameter: LiquidityParameter { + amount_x: position_total_amount, + amount_y: 0, + bin_liquidity_dist, + }, + remaining_accounts_info, + } + .data(); + instructions.push(Instruction { program_id: lb_clmm::ID, - accounts: accounts::ModifyLiquidity { - lb_pair, - position, - bin_array_bitmap_extension: None, - bin_array_lower, - bin_array_upper, - sender: program.payer(), - event_authority, - program: lb_clmm::ID, - reserve_x: lb_pair_state.reserve_x, - reserve_y: lb_pair_state.reserve_y, - token_x_mint: lb_pair_state.token_x_mint, - token_y_mint: lb_pair_state.token_y_mint, - user_token_x, - user_token_y, - token_x_program: anchor_spl::token::ID, - token_y_program: anchor_spl::token::ID, - } - .to_account_metas(None), - data: instruction::AddLiquidity { - liquidity_parameter: LiquidityParameter { - amount_x: position_total_amount, - amount_y: 0, - bin_liquidity_dist, - }, - } - .data(), + accounts, + data, }); let builder = program.request(); @@ -273,45 +323,62 @@ pub async fn seed_liquidity + Clone>( let (position, _bump) = derive_position_pda(lb_pair, position_base_kp.pubkey(), lower_bin_id, width); - let lower_bin_array_idx = BinArray::bin_id_to_bin_array_index(lower_bin_id)?; - let upper_bin_array_idx = BinArray::bin_id_to_bin_array_index(upper_bin_id)?; + let mut accounts = accounts::ModifyLiquidity2 { + lb_pair, + position, + bin_array_bitmap_extension: None, + sender: program.payer(), + event_authority, + program: lb_clmm::ID, + reserve_x: lb_pair_state.reserve_x, + reserve_y: lb_pair_state.reserve_y, + token_x_mint: lb_pair_state.token_x_mint, + token_y_mint: lb_pair_state.token_y_mint, + user_token_x, + user_token_y, + token_x_program: *token_x_program, + token_y_program: *token_y_program, + memo_program: memo::ID, + } + .to_account_metas(None); - let (bin_array_lower, _bump) = derive_bin_array_pda(lb_pair, lower_bin_array_idx.into()); - let (bin_array_upper, _bump) = derive_bin_array_pda(lb_pair, upper_bin_array_idx.into()); + let mut remaining_accounts_info = RemainingAccountsInfo { slices: vec![] }; + + remaining_accounts_info.slices.push(RemainingAccountsSlice { + accounts_type: AccountsType::TransferHookX, + length: transfer_hook_x_accounts.len() as u8, + }); + + remaining_accounts_info.slices.push(RemainingAccountsSlice { + accounts_type: AccountsType::TransferHookY, + length: transfer_hook_y_accounts.len() as u8, + }); + + let bin_arrays = + get_bin_array_account_meta_by_bin_range(lb_pair, lower_bin_id, upper_bin_id)?; + + accounts.extend(transfer_hook_x_accounts.clone()); + accounts.extend(transfer_hook_y_accounts.clone()); + accounts.extend(bin_arrays); + + let data = instruction::AddLiquidity2 { + liquidity_parameter: LiquidityParameter { + amount_x: leftover, + amount_y: 0, + bin_liquidity_dist: vec![BinLiquidityDistribution { + bin_id: max_active_id, + distribution_x: 10000, + distribution_y: 0, + }], + }, + remaining_accounts_info, + } + .data(); let ix = Instruction { program_id: lb_clmm::ID, - accounts: accounts::ModifyLiquidity { - lb_pair, - position, - bin_array_bitmap_extension: None, - bin_array_lower, - bin_array_upper, - sender: program.payer(), - event_authority, - program: lb_clmm::ID, - reserve_x: lb_pair_state.reserve_x, - reserve_y: lb_pair_state.reserve_y, - token_x_mint: lb_pair_state.token_x_mint, - token_y_mint: lb_pair_state.token_y_mint, - user_token_x, - user_token_y, - token_x_program: anchor_spl::token::ID, - token_y_program: anchor_spl::token::ID, - } - .to_account_metas(None), - data: instruction::AddLiquidity { - liquidity_parameter: LiquidityParameter { - amount_x: leftover, - amount_y: 0, - bin_liquidity_dist: vec![BinLiquidityDistribution { - bin_id: max_active_id, - distribution_x: 10000, - distribution_y: 0, - }], - }, - } - .data(), + accounts, + data, }; let builder = program diff --git a/cli/src/instructions/simulate_swap_demand.rs b/cli/src/instructions/simulate_swap_demand.rs index c389de13..00330ee7 100644 --- a/cli/src/instructions/simulate_swap_demand.rs +++ b/cli/src/instructions/simulate_swap_demand.rs @@ -3,7 +3,7 @@ use crate::swap; use crate::SwapExactInParameters; use anchor_client::solana_client::rpc_config::RpcSendTransactionConfig; use anchor_client::{solana_sdk::pubkey::Pubkey, solana_sdk::signer::Signer, Program}; -use anchor_spl::token::Mint; +use anchor_spl::token_interface::Mint; use anyhow::*; use lb_clmm::state::lb_pair::LbPair; use rand::Rng; @@ -30,6 +30,20 @@ pub async fn simulate_swap_demand + Clone>( } = params; let lb_pair_state: LbPair = program.account(lb_pair).await?; + + let token_programs = program + .async_rpc() + .get_multiple_accounts(&[lb_pair_state.token_x_mint, lb_pair_state.token_y_mint]) + .await? + .into_iter() + .map(|account| Some(account?.owner)) + .collect::>>() + .context("Missing token mint account")?; + + let [token_x_program, token_y_program] = token_programs.as_slice() else { + bail!("Missing token program accounts"); + }; + let token_mint_base: Mint = program.account(lb_pair_state.token_x_mint).await?; let token_mint_quote: Mint = program.account(lb_pair_state.token_y_mint).await?; @@ -38,6 +52,7 @@ pub async fn simulate_swap_demand + Clone>( transaction_config, lb_pair_state.token_x_mint, program.payer(), + *token_x_program, ) .await?; get_or_create_ata( @@ -45,6 +60,7 @@ pub async fn simulate_swap_demand + Clone>( transaction_config, lb_pair_state.token_y_mint, program.payer(), + *token_y_program, ) .await?; diff --git a/cli/src/instructions/swap_exact_in.rs b/cli/src/instructions/swap_exact_in.rs index 96fd2c55..1e71dfd6 100644 --- a/cli/src/instructions/swap_exact_in.rs +++ b/cli/src/instructions/swap_exact_in.rs @@ -5,12 +5,14 @@ use anchor_client::solana_client::rpc_config::RpcSendTransactionConfig; use anchor_client::solana_sdk::clock::Clock; use anchor_client::solana_sdk::compute_budget::ComputeBudgetInstruction; +use anchor_client::solana_sdk::instruction::Instruction; use anchor_client::solana_sdk::sysvar::SysvarId; use anchor_client::{solana_sdk::pubkey::Pubkey, solana_sdk::signer::Signer, Program}; use anchor_lang::solana_program::instruction::AccountMeta; use anchor_lang::AccountDeserialize; use anchor_spl::associated_token::get_associated_token_address; +use anchor_spl::memo; use anyhow::*; use commons::quote::{get_bin_array_pubkeys_for_swap, quote_exact_in}; use lb_clmm::accounts; @@ -22,6 +24,13 @@ use lb_clmm::state::bin_array_bitmap_extension::BinArrayBitmapExtension; use lb_clmm::state::lb_pair::LbPair; use lb_clmm::utils::pda::*; +use anchor_lang::{InstructionData, ToAccountMetas}; +use lb_clmm::utils::remaining_accounts_util::{ + AccountsType, RemainingAccountsInfo, RemainingAccountsSlice, +}; + +use crate::instructions::utils::get_extra_account_metas_for_transfer_hook; + #[derive(Debug)] pub struct SwapExactInParameters { pub lb_pair: Pubkey, @@ -42,6 +51,18 @@ pub async fn swap + Clone>( let lb_pair_state: LbPair = program.account(lb_pair).await?; + let mint_x_owner = program + .async_rpc() + .get_account(&lb_pair_state.token_x_mint) + .await + .map(|acc| acc.owner)?; + + let mint_y_owner = program + .async_rpc() + .get_account(&lb_pair_state.token_y_mint) + .await + .map(|acc| acc.owner)?; + let (user_token_in, user_token_out) = if swap_for_y { ( get_associated_token_address(&program.payer(), &lb_pair_state.token_x_mint), @@ -105,10 +126,9 @@ pub async fn swap + Clone>( clock.slot, )?; - let (event_authority, _bump) = - Pubkey::find_program_address(&[b"__event_authority"], &lb_clmm::ID); + let (event_authority, _bump) = derive_event_authority_pda(); - let accounts = accounts::Swap { + let mut accounts = accounts::Swap2 { lb_pair, bin_array_bitmap_extension: bitmap_extension .map(|_| bitmap_extension_key) @@ -117,8 +137,8 @@ pub async fn swap + Clone>( reserve_y: lb_pair_state.reserve_y, token_x_mint: lb_pair_state.token_x_mint, token_y_mint: lb_pair_state.token_y_mint, - token_x_program: anchor_spl::token::ID, - token_y_program: anchor_spl::token::ID, + token_x_program: mint_x_owner, + token_y_program: mint_y_owner, user: program.payer(), user_token_in, user_token_out, @@ -126,29 +146,61 @@ pub async fn swap + Clone>( host_fee_in: Some(lb_clmm::ID), event_authority, program: lb_clmm::ID, - }; + memo_program: memo::ID, + } + .to_account_metas(None); - // 100 bps slippage - let min_amount_out = quote.amount_out * 9900 / BASIS_POINT_MAX as u64; + let mut remaining_accounts_info = RemainingAccountsInfo { slices: vec![] }; - let ix = instruction::Swap { - amount_in, - min_amount_out, - }; + let transfer_hook_x_accounts = + get_extra_account_metas_for_transfer_hook(lb_pair_state.token_x_mint, program.async_rpc()) + .await?; + + remaining_accounts_info.slices.push(RemainingAccountsSlice { + accounts_type: AccountsType::TransferHookX, + length: transfer_hook_x_accounts.len() as u8, + }); + + let transfer_hook_y_accounts = + get_extra_account_metas_for_transfer_hook(lb_pair_state.token_y_mint, program.async_rpc()) + .await?; + + remaining_accounts_info.slices.push(RemainingAccountsSlice { + accounts_type: AccountsType::TransferHookY, + length: transfer_hook_y_accounts.len() as u8, + }); let remaining_accounts = bin_arrays_for_swap .into_iter() .map(|key| AccountMeta::new(key, false)) .collect::>(); + accounts.extend(transfer_hook_x_accounts); + accounts.extend(transfer_hook_y_accounts); + accounts.extend(remaining_accounts); + + // 100 bps slippage + let min_amount_out = quote.amount_out * 9900 / BASIS_POINT_MAX as u64; + + let data = instruction::Swap2 { + amount_in, + min_amount_out, + remaining_accounts_info, + } + .data(); + + let ix = Instruction { + program_id: lb_clmm::ID, + data, + accounts, + }; + let compute_budget_ix = ComputeBudgetInstruction::set_compute_unit_limit(1_400_000); let request_builder = program.request(); let signature = request_builder .instruction(compute_budget_ix) - .accounts(accounts) - .accounts(remaining_accounts) - .args(ix) + .instruction(ix) .send_with_spinner_and_config(transaction_config) .await; diff --git a/cli/src/instructions/swap_with_price_impact.rs b/cli/src/instructions/swap_with_price_impact.rs index a54ec162..4d26100d 100644 --- a/cli/src/instructions/swap_with_price_impact.rs +++ b/cli/src/instructions/swap_with_price_impact.rs @@ -1,24 +1,30 @@ -use std::collections::HashMap; use std::ops::Deref; use anchor_client::solana_client::rpc_config::RpcSendTransactionConfig; use anchor_client::solana_sdk::compute_budget::ComputeBudgetInstruction; +use anchor_client::solana_sdk::instruction::Instruction; use anchor_client::{solana_sdk::pubkey::Pubkey, solana_sdk::signer::Signer, Program}; use anchor_lang::solana_program::instruction::AccountMeta; -use anchor_lang::AccountDeserialize; use anchor_spl::associated_token::get_associated_token_address; +use anchor_spl::memo; use anyhow::*; -use commons::quote::{get_bin_array_pubkeys_for_swap, quote_exact_in}; +use commons::quote::get_bin_array_pubkeys_for_swap; use lb_clmm::accounts; use lb_clmm::instruction; -use lb_clmm::state::bin::BinArray; use lb_clmm::state::bin_array_bitmap_extension::BinArrayBitmapExtension; use lb_clmm::state::lb_pair::LbPair; use lb_clmm::utils::pda::*; +use anchor_lang::{InstructionData, ToAccountMetas}; +use lb_clmm::utils::remaining_accounts_util::{ + AccountsType, RemainingAccountsInfo, RemainingAccountsSlice, +}; + +use crate::instructions::utils::get_extra_account_metas_for_transfer_hook; + #[derive(Debug)] pub struct SwapWithPriceImpactParameters { pub lb_pair: Pubkey, @@ -41,6 +47,18 @@ pub async fn swap_with_price_impact + Clone>( let lb_pair_state: LbPair = program.account(lb_pair).await?; + let mint_x_owner = program + .async_rpc() + .get_account(&lb_pair_state.token_x_mint) + .await + .map(|acc| acc.owner)?; + + let mint_y_owner = program + .async_rpc() + .get_account(&lb_pair_state.token_y_mint) + .await + .map(|acc| acc.owner)?; + let (user_token_in, user_token_out) = if swap_for_y { ( get_associated_token_address(&program.payer(), &lb_pair_state.token_x_mint), @@ -68,26 +86,9 @@ pub async fn swap_with_price_impact + Clone>( 3, )?; - let bin_arrays = program - .async_rpc() - .get_multiple_accounts(&bin_arrays_for_swap) - .await? - .into_iter() - .zip(bin_arrays_for_swap.iter()) - .map(|(account, &key)| { - let account = account?; - Some(( - key, - BinArray::try_deserialize(&mut account.data.as_ref()).ok()?, - )) - }) - .collect::>>() - .context("Failed to fetch bin arrays")?; - - let (event_authority, _bump) = - Pubkey::find_program_address(&[b"__event_authority"], &lb_clmm::ID); - - let accounts = accounts::Swap { + let (event_authority, _bump) = derive_event_authority_pda(); + + let mut accounts = accounts::Swap2 { lb_pair, bin_array_bitmap_extension: bitmap_extension .map(|_| bitmap_extension_key) @@ -96,8 +97,8 @@ pub async fn swap_with_price_impact + Clone>( reserve_y: lb_pair_state.reserve_y, token_x_mint: lb_pair_state.token_x_mint, token_y_mint: lb_pair_state.token_y_mint, - token_x_program: anchor_spl::token::ID, - token_y_program: anchor_spl::token::ID, + token_x_program: mint_x_owner, + token_y_program: mint_y_owner, user: program.payer(), user_token_in, user_token_out, @@ -105,27 +106,59 @@ pub async fn swap_with_price_impact + Clone>( host_fee_in: Some(lb_clmm::ID), event_authority, program: lb_clmm::ID, - }; + memo_program: memo::ID, + } + .to_account_metas(None); - let ix = instruction::SwapWithPriceImpact { - amount_in, - active_id: Some(lb_pair_state.active_id), - max_price_impact_bps: price_impact_bps, - }; + let mut remaining_accounts_info = RemainingAccountsInfo { slices: vec![] }; + + let transfer_hook_x_accounts = + get_extra_account_metas_for_transfer_hook(lb_pair_state.token_x_mint, program.async_rpc()) + .await?; + + remaining_accounts_info.slices.push(RemainingAccountsSlice { + accounts_type: AccountsType::TransferHookX, + length: transfer_hook_x_accounts.len() as u8, + }); + + let transfer_hook_y_accounts = + get_extra_account_metas_for_transfer_hook(lb_pair_state.token_y_mint, program.async_rpc()) + .await?; + + remaining_accounts_info.slices.push(RemainingAccountsSlice { + accounts_type: AccountsType::TransferHookY, + length: transfer_hook_y_accounts.len() as u8, + }); let remaining_accounts = bin_arrays_for_swap .into_iter() .map(|key| AccountMeta::new(key, false)) .collect::>(); + accounts.extend(transfer_hook_x_accounts); + accounts.extend(transfer_hook_y_accounts); + accounts.extend(remaining_accounts); + + let data = instruction::SwapWithPriceImpact2 { + amount_in, + active_id: Some(lb_pair_state.active_id), + max_price_impact_bps: price_impact_bps, + remaining_accounts_info, + } + .data(); + + let ix = Instruction { + program_id: lb_clmm::ID, + data, + accounts, + }; + let compute_budget_ix = ComputeBudgetInstruction::set_compute_unit_limit(1_400_000); let request_builder = program.request(); let signature = request_builder .instruction(compute_budget_ix) - .accounts(accounts) - .accounts(remaining_accounts) - .args(ix) + .instruction(ix) .send_with_spinner_and_config(transaction_config) .await; diff --git a/cli/src/instructions/utils.rs b/cli/src/instructions/utils.rs index 96d64841..f569af7f 100644 --- a/cli/src/instructions/utils.rs +++ b/cli/src/instructions/utils.rs @@ -1,22 +1,26 @@ +use anchor_client::solana_client::nonblocking::rpc_client::RpcClient; +use anchor_client::solana_client::rpc_client::RpcClient as BlockingRpcClient; +use anchor_client::solana_client::rpc_config::RpcSendTransactionConfig; +use anchor_client::solana_sdk::instruction::AccountMeta; +use anchor_client::solana_sdk::pubkey::Pubkey; use anchor_client::solana_sdk::signer::Signer; use anchor_client::Program; +use anchor_spl::associated_token::get_associated_token_address; +use anchor_spl::token_2022::spl_token_2022::extension::{transfer_hook, StateWithExtensions}; +use anyhow::*; use lb_clmm::state::bin::BinArray; use lb_clmm::state::position::Position; use lb_clmm::utils::pda::derive_bin_array_pda; use spl_associated_token_account::instruction::create_associated_token_account; +use spl_transfer_hook_interface::offchain::resolve_extra_account_metas; use std::ops::Deref; -use anchor_client::solana_client::rpc_config::RpcSendTransactionConfig; -use anchor_client::solana_sdk::pubkey::Pubkey; -use anchor_spl::associated_token::get_associated_token_address; -use anchor_spl::token::spl_token; -use anyhow::*; - pub async fn get_or_create_ata + Clone>( program: &Program, transaction_config: RpcSendTransactionConfig, token_mint: Pubkey, wallet_address: Pubkey, + token_program: Pubkey, ) -> Result { let user_ata = get_associated_token_address(&wallet_address, &token_mint); @@ -32,7 +36,7 @@ pub async fn get_or_create_ata + Clone>( &program.payer(), &wallet_address, &token_mint, - &spl_token::ID, + &token_program, )); builder @@ -59,3 +63,87 @@ pub async fn get_bin_arrays_for_position + Clone> Ok([lower_bin_array, upper_bin_array]) } + +pub fn get_bin_array_account_meta_by_bin_range( + lb_pair: Pubkey, + lower_bin_id: i32, + upper_bin_id: i32, +) -> Result> { + let mut bin_array_index = BinArray::bin_id_to_bin_array_index(lower_bin_id)?; + let mut bin_arrays = vec![]; + loop { + let (bin_array, _bump) = derive_bin_array_pda(lb_pair, bin_array_index.into()); + bin_arrays.push(bin_array); + + let (bin_array_lower_bound, bin_array_upper_bound) = + BinArray::get_bin_array_lower_upper_bin_id(bin_array_index)?; + + if upper_bin_id >= bin_array_lower_bound && upper_bin_id <= bin_array_upper_bound { + break; + } else { + bin_array_index += 1; + } + } + + Ok(bin_arrays + .into_iter() + .map(|key| AccountMeta::new(key, false)) + .collect()) +} + +pub async fn get_extra_account_metas_for_transfer_hook( + mint: Pubkey, + rpc_client: RpcClient, +) -> Result> { + let mint_account = rpc_client.get_account(&mint).await?; + if mint_account.owner.eq(&anchor_spl::token::ID) { + return Ok(vec![]); + } + + let mint_state = + StateWithExtensions::::unpack( + mint_account.data.as_ref(), + )?; + + if let Some(transfer_hook_program_id) = transfer_hook::get_program_id(&mint_state) { + let mut transfer_ix = + anchor_spl::token_2022::spl_token_2022::instruction::transfer_checked( + &mint_account.owner, + &Pubkey::default(), + &mint, + &Pubkey::default(), + &Pubkey::default(), + &[], + 0, + mint_state.base.decimals, + )?; + + let blocking_rpc_client = BlockingRpcClient::new(rpc_client.url()); + + let data_fetcher = |address: Pubkey| { + let account = blocking_rpc_client + .get_account(&address) + .map(|account| account.data); + async move { + std::result::Result::Ok::>, Box>( + account.ok(), + ) + } + }; + + resolve_extra_account_metas( + &mut transfer_ix, + data_fetcher, + &mint, + &transfer_hook_program_id, + ) + .await + .map_err(|e| anyhow!(e))?; + + // Skip 0 -> 4, source, mint, destination, authority + let transfer_hook_required_accounts = transfer_ix.accounts[5..].to_vec(); + return Ok(transfer_hook_required_accounts); + } + + Ok(vec![]) +} diff --git a/cli/src/instructions/withdraw_protocol_fee.rs b/cli/src/instructions/withdraw_protocol_fee.rs index 8d43a87c..4791e931 100644 --- a/cli/src/instructions/withdraw_protocol_fee.rs +++ b/cli/src/instructions/withdraw_protocol_fee.rs @@ -3,15 +3,24 @@ use std::ops::Deref; use anchor_client::solana_client::rpc_config::RpcSendTransactionConfig; use anchor_client::solana_sdk::compute_budget::ComputeBudgetInstruction; +use anchor_client::solana_sdk::instruction::Instruction; use anchor_client::{solana_sdk::pubkey::Pubkey, solana_sdk::signer::Signer, Program}; use anchor_spl::associated_token::get_associated_token_address; +use anchor_spl::memo; use anyhow::*; use lb_clmm::accounts; use lb_clmm::instruction; use lb_clmm::state::lb_pair::LbPair; +use anchor_lang::{InstructionData, ToAccountMetas}; +use lb_clmm::utils::remaining_accounts_util::{ + AccountsType, RemainingAccountsInfo, RemainingAccountsSlice, +}; + +use crate::instructions::utils::get_extra_account_metas_for_transfer_hook; + #[derive(Debug)] pub struct WithdrawProtocolFeeParams { pub lb_pair: Pubkey, @@ -32,34 +41,82 @@ pub async fn withdraw_protocol_fee + Clone>( let lb_pair_state: LbPair = program.account(lb_pair).await?; + let token_programs = program + .async_rpc() + .get_multiple_accounts(&[lb_pair_state.token_x_mint, lb_pair_state.token_y_mint]) + .await? + .into_iter() + .map(|account| Some(account?.owner)) + .collect::>>() + .context("Missing token mint account")?; + + let [token_x_program, token_y_program] = token_programs.as_slice() else { + bail!("Missing token program accounts"); + }; + let receiver_token_x = get_associated_token_address(&program.payer(), &lb_pair_state.token_x_mint); let receiver_token_y = get_associated_token_address(&program.payer(), &lb_pair_state.token_y_mint); - let accounts = accounts::WithdrawProtocolFee { + let mut accounts = accounts::WithdrawProtocolFee { lb_pair, reserve_x: lb_pair_state.reserve_x, reserve_y: lb_pair_state.reserve_y, token_x_mint: lb_pair_state.token_x_mint, token_y_mint: lb_pair_state.token_y_mint, - token_x_program: anchor_spl::token::ID, - token_y_program: anchor_spl::token::ID, + token_x_program: *token_x_program, + token_y_program: *token_y_program, fee_owner: program.payer(), receiver_token_x, receiver_token_y, - }; + memo_program: memo::ID, + } + .to_account_metas(None); + + let mut remaining_accounts_info = RemainingAccountsInfo { slices: vec![] }; + + let transfer_hook_x_accounts = + get_extra_account_metas_for_transfer_hook(lb_pair_state.token_x_mint, program.async_rpc()) + .await?; - let ix = instruction::WithdrawProtocolFee { amount_x, amount_y }; + remaining_accounts_info.slices.push(RemainingAccountsSlice { + accounts_type: AccountsType::TransferHookX, + length: transfer_hook_x_accounts.len() as u8, + }); + + let transfer_hook_y_accounts = + get_extra_account_metas_for_transfer_hook(lb_pair_state.token_y_mint, program.async_rpc()) + .await?; + + remaining_accounts_info.slices.push(RemainingAccountsSlice { + accounts_type: AccountsType::TransferHookY, + length: transfer_hook_y_accounts.len() as u8, + }); + + accounts.extend(transfer_hook_x_accounts); + accounts.extend(transfer_hook_y_accounts); + + let data = instruction::WithdrawProtocolFee { + amount_x, + amount_y, + remaining_accounts_info, + } + .data(); + + let ix = Instruction { + accounts, + data, + program_id: lb_clmm::ID, + }; let compute_budget_ix = ComputeBudgetInstruction::set_compute_unit_limit(1_400_000); let request_builder = program.request(); let signature = request_builder .instruction(compute_budget_ix) - .accounts(accounts) - .args(ix) + .instruction(ix) .send_with_spinner_and_config(transaction_config) .await; diff --git a/cli/src/math.rs b/cli/src/math.rs index fc621f2c..5add2766 100644 --- a/cli/src/math.rs +++ b/cli/src/math.rs @@ -122,106 +122,3 @@ pub fn price_per_lamport_to_price_per_token( .checked_mul(price_per_lamport)? .checked_div(one_ui_quote_token_amount) } - -#[cfg(test)] -mod tests { - use super::*; - use lb_clmm::math::{price_math::get_price_from_id, u64x64_math::SCALE_OFFSET}; - use proptest::proptest; - - proptest! { - #[test] - fn test_get_id_from_price_range( - bin_step in 1..=BASIS_POINT_MAX as u16, - price in 0.000000000000000001f64..=u64::MAX as f64 - ) { - let price = Decimal::from_f64(price); - assert!(price.is_some()); - let id = get_id_from_price(bin_step, &price.unwrap(), Rounding::Up); - assert!(id.is_some()); - } - } - - #[test] - fn test_q64x64_price_to_decimal() { - let q64x64_price: u128 = 408988714829317079040; - let decimal_price = q64x64_price_to_decimal(q64x64_price); - - assert!(decimal_price.is_some()); - assert_eq!( - decimal_price.unwrap().to_string(), - "22.17132265700000104402533907" - ); - } - - #[test] - fn test_price_per_lamport_to_price_per_token() { - let price_per_lamport = 0.211713226574294_f64; - let base_token_decimal = 8u8; - let quote_token_decimal = 6u8; - - let price_per_token = price_per_lamport_to_price_per_token( - price_per_lamport, - base_token_decimal, - quote_token_decimal, - ); - assert!(price_per_token.is_some()); - - let recomputed_price_per_lamport = price_per_token.unwrap() - * Decimal::TEN.powu(quote_token_decimal.into()) - / Decimal::TEN.powu(base_token_decimal.into()); - - let recomputed_price_per_lamport = recomputed_price_per_lamport.to_f64(); - assert!(recomputed_price_per_lamport.is_some()); - assert_eq!(Some(price_per_lamport), recomputed_price_per_lamport); - } - - #[test] - fn test_price_per_token_to_per_lamport() { - let price_per_token = 9.95769; - let base_token_decimal = 8u8; - let quote_token_decimal = 6u8; - - let price_per_lamport = price_per_token_to_per_lamport( - price_per_token, - base_token_decimal, - quote_token_decimal, - ); - assert!(price_per_lamport.is_some()); - - let recomputed_price_per_token = price_per_lamport.unwrap() - * Decimal::TEN.powu(base_token_decimal.into()) - / Decimal::TEN.powu(quote_token_decimal.into()); - - let recomputed_price_per_token = recomputed_price_per_token.to_f64(); - assert!(recomputed_price_per_token.is_some()); - - assert_eq!(Some(price_per_token), recomputed_price_per_token); - } - - #[test] - fn test_get_id_from_price() { - let bin_step = 15; - let quote_decimal = 6u8; - let price = Decimal::from_f64(208.929000).unwrap(); - - let computed_id = get_id_from_price(bin_step, &price, Rounding::Up); - assert!(computed_id.is_some()); - - let program_computed_price = get_price_from_id(computed_id.unwrap(), bin_step); - assert!(program_computed_price.is_ok()); - - let computed_price_fixed = Decimal::from_u128(program_computed_price.unwrap()); - assert!(computed_price_fixed.is_some()); - - let fixed_to_dec_scale_off = Decimal::TWO.powu(SCALE_OFFSET.into()); - - let computed_price_dec = (computed_price_fixed.unwrap() - * Decimal::TEN.powu(quote_decimal.into()) - / fixed_to_dec_scale_off) - .floor(); - - let computed_price = computed_price_dec.to_u64(); - assert_eq!(computed_price, Some(208929004)); - } -} diff --git a/commons/Cargo.toml b/commons/Cargo.toml index 32ec375c..0c3ade61 100644 --- a/commons/Cargo.toml +++ b/commons/Cargo.toml @@ -12,4 +12,4 @@ anchor-client = { workspace = true, features = ["async"] } anyhow = { workspace = true } lb_clmm = { path = "../programs/lb_clmm", features = ["cpi"] } tokio = { workspace = true, features = ["full", "parking_lot"] } -bincode = "1.3.3" +bincode = { workspace = true } diff --git a/market_making/Cargo.toml b/market_making/Cargo.toml index 678c368b..684e87b7 100644 --- a/market_making/Cargo.toml +++ b/market_making/Cargo.toml @@ -6,23 +6,19 @@ edition = "2021" authors = ["andrew "] [dependencies] -tokio = {workspace=true, features = ["full"] } -hyper = { workspace=true, features = ["full"] } -routerify = {workspace=true} -ureq = { workspace=true, features = ["json"]} -anchor-client={workspace=true, features=["async"]} -anchor-spl={workspace=true} -anchor-lang={workspace=true} -env_logger={workspace=true} -log={workspace=true} -clap = { workspace=true, features = ["derive"] } -shellexpand = {workspace=true} -anyhow = {workspace=true} -lb_clmm = { path = "../programs/lb_clmm", features = ["cpi"] } -serde_json = {workspace=true} -serde = { workspace=true, features = ["derive"] } -spl-associated-token-account = {workspace=true} -solana-transaction-status={workspace=true} -bs58 = {workspace=true} -chrono={workspace=true} - +tokio = { workspace = true, features = ["full"] } +hyper = { workspace = true, features = ["full"] } +routerify = { workspace = true } +anchor-client = { workspace = true, features = ["async"] } +anchor-spl = { workspace = true } +anchor-lang = { workspace = true } +env_logger = { workspace = true } +log = { workspace = true } +clap = { workspace = true, features = ["derive"] } +anyhow = { workspace = true } +lb_clmm = { path = "../programs/lb_clmm", features = ["cpi"] } +serde_json = { workspace = true } +serde = { workspace = true, features = ["derive"] } +spl-associated-token-account = { workspace = true } +solana-transaction-status = { workspace = true } +bs58 = { workspace = true } diff --git a/market_making/src/core.rs b/market_making/src/core.rs index e71fb8cf..2bcd0464 100644 --- a/market_making/src/core.rs +++ b/market_making/src/core.rs @@ -21,7 +21,6 @@ use anchor_lang::AccountDeserialize; use anchor_lang::InstructionData; use anchor_lang::ToAccountMetas; use anchor_spl::associated_token::get_associated_token_address; -use anchor_spl::token::spl_token; use anchor_spl::token::Mint; use anchor_spl::token::TokenAccount; use anyhow::Ok; @@ -140,10 +139,10 @@ impl Core { let accounts = program.rpc().get_multiple_accounts(&token_mints)?; let mut tokens = HashMap::new(); - for (i, &token_pk) in token_mints.iter().enumerate() { - let account = - Mint::try_deserialize(&mut accounts[i].clone().unwrap().data.as_ref()).unwrap(); - tokens.insert(token_pk, account); + for (token_pk, account) in token_mints.into_iter().zip(accounts.into_iter()) { + let account = account.unwrap(); + let mint = Mint::try_deserialize(&mut account.data.as_ref()).unwrap(); + tokens.insert(token_pk, (mint, account.owner)); } let mut state = self.state.lock().unwrap(); state.tokens = tokens; @@ -171,15 +170,25 @@ impl Core { pub async fn init_user_ata(&self) -> Result<()> { let payer = read_keypair_file(self.wallet.clone().unwrap()) .map_err(|_| Error::msg("Requires a keypair file"))?; - let program: Program> = create_program( - self.provider.to_string(), - self.provider.to_string(), - spl_token::ID, - Arc::new(Keypair::new()), - )?; + + let mints = { + let state = self.state.lock().unwrap(); + state.tokens.clone() + }; + let token_mints = self.get_all_token_mints(); + for &token_mint_pk in token_mints.iter() { - get_or_create_ata(&program, token_mint_pk, payer.pubkey(), &payer).await?; + if let Some(&(_, program_id)) = mints.get(&token_mint_pk) { + let program: Program> = create_program( + self.provider.to_string(), + self.provider.to_string(), + program_id, + Arc::new(Keypair::new()), + )?; + get_or_create_ata(&program, token_mint_pk, payer.pubkey(), &payer, program_id) + .await?; + } } Ok(()) } @@ -635,10 +644,11 @@ impl Core { positions } - pub fn get_all_tokens(&self) -> HashMap { + pub fn get_all_tokens(&self) -> HashMap { let state = self.state.lock().unwrap(); state.tokens.clone() } + pub async fn check_shift_price_range(&self) -> Result<()> { let all_positions = self.get_all_positions(); for position in all_positions.iter() { diff --git a/market_making/src/pair_config.rs b/market_making/src/pair_config.rs index 647c3f48..a4bdad4f 100644 --- a/market_making/src/pair_config.rs +++ b/market_making/src/pair_config.rs @@ -41,22 +41,3 @@ pub fn get_config_from_file(path: &str) -> Result> { let config: Vec = serde_json::from_str(&data)?; Ok(config) } - -#[cfg(test)] -mod config_test { - use super::*; - use std::env; - #[test] - fn test_get_get_config_from_file() { - let mut owned_string: String = env::current_dir() - .unwrap() - .into_os_string() - .into_string() - .unwrap(); - let borrowed_string: &str = "/src/pair_config.json"; - owned_string.push_str(borrowed_string); - - let config = get_config_from_file(&owned_string).unwrap(); - println!("{:?}", config); - } -} diff --git a/market_making/src/state.rs b/market_making/src/state.rs index 5fc4c76d..fb570282 100644 --- a/market_making/src/state.rs +++ b/market_making/src/state.rs @@ -19,7 +19,7 @@ use std::str::FromStr; pub struct AllPosition { pub all_positions: HashMap, // hashmap of pool pubkey and a position - pub tokens: HashMap, // cached token info + pub tokens: HashMap, // cached token info } impl AllPosition { @@ -235,7 +235,7 @@ impl SinglePosition { } } -pub fn get_decimals(token_mint_pk: Pubkey, all_tokens: &HashMap) -> u8 { - let token = all_tokens.get(&token_mint_pk).unwrap(); - return token.decimals; +pub fn get_decimals(token_mint_pk: Pubkey, all_tokens: &HashMap) -> u8 { + let (mint, _) = all_tokens.get(&token_mint_pk).unwrap(); + mint.decimals } diff --git a/market_making/src/utils.rs b/market_making/src/utils.rs index 6267822a..7d74ab45 100644 --- a/market_making/src/utils.rs +++ b/market_making/src/utils.rs @@ -14,7 +14,6 @@ use anchor_client::{ use anchor_lang::event::EVENT_IX_TAG_LE; use anchor_lang::{AnchorDeserialize, AnchorSerialize, Discriminator}; use anchor_spl::associated_token::get_associated_token_address; -use anchor_spl::token::spl_token; use anyhow::*; use lb_clmm::events::Swap as SwapEvent; use solana_transaction_status::option_serializer::OptionSerializer; @@ -50,6 +49,7 @@ pub async fn get_or_create_ata + Clone>( token_mint: Pubkey, wallet_address: Pubkey, payer: &Keypair, + program_id: Pubkey, ) -> Result { let user_ata = get_associated_token_address(&wallet_address, &token_mint); @@ -65,7 +65,7 @@ pub async fn get_or_create_ata + Clone>( &payer.pubkey(), &wallet_address, &token_mint, - &spl_token::ID, + &program_id, )); let signature = send_tx(vec![payer], payer.pubkey(), program, &builder)?; diff --git a/programs/lb_clmm/Cargo.toml b/programs/lb_clmm/Cargo.toml index 425db2e5..a6d1af31 100644 --- a/programs/lb_clmm/Cargo.toml +++ b/programs/lb_clmm/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lb_clmm" -version = "0.8.0" +version = "0.9.0" description = "Created with Anchor" edition = "2021" @@ -20,21 +20,12 @@ test-bpf = [] staging = [] [dependencies] -anchor-lang = { version = "0.28.0", features = ["event-cpi"] } -anchor-spl = "0.28.0" -uint = "0.8.5" +anchor-lang = { version = "0.29.0", features = ["event-cpi"] } +anchor-spl = { version = "0.29.0", features = ["memo"] } bytemuck = { version = "1.13.1", features = ["derive", "min_const_generics"] } ruint = "1.3.0" num-traits = "0.2.16" num-integer = "0.1.45" -mpl-token-metadata = "3.0.1" -solana-program = "1.16.0" +solana-program = "=1.17.3" num_enum = "0.7.1" - -[dev-dependencies] -proptest = "1.2.0" -rand = "0.7.3" -solana-program-test = "1.16.0" -solana-sdk = "1.16.0" -async-trait = "0.1.52" -assert_matches = "1.5.0" +spl-transfer-hook-interface = "0.3.0" diff --git a/programs/lb_clmm/src/errors.rs b/programs/lb_clmm/src/errors.rs index 47ed2372..e6e2d648 100644 --- a/programs/lb_clmm/src/errors.rs +++ b/programs/lb_clmm/src/errors.rs @@ -179,4 +179,37 @@ pub enum LBError { #[msg("Invalid activation type")] InvalidActivationType, + + #[msg("Not support token_2022 mint extension")] + NotSupportMint, + + #[msg("Unsupported mint extension")] + UnsupportedMintExtension, + + #[msg("Unsupported native mint token2022")] + UnsupportNativeMintToken2022, + + #[msg("Unmatch token mint")] + UnmatchTokenMint, + + #[msg("Unsupported token mint")] + UnsupportedTokenMint, + + #[msg("Insufficient remaining accounts")] + InsufficientRemainingAccounts, + + #[msg("Invalid remaining account slice")] + InvalidRemainingAccountSlice, + + #[msg("Duplicated remaining account types")] + DuplicatedRemainingAccountTypes, + + #[msg("Missing remaining account for transfer hook")] + MissingRemainingAccountForTransferHook, + + #[msg("Remaining account was passed for transfer hook but there's no hook program")] + NoTransferHookProgram, + + #[msg("Zero funded amount")] + ZeroFundedAmount, } diff --git a/programs/lb_clmm/src/instructions/add_liquidity.rs b/programs/lb_clmm/src/instructions/add_liquidity.rs index 9186c0e7..83d9ea41 100644 --- a/programs/lb_clmm/src/instructions/add_liquidity.rs +++ b/programs/lb_clmm/src/instructions/add_liquidity.rs @@ -3,7 +3,8 @@ use crate::state::bin_array_bitmap_extension::BinArrayBitmapExtension; use crate::state::position::PositionV2; use crate::state::{bin::BinArray, lb_pair::LbPair}; use anchor_lang::prelude::*; -use anchor_spl::token_interface::{Mint, TokenAccount, TokenInterface}; +use anchor_spl::token::Token; +use anchor_spl::token_interface::{Mint, TokenAccount}; pub struct CompositeDepositInfo { pub liquidity_share: u128, @@ -87,8 +88,8 @@ pub struct ModifyLiquidity<'info> { pub bin_array_upper: AccountLoader<'info, BinArray>, pub sender: Signer<'info>, - pub token_x_program: Interface<'info, TokenInterface>, - pub token_y_program: Interface<'info, TokenInterface>, + pub token_x_program: Program<'info, Token>, + pub token_y_program: Program<'info, Token>, } pub fn handle<'a, 'b, 'c, 'info>( diff --git a/programs/lb_clmm/src/instructions/add_liquidity_by_weight_one_side.rs b/programs/lb_clmm/src/instructions/add_liquidity_by_weight_one_side.rs index 7f7cf3d0..c6a51fcf 100644 --- a/programs/lb_clmm/src/instructions/add_liquidity_by_weight_one_side.rs +++ b/programs/lb_clmm/src/instructions/add_liquidity_by_weight_one_side.rs @@ -7,7 +7,8 @@ use crate::state::bin_array_bitmap_extension::BinArrayBitmapExtension; use crate::state::position::PositionV2; use crate::state::{bin::BinArray, lb_pair::LbPair}; use anchor_lang::prelude::*; -use anchor_spl::token_interface::{Mint, TokenAccount, TokenInterface}; +use anchor_spl::token::Token; +use anchor_spl::token_interface::{Mint, TokenAccount}; use super::add_liquidity_by_weight::BinLiquidityDistributionByWeight; @@ -135,7 +136,7 @@ pub struct ModifyLiquidityOneSide<'info> { pub bin_array_upper: AccountLoader<'info, BinArray>, pub sender: Signer<'info>, - pub token_program: Interface<'info, TokenInterface>, + pub token_program: Program<'info, Token>, } pub fn handle<'a, 'b, 'c, 'info>( diff --git a/programs/lb_clmm/src/instructions/claim_fee.rs b/programs/lb_clmm/src/instructions/claim_fee.rs index 89b9ea1b..6794c104 100644 --- a/programs/lb_clmm/src/instructions/claim_fee.rs +++ b/programs/lb_clmm/src/instructions/claim_fee.rs @@ -1,7 +1,9 @@ use crate::authorize_claim_fee_position; use crate::state::{bin::BinArray, lb_pair::LbPair, position::PositionV2}; use anchor_lang::prelude::*; -use anchor_spl::token_interface::{Mint, TokenAccount, TokenInterface}; +use anchor_spl::token::Token; +use anchor_spl::token_interface::{Mint, TokenAccount}; + #[event_cpi] #[derive(Accounts)] pub struct ClaimFee<'info> { @@ -47,9 +49,10 @@ pub struct ClaimFee<'info> { pub token_x_mint: Box>, pub token_y_mint: Box>, - pub token_program: Interface<'info, TokenInterface>, + pub token_program: Program<'info, Token>, } +// Support only token program. To support both token, and token 2022, please use `ClaimFee2` pub fn handle(ctx: Context) -> Result<()> { Ok(()) } diff --git a/programs/lb_clmm/src/instructions/claim_reward.rs b/programs/lb_clmm/src/instructions/claim_reward.rs index ad94894b..fbe6b0ae 100644 --- a/programs/lb_clmm/src/instructions/claim_reward.rs +++ b/programs/lb_clmm/src/instructions/claim_reward.rs @@ -1,7 +1,8 @@ use crate::authorize_modify_position; use crate::state::{bin::BinArray, lb_pair::LbPair, position::PositionV2}; use anchor_lang::prelude::*; -use anchor_spl::token_interface::{Mint, TokenAccount, TokenInterface}; +use anchor_spl::token::Token; +use anchor_spl::token_interface::{Mint, TokenAccount}; #[event_cpi] #[derive(Accounts)] @@ -37,7 +38,7 @@ pub struct ClaimReward<'info> { #[account(mut)] pub user_token_account: Box>, - pub token_program: Interface<'info, TokenInterface>, + pub token_program: Program<'info, Token>, } // TODO: Should we pass in range of bin we are going to collect reward ? It could help us in heap / compute unit issue by chunking into multiple tx. diff --git a/programs/lb_clmm/src/instructions/fund_reward.rs b/programs/lb_clmm/src/instructions/fund_reward.rs index 0f58b2d8..f5c2d610 100644 --- a/programs/lb_clmm/src/instructions/fund_reward.rs +++ b/programs/lb_clmm/src/instructions/fund_reward.rs @@ -1,6 +1,12 @@ -use crate::state::{bin::BinArray, lb_pair::LbPair}; +use crate::{ + state::{bin::BinArray, lb_pair::LbPair}, + utils::remaining_accounts_util::RemainingAccountsInfo, +}; use anchor_lang::prelude::*; -use anchor_spl::token_interface::{Mint, TokenAccount, TokenInterface}; +use anchor_spl::{ + token::Token, + token_interface::{Mint, TokenAccount}, +}; #[event_cpi] #[derive(Accounts)] @@ -23,7 +29,7 @@ pub struct FundReward<'info> { )] pub bin_array: AccountLoader<'info, BinArray>, - pub token_program: Interface<'info, TokenInterface>, + pub token_program: Program<'info, Token>, } pub fn handle( @@ -31,6 +37,7 @@ pub fn handle( index: u64, amount: u64, carry_forward: bool, + remaining_accounts_info: RemainingAccountsInfo, ) -> Result<()> { Ok(()) } diff --git a/programs/lb_clmm/src/instructions/initialize_lb_pair.rs b/programs/lb_clmm/src/instructions/initialize_lb_pair.rs index 05e910f2..94a576ca 100644 --- a/programs/lb_clmm/src/instructions/initialize_lb_pair.rs +++ b/programs/lb_clmm/src/instructions/initialize_lb_pair.rs @@ -7,6 +7,7 @@ use crate::state::preset_parameters::PresetParameter; use crate::utils::seeds::BIN_ARRAY_BITMAP_SEED; use crate::utils::seeds::ORACLE; use anchor_lang::prelude::*; +use anchor_spl::token::Token; use anchor_spl::token_interface::{Mint, TokenAccount, TokenInterface}; use std::cmp::{max, min}; @@ -89,12 +90,12 @@ pub struct InitializeLbPair<'info> { #[account(mut)] pub funder: Signer<'info>, - // #[account(address = Token2022::id())] - pub token_program: Interface<'info, TokenInterface>, + pub token_program: Program<'info, Token>, pub system_program: Program<'info, System>, pub rent: Sysvar<'info, Rent>, } +// To support token 2022, please use `InitializeLbPair2` pub fn handle(ctx: Context, active_id: i32, bin_step: u16) -> Result<()> { Ok(()) } diff --git a/programs/lb_clmm/src/instructions/initialize_permission_lb_pair.rs b/programs/lb_clmm/src/instructions/initialize_permission_lb_pair.rs index 984550ff..2cf57b84 100644 --- a/programs/lb_clmm/src/instructions/initialize_permission_lb_pair.rs +++ b/programs/lb_clmm/src/instructions/initialize_permission_lb_pair.rs @@ -7,6 +7,7 @@ use crate::state::lb_pair::LbPair; use crate::state::lb_pair::PairType; use crate::state::oracle::Oracle; use crate::state::preset_parameters::PresetParameter; +use crate::state::token_badge::TokenBadge; use crate::utils::seeds::BIN_ARRAY_BITMAP_SEED; use crate::utils::seeds::ORACLE; use anchor_lang::prelude::*; @@ -70,6 +71,7 @@ pub struct InitializePermissionLbPair<'info> { payer = admin, token::mint = token_mint_x, token::authority = lb_pair, + token::token_program = token_program_x, )] pub reserve_x: Box>, #[account( @@ -82,6 +84,7 @@ pub struct InitializePermissionLbPair<'info> { payer = admin, token::mint = token_mint_y, token::authority = lb_pair, + token::token_program = token_program_y, )] pub reserve_y: Box>, @@ -103,7 +106,12 @@ pub struct InitializePermissionLbPair<'info> { )] pub admin: Signer<'info>, - pub token_program: Interface<'info, TokenInterface>, + pub token_badge_x: Option>, + pub token_badge_y: Option>, + + pub token_program_x: Interface<'info, TokenInterface>, + pub token_program_y: Interface<'info, TokenInterface>, + pub system_program: Program<'info, System>, pub rent: Sysvar<'info, Rent>, } diff --git a/programs/lb_clmm/src/instructions/initialize_reward.rs b/programs/lb_clmm/src/instructions/initialize_reward.rs index f577db3b..52e68830 100644 --- a/programs/lb_clmm/src/instructions/initialize_reward.rs +++ b/programs/lb_clmm/src/instructions/initialize_reward.rs @@ -1,8 +1,9 @@ -use crate::assert_eq_admin; use crate::errors::LBError; use crate::state::lb_pair::LbPair; +use crate::{assert_eq_admin, state::token_badge::TokenBadge}; use anchor_lang::prelude::*; -use anchor_spl::token_interface::{Mint, TokenAccount, TokenInterface}; +use anchor_spl::token::Token; +use anchor_spl::token_interface::{Mint, TokenAccount}; #[event_cpi] #[derive(Accounts)] @@ -26,13 +27,15 @@ pub struct InitializeReward<'info> { pub reward_mint: Box>, + pub token_badge: Option>, + #[account( mut, constraint = assert_eq_admin(admin.key()) @ LBError::InvalidAdmin, )] pub admin: Signer<'info>, - pub token_program: Interface<'info, TokenInterface>, + pub token_program: Program<'info, Token>, pub system_program: Program<'info, System>, pub rent: Sysvar<'info, Rent>, } diff --git a/programs/lb_clmm/src/instructions/mod.rs b/programs/lb_clmm/src/instructions/mod.rs index e622e2fe..c708875c 100644 --- a/programs/lb_clmm/src/instructions/mod.rs +++ b/programs/lb_clmm/src/instructions/mod.rs @@ -26,7 +26,7 @@ pub mod remove_all_liquidity; pub mod remove_liquidity; pub mod set_activation_point; pub mod set_lock_release_point; -pub mod set_pre_activation_sduration; +pub mod set_pre_activation_duration; pub mod set_pre_activation_swap_address; pub mod swap; pub mod toggle_pair_status; @@ -36,5 +36,6 @@ pub mod update_position_operator; pub mod update_reward_duration; pub mod update_reward_funder; pub mod update_whitelisted_wallet; +pub mod v2; pub mod withdraw_ineligible_reward; pub mod withdraw_protocol_fee; diff --git a/programs/lb_clmm/src/instructions/set_pre_activation_sduration.rs b/programs/lb_clmm/src/instructions/set_pre_activation_duration.rs similarity index 100% rename from programs/lb_clmm/src/instructions/set_pre_activation_sduration.rs rename to programs/lb_clmm/src/instructions/set_pre_activation_duration.rs diff --git a/programs/lb_clmm/src/instructions/swap.rs b/programs/lb_clmm/src/instructions/swap.rs index ff4deece..748a5dc7 100644 --- a/programs/lb_clmm/src/instructions/swap.rs +++ b/programs/lb_clmm/src/instructions/swap.rs @@ -3,7 +3,10 @@ use crate::state::bin_array_bitmap_extension::BinArrayBitmapExtension; use crate::state::lb_pair::*; use crate::state::oracle::Oracle; use anchor_lang::prelude::*; -use anchor_spl::token_interface::{Mint, TokenAccount, TokenInterface}; +use anchor_spl::{ + token::Token, + token_interface::{Mint, TokenAccount}, +}; #[event_cpi] #[derive(Accounts)] @@ -50,8 +53,8 @@ pub struct Swap<'info> { pub host_fee_in: Option>>, pub user: Signer<'info>, - pub token_x_program: Interface<'info, TokenInterface>, - pub token_y_program: Interface<'info, TokenInterface>, + pub token_x_program: Program<'info, Token>, + pub token_y_program: Program<'info, Token>, } pub fn handle_exact_in<'a, 'b, 'c, 'info>( diff --git a/programs/lb_clmm/src/instructions/v2/add_liquidity2.rs b/programs/lb_clmm/src/instructions/v2/add_liquidity2.rs new file mode 100644 index 00000000..24604706 --- /dev/null +++ b/programs/lb_clmm/src/instructions/v2/add_liquidity2.rs @@ -0,0 +1,73 @@ +use anchor_lang::prelude::*; +use anchor_spl::{ + memo::Memo, + token_interface::{Mint, TokenAccount, TokenInterface}, +}; + +use crate::{ + authorize_modify_position, + state::{ + bin_array_bitmap_extension::BinArrayBitmapExtension, lb_pair::LbPair, position::PositionV2, + }, + utils::remaining_accounts_util::RemainingAccountsInfo, + LiquidityParameter, +}; + +#[event_cpi] +#[derive(Accounts)] +pub struct ModifyLiquidity2<'info> { + #[account( + mut, + has_one = lb_pair, + constraint = authorize_modify_position(&position, sender.key())? + )] + pub position: AccountLoader<'info, PositionV2>, + + #[account( + mut, + has_one = reserve_x, + has_one = reserve_y, + has_one = token_x_mint, + has_one = token_y_mint, + )] + pub lb_pair: AccountLoader<'info, LbPair>, + + #[account( + mut, + has_one = lb_pair, + )] + pub bin_array_bitmap_extension: Option>, + + #[account( + mut, + token::mint = token_x_mint + )] + pub user_token_x: Box>, + #[account( + mut, + token::mint = token_y_mint + )] + pub user_token_y: Box>, + + #[account(mut)] + pub reserve_x: Box>, + #[account(mut)] + pub reserve_y: Box>, + + pub token_x_mint: Box>, + pub token_y_mint: Box>, + + pub sender: Signer<'info>, + pub token_x_program: Interface<'info, TokenInterface>, + pub token_y_program: Interface<'info, TokenInterface>, + + pub memo_program: Program<'info, Memo>, +} + +pub fn handle( + ctx: Context, + liquidity_parameter: LiquidityParameter, + remaining_account_info: RemainingAccountsInfo, +) -> Result<()> { + Ok(()) +} diff --git a/programs/lb_clmm/src/instructions/v2/add_liquidity_by_strategy2.rs b/programs/lb_clmm/src/instructions/v2/add_liquidity_by_strategy2.rs new file mode 100644 index 00000000..1089e244 --- /dev/null +++ b/programs/lb_clmm/src/instructions/v2/add_liquidity_by_strategy2.rs @@ -0,0 +1,13 @@ +use crate::{ + utils::remaining_accounts_util::RemainingAccountsInfo, LiquidityParameterByStrategy, + ModifyLiquidity2, +}; +use anchor_lang::prelude::*; + +pub fn handle( + ctx: Context, + liquidity_parameter: &LiquidityParameterByStrategy, + remaining_accounts_info: RemainingAccountsInfo, +) -> Result<()> { + Ok(()) +} diff --git a/programs/lb_clmm/src/instructions/v2/claim_fee2.rs b/programs/lb_clmm/src/instructions/v2/claim_fee2.rs new file mode 100644 index 00000000..9de379fa --- /dev/null +++ b/programs/lb_clmm/src/instructions/v2/claim_fee2.rs @@ -0,0 +1,57 @@ +use crate::authorize_claim_fee_position; +use crate::errors::LBError; +use crate::state::{bin::BinArray, lb_pair::LbPair, position::PositionV2}; +use crate::utils::remaining_accounts_util::RemainingAccountsSlice; +use crate::PositionLiquidityFlowValidator; +use anchor_lang::prelude::*; +use anchor_spl::memo::Memo; +use anchor_spl::token_interface::{Mint, TokenAccount, TokenInterface, TransferChecked}; + +#[event_cpi] +#[derive(Accounts)] +pub struct ClaimFee2<'info> { + #[account( + mut, + has_one = reserve_x, + has_one = reserve_y, + has_one = token_x_mint, + has_one = token_y_mint, + )] + pub lb_pair: AccountLoader<'info, LbPair>, + + #[account( + mut, + has_one = lb_pair, + constraint = authorize_claim_fee_position(&position, sender.key())? + )] + pub position: AccountLoader<'info, PositionV2>, + + pub sender: Signer<'info>, + + #[account(mut)] + pub reserve_x: Box>, + #[account(mut)] + pub reserve_y: Box>, + + #[account(mut)] + pub user_token_x: Box>, + #[account(mut)] + pub user_token_y: Box>, + + pub token_x_mint: Box>, + pub token_y_mint: Box>, + + pub token_program_x: Interface<'info, TokenInterface>, + pub token_program_y: Interface<'info, TokenInterface>, + + pub memo_program: Program<'info, Memo>, +} + +pub fn handle( + ctx: Context, + min_bin_id: i32, + max_bin_id: i32, + remaining_accounts_slice: &[RemainingAccountsSlice], +) -> Result<()> { + Ok(()) +} diff --git a/programs/lb_clmm/src/instructions/v2/claim_reward2.rs b/programs/lb_clmm/src/instructions/v2/claim_reward2.rs new file mode 100644 index 00000000..3846c35f --- /dev/null +++ b/programs/lb_clmm/src/instructions/v2/claim_reward2.rs @@ -0,0 +1,49 @@ +use anchor_lang::prelude::*; +use anchor_spl::{ + memo::Memo, + token_interface::{Mint, TokenAccount, TokenInterface}, +}; + +use crate::{ + authorize_modify_position, + state::{lb_pair::LbPair, position::PositionV2}, + utils::remaining_accounts_util::RemainingAccountsInfo, +}; + +#[event_cpi] +#[derive(Accounts)] +#[instruction(reward_index: u64)] +pub struct ClaimReward2<'info> { + #[account(mut)] + pub lb_pair: AccountLoader<'info, LbPair>, + + #[account( + mut, + has_one = lb_pair, + constraint = authorize_modify_position(&position, sender.key())? + )] + pub position: AccountLoader<'info, PositionV2>, + + pub sender: Signer<'info>, + + #[account(mut)] + pub reward_vault: Box>, + pub reward_mint: Box>, + + #[account(mut)] + pub user_token_account: Box>, + + pub token_program: Interface<'info, TokenInterface>, + + pub memo_program: Program<'info, Memo>, +} + +pub fn handle( + ctx: Context, + index: u64, + min_bin_id: i32, + max_bin_id: i32, + remaining_accounts_info: RemainingAccountsInfo, +) -> Result<()> { + Ok(()) +} diff --git a/programs/lb_clmm/src/instructions/v2/initialize_lb_pair2.rs b/programs/lb_clmm/src/instructions/v2/initialize_lb_pair2.rs new file mode 100644 index 00000000..fef572ad --- /dev/null +++ b/programs/lb_clmm/src/instructions/v2/initialize_lb_pair2.rs @@ -0,0 +1,110 @@ +use crate::constants::DEFAULT_OBSERVATION_LENGTH; +use crate::errors::LBError; +use crate::events::LbPairCreate; +use crate::state::bin_array_bitmap_extension::BinArrayBitmapExtension; +use crate::state::lb_pair::LbPair; +use crate::state::lb_pair::PairType; +use crate::state::oracle::Oracle; +use crate::state::preset_parameters::PresetParameter; +use crate::state::token_badge::TokenBadge; +use crate::utils::seeds::BIN_ARRAY_BITMAP_SEED; +use crate::utils::seeds::ORACLE; +use anchor_lang::prelude::*; +use anchor_spl::token_interface::TokenInterface; +use anchor_spl::token_interface::{Mint, TokenAccount}; +use std::cmp::{max, min}; + +#[event_cpi] +#[derive(Accounts)] +#[instruction(active_id: i32, bin_step: u16)] +pub struct InitializeLbPair2<'info> { + #[account( + init, + seeds = [ + min(token_mint_x.key(), token_mint_y.key()).as_ref(), + max(token_mint_x.key(), token_mint_y.key()).as_ref(), + &bin_step.to_le_bytes(), + &preset_parameter.base_factor.to_le_bytes() + ], + bump, + payer = funder, + space = 8 + LbPair::INIT_SPACE + )] + pub lb_pair: AccountLoader<'info, LbPair>, + + #[account( + init, + seeds = [ + BIN_ARRAY_BITMAP_SEED, + lb_pair.key().as_ref(), + ], + bump, + payer = funder, + space = 8 + BinArrayBitmapExtension::INIT_SPACE + )] + pub bin_array_bitmap_extension: Option>, + + #[account(constraint = token_mint_x.key() != token_mint_y.key(), mint::token_program = token_program_x)] + pub token_mint_x: Box>, + #[account(mint::token_program = token_program_y)] + pub token_mint_y: Box>, + + #[account( + init, + seeds = [ + lb_pair.key().as_ref(), + token_mint_x.key().as_ref() + ], + bump, + payer = funder, + token::mint = token_mint_x, + token::authority = lb_pair, + token::token_program = token_program_x, + )] + pub reserve_x: Box>, + #[account( + init, + seeds = [ + lb_pair.key().as_ref(), + token_mint_y.key().as_ref() + ], + bump, + payer = funder, + token::mint = token_mint_y, + token::authority = lb_pair, + token::token_program = token_program_y, + )] + pub reserve_y: Box>, + + #[account( + init, + seeds = [ + ORACLE, + lb_pair.key().as_ref() + ], + bump, + payer = funder, + space = Oracle::space(DEFAULT_OBSERVATION_LENGTH) + )] + pub oracle: AccountLoader<'info, Oracle>, + + #[account( + constraint = bin_step == preset_parameter.bin_step @ LBError::NonPresetBinStep, + )] + pub preset_parameter: Account<'info, PresetParameter>, + + #[account(mut)] + pub funder: Signer<'info>, + + pub token_badge_x: Option>, + pub token_badge_y: Option>, + + pub token_program_x: Interface<'info, TokenInterface>, + pub token_program_y: Interface<'info, TokenInterface>, + pub system_program: Program<'info, System>, + pub rent: Sysvar<'info, Rent>, +} + +pub fn handle(ctx: Context, active_id: i32, bin_step: u16) -> Result<()> { + Ok(()) +} diff --git a/programs/lb_clmm/src/instructions/v2/initialize_token_badge.rs b/programs/lb_clmm/src/instructions/v2/initialize_token_badge.rs new file mode 100644 index 00000000..7c113b2c --- /dev/null +++ b/programs/lb_clmm/src/instructions/v2/initialize_token_badge.rs @@ -0,0 +1,34 @@ +use crate::errors::LBError; +use crate::{assert_eq_admin, state::*}; +use anchor_lang::prelude::*; +use anchor_spl::token_interface::Mint; +use token_badge::TokenBadge; + +#[derive(Accounts)] +pub struct InitializeTokenBadge<'info> { + pub token_mint: InterfaceAccount<'info, Mint>, + + #[account( + init, + payer = admin, + seeds = [ + b"token_badge", + token_mint.key().as_ref(), + ], + bump, + space = 8 + TokenBadge::INIT_SPACE + )] + pub token_badge: AccountLoader<'info, TokenBadge>, + + #[account( + mut, + constraint = assert_eq_admin(admin.key()) @ LBError::InvalidAdmin, + )] + pub admin: Signer<'info>, + + pub system_program: Program<'info, System>, +} + +pub fn handle(ctx: Context) -> Result<()> { + Ok(()) +} diff --git a/programs/lb_clmm/src/instructions/v2/mod.rs b/programs/lb_clmm/src/instructions/v2/mod.rs new file mode 100644 index 00000000..ea69b2c2 --- /dev/null +++ b/programs/lb_clmm/src/instructions/v2/mod.rs @@ -0,0 +1,9 @@ +pub mod add_liquidity2; +pub mod add_liquidity_by_strategy2; +pub mod claim_fee2; +pub mod claim_reward2; +pub mod initialize_lb_pair2; +pub mod initialize_token_badge; +pub mod remove_liquidity2; +pub mod remove_liquidity_by_range2; +pub mod swap2; diff --git a/programs/lb_clmm/src/instructions/v2/remove_liquidity2.rs b/programs/lb_clmm/src/instructions/v2/remove_liquidity2.rs new file mode 100644 index 00000000..bfdb2238 --- /dev/null +++ b/programs/lb_clmm/src/instructions/v2/remove_liquidity2.rs @@ -0,0 +1,13 @@ +use anchor_lang::prelude::*; + +use crate::{ + utils::remaining_accounts_util::RemainingAccountsSlice, BinLiquidityReduction, ModifyLiquidity2, +}; + +pub fn handle( + ctx: Context, + bin_liquidity_reduction: Vec, + remaining_accounts_slice: &[RemainingAccountsSlice], +) -> Result<()> { + Ok(()) +} diff --git a/programs/lb_clmm/src/instructions/v2/remove_liquidity_by_range2.rs b/programs/lb_clmm/src/instructions/v2/remove_liquidity_by_range2.rs new file mode 100644 index 00000000..f2d49487 --- /dev/null +++ b/programs/lb_clmm/src/instructions/v2/remove_liquidity_by_range2.rs @@ -0,0 +1,13 @@ +use crate::utils::remaining_accounts_util::RemainingAccountsInfo; +use crate::ModifyLiquidity2; +use anchor_lang::prelude::*; + +pub fn handle( + ctx: Context, + min_bin_id: i32, + max_bin_id: i32, + bps: u16, + remaining_accounts_info: RemainingAccountsInfo, +) -> Result<()> { + Ok(()) +} diff --git a/programs/lb_clmm/src/instructions/v2/swap2.rs b/programs/lb_clmm/src/instructions/v2/swap2.rs new file mode 100644 index 00000000..079d4934 --- /dev/null +++ b/programs/lb_clmm/src/instructions/v2/swap2.rs @@ -0,0 +1,81 @@ +use anchor_lang::prelude::*; +use anchor_spl::{ + memo::Memo, + token_interface::{Mint, TokenAccount, TokenInterface}, +}; + +use crate::{ + errors::LBError, + state::{bin_array_bitmap_extension::BinArrayBitmapExtension, lb_pair::LbPair, oracle::Oracle}, + utils::remaining_accounts_util::RemainingAccountsInfo, +}; + +#[event_cpi] +#[derive(Accounts)] +pub struct Swap2<'info> { + #[account( + mut, + has_one = reserve_x, + has_one = reserve_y, + has_one = token_x_mint, + has_one = token_y_mint, + has_one = oracle, + )] + pub lb_pair: AccountLoader<'info, LbPair>, + + #[account( + has_one = lb_pair, + )] + pub bin_array_bitmap_extension: Option>, + + #[account(mut)] + pub reserve_x: Box>, + #[account(mut)] + pub reserve_y: Box>, + + #[account( + mut, + constraint = user_token_in.mint != user_token_out.mint @ LBError::InvalidTokenMint, + constraint = user_token_in.mint == token_x_mint.key() || user_token_in.mint == token_y_mint.key() @ LBError::InvalidTokenMint, + )] + pub user_token_in: Box>, + #[account( + mut, + constraint = user_token_out.mint == token_x_mint.key() || user_token_out.mint == token_y_mint.key() @ LBError::InvalidTokenMint, + )] + pub user_token_out: Box>, + + pub token_x_mint: Box>, + pub token_y_mint: Box>, + + #[account(mut)] + pub oracle: AccountLoader<'info, Oracle>, + + #[account(mut)] + pub host_fee_in: Option>>, + + pub user: Signer<'info>, + pub token_x_program: Interface<'info, TokenInterface>, + pub token_y_program: Interface<'info, TokenInterface>, + + pub memo_program: Program<'info, Memo>, +} + +pub fn handle_exact_in2( + ctx: Context, + amount_in: u64, + min_amount_out: u64, + remaining_account_info: RemainingAccountsInfo, +) -> Result<()> { + Ok(()) +} + +pub fn handle_exact_in_with_price_impact2( + ctx: Context, + amount_in: u64, + active_id: Option, + max_price_impact_bps: u16, + remaining_account_info: RemainingAccountsInfo, +) -> Result<()> { + Ok(()) +} diff --git a/programs/lb_clmm/src/instructions/withdraw_ineligible_reward.rs b/programs/lb_clmm/src/instructions/withdraw_ineligible_reward.rs index bf676989..2260a960 100644 --- a/programs/lb_clmm/src/instructions/withdraw_ineligible_reward.rs +++ b/programs/lb_clmm/src/instructions/withdraw_ineligible_reward.rs @@ -1,6 +1,12 @@ -use crate::state::{bin::BinArray, lb_pair::LbPair}; +use crate::{ + state::{bin::BinArray, lb_pair::LbPair}, + utils::remaining_accounts_util::RemainingAccountsInfo, +}; use anchor_lang::prelude::*; -use anchor_spl::token_interface::{Mint, TokenAccount, TokenInterface}; +use anchor_spl::{ + memo::Memo, + token_interface::{Mint, TokenAccount, TokenInterface}, +}; #[event_cpi] #[derive(Accounts)] @@ -25,8 +31,13 @@ pub struct WithdrawIneligibleReward<'info> { pub bin_array: AccountLoader<'info, BinArray>, pub token_program: Interface<'info, TokenInterface>, + pub memo_program: Program<'info, Memo>, } -pub fn handle(ctx: Context, index: u64) -> Result<()> { +pub fn handle( + ctx: Context, + index: u64, + remaining_accounts_info: RemainingAccountsInfo, +) -> Result<()> { Ok(()) } diff --git a/programs/lb_clmm/src/instructions/withdraw_protocol_fee.rs b/programs/lb_clmm/src/instructions/withdraw_protocol_fee.rs index 818144bb..5a1d7ff1 100644 --- a/programs/lb_clmm/src/instructions/withdraw_protocol_fee.rs +++ b/programs/lb_clmm/src/instructions/withdraw_protocol_fee.rs @@ -1,6 +1,9 @@ -use crate::state::lb_pair::LbPair; +use crate::{state::lb_pair::LbPair, utils::remaining_accounts_util::RemainingAccountsInfo}; use anchor_lang::prelude::*; -use anchor_spl::token_interface::{Mint, TokenAccount, TokenInterface}; +use anchor_spl::{ + memo::Memo, + token_interface::{Mint, TokenAccount, TokenInterface}, +}; #[derive(Accounts)] pub struct WithdrawProtocolFee<'info> { @@ -30,8 +33,15 @@ pub struct WithdrawProtocolFee<'info> { pub token_x_program: Interface<'info, TokenInterface>, pub token_y_program: Interface<'info, TokenInterface>, + + pub memo_program: Program<'info, Memo>, } -pub fn handle(ctx: Context, amount_x: u64, amount_y: u64) -> Result<()> { +pub fn handle( + ctx: Context, + amount_x: u64, + amount_y: u64, + remaining_accounts_info: RemainingAccountsInfo, +) -> Result<()> { Ok(()) } diff --git a/programs/lb_clmm/src/lib.rs b/programs/lb_clmm/src/lib.rs index 70f0c009..00f3eb1b 100644 --- a/programs/lb_clmm/src/lib.rs +++ b/programs/lb_clmm/src/lib.rs @@ -38,7 +38,7 @@ use instructions::position_authorize::*; use instructions::remove_liquidity::*; use instructions::set_activation_point::*; use instructions::set_lock_release_point::*; -use instructions::set_pre_activation_sduration::*; +use instructions::set_pre_activation_duration::*; use instructions::set_pre_activation_swap_address::*; use instructions::swap::*; use instructions::toggle_pair_status::*; @@ -48,8 +48,17 @@ use instructions::update_position_operator::*; use instructions::update_reward_duration::*; use instructions::update_reward_funder::*; use instructions::update_whitelisted_wallet::*; +use instructions::v2::add_liquidity2::*; +use instructions::v2::claim_fee2::*; +use instructions::v2::claim_reward2::*; +use instructions::v2::initialize_lb_pair2::*; +use instructions::v2::initialize_token_badge::*; +use instructions::v2::remove_liquidity2::*; +use instructions::v2::remove_liquidity_by_range2::*; +use instructions::v2::swap2::*; use instructions::withdraw_ineligible_reward::*; use instructions::withdraw_protocol_fee::*; +use utils::remaining_accounts_util::RemainingAccountsInfo; #[cfg(feature = "localnet")] declare_id!("LbVRzDTvBDEcrthxfZ4RL6yiq3uZw8bS6MwtdY6UhFQ"); @@ -116,9 +125,6 @@ pub fn assert_eq_launch_pool_admin(admin: Pubkey) -> bool { #[program] pub mod lb_clmm { - - use self::instructions::add_liquidity_single_side_precise::CompressedBinDepositAmount; - use super::*; pub fn initialize_lb_pair( @@ -238,8 +244,14 @@ pub mod lb_clmm { ctx: Context, amount_x: u64, amount_y: u64, + remaining_accounts_info: RemainingAccountsInfo, ) -> Result<()> { - instructions::withdraw_protocol_fee::handle(ctx, amount_x, amount_y) + instructions::withdraw_protocol_fee::handle( + ctx, + amount_x, + amount_y, + remaining_accounts_info, + ) } pub fn initialize_reward( @@ -256,8 +268,15 @@ pub mod lb_clmm { reward_index: u64, amount: u64, carry_forward: bool, + remaining_accounts_info: RemainingAccountsInfo, ) -> Result<()> { - instructions::fund_reward::handle(ctx, reward_index, amount, carry_forward) + instructions::fund_reward::handle( + ctx, + reward_index, + amount, + carry_forward, + remaining_accounts_info, + ) } pub fn update_reward_funder( @@ -346,8 +365,9 @@ pub mod lb_clmm { pub fn withdraw_ineligible_reward( ctx: Context, reward_index: u64, + remaining_accounts_info: RemainingAccountsInfo, ) -> Result<()> { - instructions::withdraw_ineligible_reward::handle(ctx, reward_index) + instructions::withdraw_ineligible_reward::handle(ctx, reward_index, remaining_accounts_info) } pub fn set_activation_point( @@ -375,7 +395,7 @@ pub mod lb_clmm { ctx: Context, pre_activation_duration: u16, ) -> Result<()> { - instructions::set_pre_activation_sduration::handle(ctx, pre_activation_duration) + instructions::set_pre_activation_duration::handle(ctx, pre_activation_duration) } pub fn set_pre_activation_swap_address( @@ -406,4 +426,125 @@ pub mod lb_clmm { max_price_impact_bps, ) } + + pub fn initialize_token_badge(ctx: Context) -> Result<()> { + instructions::v2::initialize_token_badge::handle(ctx) + } + + // V2 instructions, support both spl-token and token2022 + pub fn claim_fee2( + ctx: Context, + min_bin_id: i32, + max_bin_id: i32, + remaining_accounts_slice: RemainingAccountsInfo, + ) -> Result<()> { + instructions::v2::claim_fee2::handle( + ctx, + min_bin_id, + max_bin_id, + &remaining_accounts_slice.slices, + ) + } + + pub fn initialize_lb_pair2( + ctx: Context, + active_id: i32, + bin_step: u16, + ) -> Result<()> { + instructions::v2::initialize_lb_pair2::handle(ctx, active_id, bin_step) + } + + pub fn add_liquidity2( + ctx: Context, + liquidity_parameter: LiquidityParameter, + remaining_accounts_info: RemainingAccountsInfo, + ) -> Result<()> { + instructions::v2::add_liquidity2::handle(ctx, liquidity_parameter, remaining_accounts_info) + } + + pub fn add_liquidity_by_strategy2( + ctx: Context, + liquidity_parameter: LiquidityParameterByStrategy, + remaining_accounts_info: RemainingAccountsInfo, + ) -> Result<()> { + instructions::v2::add_liquidity_by_strategy2::handle( + ctx, + &liquidity_parameter, + remaining_accounts_info, + ) + } + + pub fn claim_reward2<'c: 'info, 'info>( + ctx: Context, + reward_index: u64, + min_bin_id: i32, + max_bin_id: i32, + remaining_accounts_info: RemainingAccountsInfo, + ) -> Result<()> { + instructions::v2::claim_reward2::handle( + ctx, + reward_index, + min_bin_id, + max_bin_id, + remaining_accounts_info, + ) + } + + pub fn remove_liquidity2( + ctx: Context, + bin_liquidity_removal: Vec, + remaining_accounts_info: RemainingAccountsInfo, + ) -> Result<()> { + instructions::v2::remove_liquidity2::handle( + ctx, + bin_liquidity_removal, + &remaining_accounts_info.slices, + ) + } + + pub fn remove_liquidity_by_range2( + ctx: Context, + from_bin_id: i32, + to_bin_id: i32, + bps_to_remove: u16, + remaining_accounts_info: RemainingAccountsInfo, + ) -> Result<()> { + instructions::v2::remove_liquidity_by_range2::handle( + ctx, + from_bin_id, + to_bin_id, + bps_to_remove, + remaining_accounts_info, + ) + } + + pub fn swap2( + ctx: Context, + amount_in: u64, + min_amount_out: u64, + remaining_accounts_info: RemainingAccountsInfo, + ) -> Result<()> { + instructions::v2::swap2::handle_exact_in2( + ctx, + amount_in, + min_amount_out, + remaining_accounts_info, + ) + } + + pub fn swap_with_price_impact2( + ctx: Context, + amount_in: u64, + active_id: Option, + max_price_impact_bps: u16, + remaining_accounts_info: RemainingAccountsInfo, + ) -> Result<()> { + instructions::v2::swap2::handle_exact_in_with_price_impact2( + ctx, + amount_in, + active_id, + max_price_impact_bps, + remaining_accounts_info, + ) + } } diff --git a/programs/lb_clmm/src/state/lb_pair.rs b/programs/lb_clmm/src/state/lb_pair.rs index 4fe00e7c..5efe6ec6 100644 --- a/programs/lb_clmm/src/state/lb_pair.rs +++ b/programs/lb_clmm/src/state/lb_pair.rs @@ -484,17 +484,6 @@ impl LbPair { Ok(total_fee_rate_cap) } - #[cfg(test)] - /// Maximum fee rate - fn get_max_total_fee(&self) -> Result { - let max_total_fee_rate = self - .get_base_fee()? - .safe_add(self.compute_variable_fee(self.parameters.max_volatility_accumulator)?)?; - - let total_fee_rate_cap = std::cmp::min(max_total_fee_rate, MAX_FEE_RATE.into()); - Ok(total_fee_rate_cap) - } - /// Compute composition fee. Composition_fee = fee_amount * (1 + total fee rate) pub fn compute_composition_fee(&self, swap_amount: u64) -> Result { let total_fee_rate = self.get_total_fee()?; diff --git a/programs/lb_clmm/src/state/mod.rs b/programs/lb_clmm/src/state/mod.rs index bb3422b6..bef654a6 100644 --- a/programs/lb_clmm/src/state/mod.rs +++ b/programs/lb_clmm/src/state/mod.rs @@ -6,3 +6,4 @@ pub mod oracle; pub mod parameters; pub mod position; pub mod preset_parameters; +pub mod token_badge; diff --git a/programs/lb_clmm/src/state/token_badge.rs b/programs/lb_clmm/src/state/token_badge.rs new file mode 100644 index 00000000..a4dfa716 --- /dev/null +++ b/programs/lb_clmm/src/state/token_badge.rs @@ -0,0 +1,18 @@ +use anchor_lang::prelude::*; + +#[account(zero_copy)] +#[derive(InitSpace, Debug)] +/// Parameter that set by the protocol +pub struct TokenBadge { + /// Token mint + pub token_mint: Pubkey, + /// Reserved space + pub _padding: [u8; 128], +} + +impl TokenBadge { + pub fn initialize(&mut self, token_mint: Pubkey) -> Result<()> { + self.token_mint = token_mint; + Ok(()) + } +} diff --git a/programs/lb_clmm/src/utils/mod.rs b/programs/lb_clmm/src/utils/mod.rs index f577dc79..1b91d15d 100644 --- a/programs/lb_clmm/src/utils/mod.rs +++ b/programs/lb_clmm/src/utils/mod.rs @@ -1,2 +1,5 @@ pub mod pda; +pub mod remaining_accounts_util; pub mod seeds; +pub mod token; +pub mod transfer_memo; diff --git a/programs/lb_clmm/src/utils/pda.rs b/programs/lb_clmm/src/utils/pda.rs index b561b2ab..be4d9707 100644 --- a/programs/lb_clmm/src/utils/pda.rs +++ b/programs/lb_clmm/src/utils/pda.rs @@ -116,3 +116,7 @@ pub fn derive_preset_parameter_pda2(bin_step: u16, base_factor: u16) -> (Pubkey, &crate::ID, ) } + +pub fn derive_token_badge_pda(token_mint: Pubkey) -> (Pubkey, u8) { + Pubkey::find_program_address(&[b"token_badge", token_mint.as_ref()], &crate::ID) +} diff --git a/programs/lb_clmm/src/utils/remaining_accounts_util.rs b/programs/lb_clmm/src/utils/remaining_accounts_util.rs new file mode 100644 index 00000000..699e9c12 --- /dev/null +++ b/programs/lb_clmm/src/utils/remaining_accounts_util.rs @@ -0,0 +1,87 @@ +use crate::errors::LBError; +use anchor_lang::prelude::*; + +#[derive(AnchorSerialize, AnchorDeserialize, Clone, PartialEq, Eq, Debug)] +pub enum AccountsType { + TransferHookX, + TransferHookY, + TransferHookReward, +} + +#[derive(AnchorSerialize, AnchorDeserialize, Clone, Debug)] +pub struct RemainingAccountsSlice { + pub accounts_type: AccountsType, + pub length: u8, +} + +#[derive(AnchorSerialize, AnchorDeserialize, Clone)] +pub struct RemainingAccountsInfo { + pub slices: Vec, +} + +impl RemainingAccountsInfo { + pub fn len(&self) -> u8 { + self.slices.iter().map(|s| s.length).sum() + } +} + +#[derive(Debug, Default)] +pub struct ParsedRemainingAccounts<'a, 'info> { + pub transfer_hook_x: Option<&'a [AccountInfo<'info>]>, + pub transfer_hook_y: Option<&'a [AccountInfo<'info>]>, + pub transfer_hook_reward: Option<&'a [AccountInfo<'info>]>, +} + +/// Parse remaining accounts by consume all the transfer hooks related accounts. +pub fn parse_remaining_accounts<'a, 'info>( + remaining_accounts: &mut &'a [AccountInfo<'info>], + remaining_accounts_slice: &[RemainingAccountsSlice], + valid_accounts_type_list: &[AccountsType], +) -> Result> { + let mut parsed_remaining_accounts = ParsedRemainingAccounts::default(); + + if remaining_accounts_slice.is_empty() { + return Ok(ParsedRemainingAccounts::default()); + } + + for slice in remaining_accounts_slice.iter() { + if !valid_accounts_type_list.contains(&slice.accounts_type) { + return Err(LBError::InvalidRemainingAccountSlice.into()); + } + + if slice.length == 0 { + continue; + } + + if remaining_accounts.len() < slice.length as usize { + return Err(LBError::InsufficientRemainingAccounts.into()); + } + + let end_idx = slice.length as usize; + let accounts = &remaining_accounts[0..end_idx]; + *remaining_accounts = &remaining_accounts[end_idx..]; + + match slice.accounts_type { + AccountsType::TransferHookX => { + if parsed_remaining_accounts.transfer_hook_x.is_some() { + return Err(LBError::DuplicatedRemainingAccountTypes.into()); + } + parsed_remaining_accounts.transfer_hook_x = Some(accounts); + } + AccountsType::TransferHookY => { + if parsed_remaining_accounts.transfer_hook_y.is_some() { + return Err(LBError::DuplicatedRemainingAccountTypes.into()); + } + parsed_remaining_accounts.transfer_hook_y = Some(accounts); + } + AccountsType::TransferHookReward => { + if parsed_remaining_accounts.transfer_hook_reward.is_some() { + return Err(LBError::DuplicatedRemainingAccountTypes.into()); + } + parsed_remaining_accounts.transfer_hook_reward = Some(accounts); + } + } + } + + Ok(parsed_remaining_accounts) +} diff --git a/programs/lb_clmm/src/utils/token.rs b/programs/lb_clmm/src/utils/token.rs new file mode 100644 index 00000000..da31c9f1 --- /dev/null +++ b/programs/lb_clmm/src/utils/token.rs @@ -0,0 +1,43 @@ +use crate::errors::LBError; +use crate::state::token_badge::TokenBadge; +use anchor_lang::prelude::*; +use anchor_spl::{ + token::Token, + token_2022::spl_token_2022::{ + self, + extension::{BaseStateWithExtensions, ExtensionType, StateWithExtensions}, + }, + token_interface::Mint, +}; + +pub fn validate_mint<'info>( + mint_account: &InterfaceAccount, + token_badge: &Option>, +) -> Result<()> { + let mint_info = mint_account.to_account_info(); + + if *mint_info.owner == Token::id() { + return Ok(()); + } + match token_badge { + Some(account) => { + let token_badge = account.load()?; + if token_badge.token_mint == mint_account.key() { + Ok(()) + } else { + Err(LBError::UnmatchTokenMint.into()) + } + } + None => { + let mint_data = mint_info.try_borrow_data()?; + let mint = StateWithExtensions::::unpack(&mint_data)?; + let extensions = mint.get_extension_types()?; + for e in extensions { + if e != ExtensionType::MetadataPointer && e != ExtensionType::TokenMetadata { + return Err(LBError::UnsupportedMintExtension.into()); + } + } + Ok(()) + } + } +} diff --git a/programs/lb_clmm/src/utils/transfer_memo.rs b/programs/lb_clmm/src/utils/transfer_memo.rs new file mode 100644 index 00000000..f0b1660a --- /dev/null +++ b/programs/lb_clmm/src/utils/transfer_memo.rs @@ -0,0 +1,7 @@ +pub const WITHDRAW_PROTOCOL_FEE_MEMO: &[u8] = b"DLMM WithdrawProtocolFee"; +pub const REMOVE_LIQUIDITY_MEMO: &[u8] = b"DLMM RemoveLiquidity"; +pub const CLAIM_FEES_MEMO: &[u8] = b"DLMM ClaimFees"; +pub const CLAIM_REWARDS_MEMO: &[u8] = b"DLMM ClaimRewards"; +pub const SWAP_MEMO: &[u8] = b"DLMM Swap"; +pub const WITHDRAW_INELIGIBLE_REWARD_MEMO: &[u8] = b"DLMM WithdrawIneligibleReward"; +pub const HOST_FEE_MEMO: &[u8] = b"DLMM HostFee"; diff --git a/target/idl/lb_clmm.json b/target/idl/lb_clmm.json index 375beae4..cf220618 100644 --- a/target/idl/lb_clmm.json +++ b/target/idl/lb_clmm.json @@ -1,5 +1,5 @@ { - "version": "0.8.0", + "version": "0.9.0", "name": "lb_clmm", "constants": [ { @@ -250,7 +250,24 @@ "isSigner": true }, { - "name": "tokenProgram", + "name": "tokenBadgeX", + "isMut": false, + "isSigner": false, + "isOptional": true + }, + { + "name": "tokenBadgeY", + "isMut": false, + "isSigner": false, + "isOptional": true + }, + { + "name": "tokenProgramX", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgramY", "isMut": false, "isSigner": false }, @@ -1188,19 +1205,13 @@ ] }, { - "name": "swapExactOut", + "name": "withdrawProtocolFee", "accounts": [ { "name": "lbPair", "isMut": true, "isSigner": false }, - { - "name": "binArrayBitmapExtension", - "isMut": false, - "isSigner": false, - "isOptional": true - }, { "name": "reserveX", "isMut": true, @@ -1211,16 +1222,6 @@ "isMut": true, "isSigner": false }, - { - "name": "userTokenIn", - "isMut": true, - "isSigner": false - }, - { - "name": "userTokenOut", - "isMut": true, - "isSigner": false - }, { "name": "tokenXMint", "isMut": false, @@ -1232,110 +1233,17 @@ "isSigner": false }, { - "name": "oracle", - "isMut": true, - "isSigner": false - }, - { - "name": "hostFeeIn", - "isMut": true, - "isSigner": false, - "isOptional": true - }, - { - "name": "user", - "isMut": false, - "isSigner": true - }, - { - "name": "tokenXProgram", - "isMut": false, - "isSigner": false - }, - { - "name": "tokenYProgram", - "isMut": false, - "isSigner": false - }, - { - "name": "eventAuthority", - "isMut": false, - "isSigner": false - }, - { - "name": "program", - "isMut": false, - "isSigner": false - } - ], - "args": [ - { - "name": "maxInAmount", - "type": "u64" - }, - { - "name": "outAmount", - "type": "u64" - } - ] - }, - { - "name": "swapWithPriceImpact", - "accounts": [ - { - "name": "lbPair", - "isMut": true, - "isSigner": false - }, - { - "name": "binArrayBitmapExtension", - "isMut": false, - "isSigner": false, - "isOptional": true - }, - { - "name": "reserveX", - "isMut": true, - "isSigner": false - }, - { - "name": "reserveY", - "isMut": true, - "isSigner": false - }, - { - "name": "userTokenIn", - "isMut": true, - "isSigner": false - }, - { - "name": "userTokenOut", + "name": "receiverTokenX", "isMut": true, "isSigner": false }, { - "name": "tokenXMint", - "isMut": false, - "isSigner": false - }, - { - "name": "tokenYMint", - "isMut": false, - "isSigner": false - }, - { - "name": "oracle", + "name": "receiverTokenY", "isMut": true, "isSigner": false }, { - "name": "hostFeeIn", - "isMut": true, - "isSigner": false, - "isOptional": true - }, - { - "name": "user", + "name": "feeOwner", "isMut": false, "isSigner": true }, @@ -1344,82 +1252,6 @@ "isMut": false, "isSigner": false }, - { - "name": "tokenYProgram", - "isMut": false, - "isSigner": false - }, - { - "name": "eventAuthority", - "isMut": false, - "isSigner": false - }, - { - "name": "program", - "isMut": false, - "isSigner": false - } - ], - "args": [ - { - "name": "amountIn", - "type": "u64" - }, - { - "name": "activeId", - "type": { - "option": "i32" - } - }, - { - "name": "maxPriceImpactBps", - "type": "u16" - } - ] - }, - { - "name": "withdrawProtocolFee", - "accounts": [ - { - "name": "lbPair", - "isMut": true, - "isSigner": false - }, - { - "name": "reserveX", - "isMut": true, - "isSigner": false - }, - { - "name": "reserveY", - "isMut": true, - "isSigner": false - }, - { - "name": "tokenXMint", - "isMut": false, - "isSigner": false - }, - { - "name": "tokenYMint", - "isMut": false, - "isSigner": false - }, - { - "name": "receiverTokenX", - "isMut": true, - "isSigner": false - }, - { - "name": "receiverTokenY", - "isMut": true, - "isSigner": false - }, - { - "name": "tokenXProgram", - "isMut": false, - "isSigner": false - }, { "name": "tokenYProgram", "isMut": false, @@ -1455,6 +1287,12 @@ "isMut": false, "isSigner": false }, + { + "name": "tokenBadge", + "isMut": false, + "isSigner": false, + "isOptional": true + }, { "name": "admin", "isMut": true, @@ -2039,124 +1877,61 @@ "args": [] }, { - "name": "removeLiquiditySingleSide", + "name": "togglePairStatus", "accounts": [ { - "name": "position", + "name": "lbPair", "isMut": true, "isSigner": false }, + { + "name": "admin", + "isMut": false, + "isSigner": true + } + ], + "args": [] + }, + { + "name": "updateWhitelistedWallet", + "accounts": [ { "name": "lbPair", "isMut": true, "isSigner": false }, { - "name": "binArrayBitmapExtension", - "isMut": true, - "isSigner": false, - "isOptional": true + "name": "creator", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "idx", + "type": "u8" }, { - "name": "userToken", + "name": "wallet", + "type": "publicKey" + } + ] + }, + { + "name": "migratePosition", + "accounts": [ + { + "name": "positionV2", "isMut": true, - "isSigner": false + "isSigner": true }, { - "name": "reserve", + "name": "positionV1", "isMut": true, "isSigner": false }, { - "name": "tokenMint", - "isMut": false, - "isSigner": false - }, - { - "name": "binArrayLower", - "isMut": true, - "isSigner": false - }, - { - "name": "binArrayUpper", - "isMut": true, - "isSigner": false - }, - { - "name": "sender", - "isMut": false, - "isSigner": true - }, - { - "name": "tokenProgram", - "isMut": false, - "isSigner": false - }, - { - "name": "eventAuthority", - "isMut": false, - "isSigner": false - }, - { - "name": "program", - "isMut": false, - "isSigner": false - } - ], - "args": [] - }, - { - "name": "togglePairStatus", - "accounts": [ - { - "name": "lbPair", - "isMut": true, - "isSigner": false - }, - { - "name": "admin", - "isMut": false, - "isSigner": true - } - ], - "args": [] - }, - { - "name": "updateWhitelistedWallet", - "accounts": [ - { - "name": "lbPair", - "isMut": true, - "isSigner": false - }, - { - "name": "creator", - "isMut": false, - "isSigner": true - } - ], - "args": [ - { - "name": "wallet", - "type": "publicKey" - } - ] - }, - { - "name": "migratePosition", - "accounts": [ - { - "name": "positionV2", - "isMut": true, - "isSigner": true - }, - { - "name": "positionV1", - "isMut": true, - "isSigner": false - }, - { - "name": "lbPair", + "name": "lbPair", "isMut": false, "isSigner": false }, @@ -2354,7 +2129,7 @@ ] }, { - "name": "removeLiquidityByRange", + "name": "addLiquidityOneSidePrecise", "accounts": [ { "name": "position", @@ -2373,15 +2148,116 @@ "isOptional": true }, { - "name": "userTokenX", + "name": "userToken", "isMut": true, "isSigner": false }, { - "name": "userTokenY", + "name": "reserve", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenMint", + "isMut": false, + "isSigner": false + }, + { + "name": "binArrayLower", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayUpper", + "isMut": true, + "isSigner": false + }, + { + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "parameter", + "type": { + "defined": "AddLiquiditySingleSidePreciseParameter" + } + } + ] + }, + { + "name": "setPreActivationDuration", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "creator", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "preActivationDuration", + "type": "u16" + } + ] + }, + { + "name": "setPreActivationSwapAddress", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "creator", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "preActivationSwapAddress", + "type": "publicKey" + } + ] + }, + { + "name": "swapExactOut", + "accounts": [ + { + "name": "lbPair", "isMut": true, "isSigner": false }, + { + "name": "binArrayBitmapExtension", + "isMut": false, + "isSigner": false, + "isOptional": true + }, { "name": "reserveX", "isMut": true, @@ -2392,6 +2268,16 @@ "isMut": true, "isSigner": false }, + { + "name": "userTokenIn", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenOut", + "isMut": true, + "isSigner": false + }, { "name": "tokenXMint", "isMut": false, @@ -2403,17 +2289,18 @@ "isSigner": false }, { - "name": "binArrayLower", + "name": "oracle", "isMut": true, "isSigner": false }, { - "name": "binArrayUpper", + "name": "hostFeeIn", "isMut": true, - "isSigner": false + "isSigner": false, + "isOptional": true }, { - "name": "sender", + "name": "user", "isMut": false, "isSigner": true }, @@ -2440,183 +2327,997 @@ ], "args": [ { - "name": "fromBinId", - "type": "i32" - }, - { - "name": "toBinId", - "type": "i32" + "name": "maxInAmount", + "type": "u64" }, { - "name": "bpsToRemove", - "type": "u16" + "name": "outAmount", + "type": "u64" } ] }, { - "name": "addLiquidityOneSidePrecise", + "name": "swapWithPriceImpact", "accounts": [ { - "name": "position", + "name": "lbPair", "isMut": true, "isSigner": false }, { - "name": "lbPair", + "name": "binArrayBitmapExtension", + "isMut": false, + "isSigner": false, + "isOptional": true + }, + { + "name": "reserveX", "isMut": true, "isSigner": false }, { - "name": "binArrayBitmapExtension", + "name": "reserveY", "isMut": true, - "isSigner": false, - "isOptional": true + "isSigner": false }, { - "name": "userToken", + "name": "userTokenIn", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenOut", "isMut": true, "isSigner": false }, { - "name": "reserve", + "name": "tokenXMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYMint", + "isMut": false, + "isSigner": false + }, + { + "name": "oracle", + "isMut": true, + "isSigner": false + }, + { + "name": "hostFeeIn", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "user", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenXProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "amountIn", + "type": "u64" + }, + { + "name": "activeId", + "type": { + "option": "i32" + } + }, + { + "name": "maxPriceImpactBps", + "type": "u16" + } + ] + }, + { + "name": "initializeTokenBadge", + "accounts": [ + { + "name": "tokenMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenBadge", + "isMut": true, + "isSigner": false + }, + { + "name": "admin", + "isMut": true, + "isSigner": true + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "claimFee2", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenX", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenY", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenXMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgramX", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgramY", + "isMut": false, + "isSigner": false + }, + { + "name": "memoProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "initializeLbPair2", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "tokenMintX", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenMintY", + "isMut": false, + "isSigner": false + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "oracle", + "isMut": true, + "isSigner": false + }, + { + "name": "presetParameter", + "isMut": false, + "isSigner": false + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "tokenBadgeX", + "isMut": false, + "isSigner": false, + "isOptional": true + }, + { + "name": "tokenBadgeY", + "isMut": false, + "isSigner": false, + "isOptional": true + }, + { + "name": "tokenProgramX", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgramY", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "activeId", + "type": "i32" + }, + { + "name": "binStep", + "type": "u16" + } + ] + }, + { + "name": "addLiquidity2", + "accounts": [ + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "userTokenX", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenY", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenXMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYMint", + "isMut": false, + "isSigner": false + }, + { + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenXProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "memoProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "liquidityParameter", + "type": { + "defined": "LiquidityParameter" + } + }, + { + "name": "remainingAccountsInfo", + "type": { + "defined": "RemainingAccountsInfo" + } + } + ] + }, + { + "name": "addLiquidityByStrategy2", + "accounts": [ + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "userTokenX", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenY", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenXMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYMint", + "isMut": false, + "isSigner": false + }, + { + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenXProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "memoProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "liquidityParameter", + "type": { + "defined": "LiquidityParameterByStrategy" + } + }, + { + "name": "remainingAccountsInfo", + "type": { + "defined": "RemainingAccountsInfo" + } + } + ] + }, + { + "name": "claimReward2", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "rewardVault", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardMint", + "isMut": false, + "isSigner": false + }, + { + "name": "userTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "memoProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "rewardIndex", + "type": "u64" + }, + { + "name": "minBinId", + "type": "i32" + }, + { + "name": "maxBinId", + "type": "i32" + }, + { + "name": "remainingAccountsInfo", + "type": { + "defined": "RemainingAccountsInfo" + } + } + ] + }, + { + "name": "removeLiquidity2", + "accounts": [ + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "userTokenX", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenY", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenXMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYMint", + "isMut": false, + "isSigner": false + }, + { + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenXProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "memoProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "binLiquidityRemoval", + "type": { + "vec": { + "defined": "BinLiquidityReduction" + } + } + }, + { + "name": "remainingAccountsInfo", + "type": { + "defined": "RemainingAccountsInfo" + } + } + ] + }, + { + "name": "removeLiquidityByRange2", + "accounts": [ + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "userTokenX", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenY", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenXMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYMint", + "isMut": false, + "isSigner": false + }, + { + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenXProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "memoProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "fromBinId", + "type": "i32" + }, + { + "name": "toBinId", + "type": "i32" + }, + { + "name": "bpsToRemove", + "type": "u16" + }, + { + "name": "remainingAccountsInfo", + "type": { + "defined": "RemainingAccountsInfo" + } + } + ] + }, + { + "name": "swap2", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": false, + "isSigner": false, + "isOptional": true + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenIn", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenOut", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenXMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYMint", + "isMut": false, + "isSigner": false + }, + { + "name": "oracle", + "isMut": true, + "isSigner": false + }, + { + "name": "hostFeeIn", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "user", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenXProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "memoProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "amountIn", + "type": "u64" + }, + { + "name": "minAmountOut", + "type": "u64" + }, + { + "name": "remainingAccountsInfo", + "type": { + "defined": "RemainingAccountsInfo" + } + } + ] + }, + { + "name": "swapWithPriceImpact2", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": false, + "isSigner": false, + "isOptional": true + }, + { + "name": "reserveX", "isMut": true, "isSigner": false }, { - "name": "tokenMint", - "isMut": false, + "name": "reserveY", + "isMut": true, "isSigner": false }, { - "name": "binArrayLower", + "name": "userTokenIn", "isMut": true, "isSigner": false }, { - "name": "binArrayUpper", + "name": "userTokenOut", "isMut": true, "isSigner": false }, { - "name": "sender", - "isMut": false, - "isSigner": true - }, - { - "name": "tokenProgram", + "name": "tokenXMint", "isMut": false, "isSigner": false }, { - "name": "eventAuthority", + "name": "tokenYMint", "isMut": false, "isSigner": false }, { - "name": "program", - "isMut": false, - "isSigner": false - } - ], - "args": [ - { - "name": "parameter", - "type": { - "defined": "AddLiquiditySingleSidePreciseParameter" - } - } - ] - }, - { - "name": "goToABin", - "accounts": [ - { - "name": "lbPair", + "name": "oracle", "isMut": true, "isSigner": false }, { - "name": "binArrayBitmapExtension", - "isMut": false, + "name": "hostFeeIn", + "isMut": true, "isSigner": false, "isOptional": true }, { - "name": "fromBinArray", + "name": "user", "isMut": false, - "isSigner": false, - "isOptional": true + "isSigner": true }, { - "name": "toBinArray", + "name": "tokenXProgram", "isMut": false, - "isSigner": false, - "isOptional": true + "isSigner": false }, { - "name": "eventAuthority", + "name": "tokenYProgram", "isMut": false, "isSigner": false }, { - "name": "program", + "name": "memoProgram", "isMut": false, "isSigner": false - } - ], - "args": [ - { - "name": "binId", - "type": "i32" - } - ] - }, - { - "name": "setPreActivationSlotDuration", - "accounts": [ + }, { - "name": "lbPair", - "isMut": true, + "name": "eventAuthority", + "isMut": false, "isSigner": false }, { - "name": "creator", + "name": "program", "isMut": false, - "isSigner": true + "isSigner": false } ], "args": [ { - "name": "preActivationDuration", - "type": "u16" - } - ] - }, - { - "name": "setPreActivationSwapAddress", - "accounts": [ + "name": "amountIn", + "type": "u64" + }, { - "name": "lbPair", - "isMut": true, - "isSigner": false + "name": "activeId", + "type": { + "option": "i32" + } }, { - "name": "creator", - "isMut": false, - "isSigner": true - } - ], - "args": [ + "name": "maxPriceImpactBps", + "type": "u16" + }, { - "name": "preActivationSwapAddress", - "type": "publicKey" + "name": "remainingAccountsInfo", + "type": { + "defined": "RemainingAccountsInfo" + } } ] } ], "accounts": [ { - "name": "binArrayBitmapExtension", + "name": "BinArrayBitmapExtension", "type": { "kind": "struct", "fields": [ @@ -2662,7 +3363,7 @@ } }, { - "name": "binArray", + "name": "BinArray", "docs": [ "An account to contain a range of bin. For example: Bin 100 <-> 200.", "For example:", @@ -2711,7 +3412,7 @@ } }, { - "name": "lbPair", + "name": "LbPair", "type": { "kind": "struct", "fields": [ @@ -2849,7 +3550,7 @@ { "name": "padding1", "docs": [ - "Fee owner. Deprecated. Can be used as buffer in the future." + "_padding_1, previous Fee owner, BE CAREFUL FOR TOMBSTONE WHEN REUSE !!" ], "type": { "array": [ @@ -2975,7 +3676,7 @@ } }, { - "name": "oracle", + "name": "Oracle", "type": { "kind": "struct", "fields": [ @@ -3004,7 +3705,7 @@ } }, { - "name": "position", + "name": "Position", "type": { "kind": "struct", "fields": [ @@ -3125,7 +3826,7 @@ } }, { - "name": "positionV2", + "name": "PositionV2", "type": { "kind": "struct", "fields": [ @@ -3274,7 +3975,7 @@ } }, { - "name": "presetParameter", + "name": "PresetParameter", "type": { "kind": "struct", "fields": [ @@ -3350,6 +4051,36 @@ } ] } + }, + { + "name": "TokenBadge", + "docs": [ + "Parameter that set by the protocol" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "tokenMint", + "docs": [ + "Token mint" + ], + "type": "publicKey" + }, + { + "name": "padding", + "docs": [ + "Reserved space" + ], + "type": { + "array": [ + "u8", + 128 + ] + } + } + ] + } } ], "types": [ @@ -3801,38 +4532,38 @@ } }, { - "name": "FeeParameter", + "name": "BinLiquidityReduction", "type": { "kind": "struct", "fields": [ { - "name": "protocolShare", - "docs": [ - "Portion of swap fees retained by the protocol by controlling protocol_share parameter. protocol_swap_fee = protocol_share * total_swap_fee" - ], - "type": "u16" + "name": "binId", + "type": "i32" }, { - "name": "baseFactor", - "docs": [ - "Base factor for base fee rate" - ], + "name": "bpsToRemove", "type": "u16" } ] } }, { - "name": "BinLiquidityReduction", + "name": "FeeParameter", "type": { "kind": "struct", "fields": [ { - "name": "binId", - "type": "i32" + "name": "protocolShare", + "docs": [ + "Portion of swap fees retained by the protocol by controlling protocol_share parameter. protocol_swap_fee = protocol_share * total_swap_fee" + ], + "type": "u16" }, { - "name": "bpsToRemove", + "name": "baseFactor", + "docs": [ + "Base factor for base fee rate" + ], "type": "u16" } ] @@ -4226,6 +4957,40 @@ ] } }, + { + "name": "RemainingAccountsSlice", + "type": { + "kind": "struct", + "fields": [ + { + "name": "accountsType", + "type": { + "defined": "AccountsType" + } + }, + { + "name": "length", + "type": "u8" + } + ] + } + }, + { + "name": "RemainingAccountsInfo", + "type": { + "kind": "struct", + "fields": [ + { + "name": "slices", + "type": { + "vec": { + "defined": "RemainingAccountsSlice" + } + } + } + ] + } + }, { "name": "StrategyType", "type": { @@ -4342,6 +5107,23 @@ } ] } + }, + { + "name": "AccountsType", + "type": { + "kind": "enum", + "variants": [ + { + "name": "TransferHookX" + }, + { + "name": "TransferHookY" + }, + { + "name": "TransferHookReward" + } + ] + } } ], "events": [ @@ -4839,26 +5621,6 @@ "index": false } ] - }, - { - "name": "GoToABin", - "fields": [ - { - "name": "lbPair", - "type": "publicKey", - "index": false - }, - { - "name": "fromBinId", - "type": "i32", - "index": false - }, - { - "name": "toBinId", - "type": "i32", - "index": false - } - ] } ], "errors": [ @@ -5124,46 +5886,93 @@ }, { "code": 6052, - "name": "AlreadyPassActivationSlot", + "name": "AlreadyPassActivationPoint", "msg": "Already activated" }, { "code": 6053, - "name": "LastSlotCannotBeSmallerThanActivateSlot", - "msg": "Last slot cannot be smaller than activate slot" - }, - { - "code": 6054, "name": "ExceedMaxSwappedAmount", "msg": "Swapped amount is exceeded max swapped amount" }, { - "code": 6055, + "code": 6054, "name": "InvalidStrategyParameters", "msg": "Invalid strategy parameters" }, { - "code": 6056, + "code": 6055, "name": "LiquidityLocked", "msg": "Liquidity locked" }, + { + "code": 6056, + "name": "BinRangeIsNotEmpty", + "msg": "Bin range is not empty" + }, { "code": 6057, - "name": "InvalidLockReleaseSlot", - "msg": "Invalid lock release slot" + "name": "NotExactAmountOut", + "msg": "Amount out is not matched with exact amount out" }, { "code": 6058, - "name": "BinRangeIsNotEmpty", - "msg": "Bin range is not empty" + "name": "InvalidActivationType", + "msg": "Invalid activation type" }, { "code": 6059, - "name": "NotExactAmountOut", - "msg": "Amount out is not matched with exact amount out" + "name": "NotSupportMint", + "msg": "Not support token_2022 mint extension" + }, + { + "code": 6060, + "name": "UnsupportedMintExtension", + "msg": "Unsupported mint extension" + }, + { + "code": 6061, + "name": "UnsupportNativeMintToken2022", + "msg": "Unsupported native mint token2022" + }, + { + "code": 6062, + "name": "UnmatchTokenMint", + "msg": "Unmatch token mint" + }, + { + "code": 6063, + "name": "UnsupportedTokenMint", + "msg": "Unsupported token mint" + }, + { + "code": 6064, + "name": "InsufficientRemainingAccounts", + "msg": "Insufficient remaining accounts" + }, + { + "code": 6065, + "name": "InvalidRemainingAccountSlice", + "msg": "Invalid remaining account slice" + }, + { + "code": 6066, + "name": "DuplicatedRemainingAccountTypes", + "msg": "Duplicated remaining account types" + }, + { + "code": 6067, + "name": "MissingRemainingAccountForTransferHook", + "msg": "Missing remaining account for transfer hook" + }, + { + "code": 6068, + "name": "NoTransferHookProgram", + "msg": "Remaining account was passed for transfer hook but there's no hook program" + }, + { + "code": 6069, + "name": "ZeroFundedAmount", + "msg": "Zero funded amount" } - ], - "metadata": { - "address": "GrAkKfEpTKQuVHG2Y97Y2FF4i7y7Q5AHLK94JBy7Y5yv" - } + ] } \ No newline at end of file diff --git a/target/types/lb_clmm.ts b/target/types/lb_clmm.ts index de1b7e7b..5bdbef99 100644 --- a/target/types/lb_clmm.ts +++ b/target/types/lb_clmm.ts @@ -1,5 +1,5 @@ export type LbClmm = { - "version": "0.8.0", + "version": "0.9.0", "name": "lb_clmm", "constants": [ { @@ -250,7 +250,24 @@ export type LbClmm = { "isSigner": true }, { - "name": "tokenProgram", + "name": "tokenBadgeX", + "isMut": false, + "isSigner": false, + "isOptional": true + }, + { + "name": "tokenBadgeY", + "isMut": false, + "isSigner": false, + "isOptional": true + }, + { + "name": "tokenProgramX", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgramY", "isMut": false, "isSigner": false }, @@ -1270,6 +1287,12 @@ export type LbClmm = { "isMut": false, "isSigner": false }, + { + "name": "tokenBadge", + "isMut": false, + "isSigner": false, + "isOptional": true + }, { "name": "admin", "isMut": true, @@ -2410,156 +2433,1036 @@ export type LbClmm = { "type": "u16" } ] - } - ], - "accounts": [ + }, { - "name": "binArrayBitmapExtension", - "type": { - "kind": "struct", - "fields": [ - { - "name": "lbPair", - "type": "publicKey" - }, - { - "name": "positiveBinArrayBitmap", - "docs": [ - "Packed initialized bin array state for start_bin_index is positive" - ], - "type": { - "array": [ - { - "array": [ - "u64", - 8 - ] - }, - 12 - ] - } - }, - { - "name": "negativeBinArrayBitmap", - "docs": [ - "Packed initialized bin array state for start_bin_index is negative" - ], - "type": { - "array": [ - { - "array": [ - "u64", - 8 - ] - }, - 12 - ] - } - } - ] - } + "name": "initializeTokenBadge", + "accounts": [ + { + "name": "tokenMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenBadge", + "isMut": true, + "isSigner": false + }, + { + "name": "admin", + "isMut": true, + "isSigner": true + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [] }, { - "name": "binArray", - "docs": [ - "An account to contain a range of bin. For example: Bin 100 <-> 200.", - "For example:", - "BinArray index: 0 contains bin 0 <-> 599", - "index: 2 contains bin 600 <-> 1199, ..." + "name": "claimFee2", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenX", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenY", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenXMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgramX", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgramY", + "isMut": false, + "isSigner": false + }, + { + "name": "memoProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } ], - "type": { - "kind": "struct", - "fields": [ - { - "name": "index", - "type": "i64" - }, - { - "name": "version", - "docs": [ - "Version of binArray" - ], - "type": "u8" - }, - { - "name": "padding", - "type": { - "array": [ - "u8", - 7 - ] - } - }, - { - "name": "lbPair", - "type": "publicKey" - }, - { - "name": "bins", - "type": { - "array": [ - { - "defined": "Bin" - }, - 70 - ] - } - } - ] - } + "args": [] }, { - "name": "lbPair", - "type": { - "kind": "struct", - "fields": [ - { - "name": "parameters", - "type": { - "defined": "StaticParameters" - } - }, - { - "name": "vParameters", - "type": { - "defined": "VariableParameters" - } - }, - { - "name": "bumpSeed", - "type": { - "array": [ - "u8", - 1 - ] - } - }, - { - "name": "binStepSeed", - "docs": [ - "Bin step signer seed" - ], - "type": { - "array": [ - "u8", - 2 - ] - } - }, - { - "name": "pairType", - "docs": [ - "Type of the pair" - ], - "type": "u8" - }, - { - "name": "activeId", - "docs": [ - "Active bin id" - ], - "type": "i32" - }, + "name": "initializeLbPair2", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "tokenMintX", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenMintY", + "isMut": false, + "isSigner": false + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "oracle", + "isMut": true, + "isSigner": false + }, + { + "name": "presetParameter", + "isMut": false, + "isSigner": false + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "tokenBadgeX", + "isMut": false, + "isSigner": false, + "isOptional": true + }, + { + "name": "tokenBadgeY", + "isMut": false, + "isSigner": false, + "isOptional": true + }, + { + "name": "tokenProgramX", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgramY", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "activeId", + "type": "i32" + }, + { + "name": "binStep", + "type": "u16" + } + ] + }, + { + "name": "addLiquidity2", + "accounts": [ + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "userTokenX", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenY", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenXMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYMint", + "isMut": false, + "isSigner": false + }, + { + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenXProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "memoProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "liquidityParameter", + "type": { + "defined": "LiquidityParameter" + } + }, + { + "name": "remainingAccountsInfo", + "type": { + "defined": "RemainingAccountsInfo" + } + } + ] + }, + { + "name": "addLiquidityByStrategy2", + "accounts": [ + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "userTokenX", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenY", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenXMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYMint", + "isMut": false, + "isSigner": false + }, + { + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenXProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "memoProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "liquidityParameter", + "type": { + "defined": "LiquidityParameterByStrategy" + } + }, + { + "name": "remainingAccountsInfo", + "type": { + "defined": "RemainingAccountsInfo" + } + } + ] + }, + { + "name": "claimReward2", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "rewardVault", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardMint", + "isMut": false, + "isSigner": false + }, + { + "name": "userTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "memoProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "rewardIndex", + "type": "u64" + }, + { + "name": "minBinId", + "type": "i32" + }, + { + "name": "maxBinId", + "type": "i32" + }, + { + "name": "remainingAccountsInfo", + "type": { + "defined": "RemainingAccountsInfo" + } + } + ] + }, + { + "name": "removeLiquidity2", + "accounts": [ + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "userTokenX", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenY", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenXMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYMint", + "isMut": false, + "isSigner": false + }, + { + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenXProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "memoProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "binLiquidityRemoval", + "type": { + "vec": { + "defined": "BinLiquidityReduction" + } + } + }, + { + "name": "remainingAccountsInfo", + "type": { + "defined": "RemainingAccountsInfo" + } + } + ] + }, + { + "name": "removeLiquidityByRange2", + "accounts": [ + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "userTokenX", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenY", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenXMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYMint", + "isMut": false, + "isSigner": false + }, + { + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenXProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "memoProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "fromBinId", + "type": "i32" + }, + { + "name": "toBinId", + "type": "i32" + }, + { + "name": "bpsToRemove", + "type": "u16" + }, + { + "name": "remainingAccountsInfo", + "type": { + "defined": "RemainingAccountsInfo" + } + } + ] + }, + { + "name": "swap2", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": false, + "isSigner": false, + "isOptional": true + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenIn", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenOut", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenXMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYMint", + "isMut": false, + "isSigner": false + }, + { + "name": "oracle", + "isMut": true, + "isSigner": false + }, + { + "name": "hostFeeIn", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "user", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenXProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "memoProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "amountIn", + "type": "u64" + }, + { + "name": "minAmountOut", + "type": "u64" + }, + { + "name": "remainingAccountsInfo", + "type": { + "defined": "RemainingAccountsInfo" + } + } + ] + }, + { + "name": "swapWithPriceImpact2", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": false, + "isSigner": false, + "isOptional": true + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenIn", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenOut", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenXMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYMint", + "isMut": false, + "isSigner": false + }, + { + "name": "oracle", + "isMut": true, + "isSigner": false + }, + { + "name": "hostFeeIn", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "user", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenXProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "memoProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "amountIn", + "type": "u64" + }, + { + "name": "activeId", + "type": { + "option": "i32" + } + }, + { + "name": "maxPriceImpactBps", + "type": "u16" + }, + { + "name": "remainingAccountsInfo", + "type": { + "defined": "RemainingAccountsInfo" + } + } + ] + } + ], + "accounts": [ + { + "name": "binArrayBitmapExtension", + "type": { + "kind": "struct", + "fields": [ + { + "name": "lbPair", + "type": "publicKey" + }, + { + "name": "positiveBinArrayBitmap", + "docs": [ + "Packed initialized bin array state for start_bin_index is positive" + ], + "type": { + "array": [ + { + "array": [ + "u64", + 8 + ] + }, + 12 + ] + } + }, + { + "name": "negativeBinArrayBitmap", + "docs": [ + "Packed initialized bin array state for start_bin_index is negative" + ], + "type": { + "array": [ + { + "array": [ + "u64", + 8 + ] + }, + 12 + ] + } + } + ] + } + }, + { + "name": "binArray", + "docs": [ + "An account to contain a range of bin. For example: Bin 100 <-> 200.", + "For example:", + "BinArray index: 0 contains bin 0 <-> 599", + "index: 2 contains bin 600 <-> 1199, ..." + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "index", + "type": "i64" + }, + { + "name": "version", + "docs": [ + "Version of binArray" + ], + "type": "u8" + }, + { + "name": "padding", + "type": { + "array": [ + "u8", + 7 + ] + } + }, + { + "name": "lbPair", + "type": "publicKey" + }, + { + "name": "bins", + "type": { + "array": [ + { + "defined": "Bin" + }, + 70 + ] + } + } + ] + } + }, + { + "name": "lbPair", + "type": { + "kind": "struct", + "fields": [ + { + "name": "parameters", + "type": { + "defined": "StaticParameters" + } + }, + { + "name": "vParameters", + "type": { + "defined": "VariableParameters" + } + }, + { + "name": "bumpSeed", + "type": { + "array": [ + "u8", + 1 + ] + } + }, + { + "name": "binStepSeed", + "docs": [ + "Bin step signer seed" + ], + "type": { + "array": [ + "u8", + 2 + ] + } + }, + { + "name": "pairType", + "docs": [ + "Type of the pair" + ], + "type": "u8" + }, + { + "name": "activeId", + "docs": [ + "Active bin id" + ], + "type": "i32" + }, { "name": "binStep", "docs": [ @@ -3148,6 +4051,36 @@ export type LbClmm = { } ] } + }, + { + "name": "tokenBadge", + "docs": [ + "Parameter that set by the protocol" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "tokenMint", + "docs": [ + "Token mint" + ], + "type": "publicKey" + }, + { + "name": "padding", + "docs": [ + "Reserved space" + ], + "type": { + "array": [ + "u8", + 128 + ] + } + } + ] + } } ], "types": [ @@ -4024,6 +4957,40 @@ export type LbClmm = { ] } }, + { + "name": "RemainingAccountsSlice", + "type": { + "kind": "struct", + "fields": [ + { + "name": "accountsType", + "type": { + "defined": "AccountsType" + } + }, + { + "name": "length", + "type": "u8" + } + ] + } + }, + { + "name": "RemainingAccountsInfo", + "type": { + "kind": "struct", + "fields": [ + { + "name": "slices", + "type": { + "vec": { + "defined": "RemainingAccountsSlice" + } + } + } + ] + } + }, { "name": "StrategyType", "type": { @@ -4140,6 +5107,23 @@ export type LbClmm = { } ] } + }, + { + "name": "AccountsType", + "type": { + "kind": "enum", + "variants": [ + { + "name": "TransferHookX" + }, + { + "name": "TransferHookY" + }, + { + "name": "TransferHookReward" + } + ] + } } ], "events": [ @@ -4934,12 +5918,67 @@ export type LbClmm = { "code": 6058, "name": "InvalidActivationType", "msg": "Invalid activation type" + }, + { + "code": 6059, + "name": "NotSupportMint", + "msg": "Not support token_2022 mint extension" + }, + { + "code": 6060, + "name": "UnsupportedMintExtension", + "msg": "Unsupported mint extension" + }, + { + "code": 6061, + "name": "UnsupportNativeMintToken2022", + "msg": "Unsupported native mint token2022" + }, + { + "code": 6062, + "name": "UnmatchTokenMint", + "msg": "Unmatch token mint" + }, + { + "code": 6063, + "name": "UnsupportedTokenMint", + "msg": "Unsupported token mint" + }, + { + "code": 6064, + "name": "InsufficientRemainingAccounts", + "msg": "Insufficient remaining accounts" + }, + { + "code": 6065, + "name": "InvalidRemainingAccountSlice", + "msg": "Invalid remaining account slice" + }, + { + "code": 6066, + "name": "DuplicatedRemainingAccountTypes", + "msg": "Duplicated remaining account types" + }, + { + "code": 6067, + "name": "MissingRemainingAccountForTransferHook", + "msg": "Missing remaining account for transfer hook" + }, + { + "code": 6068, + "name": "NoTransferHookProgram", + "msg": "Remaining account was passed for transfer hook but there's no hook program" + }, + { + "code": 6069, + "name": "ZeroFundedAmount", + "msg": "Zero funded amount" } ] }; export const IDL: LbClmm = { - "version": "0.8.0", + "version": "0.9.0", "name": "lb_clmm", "constants": [ { @@ -4982,80 +6021,1078 @@ export const IDL: LbClmm = { "value": "1_000_000_000" }, { - "name": "MAX_PROTOCOL_SHARE", - "type": "u16", - "value": "2_500" + "name": "MAX_PROTOCOL_SHARE", + "type": "u16", + "value": "2_500" + }, + { + "name": "HOST_FEE_BPS", + "type": "u16", + "value": "2_000" + }, + { + "name": "NUM_REWARDS", + "type": { + "defined": "usize" + }, + "value": "2" + }, + { + "name": "MIN_REWARD_DURATION", + "type": "u64", + "value": "1" + }, + { + "name": "MAX_REWARD_DURATION", + "type": "u64", + "value": "31536000" + }, + { + "name": "EXTENSION_BINARRAY_BITMAP_SIZE", + "type": { + "defined": "usize" + }, + "value": "12" + }, + { + "name": "BIN_ARRAY_BITMAP_SIZE", + "type": "i32", + "value": "512" + }, + { + "name": "MAX_REWARD_BIN_SPLIT", + "type": { + "defined": "usize" + }, + "value": "15" + }, + { + "name": "BIN_ARRAY", + "type": "bytes", + "value": "[98, 105, 110, 95, 97, 114, 114, 97, 121]" + }, + { + "name": "ORACLE", + "type": "bytes", + "value": "[111, 114, 97, 99, 108, 101]" + }, + { + "name": "BIN_ARRAY_BITMAP_SEED", + "type": "bytes", + "value": "[98, 105, 116, 109, 97, 112]" + }, + { + "name": "PRESET_PARAMETER", + "type": "bytes", + "value": "[112, 114, 101, 115, 101, 116, 95, 112, 97, 114, 97, 109, 101, 116, 101, 114]" + }, + { + "name": "POSITION", + "type": "bytes", + "value": "[112, 111, 115, 105, 116, 105, 111, 110]" + } + ], + "instructions": [ + { + "name": "initializeLbPair", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "tokenMintX", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenMintY", + "isMut": false, + "isSigner": false + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "oracle", + "isMut": true, + "isSigner": false + }, + { + "name": "presetParameter", + "isMut": false, + "isSigner": false + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "activeId", + "type": "i32" + }, + { + "name": "binStep", + "type": "u16" + } + ] + }, + { + "name": "initializePermissionLbPair", + "accounts": [ + { + "name": "base", + "isMut": false, + "isSigner": true + }, + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "tokenMintX", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenMintY", + "isMut": false, + "isSigner": false + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "oracle", + "isMut": true, + "isSigner": false + }, + { + "name": "admin", + "isMut": true, + "isSigner": true + }, + { + "name": "tokenBadgeX", + "isMut": false, + "isSigner": false, + "isOptional": true + }, + { + "name": "tokenBadgeY", + "isMut": false, + "isSigner": false, + "isOptional": true + }, + { + "name": "tokenProgramX", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgramY", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "ixData", + "type": { + "defined": "InitPermissionPairIx" + } + } + ] }, { - "name": "HOST_FEE_BPS", - "type": "u16", - "value": "2_000" + "name": "initializeBinArrayBitmapExtension", + "accounts": [ + { + "name": "lbPair", + "isMut": false, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": true, + "isSigner": false, + "docs": [ + "Initialize an account to store if a bin array is initialized." + ] + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + } + ], + "args": [] }, { - "name": "NUM_REWARDS", - "type": { - "defined": "usize" - }, - "value": "2" + "name": "initializeBinArray", + "accounts": [ + { + "name": "lbPair", + "isMut": false, + "isSigner": false + }, + { + "name": "binArray", + "isMut": true, + "isSigner": false + }, + { + "name": "funder", + "isMut": true, + "isSigner": true + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "index", + "type": "i64" + } + ] }, { - "name": "MIN_REWARD_DURATION", - "type": "u64", - "value": "1" + "name": "addLiquidity", + "accounts": [ + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "userTokenX", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenY", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenXMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYMint", + "isMut": false, + "isSigner": false + }, + { + "name": "binArrayLower", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayUpper", + "isMut": true, + "isSigner": false + }, + { + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenXProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "liquidityParameter", + "type": { + "defined": "LiquidityParameter" + } + } + ] }, { - "name": "MAX_REWARD_DURATION", - "type": "u64", - "value": "31536000" + "name": "addLiquidityByWeight", + "accounts": [ + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "userTokenX", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenY", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenXMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYMint", + "isMut": false, + "isSigner": false + }, + { + "name": "binArrayLower", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayUpper", + "isMut": true, + "isSigner": false + }, + { + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenXProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "liquidityParameter", + "type": { + "defined": "LiquidityParameterByWeight" + } + } + ] }, { - "name": "EXTENSION_BINARRAY_BITMAP_SIZE", - "type": { - "defined": "usize" - }, - "value": "12" + "name": "addLiquidityByStrategy", + "accounts": [ + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "userTokenX", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenY", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenXMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYMint", + "isMut": false, + "isSigner": false + }, + { + "name": "binArrayLower", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayUpper", + "isMut": true, + "isSigner": false + }, + { + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenXProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "liquidityParameter", + "type": { + "defined": "LiquidityParameterByStrategy" + } + } + ] }, { - "name": "BIN_ARRAY_BITMAP_SIZE", - "type": "i32", - "value": "512" + "name": "addLiquidityByStrategyOneSide", + "accounts": [ + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "userToken", + "isMut": true, + "isSigner": false + }, + { + "name": "reserve", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenMint", + "isMut": false, + "isSigner": false + }, + { + "name": "binArrayLower", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayUpper", + "isMut": true, + "isSigner": false + }, + { + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "liquidityParameter", + "type": { + "defined": "LiquidityParameterByStrategyOneSide" + } + } + ] }, { - "name": "MAX_REWARD_BIN_SPLIT", - "type": { - "defined": "usize" - }, - "value": "15" + "name": "addLiquidityOneSide", + "accounts": [ + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "userToken", + "isMut": true, + "isSigner": false + }, + { + "name": "reserve", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenMint", + "isMut": false, + "isSigner": false + }, + { + "name": "binArrayLower", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayUpper", + "isMut": true, + "isSigner": false + }, + { + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "liquidityParameter", + "type": { + "defined": "LiquidityOneSideParameter" + } + } + ] }, { - "name": "BIN_ARRAY", - "type": "bytes", - "value": "[98, 105, 110, 95, 97, 114, 114, 97, 121]" + "name": "removeLiquidity", + "accounts": [ + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayBitmapExtension", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "userTokenX", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenY", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveX", + "isMut": true, + "isSigner": false + }, + { + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenXMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYMint", + "isMut": false, + "isSigner": false + }, + { + "name": "binArrayLower", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayUpper", + "isMut": true, + "isSigner": false + }, + { + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenXProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "binLiquidityRemoval", + "type": { + "vec": { + "defined": "BinLiquidityReduction" + } + } + } + ] + }, + { + "name": "initializePosition", + "accounts": [ + { + "name": "payer", + "isMut": true, + "isSigner": true + }, + { + "name": "position", + "isMut": true, + "isSigner": true + }, + { + "name": "lbPair", + "isMut": false, + "isSigner": false + }, + { + "name": "owner", + "isMut": false, + "isSigner": true + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "lowerBinId", + "type": "i32" + }, + { + "name": "width", + "type": "i32" + } + ] }, { - "name": "ORACLE", - "type": "bytes", - "value": "[111, 114, 97, 99, 108, 101]" + "name": "initializePositionPda", + "accounts": [ + { + "name": "payer", + "isMut": true, + "isSigner": true + }, + { + "name": "base", + "isMut": false, + "isSigner": true + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "lbPair", + "isMut": false, + "isSigner": false + }, + { + "name": "owner", + "isMut": false, + "isSigner": true, + "docs": [ + "owner" + ] + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "lowerBinId", + "type": "i32" + }, + { + "name": "width", + "type": "i32" + } + ] }, { - "name": "BIN_ARRAY_BITMAP_SEED", - "type": "bytes", - "value": "[98, 105, 116, 109, 97, 112]" + "name": "initializePositionByOperator", + "accounts": [ + { + "name": "payer", + "isMut": true, + "isSigner": true + }, + { + "name": "base", + "isMut": false, + "isSigner": true + }, + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "lbPair", + "isMut": false, + "isSigner": false + }, + { + "name": "operator", + "isMut": false, + "isSigner": true, + "docs": [ + "operator" + ] + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "lowerBinId", + "type": "i32" + }, + { + "name": "width", + "type": "i32" + }, + { + "name": "owner", + "type": "publicKey" + }, + { + "name": "feeOwner", + "type": "publicKey" + } + ] }, { - "name": "PRESET_PARAMETER", - "type": "bytes", - "value": "[112, 114, 101, 115, 101, 116, 95, 112, 97, 114, 97, 109, 101, 116, 101, 114]" + "name": "updatePositionOperator", + "accounts": [ + { + "name": "position", + "isMut": true, + "isSigner": false + }, + { + "name": "owner", + "isMut": false, + "isSigner": true + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "operator", + "type": "publicKey" + } + ] }, { - "name": "POSITION", - "type": "bytes", - "value": "[112, 111, 115, 105, 116, 105, 111, 110]" - } - ], - "instructions": [ - { - "name": "initializeLbPair", + "name": "swap", "accounts": [ { "name": "lbPair", @@ -5064,57 +7101,63 @@ export const IDL: LbClmm = { }, { "name": "binArrayBitmapExtension", - "isMut": true, + "isMut": false, "isSigner": false, "isOptional": true }, { - "name": "tokenMintX", - "isMut": false, + "name": "reserveX", + "isMut": true, "isSigner": false }, { - "name": "tokenMintY", - "isMut": false, + "name": "reserveY", + "isMut": true, "isSigner": false }, { - "name": "reserveX", + "name": "userTokenIn", "isMut": true, "isSigner": false }, { - "name": "reserveY", + "name": "userTokenOut", "isMut": true, "isSigner": false }, { - "name": "oracle", - "isMut": true, + "name": "tokenXMint", + "isMut": false, "isSigner": false }, { - "name": "presetParameter", + "name": "tokenYMint", "isMut": false, "isSigner": false }, { - "name": "funder", + "name": "oracle", "isMut": true, - "isSigner": true + "isSigner": false + }, + { + "name": "hostFeeIn", + "isMut": true, + "isSigner": false, + "isOptional": true }, { - "name": "tokenProgram", + "name": "user", "isMut": false, - "isSigner": false + "isSigner": true }, { - "name": "systemProgram", + "name": "tokenXProgram", "isMut": false, "isSigner": false }, { - "name": "rent", + "name": "tokenYProgram", "isMut": false, "isSigner": false }, @@ -5131,44 +7174,23 @@ export const IDL: LbClmm = { ], "args": [ { - "name": "activeId", - "type": "i32" + "name": "amountIn", + "type": "u64" }, { - "name": "binStep", - "type": "u16" + "name": "minAmountOut", + "type": "u64" } ] }, { - "name": "initializePermissionLbPair", + "name": "withdrawProtocolFee", "accounts": [ - { - "name": "base", - "isMut": false, - "isSigner": true - }, { "name": "lbPair", "isMut": true, "isSigner": false }, - { - "name": "binArrayBitmapExtension", - "isMut": true, - "isSigner": false, - "isOptional": true - }, - { - "name": "tokenMintX", - "isMut": false, - "isSigner": false - }, - { - "name": "tokenMintY", - "isMut": false, - "isSigner": false - }, { "name": "reserveX", "isMut": true, @@ -5180,188 +7202,198 @@ export const IDL: LbClmm = { "isSigner": false }, { - "name": "oracle", - "isMut": true, + "name": "tokenXMint", + "isMut": false, "isSigner": false }, { - "name": "admin", - "isMut": true, - "isSigner": true + "name": "tokenYMint", + "isMut": false, + "isSigner": false }, { - "name": "tokenProgram", - "isMut": false, + "name": "receiverTokenX", + "isMut": true, "isSigner": false }, { - "name": "systemProgram", - "isMut": false, + "name": "receiverTokenY", + "isMut": true, "isSigner": false }, { - "name": "rent", + "name": "feeOwner", "isMut": false, - "isSigner": false + "isSigner": true }, { - "name": "eventAuthority", + "name": "tokenXProgram", "isMut": false, "isSigner": false }, { - "name": "program", + "name": "tokenYProgram", "isMut": false, "isSigner": false } ], "args": [ { - "name": "ixData", - "type": { - "defined": "InitPermissionPairIx" - } + "name": "amountX", + "type": "u64" + }, + { + "name": "amountY", + "type": "u64" } ] }, { - "name": "initializeBinArrayBitmapExtension", + "name": "initializeReward", "accounts": [ { "name": "lbPair", - "isMut": false, + "isMut": true, "isSigner": false }, { - "name": "binArrayBitmapExtension", + "name": "rewardVault", "isMut": true, + "isSigner": false + }, + { + "name": "rewardMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenBadge", + "isMut": false, "isSigner": false, - "docs": [ - "Initialize an account to store if a bin array is initialized." - ] + "isOptional": true }, { - "name": "funder", + "name": "admin", "isMut": true, "isSigner": true }, { - "name": "systemProgram", + "name": "tokenProgram", "isMut": false, "isSigner": false }, { - "name": "rent", + "name": "systemProgram", "isMut": false, "isSigner": false - } - ], - "args": [] - }, - { - "name": "initializeBinArray", - "accounts": [ + }, { - "name": "lbPair", + "name": "rent", "isMut": false, "isSigner": false }, { - "name": "binArray", - "isMut": true, + "name": "eventAuthority", + "isMut": false, "isSigner": false }, { - "name": "funder", - "isMut": true, - "isSigner": true - }, - { - "name": "systemProgram", + "name": "program", "isMut": false, "isSigner": false } ], "args": [ { - "name": "index", - "type": "i64" + "name": "rewardIndex", + "type": "u64" + }, + { + "name": "rewardDuration", + "type": "u64" + }, + { + "name": "funder", + "type": "publicKey" } ] }, { - "name": "addLiquidity", + "name": "fundReward", "accounts": [ - { - "name": "position", - "isMut": true, - "isSigner": false - }, { "name": "lbPair", "isMut": true, "isSigner": false }, { - "name": "binArrayBitmapExtension", + "name": "rewardVault", "isMut": true, - "isSigner": false, - "isOptional": true + "isSigner": false }, { - "name": "userTokenX", - "isMut": true, + "name": "rewardMint", + "isMut": false, "isSigner": false }, { - "name": "userTokenY", + "name": "funderTokenAccount", "isMut": true, "isSigner": false }, { - "name": "reserveX", - "isMut": true, - "isSigner": false + "name": "funder", + "isMut": false, + "isSigner": true }, { - "name": "reserveY", + "name": "binArray", "isMut": true, "isSigner": false }, { - "name": "tokenXMint", + "name": "tokenProgram", "isMut": false, "isSigner": false }, { - "name": "tokenYMint", + "name": "eventAuthority", "isMut": false, "isSigner": false }, { - "name": "binArrayLower", - "isMut": true, + "name": "program", + "isMut": false, "isSigner": false - }, + } + ], + "args": [ { - "name": "binArrayUpper", - "isMut": true, - "isSigner": false + "name": "rewardIndex", + "type": "u64" }, { - "name": "sender", - "isMut": false, - "isSigner": true + "name": "amount", + "type": "u64" }, { - "name": "tokenXProgram", - "isMut": false, + "name": "carryForward", + "type": "bool" + } + ] + }, + { + "name": "updateRewardFunder", + "accounts": [ + { + "name": "lbPair", + "isMut": true, "isSigner": false }, { - "name": "tokenYProgram", + "name": "admin", "isMut": false, - "isSigner": false + "isSigner": true }, { "name": "eventAuthority", @@ -5376,60 +7408,66 @@ export const IDL: LbClmm = { ], "args": [ { - "name": "liquidityParameter", - "type": { - "defined": "LiquidityParameter" - } + "name": "rewardIndex", + "type": "u64" + }, + { + "name": "newFunder", + "type": "publicKey" } ] }, { - "name": "addLiquidityByWeight", + "name": "updateRewardDuration", "accounts": [ - { - "name": "position", - "isMut": true, - "isSigner": false - }, { "name": "lbPair", "isMut": true, "isSigner": false }, { - "name": "binArrayBitmapExtension", - "isMut": true, - "isSigner": false, - "isOptional": true + "name": "admin", + "isMut": false, + "isSigner": true }, { - "name": "userTokenX", + "name": "binArray", "isMut": true, "isSigner": false }, { - "name": "userTokenY", - "isMut": true, + "name": "eventAuthority", + "isMut": false, "isSigner": false }, { - "name": "reserveX", - "isMut": true, + "name": "program", + "isMut": false, "isSigner": false - }, + } + ], + "args": [ { - "name": "reserveY", - "isMut": true, - "isSigner": false + "name": "rewardIndex", + "type": "u64" }, { - "name": "tokenXMint", - "isMut": false, + "name": "newDuration", + "type": "u64" + } + ] + }, + { + "name": "claimReward", + "accounts": [ + { + "name": "lbPair", + "isMut": true, "isSigner": false }, { - "name": "tokenYMint", - "isMut": false, + "name": "position", + "isMut": true, "isSigner": false }, { @@ -5448,12 +7486,22 @@ export const IDL: LbClmm = { "isSigner": true }, { - "name": "tokenXProgram", + "name": "rewardVault", + "isMut": true, + "isSigner": false + }, + { + "name": "rewardMint", "isMut": false, "isSigner": false }, { - "name": "tokenYProgram", + "name": "userTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", "isMut": false, "isSigner": false }, @@ -5470,41 +7518,38 @@ export const IDL: LbClmm = { ], "args": [ { - "name": "liquidityParameter", - "type": { - "defined": "LiquidityParameterByWeight" - } + "name": "rewardIndex", + "type": "u64" } ] }, { - "name": "addLiquidityByStrategy", + "name": "claimFee", "accounts": [ { - "name": "position", + "name": "lbPair", "isMut": true, "isSigner": false }, { - "name": "lbPair", + "name": "position", "isMut": true, "isSigner": false }, { - "name": "binArrayBitmapExtension", + "name": "binArrayLower", "isMut": true, - "isSigner": false, - "isOptional": true + "isSigner": false }, { - "name": "userTokenX", + "name": "binArrayUpper", "isMut": true, "isSigner": false }, { - "name": "userTokenY", - "isMut": true, - "isSigner": false + "name": "sender", + "isMut": false, + "isSigner": true }, { "name": "reserveX", @@ -5517,37 +7562,27 @@ export const IDL: LbClmm = { "isSigner": false }, { - "name": "tokenXMint", - "isMut": false, - "isSigner": false - }, - { - "name": "tokenYMint", - "isMut": false, - "isSigner": false - }, - { - "name": "binArrayLower", + "name": "userTokenX", "isMut": true, "isSigner": false }, { - "name": "binArrayUpper", + "name": "userTokenY", "isMut": true, "isSigner": false }, { - "name": "sender", + "name": "tokenXMint", "isMut": false, - "isSigner": true + "isSigner": false }, { - "name": "tokenXProgram", + "name": "tokenYMint", "isMut": false, "isSigner": false }, { - "name": "tokenYProgram", + "name": "tokenProgram", "isMut": false, "isSigner": false }, @@ -5562,17 +7597,10 @@ export const IDL: LbClmm = { "isSigner": false } ], - "args": [ - { - "name": "liquidityParameter", - "type": { - "defined": "LiquidityParameterByStrategy" - } - } - ] + "args": [] }, { - "name": "addLiquidityByStrategyOneSide", + "name": "closePosition", "accounts": [ { "name": "position", @@ -5585,46 +7613,51 @@ export const IDL: LbClmm = { "isSigner": false }, { - "name": "binArrayBitmapExtension", + "name": "binArrayLower", "isMut": true, - "isSigner": false, - "isOptional": true + "isSigner": false }, { - "name": "userToken", + "name": "binArrayUpper", "isMut": true, "isSigner": false }, { - "name": "reserve", + "name": "sender", + "isMut": false, + "isSigner": true + }, + { + "name": "rentReceiver", "isMut": true, "isSigner": false }, { - "name": "tokenMint", + "name": "eventAuthority", "isMut": false, "isSigner": false }, { - "name": "binArrayLower", - "isMut": true, + "name": "program", + "isMut": false, "isSigner": false - }, + } + ], + "args": [] + }, + { + "name": "updateFeeParameters", + "accounts": [ { - "name": "binArrayUpper", + "name": "lbPair", "isMut": true, "isSigner": false }, { - "name": "sender", + "name": "admin", "isMut": false, "isSigner": true }, - { - "name": "tokenProgram", - "isMut": false, - "isSigner": false - }, { "name": "eventAuthority", "isMut": false, @@ -5638,89 +7671,105 @@ export const IDL: LbClmm = { ], "args": [ { - "name": "liquidityParameter", + "name": "feeParameter", "type": { - "defined": "LiquidityParameterByStrategyOneSide" + "defined": "FeeParameter" } } ] }, { - "name": "addLiquidityOneSide", + "name": "increaseOracleLength", "accounts": [ { - "name": "position", - "isMut": true, - "isSigner": false - }, - { - "name": "lbPair", + "name": "oracle", "isMut": true, "isSigner": false }, { - "name": "binArrayBitmapExtension", + "name": "funder", "isMut": true, - "isSigner": false, - "isOptional": true + "isSigner": true }, { - "name": "userToken", - "isMut": true, + "name": "systemProgram", + "isMut": false, "isSigner": false }, { - "name": "reserve", - "isMut": true, + "name": "eventAuthority", + "isMut": false, "isSigner": false }, { - "name": "tokenMint", + "name": "program", "isMut": false, "isSigner": false - }, + } + ], + "args": [ { - "name": "binArrayLower", - "isMut": true, - "isSigner": false - }, + "name": "lengthToAdd", + "type": "u64" + } + ] + }, + { + "name": "initializePresetParameter", + "accounts": [ { - "name": "binArrayUpper", + "name": "presetParameter", "isMut": true, "isSigner": false }, { - "name": "sender", - "isMut": false, + "name": "admin", + "isMut": true, "isSigner": true }, { - "name": "tokenProgram", - "isMut": false, - "isSigner": false - }, - { - "name": "eventAuthority", + "name": "systemProgram", "isMut": false, "isSigner": false }, { - "name": "program", + "name": "rent", "isMut": false, "isSigner": false } ], "args": [ { - "name": "liquidityParameter", + "name": "ix", "type": { - "defined": "LiquidityOneSideParameter" + "defined": "InitPresetParametersIx" } } ] }, { - "name": "removeLiquidity", + "name": "closePresetParameter", + "accounts": [ + { + "name": "presetParameter", + "isMut": true, + "isSigner": false + }, + { + "name": "admin", + "isMut": true, + "isSigner": true + }, + { + "name": "rentReceiver", + "isMut": true, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "removeAllLiquidity", "accounts": [ { "name": "position", @@ -5804,102 +7853,81 @@ export const IDL: LbClmm = { "isSigner": false } ], - "args": [ - { - "name": "binLiquidityRemoval", - "type": { - "vec": { - "defined": "BinLiquidityReduction" - } - } - } - ] + "args": [] }, { - "name": "initializePosition", + "name": "togglePairStatus", "accounts": [ - { - "name": "payer", - "isMut": true, - "isSigner": true - }, - { - "name": "position", - "isMut": true, - "isSigner": true - }, { "name": "lbPair", - "isMut": false, + "isMut": true, "isSigner": false }, { - "name": "owner", + "name": "admin", "isMut": false, "isSigner": true - }, - { - "name": "systemProgram", - "isMut": false, - "isSigner": false - }, - { - "name": "rent", - "isMut": false, - "isSigner": false - }, + } + ], + "args": [] + }, + { + "name": "updateWhitelistedWallet", + "accounts": [ { - "name": "eventAuthority", - "isMut": false, + "name": "lbPair", + "isMut": true, "isSigner": false }, { - "name": "program", + "name": "creator", "isMut": false, - "isSigner": false + "isSigner": true } ], "args": [ { - "name": "lowerBinId", - "type": "i32" + "name": "idx", + "type": "u8" }, { - "name": "width", - "type": "i32" + "name": "wallet", + "type": "publicKey" } ] }, { - "name": "initializePositionPda", + "name": "migratePosition", "accounts": [ { - "name": "payer", + "name": "positionV2", "isMut": true, "isSigner": true }, { - "name": "base", + "name": "positionV1", + "isMut": true, + "isSigner": false + }, + { + "name": "lbPair", "isMut": false, - "isSigner": true + "isSigner": false }, { - "name": "position", + "name": "binArrayLower", "isMut": true, "isSigner": false }, { - "name": "lbPair", - "isMut": false, + "name": "binArrayUpper", + "isMut": true, "isSigner": false }, { "name": "owner", - "isMut": false, - "isSigner": true, - "docs": [ - "owner" - ] + "isMut": true, + "isSigner": true }, { "name": "systemProgram", @@ -5907,8 +7935,8 @@ export const IDL: LbClmm = { "isSigner": false }, { - "name": "rent", - "isMut": false, + "name": "rentReceiver", + "isMut": true, "isSigner": false }, { @@ -5922,55 +7950,85 @@ export const IDL: LbClmm = { "isSigner": false } ], - "args": [ - { - "name": "lowerBinId", - "type": "i32" - }, + "args": [] + }, + { + "name": "migrateBinArray", + "accounts": [ { - "name": "width", - "type": "i32" + "name": "lbPair", + "isMut": false, + "isSigner": false } - ] + ], + "args": [] }, { - "name": "initializePositionByOperator", + "name": "updateFeesAndRewards", "accounts": [ { - "name": "payer", + "name": "position", "isMut": true, - "isSigner": true + "isSigner": false }, { - "name": "base", + "name": "lbPair", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayLower", + "isMut": true, + "isSigner": false + }, + { + "name": "binArrayUpper", + "isMut": true, + "isSigner": false + }, + { + "name": "owner", "isMut": false, "isSigner": true + } + ], + "args": [] + }, + { + "name": "withdrawIneligibleReward", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false }, { - "name": "position", + "name": "rewardVault", "isMut": true, "isSigner": false }, { - "name": "lbPair", + "name": "rewardMint", "isMut": false, "isSigner": false }, { - "name": "operator", - "isMut": false, - "isSigner": true, - "docs": [ - "operator" - ] + "name": "funderTokenAccount", + "isMut": true, + "isSigner": false }, { - "name": "systemProgram", + "name": "funder", "isMut": false, + "isSigner": true + }, + { + "name": "binArray", + "isMut": true, "isSigner": false }, { - "name": "rent", + "name": "tokenProgram", "isMut": false, "isSigner": false }, @@ -5987,25 +8045,34 @@ export const IDL: LbClmm = { ], "args": [ { - "name": "lowerBinId", - "type": "i32" - }, + "name": "rewardIndex", + "type": "u64" + } + ] + }, + { + "name": "setActivationPoint", + "accounts": [ { - "name": "width", - "type": "i32" + "name": "lbPair", + "isMut": true, + "isSigner": false }, { - "name": "owner", - "type": "publicKey" - }, + "name": "admin", + "isMut": true, + "isSigner": true + } + ], + "args": [ { - "name": "feeOwner", - "type": "publicKey" + "name": "activationPoint", + "type": "u64" } ] }, { - "name": "updatePositionOperator", + "name": "setLockReleasePoint", "accounts": [ { "name": "position", @@ -6013,7 +8080,12 @@ export const IDL: LbClmm = { "isSigner": false }, { - "name": "owner", + "name": "lbPair", + "isMut": false, + "isSigner": false + }, + { + "name": "sender", "isMut": false, "isSigner": true }, @@ -6030,118 +8102,158 @@ export const IDL: LbClmm = { ], "args": [ { - "name": "operator", - "type": "publicKey" + "name": "newLockReleasePoint", + "type": "u64" } ] }, { - "name": "swap", + "name": "addLiquidityOneSidePrecise", "accounts": [ { - "name": "lbPair", + "name": "position", "isMut": true, "isSigner": false }, { - "name": "binArrayBitmapExtension", - "isMut": false, - "isSigner": false, - "isOptional": true - }, - { - "name": "reserveX", + "name": "lbPair", "isMut": true, "isSigner": false }, { - "name": "reserveY", + "name": "binArrayBitmapExtension", "isMut": true, - "isSigner": false + "isSigner": false, + "isOptional": true }, { - "name": "userTokenIn", + "name": "userToken", "isMut": true, "isSigner": false }, { - "name": "userTokenOut", + "name": "reserve", "isMut": true, "isSigner": false }, { - "name": "tokenXMint", - "isMut": false, - "isSigner": false - }, - { - "name": "tokenYMint", + "name": "tokenMint", "isMut": false, "isSigner": false }, { - "name": "oracle", + "name": "binArrayLower", "isMut": true, "isSigner": false }, { - "name": "hostFeeIn", + "name": "binArrayUpper", "isMut": true, - "isSigner": false, - "isOptional": true + "isSigner": false }, { - "name": "user", + "name": "sender", "isMut": false, "isSigner": true }, { - "name": "tokenXProgram", + "name": "tokenProgram", "isMut": false, "isSigner": false }, { - "name": "tokenYProgram", + "name": "eventAuthority", "isMut": false, "isSigner": false }, { - "name": "eventAuthority", + "name": "program", "isMut": false, "isSigner": false + } + ], + "args": [ + { + "name": "parameter", + "type": { + "defined": "AddLiquiditySingleSidePreciseParameter" + } + } + ] + }, + { + "name": "setPreActivationDuration", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false }, { - "name": "program", + "name": "creator", "isMut": false, - "isSigner": false + "isSigner": true } ], "args": [ { - "name": "amountIn", - "type": "u64" + "name": "preActivationDuration", + "type": "u16" + } + ] + }, + { + "name": "setPreActivationSwapAddress", + "accounts": [ + { + "name": "lbPair", + "isMut": true, + "isSigner": false }, { - "name": "minAmountOut", - "type": "u64" + "name": "creator", + "isMut": false, + "isSigner": true + } + ], + "args": [ + { + "name": "preActivationSwapAddress", + "type": "publicKey" } ] }, { - "name": "withdrawProtocolFee", + "name": "swapExactOut", "accounts": [ { "name": "lbPair", "isMut": true, "isSigner": false }, + { + "name": "binArrayBitmapExtension", + "isMut": false, + "isSigner": false, + "isOptional": true + }, { "name": "reserveX", "isMut": true, "isSigner": false }, { - "name": "reserveY", + "name": "reserveY", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenIn", + "isMut": true, + "isSigner": false + }, + { + "name": "userTokenOut", "isMut": true, "isSigner": false }, @@ -6156,17 +8268,18 @@ export const IDL: LbClmm = { "isSigner": false }, { - "name": "receiverTokenX", + "name": "oracle", "isMut": true, "isSigner": false }, { - "name": "receiverTokenY", + "name": "hostFeeIn", "isMut": true, - "isSigner": false + "isSigner": false, + "isOptional": true }, { - "name": "feeOwner", + "name": "user", "isMut": false, "isSigner": true }, @@ -6179,21 +8292,31 @@ export const IDL: LbClmm = { "name": "tokenYProgram", "isMut": false, "isSigner": false + }, + { + "name": "eventAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "program", + "isMut": false, + "isSigner": false } ], "args": [ { - "name": "amountX", + "name": "maxInAmount", "type": "u64" }, { - "name": "amountY", + "name": "outAmount", "type": "u64" } ] }, { - "name": "initializeReward", + "name": "swapWithPriceImpact", "accounts": [ { "name": "lbPair", @@ -6201,96 +8324,64 @@ export const IDL: LbClmm = { "isSigner": false }, { - "name": "rewardVault", - "isMut": true, - "isSigner": false - }, - { - "name": "rewardMint", + "name": "binArrayBitmapExtension", "isMut": false, - "isSigner": false + "isSigner": false, + "isOptional": true }, { - "name": "admin", + "name": "reserveX", "isMut": true, - "isSigner": true - }, - { - "name": "tokenProgram", - "isMut": false, "isSigner": false }, { - "name": "systemProgram", - "isMut": false, + "name": "reserveY", + "isMut": true, "isSigner": false }, { - "name": "rent", - "isMut": false, + "name": "userTokenIn", + "isMut": true, "isSigner": false }, { - "name": "eventAuthority", - "isMut": false, + "name": "userTokenOut", + "isMut": true, "isSigner": false }, { - "name": "program", + "name": "tokenXMint", "isMut": false, "isSigner": false - } - ], - "args": [ - { - "name": "rewardIndex", - "type": "u64" }, { - "name": "rewardDuration", - "type": "u64" - }, - { - "name": "funder", - "type": "publicKey" - } - ] - }, - { - "name": "fundReward", - "accounts": [ - { - "name": "lbPair", - "isMut": true, + "name": "tokenYMint", + "isMut": false, "isSigner": false }, { - "name": "rewardVault", + "name": "oracle", "isMut": true, "isSigner": false }, { - "name": "rewardMint", - "isMut": false, - "isSigner": false - }, - { - "name": "funderTokenAccount", + "name": "hostFeeIn", "isMut": true, - "isSigner": false + "isSigner": false, + "isOptional": true }, { - "name": "funder", + "name": "user", "isMut": false, "isSigner": true }, { - "name": "binArray", - "isMut": true, + "name": "tokenXProgram", + "isMut": false, "isSigner": false }, { - "name": "tokenProgram", + "name": "tokenYProgram", "isMut": false, "isSigner": false }, @@ -6307,56 +8398,49 @@ export const IDL: LbClmm = { ], "args": [ { - "name": "rewardIndex", + "name": "amountIn", "type": "u64" }, { - "name": "amount", - "type": "u64" + "name": "activeId", + "type": { + "option": "i32" + } }, { - "name": "carryForward", - "type": "bool" + "name": "maxPriceImpactBps", + "type": "u16" } ] }, { - "name": "updateRewardFunder", + "name": "initializeTokenBadge", "accounts": [ { - "name": "lbPair", + "name": "tokenMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenBadge", "isMut": true, "isSigner": false }, { "name": "admin", - "isMut": false, + "isMut": true, "isSigner": true }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false - }, - { - "name": "program", + "name": "systemProgram", "isMut": false, "isSigner": false } ], - "args": [ - { - "name": "rewardIndex", - "type": "u64" - }, - { - "name": "newFunder", - "type": "publicKey" - } - ] + "args": [] }, { - "name": "updateRewardDuration", + "name": "claimFee2", "accounts": [ { "name": "lbPair", @@ -6364,82 +8448,57 @@ export const IDL: LbClmm = { "isSigner": false }, { - "name": "admin", - "isMut": false, - "isSigner": true - }, - { - "name": "binArray", + "name": "position", "isMut": true, "isSigner": false }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false - }, - { - "name": "program", + "name": "sender", "isMut": false, - "isSigner": false - } - ], - "args": [ - { - "name": "rewardIndex", - "type": "u64" + "isSigner": true }, { - "name": "newDuration", - "type": "u64" - } - ] - }, - { - "name": "claimReward", - "accounts": [ - { - "name": "lbPair", + "name": "reserveX", "isMut": true, "isSigner": false }, { - "name": "position", + "name": "reserveY", "isMut": true, "isSigner": false }, { - "name": "binArrayLower", + "name": "userTokenX", "isMut": true, "isSigner": false }, { - "name": "binArrayUpper", + "name": "userTokenY", "isMut": true, "isSigner": false }, { - "name": "sender", + "name": "tokenXMint", "isMut": false, - "isSigner": true + "isSigner": false }, { - "name": "rewardVault", - "isMut": true, + "name": "tokenYMint", + "isMut": false, "isSigner": false }, { - "name": "rewardMint", + "name": "tokenProgramX", "isMut": false, "isSigner": false }, { - "name": "userTokenAccount", - "isMut": true, + "name": "tokenProgramY", + "isMut": false, "isSigner": false }, { - "name": "tokenProgram", + "name": "memoProgram", "isMut": false, "isSigner": false }, @@ -6454,15 +8513,10 @@ export const IDL: LbClmm = { "isSigner": false } ], - "args": [ - { - "name": "rewardIndex", - "type": "u64" - } - ] + "args": [] }, { - "name": "claimFee", + "name": "initializeLbPair2", "accounts": [ { "name": "lbPair", @@ -6470,24 +8524,20 @@ export const IDL: LbClmm = { "isSigner": false }, { - "name": "position", - "isMut": true, - "isSigner": false - }, - { - "name": "binArrayLower", + "name": "binArrayBitmapExtension", "isMut": true, - "isSigner": false + "isSigner": false, + "isOptional": true }, { - "name": "binArrayUpper", - "isMut": true, + "name": "tokenMintX", + "isMut": false, "isSigner": false }, { - "name": "sender", + "name": "tokenMintY", "isMut": false, - "isSigner": true + "isSigner": false }, { "name": "reserveX", @@ -6500,27 +8550,49 @@ export const IDL: LbClmm = { "isSigner": false }, { - "name": "userTokenX", + "name": "oracle", "isMut": true, "isSigner": false }, { - "name": "userTokenY", + "name": "presetParameter", + "isMut": false, + "isSigner": false + }, + { + "name": "funder", "isMut": true, + "isSigner": true + }, + { + "name": "tokenBadgeX", + "isMut": false, + "isSigner": false, + "isOptional": true + }, + { + "name": "tokenBadgeY", + "isMut": false, + "isSigner": false, + "isOptional": true + }, + { + "name": "tokenProgramX", + "isMut": false, "isSigner": false }, { - "name": "tokenXMint", + "name": "tokenProgramY", "isMut": false, "isSigner": false }, { - "name": "tokenYMint", + "name": "systemProgram", "isMut": false, "isSigner": false }, { - "name": "tokenProgram", + "name": "rent", "isMut": false, "isSigner": false }, @@ -6535,10 +8607,19 @@ export const IDL: LbClmm = { "isSigner": false } ], - "args": [] + "args": [ + { + "name": "activeId", + "type": "i32" + }, + { + "name": "binStep", + "type": "u16" + } + ] }, { - "name": "closePosition", + "name": "addLiquidity2", "accounts": [ { "name": "position", @@ -6551,163 +8632,89 @@ export const IDL: LbClmm = { "isSigner": false }, { - "name": "binArrayLower", + "name": "binArrayBitmapExtension", "isMut": true, - "isSigner": false + "isSigner": false, + "isOptional": true }, { - "name": "binArrayUpper", + "name": "userTokenX", "isMut": true, "isSigner": false }, { - "name": "sender", - "isMut": false, - "isSigner": true - }, - { - "name": "rentReceiver", + "name": "userTokenY", "isMut": true, "isSigner": false }, { - "name": "eventAuthority", - "isMut": false, + "name": "reserveX", + "isMut": true, "isSigner": false }, { - "name": "program", - "isMut": false, - "isSigner": false - } - ], - "args": [] - }, - { - "name": "updateFeeParameters", - "accounts": [ - { - "name": "lbPair", + "name": "reserveY", "isMut": true, "isSigner": false }, { - "name": "admin", - "isMut": false, - "isSigner": true - }, - { - "name": "eventAuthority", + "name": "tokenXMint", "isMut": false, "isSigner": false }, { - "name": "program", + "name": "tokenYMint", "isMut": false, "isSigner": false - } - ], - "args": [ - { - "name": "feeParameter", - "type": { - "defined": "FeeParameter" - } - } - ] - }, - { - "name": "increaseOracleLength", - "accounts": [ - { - "name": "oracle", - "isMut": true, - "isSigner": false }, { - "name": "funder", - "isMut": true, + "name": "sender", + "isMut": false, "isSigner": true }, { - "name": "systemProgram", + "name": "tokenXProgram", "isMut": false, "isSigner": false }, { - "name": "eventAuthority", + "name": "tokenYProgram", "isMut": false, "isSigner": false }, { - "name": "program", + "name": "memoProgram", "isMut": false, "isSigner": false - } - ], - "args": [ - { - "name": "lengthToAdd", - "type": "u64" - } - ] - }, - { - "name": "initializePresetParameter", - "accounts": [ - { - "name": "presetParameter", - "isMut": true, - "isSigner": false - }, - { - "name": "admin", - "isMut": true, - "isSigner": true }, { - "name": "systemProgram", + "name": "eventAuthority", "isMut": false, "isSigner": false }, { - "name": "rent", + "name": "program", "isMut": false, "isSigner": false } ], "args": [ { - "name": "ix", + "name": "liquidityParameter", "type": { - "defined": "InitPresetParametersIx" + "defined": "LiquidityParameter" } - } - ] - }, - { - "name": "closePresetParameter", - "accounts": [ - { - "name": "presetParameter", - "isMut": true, - "isSigner": false - }, - { - "name": "admin", - "isMut": true, - "isSigner": true }, { - "name": "rentReceiver", - "isMut": true, - "isSigner": false + "name": "remainingAccountsInfo", + "type": { + "defined": "RemainingAccountsInfo" + } } - ], - "args": [] + ] }, { - "name": "removeAllLiquidity", + "name": "addLiquidityByStrategy2", "accounts": [ { "name": "position", @@ -6755,16 +8762,6 @@ export const IDL: LbClmm = { "isMut": false, "isSigner": false }, - { - "name": "binArrayLower", - "isMut": true, - "isSigner": false - }, - { - "name": "binArrayUpper", - "isMut": true, - "isSigner": false - }, { "name": "sender", "isMut": false, @@ -6781,100 +8778,77 @@ export const IDL: LbClmm = { "isSigner": false }, { - "name": "eventAuthority", + "name": "memoProgram", "isMut": false, "isSigner": false }, { - "name": "program", + "name": "eventAuthority", "isMut": false, "isSigner": false - } - ], - "args": [] - }, - { - "name": "togglePairStatus", - "accounts": [ - { - "name": "lbPair", - "isMut": true, - "isSigner": false }, { - "name": "admin", + "name": "program", "isMut": false, - "isSigner": true - } - ], - "args": [] - }, - { - "name": "updateWhitelistedWallet", - "accounts": [ - { - "name": "lbPair", - "isMut": true, "isSigner": false - }, - { - "name": "creator", - "isMut": false, - "isSigner": true } ], "args": [ { - "name": "idx", - "type": "u8" + "name": "liquidityParameter", + "type": { + "defined": "LiquidityParameterByStrategy" + } }, { - "name": "wallet", - "type": "publicKey" + "name": "remainingAccountsInfo", + "type": { + "defined": "RemainingAccountsInfo" + } } ] }, { - "name": "migratePosition", + "name": "claimReward2", "accounts": [ { - "name": "positionV2", + "name": "lbPair", "isMut": true, - "isSigner": true + "isSigner": false }, { - "name": "positionV1", + "name": "position", "isMut": true, "isSigner": false }, { - "name": "lbPair", + "name": "sender", "isMut": false, - "isSigner": false + "isSigner": true }, { - "name": "binArrayLower", + "name": "rewardVault", "isMut": true, "isSigner": false }, { - "name": "binArrayUpper", - "isMut": true, + "name": "rewardMint", + "isMut": false, "isSigner": false }, { - "name": "owner", + "name": "userTokenAccount", "isMut": true, - "isSigner": true + "isSigner": false }, { - "name": "systemProgram", + "name": "tokenProgram", "isMut": false, "isSigner": false }, { - "name": "rentReceiver", - "isMut": true, + "name": "memoProgram", + "isMut": false, "isSigner": false }, { @@ -6888,144 +8862,95 @@ export const IDL: LbClmm = { "isSigner": false } ], - "args": [] - }, - { - "name": "migrateBinArray", - "accounts": [ - { - "name": "lbPair", - "isMut": false, - "isSigner": false - } - ], - "args": [] - }, - { - "name": "updateFeesAndRewards", - "accounts": [ - { - "name": "position", - "isMut": true, - "isSigner": false - }, + "args": [ { - "name": "lbPair", - "isMut": true, - "isSigner": false + "name": "rewardIndex", + "type": "u64" }, { - "name": "binArrayLower", - "isMut": true, - "isSigner": false + "name": "minBinId", + "type": "i32" }, { - "name": "binArrayUpper", - "isMut": true, - "isSigner": false + "name": "maxBinId", + "type": "i32" }, { - "name": "owner", - "isMut": false, - "isSigner": true + "name": "remainingAccountsInfo", + "type": { + "defined": "RemainingAccountsInfo" + } } - ], - "args": [] + ] }, { - "name": "withdrawIneligibleReward", + "name": "removeLiquidity2", "accounts": [ { - "name": "lbPair", + "name": "position", "isMut": true, "isSigner": false }, { - "name": "rewardVault", + "name": "lbPair", "isMut": true, "isSigner": false }, { - "name": "rewardMint", - "isMut": false, - "isSigner": false + "name": "binArrayBitmapExtension", + "isMut": true, + "isSigner": false, + "isOptional": true }, { - "name": "funderTokenAccount", + "name": "userTokenX", "isMut": true, "isSigner": false }, { - "name": "funder", - "isMut": false, - "isSigner": true + "name": "userTokenY", + "isMut": true, + "isSigner": false }, { - "name": "binArray", + "name": "reserveX", "isMut": true, "isSigner": false }, { - "name": "tokenProgram", - "isMut": false, + "name": "reserveY", + "isMut": true, "isSigner": false }, { - "name": "eventAuthority", + "name": "tokenXMint", "isMut": false, "isSigner": false }, { - "name": "program", + "name": "tokenYMint", "isMut": false, "isSigner": false - } - ], - "args": [ - { - "name": "rewardIndex", - "type": "u64" - } - ] - }, - { - "name": "setActivationPoint", - "accounts": [ - { - "name": "lbPair", - "isMut": true, - "isSigner": false }, { - "name": "admin", - "isMut": true, + "name": "sender", + "isMut": false, "isSigner": true - } - ], - "args": [ - { - "name": "activationPoint", - "type": "u64" - } - ] - }, - { - "name": "setLockReleasePoint", - "accounts": [ + }, { - "name": "position", - "isMut": true, + "name": "tokenXProgram", + "isMut": false, "isSigner": false }, { - "name": "lbPair", + "name": "tokenYProgram", "isMut": false, "isSigner": false }, { - "name": "sender", + "name": "memoProgram", "isMut": false, - "isSigner": true + "isSigner": false }, { "name": "eventAuthority", @@ -7040,13 +8965,23 @@ export const IDL: LbClmm = { ], "args": [ { - "name": "newLockReleasePoint", - "type": "u64" + "name": "binLiquidityRemoval", + "type": { + "vec": { + "defined": "BinLiquidityReduction" + } + } + }, + { + "name": "remainingAccountsInfo", + "type": { + "defined": "RemainingAccountsInfo" + } } ] }, { - "name": "addLiquidityOneSidePrecise", + "name": "removeLiquidityByRange2", "accounts": [ { "name": "position", @@ -7065,28 +9000,33 @@ export const IDL: LbClmm = { "isOptional": true }, { - "name": "userToken", + "name": "userTokenX", "isMut": true, "isSigner": false }, { - "name": "reserve", + "name": "userTokenY", "isMut": true, "isSigner": false }, { - "name": "tokenMint", - "isMut": false, + "name": "reserveX", + "isMut": true, "isSigner": false }, { - "name": "binArrayLower", + "name": "reserveY", "isMut": true, "isSigner": false }, { - "name": "binArrayUpper", - "isMut": true, + "name": "tokenXMint", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenYMint", + "isMut": false, "isSigner": false }, { @@ -7095,74 +9035,54 @@ export const IDL: LbClmm = { "isSigner": true }, { - "name": "tokenProgram", + "name": "tokenXProgram", "isMut": false, "isSigner": false }, { - "name": "eventAuthority", + "name": "tokenYProgram", "isMut": false, "isSigner": false }, { - "name": "program", + "name": "memoProgram", "isMut": false, "isSigner": false - } - ], - "args": [ - { - "name": "parameter", - "type": { - "defined": "AddLiquiditySingleSidePreciseParameter" - } - } - ] - }, - { - "name": "setPreActivationDuration", - "accounts": [ + }, { - "name": "lbPair", - "isMut": true, + "name": "eventAuthority", + "isMut": false, "isSigner": false }, { - "name": "creator", + "name": "program", "isMut": false, - "isSigner": true + "isSigner": false } ], "args": [ { - "name": "preActivationDuration", - "type": "u16" - } - ] - }, - { - "name": "setPreActivationSwapAddress", - "accounts": [ + "name": "fromBinId", + "type": "i32" + }, { - "name": "lbPair", - "isMut": true, - "isSigner": false + "name": "toBinId", + "type": "i32" }, { - "name": "creator", - "isMut": false, - "isSigner": true - } - ], - "args": [ + "name": "bpsToRemove", + "type": "u16" + }, { - "name": "preActivationSwapAddress", - "type": "publicKey" + "name": "remainingAccountsInfo", + "type": { + "defined": "RemainingAccountsInfo" + } } ] }, { - "name": "swapExactOut", + "name": "swap2", "accounts": [ { "name": "lbPair", @@ -7231,6 +9151,11 @@ export const IDL: LbClmm = { "isMut": false, "isSigner": false }, + { + "name": "memoProgram", + "isMut": false, + "isSigner": false + }, { "name": "eventAuthority", "isMut": false, @@ -7244,17 +9169,23 @@ export const IDL: LbClmm = { ], "args": [ { - "name": "maxInAmount", + "name": "amountIn", "type": "u64" }, { - "name": "outAmount", + "name": "minAmountOut", "type": "u64" + }, + { + "name": "remainingAccountsInfo", + "type": { + "defined": "RemainingAccountsInfo" + } } ] }, { - "name": "swapWithPriceImpact", + "name": "swapWithPriceImpact2", "accounts": [ { "name": "lbPair", @@ -7323,6 +9254,11 @@ export const IDL: LbClmm = { "isMut": false, "isSigner": false }, + { + "name": "memoProgram", + "isMut": false, + "isSigner": false + }, { "name": "eventAuthority", "isMut": false, @@ -7348,6 +9284,12 @@ export const IDL: LbClmm = { { "name": "maxPriceImpactBps", "type": "u16" + }, + { + "name": "remainingAccountsInfo", + "type": { + "defined": "RemainingAccountsInfo" + } } ] } @@ -8088,6 +10030,36 @@ export const IDL: LbClmm = { } ] } + }, + { + "name": "tokenBadge", + "docs": [ + "Parameter that set by the protocol" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "tokenMint", + "docs": [ + "Token mint" + ], + "type": "publicKey" + }, + { + "name": "padding", + "docs": [ + "Reserved space" + ], + "type": { + "array": [ + "u8", + 128 + ] + } + } + ] + } } ], "types": [ @@ -8964,6 +10936,40 @@ export const IDL: LbClmm = { ] } }, + { + "name": "RemainingAccountsSlice", + "type": { + "kind": "struct", + "fields": [ + { + "name": "accountsType", + "type": { + "defined": "AccountsType" + } + }, + { + "name": "length", + "type": "u8" + } + ] + } + }, + { + "name": "RemainingAccountsInfo", + "type": { + "kind": "struct", + "fields": [ + { + "name": "slices", + "type": { + "vec": { + "defined": "RemainingAccountsSlice" + } + } + } + ] + } + }, { "name": "StrategyType", "type": { @@ -9080,6 +11086,23 @@ export const IDL: LbClmm = { } ] } + }, + { + "name": "AccountsType", + "type": { + "kind": "enum", + "variants": [ + { + "name": "TransferHookX" + }, + { + "name": "TransferHookY" + }, + { + "name": "TransferHookReward" + } + ] + } } ], "events": [ @@ -9874,6 +11897,61 @@ export const IDL: LbClmm = { "code": 6058, "name": "InvalidActivationType", "msg": "Invalid activation type" + }, + { + "code": 6059, + "name": "NotSupportMint", + "msg": "Not support token_2022 mint extension" + }, + { + "code": 6060, + "name": "UnsupportedMintExtension", + "msg": "Unsupported mint extension" + }, + { + "code": 6061, + "name": "UnsupportNativeMintToken2022", + "msg": "Unsupported native mint token2022" + }, + { + "code": 6062, + "name": "UnmatchTokenMint", + "msg": "Unmatch token mint" + }, + { + "code": 6063, + "name": "UnsupportedTokenMint", + "msg": "Unsupported token mint" + }, + { + "code": 6064, + "name": "InsufficientRemainingAccounts", + "msg": "Insufficient remaining accounts" + }, + { + "code": 6065, + "name": "InvalidRemainingAccountSlice", + "msg": "Invalid remaining account slice" + }, + { + "code": 6066, + "name": "DuplicatedRemainingAccountTypes", + "msg": "Duplicated remaining account types" + }, + { + "code": 6067, + "name": "MissingRemainingAccountForTransferHook", + "msg": "Missing remaining account for transfer hook" + }, + { + "code": 6068, + "name": "NoTransferHookProgram", + "msg": "Remaining account was passed for transfer hook but there's no hook program" + }, + { + "code": 6069, + "name": "ZeroFundedAmount", + "msg": "Zero funded amount" } ] }; diff --git a/ts-client/package.json b/ts-client/package.json index 2374022a..9112f923 100644 --- a/ts-client/package.json +++ b/ts-client/package.json @@ -31,13 +31,14 @@ "typescript": "^5.0.4" }, "dependencies": { - "@coral-xyz/anchor": "^0.28.0", - "@coral-xyz/borsh": "^0.28.0", + "@coral-xyz/anchor": "^0.29.0", + "@coral-xyz/borsh": "^0.29.0", "@solana/buffer-layout": "^4.0.1", "@solana/spl-token": "^0.4.6", "@solana/web3.js": "^1.91.6", "decimal.js": "^10.4.2", - "gaussian": "^1.3.0" + "gaussian": "^1.3.0", + "@solana/spl-token-metadata": "^0.1.4" }, "keywords": [], "author": "McSam", diff --git a/ts-client/pnpm-lock.yaml b/ts-client/pnpm-lock.yaml index 2315b3a4..3b5582a8 100644 --- a/ts-client/pnpm-lock.yaml +++ b/ts-client/pnpm-lock.yaml @@ -9,17 +9,20 @@ importers: .: dependencies: '@coral-xyz/anchor': - specifier: ^0.28.0 - version: 0.28.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) + specifier: ^0.29.0 + version: 0.29.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) '@coral-xyz/borsh': - specifier: ^0.28.0 - version: 0.28.0(@solana/web3.js@1.95.3(bufferutil@4.0.8)(utf-8-validate@5.0.10)) + specifier: ^0.29.0 + version: 0.29.0(@solana/web3.js@1.95.3(bufferutil@4.0.8)(utf-8-validate@5.0.10)) '@solana/buffer-layout': specifier: ^4.0.1 version: 4.0.1 '@solana/spl-token': specifier: ^0.4.6 version: 0.4.8(@solana/web3.js@1.95.3(bufferutil@4.0.8)(utf-8-validate@5.0.10))(bufferutil@4.0.8)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.3.3)(utf-8-validate@5.0.10) + '@solana/spl-token-metadata': + specifier: ^0.1.4 + version: 0.1.4(@solana/web3.js@1.95.3(bufferutil@4.0.8)(utf-8-validate@5.0.10))(fastestsmallesttextencoderdecoder@1.0.22) '@solana/web3.js': specifier: ^1.91.6 version: 1.95.3(bufferutil@4.0.8)(utf-8-validate@5.0.10) @@ -667,12 +670,12 @@ packages: '@bcoe/v8-coverage@0.2.3': resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} - '@coral-xyz/anchor@0.28.0': - resolution: {integrity: sha512-kQ02Hv2ZqxtWP30WN1d4xxT4QqlOXYDxmEd3k/bbneqhV3X5QMO4LAtoUFs7otxyivOgoqam5Il5qx81FuI4vw==} + '@coral-xyz/anchor@0.29.0': + resolution: {integrity: sha512-eny6QNG0WOwqV0zQ7cs/b1tIuzZGmP7U7EcH+ogt4Gdbl8HDmIYVMh/9aTmYZPaFWjtUaI8qSn73uYEXWfATdA==} engines: {node: '>=11'} - '@coral-xyz/borsh@0.28.0': - resolution: {integrity: sha512-/u1VTzw7XooK7rqeD7JLUSwOyRSesPUk0U37BV9zK0axJc1q0nRbKFGFLYCQ16OtdOJTTwGfGp11Lx9B45bRCQ==} + '@coral-xyz/borsh@0.29.0': + resolution: {integrity: sha512-s7VFVa3a0oqpkuRloWVPdCK7hMbAMY270geZOGfCnaqexrP5dTIpbEHL33req6IYPPJ0hYa71cdvJ1h6V55/oQ==} engines: {node: '>=10'} peerDependencies: '@solana/web3.js': ^1.68.0 @@ -1842,9 +1845,6 @@ packages: resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==} engines: {node: '>=10'} - js-sha256@0.9.0: - resolution: {integrity: sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA==} - js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} @@ -3233,11 +3233,11 @@ snapshots: '@bcoe/v8-coverage@0.2.3': {} - '@coral-xyz/anchor@0.28.0(bufferutil@4.0.8)(utf-8-validate@5.0.10)': + '@coral-xyz/anchor@0.29.0(bufferutil@4.0.8)(utf-8-validate@5.0.10)': dependencies: - '@coral-xyz/borsh': 0.28.0(@solana/web3.js@1.95.3(bufferutil@4.0.8)(utf-8-validate@5.0.10)) + '@coral-xyz/borsh': 0.29.0(@solana/web3.js@1.95.3(bufferutil@4.0.8)(utf-8-validate@5.0.10)) + '@noble/hashes': 1.4.0 '@solana/web3.js': 1.95.3(bufferutil@4.0.8)(utf-8-validate@5.0.10) - base64-js: 1.5.1 bn.js: 5.2.1 bs58: 4.0.1 buffer-layout: 1.2.2 @@ -3245,7 +3245,6 @@ snapshots: cross-fetch: 3.1.8 crypto-hash: 1.3.0 eventemitter3: 4.0.7 - js-sha256: 0.9.0 pako: 2.1.0 snake-case: 3.0.4 superstruct: 0.15.5 @@ -3255,7 +3254,7 @@ snapshots: - encoding - utf-8-validate - '@coral-xyz/borsh@0.28.0(@solana/web3.js@1.95.3(bufferutil@4.0.8)(utf-8-validate@5.0.10))': + '@coral-xyz/borsh@0.29.0(@solana/web3.js@1.95.3(bufferutil@4.0.8)(utf-8-validate@5.0.10))': dependencies: '@solana/web3.js': 1.95.3(bufferutil@4.0.8)(utf-8-validate@5.0.10) bn.js: 5.2.1 @@ -4761,8 +4760,6 @@ snapshots: joycon@3.1.1: {} - js-sha256@0.9.0: {} - js-tokens@4.0.0: {} js-yaml@3.14.1: diff --git a/ts-client/src/dlmm/constants/index.ts b/ts-client/src/dlmm/constants/index.ts index 3261638e..588aac4d 100644 --- a/ts-client/src/dlmm/constants/index.ts +++ b/ts-client/src/dlmm/constants/index.ts @@ -8,6 +8,10 @@ export const LBCLMM_PROGRAM_IDS = { "mainnet-beta": "LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo", }; +export const MEMO_PROGRAM_ID = new PublicKey( + "MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr" +); + export const ADMIN = { devnet: "6WaLrrRfReGKBYUSkmx2K6AuT21ida4j8at2SUiZdXu8", localhost: "bossj3JvwiNK7pvjr149DqdtJxf2gdygbcmEPTkb2F1", diff --git a/ts-client/src/dlmm/helpers/binArray.ts b/ts-client/src/dlmm/helpers/binArray.ts index a95cc8c8..bf4f7b70 100644 --- a/ts-client/src/dlmm/helpers/binArray.ts +++ b/ts-client/src/dlmm/helpers/binArray.ts @@ -1,5 +1,5 @@ import { BN } from "@coral-xyz/anchor"; -import { PublicKey } from "@solana/web3.js"; +import { AccountMeta, PublicKey } from "@solana/web3.js"; import { MAX_BIN_ARRAY_SIZE, MAX_BIN_PER_POSITION } from "../constants"; import { Bin, @@ -364,3 +364,41 @@ export function getBinArraysRequiredByPositionRange( index, })); } + +export function getBinArrayIndexesByBinRange(lowerBinId: BN, upperBinId: BN) { + let binArrayIndex = binIdToBinArrayIndex(lowerBinId); + const indexes: BN[] = []; + while (true) { + const [binArrayLowerBinId, binArrayUpperBinId] = + getBinArrayLowerUpperBinId(binArrayIndex); + indexes.push(binArrayIndex); + + if ( + upperBinId.gte(binArrayLowerBinId) && + upperBinId.lte(binArrayUpperBinId) + ) { + break; + } else { + binArrayIndex = binArrayIndex.add(new BN(1)); + } + } + + return indexes; +} + +export function getBinArrayAccounstMetaByBinRange( + lbPair: PublicKey, + lowerBinId: BN, + upperBinId: BN, + programId: PublicKey +): AccountMeta[] { + const indexes = getBinArrayIndexesByBinRange(lowerBinId, upperBinId); + return indexes.map((index) => { + const [binArray] = deriveBinArray(lbPair, index, programId); + return { + pubkey: binArray, + isSigner: false, + isWritable: true, + }; + }); +} diff --git a/ts-client/src/dlmm/helpers/derive.ts b/ts-client/src/dlmm/helpers/derive.ts index 4d881f5d..5f253e29 100644 --- a/ts-client/src/dlmm/helpers/derive.ts +++ b/ts-client/src/dlmm/helpers/derive.ts @@ -82,6 +82,13 @@ export function deriveLbPair( ); } +export function deriveTokenBadge(token: PublicKey, programId: PublicKey) { + return PublicKey.findProgramAddressSync( + [Buffer.from("token_badge"), token.toBuffer()], + programId + ); +} + export function derivePermissionLbPair( baseKey: PublicKey, tokenX: PublicKey, diff --git a/ts-client/src/dlmm/helpers/token2022.ts b/ts-client/src/dlmm/helpers/token2022.ts new file mode 100644 index 00000000..58e20046 --- /dev/null +++ b/ts-client/src/dlmm/helpers/token2022.ts @@ -0,0 +1,56 @@ +import { + addExtraAccountMetasForExecute, + createTransferCheckedInstruction, + getTransferHook, + TOKEN_PROGRAM_ID, + unpackMint, +} from "@solana/spl-token"; +import { AccountInfo, Connection, PublicKey } from "@solana/web3.js"; + +export async function getExtraAccountMetasForTransferHook( + connection: Connection, + mintAddress: PublicKey, + mintAccountInfo: AccountInfo +) { + const mintState = unpackMint( + mintAddress, + mintAccountInfo, + mintAccountInfo.owner + ); + + if (mintAccountInfo.owner.equals(TOKEN_PROGRAM_ID)) { + return []; + } + + const transferHook = getTransferHook(mintState); + + if (!transferHook) { + return []; + } else { + // We just need the instruction, therefore we do not need source and destination key + const instruction = createTransferCheckedInstruction( + PublicKey.default, + mintAddress, + PublicKey.default, + PublicKey.default, + BigInt(0), + mintState.decimals, + [], + mintAccountInfo.owner + ); + + await addExtraAccountMetasForExecute( + connection, + instruction, + transferHook.programId, + PublicKey.default, + mintAddress, + PublicKey.default, + PublicKey.default, + BigInt(0) + ); + + // Only 4 keys needed if it's single signer. https://github.com/solana-labs/solana-program-library/blob/d72289c79a04411c69a8bf1054f7156b6196f9b3/token/js/src/extensions/transferFee/instructions.ts#L251 + return instruction.keys.slice(4); + } +} diff --git a/ts-client/src/dlmm/idl.ts b/ts-client/src/dlmm/idl.ts index 64e03074..b502099f 100644 --- a/ts-client/src/dlmm/idl.ts +++ b/ts-client/src/dlmm/idl.ts @@ -1,10323 +1,11818 @@ export type LbClmm = { - "version": "0.8.0", - "name": "lb_clmm", - "constants": [ + version: "0.9.0"; + name: "lb_clmm"; + constants: [ { - "name": "BASIS_POINT_MAX", - "type": "i32", - "value": "10000" + name: "BASIS_POINT_MAX"; + type: "i32"; + value: "10000"; }, { - "name": "MAX_BIN_PER_ARRAY", - "type": { - "defined": "usize" - }, - "value": "70" + name: "MAX_BIN_PER_ARRAY"; + type: { + defined: "usize"; + }; + value: "70"; }, { - "name": "MAX_BIN_PER_POSITION", - "type": { - "defined": "usize" - }, - "value": "70" + name: "MAX_BIN_PER_POSITION"; + type: { + defined: "usize"; + }; + value: "70"; }, { - "name": "MIN_BIN_ID", - "type": "i32", - "value": "- 443636" + name: "MIN_BIN_ID"; + type: "i32"; + value: "- 443636"; }, { - "name": "MAX_BIN_ID", - "type": "i32", - "value": "443636" + name: "MAX_BIN_ID"; + type: "i32"; + value: "443636"; }, { - "name": "MAX_FEE_RATE", - "type": "u64", - "value": "100_000_000" + name: "MAX_FEE_RATE"; + type: "u64"; + value: "100_000_000"; }, { - "name": "FEE_PRECISION", - "type": "u64", - "value": "1_000_000_000" + name: "FEE_PRECISION"; + type: "u64"; + value: "1_000_000_000"; }, { - "name": "MAX_PROTOCOL_SHARE", - "type": "u16", - "value": "2_500" + name: "MAX_PROTOCOL_SHARE"; + type: "u16"; + value: "2_500"; }, { - "name": "HOST_FEE_BPS", - "type": "u16", - "value": "2_000" + name: "HOST_FEE_BPS"; + type: "u16"; + value: "2_000"; }, { - "name": "NUM_REWARDS", - "type": { - "defined": "usize" - }, - "value": "2" + name: "NUM_REWARDS"; + type: { + defined: "usize"; + }; + value: "2"; }, { - "name": "MIN_REWARD_DURATION", - "type": "u64", - "value": "1" + name: "MIN_REWARD_DURATION"; + type: "u64"; + value: "1"; }, { - "name": "MAX_REWARD_DURATION", - "type": "u64", - "value": "31536000" + name: "MAX_REWARD_DURATION"; + type: "u64"; + value: "31536000"; }, { - "name": "EXTENSION_BINARRAY_BITMAP_SIZE", - "type": { - "defined": "usize" - }, - "value": "12" + name: "EXTENSION_BINARRAY_BITMAP_SIZE"; + type: { + defined: "usize"; + }; + value: "12"; }, { - "name": "BIN_ARRAY_BITMAP_SIZE", - "type": "i32", - "value": "512" + name: "BIN_ARRAY_BITMAP_SIZE"; + type: "i32"; + value: "512"; }, { - "name": "MAX_REWARD_BIN_SPLIT", - "type": { - "defined": "usize" - }, - "value": "15" + name: "MAX_REWARD_BIN_SPLIT"; + type: { + defined: "usize"; + }; + value: "15"; }, { - "name": "BIN_ARRAY", - "type": "bytes", - "value": "[98, 105, 110, 95, 97, 114, 114, 97, 121]" + name: "BIN_ARRAY"; + type: "bytes"; + value: "[98, 105, 110, 95, 97, 114, 114, 97, 121]"; }, { - "name": "ORACLE", - "type": "bytes", - "value": "[111, 114, 97, 99, 108, 101]" + name: "ORACLE"; + type: "bytes"; + value: "[111, 114, 97, 99, 108, 101]"; }, { - "name": "BIN_ARRAY_BITMAP_SEED", - "type": "bytes", - "value": "[98, 105, 116, 109, 97, 112]" + name: "BIN_ARRAY_BITMAP_SEED"; + type: "bytes"; + value: "[98, 105, 116, 109, 97, 112]"; }, { - "name": "PRESET_PARAMETER", - "type": "bytes", - "value": "[112, 114, 101, 115, 101, 116, 95, 112, 97, 114, 97, 109, 101, 116, 101, 114]" + name: "PRESET_PARAMETER"; + type: "bytes"; + value: "[112, 114, 101, 115, 101, 116, 95, 112, 97, 114, 97, 109, 101, 116, 101, 114]"; }, { - "name": "POSITION", - "type": "bytes", - "value": "[112, 111, 115, 105, 116, 105, 111, 110]" + name: "POSITION"; + type: "bytes"; + value: "[112, 111, 115, 105, 116, 105, 111, 110]"; } - ], - "instructions": [ + ]; + instructions: [ { - "name": "initializeLbPair", - "accounts": [ + name: "initializeLbPair"; + accounts: [ { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "lbPair"; + isMut: true; + isSigner: false; }, { - "name": "binArrayBitmapExtension", - "isMut": true, - "isSigner": false, - "isOptional": true + name: "binArrayBitmapExtension"; + isMut: true; + isSigner: false; + isOptional: true; }, { - "name": "tokenMintX", - "isMut": false, - "isSigner": false + name: "tokenMintX"; + isMut: false; + isSigner: false; }, { - "name": "tokenMintY", - "isMut": false, - "isSigner": false + name: "tokenMintY"; + isMut: false; + isSigner: false; }, { - "name": "reserveX", - "isMut": true, - "isSigner": false + name: "reserveX"; + isMut: true; + isSigner: false; }, { - "name": "reserveY", - "isMut": true, - "isSigner": false + name: "reserveY"; + isMut: true; + isSigner: false; }, { - "name": "oracle", - "isMut": true, - "isSigner": false + name: "oracle"; + isMut: true; + isSigner: false; }, { - "name": "presetParameter", - "isMut": false, - "isSigner": false + name: "presetParameter"; + isMut: false; + isSigner: false; }, { - "name": "funder", - "isMut": true, - "isSigner": true + name: "funder"; + isMut: true; + isSigner: true; }, { - "name": "tokenProgram", - "isMut": false, - "isSigner": false + name: "tokenProgram"; + isMut: false; + isSigner: false; }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false + name: "systemProgram"; + isMut: false; + isSigner: false; }, { - "name": "rent", - "isMut": false, - "isSigner": false + name: "rent"; + isMut: false; + isSigner: false; }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "eventAuthority"; + isMut: false; + isSigner: false; }, { - "name": "program", - "isMut": false, - "isSigner": false + name: "program"; + isMut: false; + isSigner: false; } - ], - "args": [ + ]; + args: [ { - "name": "activeId", - "type": "i32" + name: "activeId"; + type: "i32"; }, { - "name": "binStep", - "type": "u16" + name: "binStep"; + type: "u16"; } - ] + ]; }, { - "name": "initializePermissionLbPair", - "accounts": [ + name: "initializePermissionLbPair"; + accounts: [ + { + name: "base"; + isMut: false; + isSigner: true; + }, + { + name: "lbPair"; + isMut: true; + isSigner: false; + }, + { + name: "binArrayBitmapExtension"; + isMut: true; + isSigner: false; + isOptional: true; + }, { - "name": "base", - "isMut": false, - "isSigner": true + name: "tokenMintX"; + isMut: false; + isSigner: false; }, { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "tokenMintY"; + isMut: false; + isSigner: false; }, { - "name": "binArrayBitmapExtension", - "isMut": true, - "isSigner": false, - "isOptional": true + name: "reserveX"; + isMut: true; + isSigner: false; }, { - "name": "tokenMintX", - "isMut": false, - "isSigner": false + name: "reserveY"; + isMut: true; + isSigner: false; }, { - "name": "tokenMintY", - "isMut": false, - "isSigner": false + name: "oracle"; + isMut: true; + isSigner: false; }, { - "name": "reserveX", - "isMut": true, - "isSigner": false + name: "admin"; + isMut: true; + isSigner: true; }, { - "name": "reserveY", - "isMut": true, - "isSigner": false + name: "tokenBadgeX"; + isMut: false; + isSigner: false; + isOptional: true; }, { - "name": "oracle", - "isMut": true, - "isSigner": false + name: "tokenBadgeY"; + isMut: false; + isSigner: false; + isOptional: true; }, { - "name": "admin", - "isMut": true, - "isSigner": true + name: "tokenProgramX"; + isMut: false; + isSigner: false; }, { - "name": "tokenProgram", - "isMut": false, - "isSigner": false + name: "tokenProgramY"; + isMut: false; + isSigner: false; }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false + name: "systemProgram"; + isMut: false; + isSigner: false; }, { - "name": "rent", - "isMut": false, - "isSigner": false + name: "rent"; + isMut: false; + isSigner: false; }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "eventAuthority"; + isMut: false; + isSigner: false; }, { - "name": "program", - "isMut": false, - "isSigner": false + name: "program"; + isMut: false; + isSigner: false; } - ], - "args": [ + ]; + args: [ { - "name": "ixData", - "type": { - "defined": "InitPermissionPairIx" - } + name: "ixData"; + type: { + defined: "InitPermissionPairIx"; + }; } - ] + ]; }, { - "name": "initializeBinArrayBitmapExtension", - "accounts": [ + name: "initializeBinArrayBitmapExtension"; + accounts: [ { - "name": "lbPair", - "isMut": false, - "isSigner": false + name: "lbPair"; + isMut: false; + isSigner: false; }, { - "name": "binArrayBitmapExtension", - "isMut": true, - "isSigner": false, - "docs": [ + name: "binArrayBitmapExtension"; + isMut: true; + isSigner: false; + docs: [ "Initialize an account to store if a bin array is initialized." - ] + ]; }, { - "name": "funder", - "isMut": true, - "isSigner": true + name: "funder"; + isMut: true; + isSigner: true; }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false + name: "systemProgram"; + isMut: false; + isSigner: false; }, { - "name": "rent", - "isMut": false, - "isSigner": false + name: "rent"; + isMut: false; + isSigner: false; } - ], - "args": [] + ]; + args: []; }, { - "name": "initializeBinArray", - "accounts": [ + name: "initializeBinArray"; + accounts: [ { - "name": "lbPair", - "isMut": false, - "isSigner": false + name: "lbPair"; + isMut: false; + isSigner: false; }, { - "name": "binArray", - "isMut": true, - "isSigner": false + name: "binArray"; + isMut: true; + isSigner: false; }, { - "name": "funder", - "isMut": true, - "isSigner": true + name: "funder"; + isMut: true; + isSigner: true; }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false + name: "systemProgram"; + isMut: false; + isSigner: false; } - ], - "args": [ + ]; + args: [ { - "name": "index", - "type": "i64" + name: "index"; + type: "i64"; } - ] + ]; }, { - "name": "addLiquidity", - "accounts": [ + name: "addLiquidity"; + accounts: [ { - "name": "position", - "isMut": true, - "isSigner": false + name: "position"; + isMut: true; + isSigner: false; }, { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "lbPair"; + isMut: true; + isSigner: false; }, { - "name": "binArrayBitmapExtension", - "isMut": true, - "isSigner": false, - "isOptional": true + name: "binArrayBitmapExtension"; + isMut: true; + isSigner: false; + isOptional: true; }, { - "name": "userTokenX", - "isMut": true, - "isSigner": false + name: "userTokenX"; + isMut: true; + isSigner: false; }, { - "name": "userTokenY", - "isMut": true, - "isSigner": false + name: "userTokenY"; + isMut: true; + isSigner: false; }, { - "name": "reserveX", - "isMut": true, - "isSigner": false + name: "reserveX"; + isMut: true; + isSigner: false; }, { - "name": "reserveY", - "isMut": true, - "isSigner": false + name: "reserveY"; + isMut: true; + isSigner: false; }, { - "name": "tokenXMint", - "isMut": false, - "isSigner": false + name: "tokenXMint"; + isMut: false; + isSigner: false; }, { - "name": "tokenYMint", - "isMut": false, - "isSigner": false + name: "tokenYMint"; + isMut: false; + isSigner: false; }, { - "name": "binArrayLower", - "isMut": true, - "isSigner": false + name: "binArrayLower"; + isMut: true; + isSigner: false; }, { - "name": "binArrayUpper", - "isMut": true, - "isSigner": false + name: "binArrayUpper"; + isMut: true; + isSigner: false; }, { - "name": "sender", - "isMut": false, - "isSigner": true + name: "sender"; + isMut: false; + isSigner: true; }, { - "name": "tokenXProgram", - "isMut": false, - "isSigner": false + name: "tokenXProgram"; + isMut: false; + isSigner: false; }, { - "name": "tokenYProgram", - "isMut": false, - "isSigner": false + name: "tokenYProgram"; + isMut: false; + isSigner: false; }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "eventAuthority"; + isMut: false; + isSigner: false; }, { - "name": "program", - "isMut": false, - "isSigner": false + name: "program"; + isMut: false; + isSigner: false; } - ], - "args": [ + ]; + args: [ { - "name": "liquidityParameter", - "type": { - "defined": "LiquidityParameter" - } + name: "liquidityParameter"; + type: { + defined: "LiquidityParameter"; + }; } - ] + ]; }, { - "name": "addLiquidityByWeight", - "accounts": [ + name: "addLiquidityByWeight"; + accounts: [ { - "name": "position", - "isMut": true, - "isSigner": false + name: "position"; + isMut: true; + isSigner: false; }, { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "lbPair"; + isMut: true; + isSigner: false; }, { - "name": "binArrayBitmapExtension", - "isMut": true, - "isSigner": false, - "isOptional": true + name: "binArrayBitmapExtension"; + isMut: true; + isSigner: false; + isOptional: true; }, { - "name": "userTokenX", - "isMut": true, - "isSigner": false + name: "userTokenX"; + isMut: true; + isSigner: false; }, { - "name": "userTokenY", - "isMut": true, - "isSigner": false + name: "userTokenY"; + isMut: true; + isSigner: false; }, { - "name": "reserveX", - "isMut": true, - "isSigner": false + name: "reserveX"; + isMut: true; + isSigner: false; }, { - "name": "reserveY", - "isMut": true, - "isSigner": false + name: "reserveY"; + isMut: true; + isSigner: false; }, { - "name": "tokenXMint", - "isMut": false, - "isSigner": false + name: "tokenXMint"; + isMut: false; + isSigner: false; }, { - "name": "tokenYMint", - "isMut": false, - "isSigner": false + name: "tokenYMint"; + isMut: false; + isSigner: false; }, { - "name": "binArrayLower", - "isMut": true, - "isSigner": false + name: "binArrayLower"; + isMut: true; + isSigner: false; }, { - "name": "binArrayUpper", - "isMut": true, - "isSigner": false + name: "binArrayUpper"; + isMut: true; + isSigner: false; }, { - "name": "sender", - "isMut": false, - "isSigner": true + name: "sender"; + isMut: false; + isSigner: true; }, { - "name": "tokenXProgram", - "isMut": false, - "isSigner": false + name: "tokenXProgram"; + isMut: false; + isSigner: false; }, { - "name": "tokenYProgram", - "isMut": false, - "isSigner": false + name: "tokenYProgram"; + isMut: false; + isSigner: false; }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "eventAuthority"; + isMut: false; + isSigner: false; }, { - "name": "program", - "isMut": false, - "isSigner": false + name: "program"; + isMut: false; + isSigner: false; } - ], - "args": [ + ]; + args: [ { - "name": "liquidityParameter", - "type": { - "defined": "LiquidityParameterByWeight" - } + name: "liquidityParameter"; + type: { + defined: "LiquidityParameterByWeight"; + }; } - ] + ]; }, { - "name": "addLiquidityByStrategy", - "accounts": [ + name: "addLiquidityByStrategy"; + accounts: [ { - "name": "position", - "isMut": true, - "isSigner": false + name: "position"; + isMut: true; + isSigner: false; }, { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "lbPair"; + isMut: true; + isSigner: false; }, { - "name": "binArrayBitmapExtension", - "isMut": true, - "isSigner": false, - "isOptional": true + name: "binArrayBitmapExtension"; + isMut: true; + isSigner: false; + isOptional: true; }, { - "name": "userTokenX", - "isMut": true, - "isSigner": false + name: "userTokenX"; + isMut: true; + isSigner: false; }, { - "name": "userTokenY", - "isMut": true, - "isSigner": false + name: "userTokenY"; + isMut: true; + isSigner: false; }, { - "name": "reserveX", - "isMut": true, - "isSigner": false + name: "reserveX"; + isMut: true; + isSigner: false; }, { - "name": "reserveY", - "isMut": true, - "isSigner": false + name: "reserveY"; + isMut: true; + isSigner: false; }, { - "name": "tokenXMint", - "isMut": false, - "isSigner": false + name: "tokenXMint"; + isMut: false; + isSigner: false; }, { - "name": "tokenYMint", - "isMut": false, - "isSigner": false + name: "tokenYMint"; + isMut: false; + isSigner: false; }, { - "name": "binArrayLower", - "isMut": true, - "isSigner": false + name: "binArrayLower"; + isMut: true; + isSigner: false; }, { - "name": "binArrayUpper", - "isMut": true, - "isSigner": false + name: "binArrayUpper"; + isMut: true; + isSigner: false; }, { - "name": "sender", - "isMut": false, - "isSigner": true + name: "sender"; + isMut: false; + isSigner: true; }, { - "name": "tokenXProgram", - "isMut": false, - "isSigner": false + name: "tokenXProgram"; + isMut: false; + isSigner: false; }, { - "name": "tokenYProgram", - "isMut": false, - "isSigner": false + name: "tokenYProgram"; + isMut: false; + isSigner: false; }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "eventAuthority"; + isMut: false; + isSigner: false; }, { - "name": "program", - "isMut": false, - "isSigner": false + name: "program"; + isMut: false; + isSigner: false; } - ], - "args": [ + ]; + args: [ { - "name": "liquidityParameter", - "type": { - "defined": "LiquidityParameterByStrategy" - } + name: "liquidityParameter"; + type: { + defined: "LiquidityParameterByStrategy"; + }; } - ] + ]; }, { - "name": "addLiquidityByStrategyOneSide", - "accounts": [ + name: "addLiquidityByStrategyOneSide"; + accounts: [ { - "name": "position", - "isMut": true, - "isSigner": false + name: "position"; + isMut: true; + isSigner: false; }, { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "lbPair"; + isMut: true; + isSigner: false; }, { - "name": "binArrayBitmapExtension", - "isMut": true, - "isSigner": false, - "isOptional": true + name: "binArrayBitmapExtension"; + isMut: true; + isSigner: false; + isOptional: true; }, { - "name": "userToken", - "isMut": true, - "isSigner": false + name: "userToken"; + isMut: true; + isSigner: false; }, { - "name": "reserve", - "isMut": true, - "isSigner": false + name: "reserve"; + isMut: true; + isSigner: false; }, { - "name": "tokenMint", - "isMut": false, - "isSigner": false + name: "tokenMint"; + isMut: false; + isSigner: false; }, { - "name": "binArrayLower", - "isMut": true, - "isSigner": false + name: "binArrayLower"; + isMut: true; + isSigner: false; }, { - "name": "binArrayUpper", - "isMut": true, - "isSigner": false + name: "binArrayUpper"; + isMut: true; + isSigner: false; }, { - "name": "sender", - "isMut": false, - "isSigner": true + name: "sender"; + isMut: false; + isSigner: true; }, { - "name": "tokenProgram", - "isMut": false, - "isSigner": false + name: "tokenProgram"; + isMut: false; + isSigner: false; }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "eventAuthority"; + isMut: false; + isSigner: false; }, { - "name": "program", - "isMut": false, - "isSigner": false + name: "program"; + isMut: false; + isSigner: false; } - ], - "args": [ + ]; + args: [ { - "name": "liquidityParameter", - "type": { - "defined": "LiquidityParameterByStrategyOneSide" - } + name: "liquidityParameter"; + type: { + defined: "LiquidityParameterByStrategyOneSide"; + }; } - ] + ]; }, { - "name": "addLiquidityOneSide", - "accounts": [ + name: "addLiquidityOneSide"; + accounts: [ { - "name": "position", - "isMut": true, - "isSigner": false + name: "position"; + isMut: true; + isSigner: false; }, { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "lbPair"; + isMut: true; + isSigner: false; }, { - "name": "binArrayBitmapExtension", - "isMut": true, - "isSigner": false, - "isOptional": true + name: "binArrayBitmapExtension"; + isMut: true; + isSigner: false; + isOptional: true; }, { - "name": "userToken", - "isMut": true, - "isSigner": false + name: "userToken"; + isMut: true; + isSigner: false; }, { - "name": "reserve", - "isMut": true, - "isSigner": false + name: "reserve"; + isMut: true; + isSigner: false; }, { - "name": "tokenMint", - "isMut": false, - "isSigner": false + name: "tokenMint"; + isMut: false; + isSigner: false; }, { - "name": "binArrayLower", - "isMut": true, - "isSigner": false + name: "binArrayLower"; + isMut: true; + isSigner: false; }, { - "name": "binArrayUpper", - "isMut": true, - "isSigner": false + name: "binArrayUpper"; + isMut: true; + isSigner: false; }, { - "name": "sender", - "isMut": false, - "isSigner": true + name: "sender"; + isMut: false; + isSigner: true; }, { - "name": "tokenProgram", - "isMut": false, - "isSigner": false + name: "tokenProgram"; + isMut: false; + isSigner: false; }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "eventAuthority"; + isMut: false; + isSigner: false; }, { - "name": "program", - "isMut": false, - "isSigner": false + name: "program"; + isMut: false; + isSigner: false; } - ], - "args": [ + ]; + args: [ { - "name": "liquidityParameter", - "type": { - "defined": "LiquidityOneSideParameter" - } + name: "liquidityParameter"; + type: { + defined: "LiquidityOneSideParameter"; + }; } - ] + ]; }, { - "name": "removeLiquidity", - "accounts": [ + name: "removeLiquidity"; + accounts: [ { - "name": "position", - "isMut": true, - "isSigner": false + name: "position"; + isMut: true; + isSigner: false; }, { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "lbPair"; + isMut: true; + isSigner: false; }, { - "name": "binArrayBitmapExtension", - "isMut": true, - "isSigner": false, - "isOptional": true + name: "binArrayBitmapExtension"; + isMut: true; + isSigner: false; + isOptional: true; }, { - "name": "userTokenX", - "isMut": true, - "isSigner": false + name: "userTokenX"; + isMut: true; + isSigner: false; }, { - "name": "userTokenY", - "isMut": true, - "isSigner": false + name: "userTokenY"; + isMut: true; + isSigner: false; }, { - "name": "reserveX", - "isMut": true, - "isSigner": false + name: "reserveX"; + isMut: true; + isSigner: false; }, { - "name": "reserveY", - "isMut": true, - "isSigner": false + name: "reserveY"; + isMut: true; + isSigner: false; }, { - "name": "tokenXMint", - "isMut": false, - "isSigner": false + name: "tokenXMint"; + isMut: false; + isSigner: false; }, { - "name": "tokenYMint", - "isMut": false, - "isSigner": false + name: "tokenYMint"; + isMut: false; + isSigner: false; }, { - "name": "binArrayLower", - "isMut": true, - "isSigner": false + name: "binArrayLower"; + isMut: true; + isSigner: false; }, { - "name": "binArrayUpper", - "isMut": true, - "isSigner": false + name: "binArrayUpper"; + isMut: true; + isSigner: false; }, { - "name": "sender", - "isMut": false, - "isSigner": true + name: "sender"; + isMut: false; + isSigner: true; }, { - "name": "tokenXProgram", - "isMut": false, - "isSigner": false + name: "tokenXProgram"; + isMut: false; + isSigner: false; }, { - "name": "tokenYProgram", - "isMut": false, - "isSigner": false + name: "tokenYProgram"; + isMut: false; + isSigner: false; }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "eventAuthority"; + isMut: false; + isSigner: false; }, { - "name": "program", - "isMut": false, - "isSigner": false + name: "program"; + isMut: false; + isSigner: false; } - ], - "args": [ + ]; + args: [ { - "name": "binLiquidityRemoval", - "type": { - "vec": { - "defined": "BinLiquidityReduction" - } - } + name: "binLiquidityRemoval"; + type: { + vec: { + defined: "BinLiquidityReduction"; + }; + }; } - ] + ]; }, { - "name": "initializePosition", - "accounts": [ + name: "initializePosition"; + accounts: [ { - "name": "payer", - "isMut": true, - "isSigner": true + name: "payer"; + isMut: true; + isSigner: true; }, { - "name": "position", - "isMut": true, - "isSigner": true + name: "position"; + isMut: true; + isSigner: true; }, { - "name": "lbPair", - "isMut": false, - "isSigner": false + name: "lbPair"; + isMut: false; + isSigner: false; }, { - "name": "owner", - "isMut": false, - "isSigner": true + name: "owner"; + isMut: false; + isSigner: true; }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false + name: "systemProgram"; + isMut: false; + isSigner: false; }, { - "name": "rent", - "isMut": false, - "isSigner": false + name: "rent"; + isMut: false; + isSigner: false; }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "eventAuthority"; + isMut: false; + isSigner: false; }, { - "name": "program", - "isMut": false, - "isSigner": false + name: "program"; + isMut: false; + isSigner: false; } - ], - "args": [ + ]; + args: [ { - "name": "lowerBinId", - "type": "i32" + name: "lowerBinId"; + type: "i32"; }, { - "name": "width", - "type": "i32" + name: "width"; + type: "i32"; } - ] + ]; }, { - "name": "initializePositionPda", - "accounts": [ + name: "initializePositionPda"; + accounts: [ { - "name": "payer", - "isMut": true, - "isSigner": true + name: "payer"; + isMut: true; + isSigner: true; }, { - "name": "base", - "isMut": false, - "isSigner": true + name: "base"; + isMut: false; + isSigner: true; }, { - "name": "position", - "isMut": true, - "isSigner": false + name: "position"; + isMut: true; + isSigner: false; }, { - "name": "lbPair", - "isMut": false, - "isSigner": false + name: "lbPair"; + isMut: false; + isSigner: false; }, { - "name": "owner", - "isMut": false, - "isSigner": true, - "docs": [ - "owner" - ] + name: "owner"; + isMut: false; + isSigner: true; + docs: ["owner"]; }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false + name: "systemProgram"; + isMut: false; + isSigner: false; }, { - "name": "rent", - "isMut": false, - "isSigner": false + name: "rent"; + isMut: false; + isSigner: false; }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "eventAuthority"; + isMut: false; + isSigner: false; }, { - "name": "program", - "isMut": false, - "isSigner": false + name: "program"; + isMut: false; + isSigner: false; } - ], - "args": [ + ]; + args: [ { - "name": "lowerBinId", - "type": "i32" + name: "lowerBinId"; + type: "i32"; }, { - "name": "width", - "type": "i32" + name: "width"; + type: "i32"; } - ] + ]; }, { - "name": "initializePositionByOperator", - "accounts": [ + name: "initializePositionByOperator"; + accounts: [ { - "name": "payer", - "isMut": true, - "isSigner": true + name: "payer"; + isMut: true; + isSigner: true; }, { - "name": "base", - "isMut": false, - "isSigner": true + name: "base"; + isMut: false; + isSigner: true; }, { - "name": "position", - "isMut": true, - "isSigner": false + name: "position"; + isMut: true; + isSigner: false; }, { - "name": "lbPair", - "isMut": false, - "isSigner": false + name: "lbPair"; + isMut: false; + isSigner: false; }, { - "name": "operator", - "isMut": false, - "isSigner": true, - "docs": [ - "operator" - ] + name: "operator"; + isMut: false; + isSigner: true; + docs: ["operator"]; }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false + name: "systemProgram"; + isMut: false; + isSigner: false; }, { - "name": "rent", - "isMut": false, - "isSigner": false + name: "rent"; + isMut: false; + isSigner: false; }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "eventAuthority"; + isMut: false; + isSigner: false; }, { - "name": "program", - "isMut": false, - "isSigner": false + name: "program"; + isMut: false; + isSigner: false; } - ], - "args": [ + ]; + args: [ { - "name": "lowerBinId", - "type": "i32" + name: "lowerBinId"; + type: "i32"; }, { - "name": "width", - "type": "i32" + name: "width"; + type: "i32"; }, { - "name": "owner", - "type": "publicKey" + name: "owner"; + type: "publicKey"; }, { - "name": "feeOwner", - "type": "publicKey" + name: "feeOwner"; + type: "publicKey"; } - ] + ]; }, { - "name": "updatePositionOperator", - "accounts": [ + name: "updatePositionOperator"; + accounts: [ { - "name": "position", - "isMut": true, - "isSigner": false + name: "position"; + isMut: true; + isSigner: false; }, { - "name": "owner", - "isMut": false, - "isSigner": true + name: "owner"; + isMut: false; + isSigner: true; }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "eventAuthority"; + isMut: false; + isSigner: false; }, { - "name": "program", - "isMut": false, - "isSigner": false + name: "program"; + isMut: false; + isSigner: false; } - ], - "args": [ + ]; + args: [ { - "name": "operator", - "type": "publicKey" + name: "operator"; + type: "publicKey"; } - ] + ]; }, { - "name": "swap", - "accounts": [ + name: "swap"; + accounts: [ { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "lbPair"; + isMut: true; + isSigner: false; }, { - "name": "binArrayBitmapExtension", - "isMut": false, - "isSigner": false, - "isOptional": true + name: "binArrayBitmapExtension"; + isMut: false; + isSigner: false; + isOptional: true; }, { - "name": "reserveX", - "isMut": true, - "isSigner": false + name: "reserveX"; + isMut: true; + isSigner: false; }, { - "name": "reserveY", - "isMut": true, - "isSigner": false + name: "reserveY"; + isMut: true; + isSigner: false; }, { - "name": "userTokenIn", - "isMut": true, - "isSigner": false + name: "userTokenIn"; + isMut: true; + isSigner: false; }, { - "name": "userTokenOut", - "isMut": true, - "isSigner": false + name: "userTokenOut"; + isMut: true; + isSigner: false; }, { - "name": "tokenXMint", - "isMut": false, - "isSigner": false + name: "tokenXMint"; + isMut: false; + isSigner: false; }, { - "name": "tokenYMint", - "isMut": false, - "isSigner": false + name: "tokenYMint"; + isMut: false; + isSigner: false; }, { - "name": "oracle", - "isMut": true, - "isSigner": false + name: "oracle"; + isMut: true; + isSigner: false; }, { - "name": "hostFeeIn", - "isMut": true, - "isSigner": false, - "isOptional": true + name: "hostFeeIn"; + isMut: true; + isSigner: false; + isOptional: true; }, { - "name": "user", - "isMut": false, - "isSigner": true + name: "user"; + isMut: false; + isSigner: true; }, { - "name": "tokenXProgram", - "isMut": false, - "isSigner": false + name: "tokenXProgram"; + isMut: false; + isSigner: false; }, { - "name": "tokenYProgram", - "isMut": false, - "isSigner": false + name: "tokenYProgram"; + isMut: false; + isSigner: false; }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "eventAuthority"; + isMut: false; + isSigner: false; }, { - "name": "program", - "isMut": false, - "isSigner": false + name: "program"; + isMut: false; + isSigner: false; } - ], - "args": [ + ]; + args: [ { - "name": "amountIn", - "type": "u64" + name: "amountIn"; + type: "u64"; }, { - "name": "minAmountOut", - "type": "u64" + name: "minAmountOut"; + type: "u64"; } - ] + ]; }, { - "name": "swapExactOut", - "accounts": [ + name: "swapExactOut"; + accounts: [ { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "lbPair"; + isMut: true; + isSigner: false; }, { - "name": "binArrayBitmapExtension", - "isMut": false, - "isSigner": false, - "isOptional": true + name: "binArrayBitmapExtension"; + isMut: false; + isSigner: false; + isOptional: true; }, { - "name": "reserveX", - "isMut": true, - "isSigner": false + name: "reserveX"; + isMut: true; + isSigner: false; }, { - "name": "reserveY", - "isMut": true, - "isSigner": false + name: "reserveY"; + isMut: true; + isSigner: false; }, { - "name": "userTokenIn", - "isMut": true, - "isSigner": false + name: "userTokenIn"; + isMut: true; + isSigner: false; }, { - "name": "userTokenOut", - "isMut": true, - "isSigner": false + name: "userTokenOut"; + isMut: true; + isSigner: false; }, { - "name": "tokenXMint", - "isMut": false, - "isSigner": false + name: "tokenXMint"; + isMut: false; + isSigner: false; }, { - "name": "tokenYMint", - "isMut": false, - "isSigner": false + name: "tokenYMint"; + isMut: false; + isSigner: false; }, { - "name": "oracle", - "isMut": true, - "isSigner": false + name: "oracle"; + isMut: true; + isSigner: false; }, { - "name": "hostFeeIn", - "isMut": true, - "isSigner": false, - "isOptional": true + name: "hostFeeIn"; + isMut: true; + isSigner: false; + isOptional: true; }, { - "name": "user", - "isMut": false, - "isSigner": true + name: "user"; + isMut: false; + isSigner: true; }, { - "name": "tokenXProgram", - "isMut": false, - "isSigner": false + name: "tokenXProgram"; + isMut: false; + isSigner: false; }, { - "name": "tokenYProgram", - "isMut": false, - "isSigner": false + name: "tokenYProgram"; + isMut: false; + isSigner: false; }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "eventAuthority"; + isMut: false; + isSigner: false; }, { - "name": "program", - "isMut": false, - "isSigner": false + name: "program"; + isMut: false; + isSigner: false; } - ], - "args": [ + ]; + args: [ { - "name": "maxInAmount", - "type": "u64" + name: "maxInAmount"; + type: "u64"; }, { - "name": "outAmount", - "type": "u64" + name: "outAmount"; + type: "u64"; } - ] + ]; }, { - "name": "swapWithPriceImpact", - "accounts": [ + name: "swapWithPriceImpact"; + accounts: [ { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "lbPair"; + isMut: true; + isSigner: false; }, { - "name": "binArrayBitmapExtension", - "isMut": false, - "isSigner": false, - "isOptional": true + name: "binArrayBitmapExtension"; + isMut: false; + isSigner: false; + isOptional: true; }, { - "name": "reserveX", - "isMut": true, - "isSigner": false + name: "reserveX"; + isMut: true; + isSigner: false; }, { - "name": "reserveY", - "isMut": true, - "isSigner": false + name: "reserveY"; + isMut: true; + isSigner: false; }, { - "name": "userTokenIn", - "isMut": true, - "isSigner": false + name: "userTokenIn"; + isMut: true; + isSigner: false; }, { - "name": "userTokenOut", - "isMut": true, - "isSigner": false + name: "userTokenOut"; + isMut: true; + isSigner: false; }, { - "name": "tokenXMint", - "isMut": false, - "isSigner": false + name: "tokenXMint"; + isMut: false; + isSigner: false; }, { - "name": "tokenYMint", - "isMut": false, - "isSigner": false + name: "tokenYMint"; + isMut: false; + isSigner: false; }, { - "name": "oracle", - "isMut": true, - "isSigner": false + name: "oracle"; + isMut: true; + isSigner: false; }, { - "name": "hostFeeIn", - "isMut": true, - "isSigner": false, - "isOptional": true + name: "hostFeeIn"; + isMut: true; + isSigner: false; + isOptional: true; }, { - "name": "user", - "isMut": false, - "isSigner": true + name: "user"; + isMut: false; + isSigner: true; }, { - "name": "tokenXProgram", - "isMut": false, - "isSigner": false + name: "tokenXProgram"; + isMut: false; + isSigner: false; }, { - "name": "tokenYProgram", - "isMut": false, - "isSigner": false + name: "tokenYProgram"; + isMut: false; + isSigner: false; }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "eventAuthority"; + isMut: false; + isSigner: false; }, { - "name": "program", - "isMut": false, - "isSigner": false + name: "program"; + isMut: false; + isSigner: false; } - ], - "args": [ + ]; + args: [ { - "name": "amountIn", - "type": "u64" + name: "amountIn"; + type: "u64"; }, { - "name": "activeId", - "type": { - "option": "i32" - } + name: "activeId"; + type: { + option: "i32"; + }; }, { - "name": "maxPriceImpactBps", - "type": "u16" + name: "maxPriceImpactBps"; + type: "u16"; } - ] + ]; }, { - "name": "withdrawProtocolFee", - "accounts": [ + name: "withdrawProtocolFee"; + accounts: [ + { + name: "lbPair"; + isMut: true; + isSigner: false; + }, { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "reserveX"; + isMut: true; + isSigner: false; }, { - "name": "reserveX", - "isMut": true, - "isSigner": false + name: "reserveY"; + isMut: true; + isSigner: false; }, { - "name": "reserveY", - "isMut": true, - "isSigner": false + name: "tokenXMint"; + isMut: false; + isSigner: false; }, { - "name": "tokenXMint", - "isMut": false, - "isSigner": false + name: "tokenYMint"; + isMut: false; + isSigner: false; }, { - "name": "tokenYMint", - "isMut": false, - "isSigner": false + name: "receiverTokenX"; + isMut: true; + isSigner: false; }, { - "name": "receiverTokenX", - "isMut": true, - "isSigner": false + name: "receiverTokenY"; + isMut: true; + isSigner: false; }, { - "name": "receiverTokenY", - "isMut": true, - "isSigner": false + name: "tokenXProgram"; + isMut: false; + isSigner: false; }, { - "name": "tokenXProgram", - "isMut": false, - "isSigner": false + name: "tokenYProgram"; + isMut: false; + isSigner: false; }, { - "name": "tokenYProgram", - "isMut": false, - "isSigner": false + name: "memoProgram"; + isMut: false; + isSigner: false; } - ], - "args": [ + ]; + args: [ { - "name": "amountX", - "type": "u64" + name: "amountX"; + type: "u64"; }, { - "name": "amountY", - "type": "u64" + name: "amountY"; + type: "u64"; + }, + { + name: "remainingAccountsInfo"; + type: { + defined: "RemainingAccountsInfo"; + }; } - ] + ]; }, { - "name": "initializeReward", - "accounts": [ + name: "initializeReward"; + accounts: [ + { + name: "lbPair"; + isMut: true; + isSigner: false; + }, { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "rewardVault"; + isMut: true; + isSigner: false; }, { - "name": "rewardVault", - "isMut": true, - "isSigner": false + name: "rewardMint"; + isMut: false; + isSigner: false; }, { - "name": "rewardMint", - "isMut": false, - "isSigner": false + name: "tokenBadge"; + isMut: false; + isSigner: false; + isOptional: true; }, { - "name": "admin", - "isMut": true, - "isSigner": true + name: "admin"; + isMut: true; + isSigner: true; }, { - "name": "tokenProgram", - "isMut": false, - "isSigner": false + name: "tokenProgram"; + isMut: false; + isSigner: false; }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false + name: "systemProgram"; + isMut: false; + isSigner: false; }, { - "name": "rent", - "isMut": false, - "isSigner": false + name: "rent"; + isMut: false; + isSigner: false; }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "eventAuthority"; + isMut: false; + isSigner: false; }, { - "name": "program", - "isMut": false, - "isSigner": false + name: "program"; + isMut: false; + isSigner: false; } - ], - "args": [ + ]; + args: [ { - "name": "rewardIndex", - "type": "u64" + name: "rewardIndex"; + type: "u64"; }, { - "name": "rewardDuration", - "type": "u64" + name: "rewardDuration"; + type: "u64"; }, { - "name": "funder", - "type": "publicKey" + name: "funder"; + type: "publicKey"; } - ] + ]; }, { - "name": "fundReward", - "accounts": [ + name: "fundReward"; + accounts: [ { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "lbPair"; + isMut: true; + isSigner: false; }, { - "name": "rewardVault", - "isMut": true, - "isSigner": false + name: "rewardVault"; + isMut: true; + isSigner: false; }, { - "name": "rewardMint", - "isMut": false, - "isSigner": false + name: "rewardMint"; + isMut: false; + isSigner: false; }, { - "name": "funderTokenAccount", - "isMut": true, - "isSigner": false + name: "funderTokenAccount"; + isMut: true; + isSigner: false; }, { - "name": "funder", - "isMut": false, - "isSigner": true + name: "funder"; + isMut: false; + isSigner: true; }, { - "name": "binArray", - "isMut": true, - "isSigner": false + name: "binArray"; + isMut: true; + isSigner: false; }, { - "name": "tokenProgram", - "isMut": false, - "isSigner": false + name: "tokenProgram"; + isMut: false; + isSigner: false; }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "eventAuthority"; + isMut: false; + isSigner: false; }, { - "name": "program", - "isMut": false, - "isSigner": false + name: "program"; + isMut: false; + isSigner: false; } - ], - "args": [ + ]; + args: [ + { + name: "rewardIndex"; + type: "u64"; + }, { - "name": "rewardIndex", - "type": "u64" + name: "amount"; + type: "u64"; }, { - "name": "amount", - "type": "u64" + name: "carryForward"; + type: "bool"; }, { - "name": "carryForward", - "type": "bool" + name: "remainingAccountsInfo"; + type: { + defined: "RemainingAccountsInfo"; + }; } - ] + ]; }, { - "name": "updateRewardFunder", - "accounts": [ + name: "updateRewardFunder"; + accounts: [ { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "lbPair"; + isMut: true; + isSigner: false; }, { - "name": "admin", - "isMut": false, - "isSigner": true + name: "admin"; + isMut: false; + isSigner: true; }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "eventAuthority"; + isMut: false; + isSigner: false; }, { - "name": "program", - "isMut": false, - "isSigner": false + name: "program"; + isMut: false; + isSigner: false; } - ], - "args": [ + ]; + args: [ { - "name": "rewardIndex", - "type": "u64" + name: "rewardIndex"; + type: "u64"; }, { - "name": "newFunder", - "type": "publicKey" + name: "newFunder"; + type: "publicKey"; } - ] + ]; }, { - "name": "updateRewardDuration", - "accounts": [ + name: "updateRewardDuration"; + accounts: [ { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "lbPair"; + isMut: true; + isSigner: false; }, { - "name": "admin", - "isMut": false, - "isSigner": true + name: "admin"; + isMut: false; + isSigner: true; }, { - "name": "binArray", - "isMut": true, - "isSigner": false + name: "binArray"; + isMut: true; + isSigner: false; }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "eventAuthority"; + isMut: false; + isSigner: false; }, { - "name": "program", - "isMut": false, - "isSigner": false + name: "program"; + isMut: false; + isSigner: false; } - ], - "args": [ + ]; + args: [ { - "name": "rewardIndex", - "type": "u64" + name: "rewardIndex"; + type: "u64"; }, { - "name": "newDuration", - "type": "u64" + name: "newDuration"; + type: "u64"; } - ] + ]; }, { - "name": "claimReward", - "accounts": [ + name: "claimReward"; + accounts: [ { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "lbPair"; + isMut: true; + isSigner: false; }, { - "name": "position", - "isMut": true, - "isSigner": false + name: "position"; + isMut: true; + isSigner: false; }, { - "name": "binArrayLower", - "isMut": true, - "isSigner": false + name: "binArrayLower"; + isMut: true; + isSigner: false; }, { - "name": "binArrayUpper", - "isMut": true, - "isSigner": false + name: "binArrayUpper"; + isMut: true; + isSigner: false; }, { - "name": "sender", - "isMut": false, - "isSigner": true + name: "sender"; + isMut: false; + isSigner: true; }, { - "name": "rewardVault", - "isMut": true, - "isSigner": false + name: "rewardVault"; + isMut: true; + isSigner: false; }, { - "name": "rewardMint", - "isMut": false, - "isSigner": false + name: "rewardMint"; + isMut: false; + isSigner: false; }, { - "name": "userTokenAccount", - "isMut": true, - "isSigner": false + name: "userTokenAccount"; + isMut: true; + isSigner: false; }, { - "name": "tokenProgram", - "isMut": false, - "isSigner": false + name: "tokenProgram"; + isMut: false; + isSigner: false; }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "eventAuthority"; + isMut: false; + isSigner: false; }, { - "name": "program", - "isMut": false, - "isSigner": false + name: "program"; + isMut: false; + isSigner: false; } - ], - "args": [ + ]; + args: [ { - "name": "rewardIndex", - "type": "u64" + name: "rewardIndex"; + type: "u64"; } - ] + ]; }, { - "name": "claimFee", - "accounts": [ + name: "claimFee"; + accounts: [ { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "lbPair"; + isMut: true; + isSigner: false; }, { - "name": "position", - "isMut": true, - "isSigner": false + name: "position"; + isMut: true; + isSigner: false; }, { - "name": "binArrayLower", - "isMut": true, - "isSigner": false + name: "binArrayLower"; + isMut: true; + isSigner: false; }, { - "name": "binArrayUpper", - "isMut": true, - "isSigner": false + name: "binArrayUpper"; + isMut: true; + isSigner: false; }, { - "name": "sender", - "isMut": false, - "isSigner": true + name: "sender"; + isMut: false; + isSigner: true; }, { - "name": "reserveX", - "isMut": true, - "isSigner": false + name: "reserveX"; + isMut: true; + isSigner: false; }, { - "name": "reserveY", - "isMut": true, - "isSigner": false + name: "reserveY"; + isMut: true; + isSigner: false; }, { - "name": "userTokenX", - "isMut": true, - "isSigner": false + name: "userTokenX"; + isMut: true; + isSigner: false; }, { - "name": "userTokenY", - "isMut": true, - "isSigner": false + name: "userTokenY"; + isMut: true; + isSigner: false; }, { - "name": "tokenXMint", - "isMut": false, - "isSigner": false + name: "tokenXMint"; + isMut: false; + isSigner: false; }, { - "name": "tokenYMint", - "isMut": false, - "isSigner": false + name: "tokenYMint"; + isMut: false; + isSigner: false; }, { - "name": "tokenProgram", - "isMut": false, - "isSigner": false + name: "tokenProgram"; + isMut: false; + isSigner: false; }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "eventAuthority"; + isMut: false; + isSigner: false; }, { - "name": "program", - "isMut": false, - "isSigner": false + name: "program"; + isMut: false; + isSigner: false; } - ], - "args": [] + ]; + args: []; }, { - "name": "closePosition", - "accounts": [ + name: "closePosition"; + accounts: [ { - "name": "position", - "isMut": true, - "isSigner": false + name: "position"; + isMut: true; + isSigner: false; }, { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "lbPair"; + isMut: true; + isSigner: false; }, { - "name": "binArrayLower", - "isMut": true, - "isSigner": false + name: "binArrayLower"; + isMut: true; + isSigner: false; }, { - "name": "binArrayUpper", - "isMut": true, - "isSigner": false + name: "binArrayUpper"; + isMut: true; + isSigner: false; }, { - "name": "sender", - "isMut": false, - "isSigner": true + name: "sender"; + isMut: false; + isSigner: true; }, { - "name": "rentReceiver", - "isMut": true, - "isSigner": false + name: "rentReceiver"; + isMut: true; + isSigner: false; }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "eventAuthority"; + isMut: false; + isSigner: false; }, { - "name": "program", - "isMut": false, - "isSigner": false + name: "program"; + isMut: false; + isSigner: false; } - ], - "args": [] + ]; + args: []; }, { - "name": "updateFeeParameters", - "accounts": [ + name: "updateFeeParameters"; + accounts: [ { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "lbPair"; + isMut: true; + isSigner: false; }, { - "name": "admin", - "isMut": false, - "isSigner": true + name: "admin"; + isMut: false; + isSigner: true; }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "eventAuthority"; + isMut: false; + isSigner: false; }, { - "name": "program", - "isMut": false, - "isSigner": false + name: "program"; + isMut: false; + isSigner: false; } - ], - "args": [ + ]; + args: [ { - "name": "feeParameter", - "type": { - "defined": "FeeParameter" - } + name: "feeParameter"; + type: { + defined: "FeeParameter"; + }; } - ] + ]; }, { - "name": "increaseOracleLength", - "accounts": [ + name: "increaseOracleLength"; + accounts: [ { - "name": "oracle", - "isMut": true, - "isSigner": false + name: "oracle"; + isMut: true; + isSigner: false; }, { - "name": "funder", - "isMut": true, - "isSigner": true + name: "funder"; + isMut: true; + isSigner: true; }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false + name: "systemProgram"; + isMut: false; + isSigner: false; }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "eventAuthority"; + isMut: false; + isSigner: false; }, { - "name": "program", - "isMut": false, - "isSigner": false + name: "program"; + isMut: false; + isSigner: false; } - ], - "args": [ + ]; + args: [ { - "name": "lengthToAdd", - "type": "u64" + name: "lengthToAdd"; + type: "u64"; } - ] + ]; }, { - "name": "initializePresetParameter", - "accounts": [ + name: "initializePresetParameter"; + accounts: [ { - "name": "presetParameter", - "isMut": true, - "isSigner": false + name: "presetParameter"; + isMut: true; + isSigner: false; }, { - "name": "admin", - "isMut": true, - "isSigner": true + name: "admin"; + isMut: true; + isSigner: true; }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false + name: "systemProgram"; + isMut: false; + isSigner: false; }, { - "name": "rent", - "isMut": false, - "isSigner": false + name: "rent"; + isMut: false; + isSigner: false; } - ], - "args": [ + ]; + args: [ { - "name": "ix", - "type": { - "defined": "InitPresetParametersIx" - } + name: "ix"; + type: { + defined: "InitPresetParametersIx"; + }; } - ] + ]; }, { - "name": "closePresetParameter", - "accounts": [ + name: "closePresetParameter"; + accounts: [ { - "name": "presetParameter", - "isMut": true, - "isSigner": false + name: "presetParameter"; + isMut: true; + isSigner: false; }, { - "name": "admin", - "isMut": true, - "isSigner": true + name: "admin"; + isMut: true; + isSigner: true; }, { - "name": "rentReceiver", - "isMut": true, - "isSigner": false + name: "rentReceiver"; + isMut: true; + isSigner: false; } - ], - "args": [] + ]; + args: []; }, { - "name": "removeAllLiquidity", - "accounts": [ + name: "removeAllLiquidity"; + accounts: [ { - "name": "position", - "isMut": true, - "isSigner": false + name: "position"; + isMut: true; + isSigner: false; }, { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "lbPair"; + isMut: true; + isSigner: false; }, { - "name": "binArrayBitmapExtension", - "isMut": true, - "isSigner": false, - "isOptional": true + name: "binArrayBitmapExtension"; + isMut: true; + isSigner: false; + isOptional: true; }, { - "name": "userTokenX", - "isMut": true, - "isSigner": false + name: "userTokenX"; + isMut: true; + isSigner: false; }, { - "name": "userTokenY", - "isMut": true, - "isSigner": false + name: "userTokenY"; + isMut: true; + isSigner: false; }, { - "name": "reserveX", - "isMut": true, - "isSigner": false + name: "reserveX"; + isMut: true; + isSigner: false; }, { - "name": "reserveY", - "isMut": true, - "isSigner": false + name: "reserveY"; + isMut: true; + isSigner: false; }, { - "name": "tokenXMint", - "isMut": false, - "isSigner": false + name: "tokenXMint"; + isMut: false; + isSigner: false; }, { - "name": "tokenYMint", - "isMut": false, - "isSigner": false + name: "tokenYMint"; + isMut: false; + isSigner: false; }, { - "name": "binArrayLower", - "isMut": true, - "isSigner": false + name: "binArrayLower"; + isMut: true; + isSigner: false; }, { - "name": "binArrayUpper", - "isMut": true, - "isSigner": false + name: "binArrayUpper"; + isMut: true; + isSigner: false; }, { - "name": "sender", - "isMut": false, - "isSigner": true + name: "sender"; + isMut: false; + isSigner: true; }, { - "name": "tokenXProgram", - "isMut": false, - "isSigner": false + name: "tokenXProgram"; + isMut: false; + isSigner: false; }, { - "name": "tokenYProgram", - "isMut": false, - "isSigner": false + name: "tokenYProgram"; + isMut: false; + isSigner: false; }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "eventAuthority"; + isMut: false; + isSigner: false; }, { - "name": "program", - "isMut": false, - "isSigner": false + name: "program"; + isMut: false; + isSigner: false; } - ], - "args": [] + ]; + args: []; }, { - "name": "removeLiquiditySingleSide", - "accounts": [ + name: "togglePairStatus"; + accounts: [ { - "name": "position", - "isMut": true, - "isSigner": false + name: "lbPair"; + isMut: true; + isSigner: false; }, { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "admin"; + isMut: false; + isSigner: true; + } + ]; + args: []; + }, + { + name: "updateWhitelistedWallet"; + accounts: [ + { + name: "lbPair"; + isMut: true; + isSigner: false; }, { - "name": "binArrayBitmapExtension", - "isMut": true, - "isSigner": false, - "isOptional": true + name: "creator"; + isMut: false; + isSigner: true; + } + ]; + args: [ + { + name: "wallet"; + type: "publicKey"; + } + ]; + }, + { + name: "migratePosition"; + accounts: [ + { + name: "positionV2"; + isMut: true; + isSigner: true; }, { - "name": "userToken", - "isMut": true, - "isSigner": false + name: "positionV1"; + isMut: true; + isSigner: false; }, { - "name": "reserve", - "isMut": true, - "isSigner": false + name: "lbPair"; + isMut: false; + isSigner: false; }, { - "name": "tokenMint", - "isMut": false, - "isSigner": false + name: "binArrayLower"; + isMut: true; + isSigner: false; }, { - "name": "binArrayLower", - "isMut": true, - "isSigner": false + name: "binArrayUpper"; + isMut: true; + isSigner: false; }, { - "name": "binArrayUpper", - "isMut": true, - "isSigner": false + name: "owner"; + isMut: true; + isSigner: true; }, { - "name": "sender", - "isMut": false, - "isSigner": true + name: "systemProgram"; + isMut: false; + isSigner: false; }, { - "name": "tokenProgram", - "isMut": false, - "isSigner": false + name: "rentReceiver"; + isMut: true; + isSigner: false; }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "eventAuthority"; + isMut: false; + isSigner: false; }, { - "name": "program", - "isMut": false, - "isSigner": false + name: "program"; + isMut: false; + isSigner: false; } - ], - "args": [] + ]; + args: []; }, { - "name": "togglePairStatus", - "accounts": [ - { - "name": "lbPair", - "isMut": true, - "isSigner": false - }, + name: "migrateBinArray"; + accounts: [ { - "name": "admin", - "isMut": false, - "isSigner": true + name: "lbPair"; + isMut: false; + isSigner: false; } - ], - "args": [] + ]; + args: []; }, { - "name": "updateWhitelistedWallet", - "accounts": [ + name: "updateFeesAndRewards"; + accounts: [ { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "position"; + isMut: true; + isSigner: false; }, { - "name": "creator", - "isMut": false, - "isSigner": true - } - ], - "args": [ + name: "lbPair"; + isMut: true; + isSigner: false; + }, + { + name: "binArrayLower"; + isMut: true; + isSigner: false; + }, + { + name: "binArrayUpper"; + isMut: true; + isSigner: false; + }, { - "name": "wallet", - "type": "publicKey" + name: "owner"; + isMut: false; + isSigner: true; } - ] + ]; + args: []; }, { - "name": "migratePosition", - "accounts": [ + name: "withdrawIneligibleReward"; + accounts: [ { - "name": "positionV2", - "isMut": true, - "isSigner": true + name: "lbPair"; + isMut: true; + isSigner: false; }, { - "name": "positionV1", - "isMut": true, - "isSigner": false + name: "rewardVault"; + isMut: true; + isSigner: false; }, { - "name": "lbPair", - "isMut": false, - "isSigner": false + name: "rewardMint"; + isMut: false; + isSigner: false; }, { - "name": "binArrayLower", - "isMut": true, - "isSigner": false + name: "funderTokenAccount"; + isMut: true; + isSigner: false; }, { - "name": "binArrayUpper", - "isMut": true, - "isSigner": false + name: "funder"; + isMut: false; + isSigner: true; }, { - "name": "owner", - "isMut": true, - "isSigner": true + name: "binArray"; + isMut: true; + isSigner: false; }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false + name: "tokenProgram"; + isMut: false; + isSigner: false; }, { - "name": "rentReceiver", - "isMut": true, - "isSigner": false + name: "memoProgram"; + isMut: false; + isSigner: false; }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "eventAuthority"; + isMut: false; + isSigner: false; }, { - "name": "program", - "isMut": false, - "isSigner": false + name: "program"; + isMut: false; + isSigner: false; } - ], - "args": [] + ]; + args: [ + { + name: "rewardIndex"; + type: "u64"; + }, + { + name: "remainingAccountsInfo"; + type: { + defined: "RemainingAccountsInfo"; + }; + } + ]; }, { - "name": "migrateBinArray", - "accounts": [ + name: "setActivationPoint"; + accounts: [ + { + name: "lbPair"; + isMut: true; + isSigner: false; + }, { - "name": "lbPair", - "isMut": false, - "isSigner": false + name: "admin"; + isMut: true; + isSigner: true; } - ], - "args": [] + ]; + args: [ + { + name: "activationPoint"; + type: "u64"; + } + ]; }, { - "name": "updateFeesAndRewards", - "accounts": [ + name: "setLockReleasePoint"; + accounts: [ { - "name": "position", - "isMut": true, - "isSigner": false + name: "position"; + isMut: true; + isSigner: false; }, { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "lbPair"; + isMut: false; + isSigner: false; }, { - "name": "binArrayLower", - "isMut": true, - "isSigner": false + name: "sender"; + isMut: false; + isSigner: true; }, { - "name": "binArrayUpper", - "isMut": true, - "isSigner": false + name: "eventAuthority"; + isMut: false; + isSigner: false; }, { - "name": "owner", - "isMut": false, - "isSigner": true + name: "program"; + isMut: false; + isSigner: false; } - ], - "args": [] + ]; + args: [ + { + name: "newLockReleasePoint"; + type: "u64"; + } + ]; }, { - "name": "withdrawIneligibleReward", - "accounts": [ + name: "removeLiquidityByRange"; + accounts: [ + { + name: "position"; + isMut: true; + isSigner: false; + }, { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "lbPair"; + isMut: true; + isSigner: false; }, { - "name": "rewardVault", - "isMut": true, - "isSigner": false + name: "binArrayBitmapExtension"; + isMut: true; + isSigner: false; + isOptional: true; }, { - "name": "rewardMint", - "isMut": false, - "isSigner": false + name: "userTokenX"; + isMut: true; + isSigner: false; }, { - "name": "funderTokenAccount", - "isMut": true, - "isSigner": false + name: "userTokenY"; + isMut: true; + isSigner: false; }, { - "name": "funder", - "isMut": false, - "isSigner": true + name: "reserveX"; + isMut: true; + isSigner: false; }, { - "name": "binArray", - "isMut": true, - "isSigner": false + name: "reserveY"; + isMut: true; + isSigner: false; }, { - "name": "tokenProgram", - "isMut": false, - "isSigner": false + name: "tokenXMint"; + isMut: false; + isSigner: false; }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "tokenYMint"; + isMut: false; + isSigner: false; }, { - "name": "program", - "isMut": false, - "isSigner": false + name: "binArrayLower"; + isMut: true; + isSigner: false; + }, + { + name: "binArrayUpper"; + isMut: true; + isSigner: false; + }, + { + name: "sender"; + isMut: false; + isSigner: true; + }, + { + name: "tokenXProgram"; + isMut: false; + isSigner: false; + }, + { + name: "tokenYProgram"; + isMut: false; + isSigner: false; + }, + { + name: "eventAuthority"; + isMut: false; + isSigner: false; + }, + { + name: "program"; + isMut: false; + isSigner: false; } - ], - "args": [ + ]; + args: [ + { + name: "fromBinId"; + type: "i32"; + }, + { + name: "toBinId"; + type: "i32"; + }, { - "name": "rewardIndex", - "type": "u64" + name: "bpsToRemove"; + type: "u16"; } - ] + ]; }, { - "name": "setActivationPoint", - "accounts": [ + name: "addLiquidityOneSidePrecise"; + accounts: [ + { + name: "position"; + isMut: true; + isSigner: false; + }, + { + name: "lbPair"; + isMut: true; + isSigner: false; + }, + { + name: "binArrayBitmapExtension"; + isMut: true; + isSigner: false; + isOptional: true; + }, + { + name: "userToken"; + isMut: true; + isSigner: false; + }, + { + name: "reserve"; + isMut: true; + isSigner: false; + }, + { + name: "tokenMint"; + isMut: false; + isSigner: false; + }, + { + name: "binArrayLower"; + isMut: true; + isSigner: false; + }, + { + name: "binArrayUpper"; + isMut: true; + isSigner: false; + }, + { + name: "sender"; + isMut: false; + isSigner: true; + }, + { + name: "tokenProgram"; + isMut: false; + isSigner: false; + }, { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "eventAuthority"; + isMut: false; + isSigner: false; }, { - "name": "admin", - "isMut": true, - "isSigner": true + name: "program"; + isMut: false; + isSigner: false; } - ], - "args": [ + ]; + args: [ { - "name": "activationPoint", - "type": "u64" + name: "parameter"; + type: { + defined: "AddLiquiditySingleSidePreciseParameter"; + }; } - ] + ]; }, { - "name": "setLockReleasePoint", - "accounts": [ + name: "goToABin"; + accounts: [ + { + name: "lbPair"; + isMut: true; + isSigner: false; + }, { - "name": "position", - "isMut": true, - "isSigner": false + name: "binArrayBitmapExtension"; + isMut: false; + isSigner: false; + isOptional: true; }, { - "name": "lbPair", - "isMut": false, - "isSigner": false + name: "fromBinArray"; + isMut: false; + isSigner: false; + isOptional: true; }, { - "name": "sender", - "isMut": false, - "isSigner": true + name: "toBinArray"; + isMut: false; + isSigner: false; + isOptional: true; }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "eventAuthority"; + isMut: false; + isSigner: false; }, { - "name": "program", - "isMut": false, - "isSigner": false + name: "program"; + isMut: false; + isSigner: false; } - ], - "args": [ + ]; + args: [ + { + name: "binId"; + type: "i32"; + } + ]; + }, + { + name: "setPreActivationDuration"; + accounts: [ + { + name: "lbPair"; + isMut: true; + isSigner: false; + }, + { + name: "creator"; + isMut: false; + isSigner: true; + } + ]; + args: [ + { + name: "preActivationDuration"; + type: "u64"; + } + ]; + }, + { + name: "setPreActivationSwapAddress"; + accounts: [ + { + name: "lbPair"; + isMut: true; + isSigner: false; + }, + { + name: "creator"; + isMut: false; + isSigner: true; + } + ]; + args: [ { - "name": "newLockReleasePoint", - "type": "u64" + name: "preActivationSwapAddress"; + type: "publicKey"; } - ] + ]; }, { - "name": "removeLiquidityByRange", - "accounts": [ + name: "initializeTokenBadge"; + accounts: [ { - "name": "position", - "isMut": true, - "isSigner": false + name: "tokenMint"; + isMut: false; + isSigner: false; }, { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "tokenBadge"; + isMut: true; + isSigner: false; }, { - "name": "binArrayBitmapExtension", - "isMut": true, - "isSigner": false, - "isOptional": true + name: "admin"; + isMut: true; + isSigner: true; }, { - "name": "userTokenX", - "isMut": true, - "isSigner": false + name: "systemProgram"; + isMut: false; + isSigner: false; + } + ]; + args: []; + }, + { + name: "initializeLbPair2"; + accounts: [ + { + name: "lbPair"; + isMut: true; + isSigner: false; }, { - "name": "userTokenY", - "isMut": true, - "isSigner": false + name: "binArrayBitmapExtension"; + isMut: true; + isSigner: false; + isOptional: true; }, { - "name": "reserveX", - "isMut": true, - "isSigner": false + name: "tokenMintX"; + isMut: false; + isSigner: false; }, { - "name": "reserveY", - "isMut": true, - "isSigner": false + name: "tokenMintY"; + isMut: false; + isSigner: false; }, { - "name": "tokenXMint", - "isMut": false, - "isSigner": false + name: "reserveX"; + isMut: true; + isSigner: false; }, { - "name": "tokenYMint", - "isMut": false, - "isSigner": false + name: "reserveY"; + isMut: true; + isSigner: false; }, { - "name": "binArrayLower", - "isMut": true, - "isSigner": false + name: "oracle"; + isMut: true; + isSigner: false; }, { - "name": "binArrayUpper", - "isMut": true, - "isSigner": false + name: "presetParameter"; + isMut: false; + isSigner: false; }, { - "name": "sender", - "isMut": false, - "isSigner": true + name: "funder"; + isMut: true; + isSigner: true; }, { - "name": "tokenXProgram", - "isMut": false, - "isSigner": false + name: "tokenBadgeX"; + isMut: false; + isSigner: false; + isOptional: true; }, { - "name": "tokenYProgram", - "isMut": false, - "isSigner": false + name: "tokenBadgeY"; + isMut: false; + isSigner: false; + isOptional: true; }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "tokenProgramX"; + isMut: false; + isSigner: false; }, { - "name": "program", - "isMut": false, - "isSigner": false - } - ], - "args": [ + name: "tokenProgramY"; + isMut: false; + isSigner: false; + }, { - "name": "fromBinId", - "type": "i32" + name: "systemProgram"; + isMut: false; + isSigner: false; }, { - "name": "toBinId", - "type": "i32" + name: "rent"; + isMut: false; + isSigner: false; }, { - "name": "bpsToRemove", - "type": "u16" + name: "eventAuthority"; + isMut: false; + isSigner: false; + }, + { + name: "program"; + isMut: false; + isSigner: false; + } + ]; + args: [ + { + name: "activeId"; + type: "i32"; + }, + { + name: "binStep"; + type: "u16"; } - ] + ]; }, { - "name": "addLiquidityOneSidePrecise", - "accounts": [ + name: "claimFee2"; + accounts: [ + { + name: "lbPair"; + isMut: true; + isSigner: false; + }, { - "name": "position", - "isMut": true, - "isSigner": false + name: "position"; + isMut: true; + isSigner: false; }, { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "sender"; + isMut: false; + isSigner: true; }, { - "name": "binArrayBitmapExtension", - "isMut": true, - "isSigner": false, - "isOptional": true + name: "reserveX"; + isMut: true; + isSigner: false; }, { - "name": "userToken", - "isMut": true, - "isSigner": false + name: "reserveY"; + isMut: true; + isSigner: false; }, { - "name": "reserve", - "isMut": true, - "isSigner": false + name: "userTokenX"; + isMut: true; + isSigner: false; }, { - "name": "tokenMint", - "isMut": false, - "isSigner": false + name: "userTokenY"; + isMut: true; + isSigner: false; }, { - "name": "binArrayLower", - "isMut": true, - "isSigner": false + name: "tokenXMint"; + isMut: false; + isSigner: false; }, { - "name": "binArrayUpper", - "isMut": true, - "isSigner": false + name: "tokenYMint"; + isMut: false; + isSigner: false; }, { - "name": "sender", - "isMut": false, - "isSigner": true + name: "tokenProgramX"; + isMut: false; + isSigner: false; }, { - "name": "tokenProgram", - "isMut": false, - "isSigner": false + name: "tokenProgramY"; + isMut: false; + isSigner: false; }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "memoProgram"; + isMut: false; + isSigner: false; }, { - "name": "program", - "isMut": false, - "isSigner": false + name: "eventAuthority"; + isMut: false; + isSigner: false; + }, + { + name: "program"; + isMut: false; + isSigner: false; } - ], - "args": [ + ]; + args: [ { - "name": "parameter", - "type": { - "defined": "AddLiquiditySingleSidePreciseParameter" - } + name: "minBinId"; + type: "i32"; + }, + { + name: "maxBinId"; + type: "i32"; + }, + { + name: "remainingAccountsInfo"; + type: { + defined: "RemainingAccountsInfo"; + }; } - ] + ]; }, { - "name": "goToABin", - "accounts": [ + name: "claimReward2"; + accounts: [ { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "lbPair"; + isMut: true; + isSigner: false; }, { - "name": "binArrayBitmapExtension", - "isMut": false, - "isSigner": false, - "isOptional": true + name: "position"; + isMut: true; + isSigner: false; }, { - "name": "fromBinArray", - "isMut": false, - "isSigner": false, - "isOptional": true + name: "sender"; + isMut: false; + isSigner: true; }, { - "name": "toBinArray", - "isMut": false, - "isSigner": false, - "isOptional": true + name: "rewardVault"; + isMut: true; + isSigner: false; }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "rewardMint"; + isMut: false; + isSigner: false; }, { - "name": "program", - "isMut": false, - "isSigner": false + name: "userTokenAccount"; + isMut: true; + isSigner: false; + }, + { + name: "tokenProgram"; + isMut: false; + isSigner: false; + }, + { + name: "memoProgram"; + isMut: false; + isSigner: false; + }, + { + name: "eventAuthority"; + isMut: false; + isSigner: false; + }, + { + name: "program"; + isMut: false; + isSigner: false; } - ], - "args": [ + ]; + args: [ + { + name: "rewardIndex"; + type: "u64"; + }, + { + name: "minBinId"; + type: "i32"; + }, + { + name: "maxBinId"; + type: "i32"; + }, { - "name": "binId", - "type": "i32" + name: "remainingAccountsInfo"; + type: { + defined: "RemainingAccountsInfo"; + }; } - ] + ]; }, { - "name": "setPreActivationDuration", - "accounts": [ + name: "addLiquidity2"; + accounts: [ + { + name: "position"; + isMut: true; + isSigner: false; + }, + { + name: "lbPair"; + isMut: true; + isSigner: false; + }, + { + name: "binArrayBitmapExtension"; + isMut: true; + isSigner: false; + isOptional: true; + }, + { + name: "userTokenX"; + isMut: true; + isSigner: false; + }, + { + name: "userTokenY"; + isMut: true; + isSigner: false; + }, + { + name: "reserveX"; + isMut: true; + isSigner: false; + }, + { + name: "reserveY"; + isMut: true; + isSigner: false; + }, + { + name: "tokenXMint"; + isMut: false; + isSigner: false; + }, + { + name: "tokenYMint"; + isMut: false; + isSigner: false; + }, + { + name: "sender"; + isMut: false; + isSigner: true; + }, + { + name: "tokenXProgram"; + isMut: false; + isSigner: false; + }, + { + name: "tokenYProgram"; + isMut: false; + isSigner: false; + }, + { + name: "memoProgram"; + isMut: false; + isSigner: false; + }, { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "eventAuthority"; + isMut: false; + isSigner: false; }, { - "name": "creator", - "isMut": false, - "isSigner": true + name: "program"; + isMut: false; + isSigner: false; } - ], - "args": [ + ]; + args: [ + { + name: "liquidityParameter"; + type: { + defined: "LiquidityParameter"; + }; + }, { - "name": "preActivationDuration", - "type": "u16" + name: "remainingAccountsInfo"; + type: { + defined: "RemainingAccountsInfo"; + }; } - ] + ]; }, { - "name": "setPreActivationSwapAddress", - "accounts": [ + name: "addLiquidityByStrategy2"; + accounts: [ + { + name: "position"; + isMut: true; + isSigner: false; + }, + { + name: "lbPair"; + isMut: true; + isSigner: false; + }, { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "binArrayBitmapExtension"; + isMut: true; + isSigner: false; + isOptional: true; }, { - "name": "creator", - "isMut": false, - "isSigner": true + name: "userTokenX"; + isMut: true; + isSigner: false; + }, + { + name: "userTokenY"; + isMut: true; + isSigner: false; + }, + { + name: "reserveX"; + isMut: true; + isSigner: false; + }, + { + name: "reserveY"; + isMut: true; + isSigner: false; + }, + { + name: "tokenXMint"; + isMut: false; + isSigner: false; + }, + { + name: "tokenYMint"; + isMut: false; + isSigner: false; + }, + { + name: "sender"; + isMut: false; + isSigner: true; + }, + { + name: "tokenXProgram"; + isMut: false; + isSigner: false; + }, + { + name: "tokenYProgram"; + isMut: false; + isSigner: false; + }, + { + name: "memoProgram"; + isMut: false; + isSigner: false; + }, + { + name: "eventAuthority"; + isMut: false; + isSigner: false; + }, + { + name: "program"; + isMut: false; + isSigner: false; } - ], - "args": [ + ]; + args: [ + { + name: "liquidityParameter"; + type: { + defined: "LiquidityParameterByStrategy"; + }; + }, { - "name": "preActivationSwapAddress", - "type": "publicKey" + name: "remainingAccountsInfo"; + type: { + defined: "RemainingAccountsInfo"; + }; } - ] - } - ], - "accounts": [ + ]; + }, { - "name": "binArrayBitmapExtension", - "type": { - "kind": "struct", - "fields": [ - { - "name": "lbPair", - "type": "publicKey" - }, - { - "name": "positiveBinArrayBitmap", - "docs": [ - "Packed initialized bin array state for start_bin_index is positive" - ], - "type": { - "array": [ + name: "removeLiquidity2"; + accounts: [ + { + name: "position"; + isMut: true; + isSigner: false; + }, + { + name: "lbPair"; + isMut: true; + isSigner: false; + }, + { + name: "binArrayBitmapExtension"; + isMut: true; + isSigner: false; + isOptional: true; + }, + { + name: "userTokenX"; + isMut: true; + isSigner: false; + }, + { + name: "userTokenY"; + isMut: true; + isSigner: false; + }, + { + name: "reserveX"; + isMut: true; + isSigner: false; + }, + { + name: "reserveY"; + isMut: true; + isSigner: false; + }, + { + name: "tokenXMint"; + isMut: false; + isSigner: false; + }, + { + name: "tokenYMint"; + isMut: false; + isSigner: false; + }, + { + name: "sender"; + isMut: false; + isSigner: true; + }, + { + name: "tokenXProgram"; + isMut: false; + isSigner: false; + }, + { + name: "tokenYProgram"; + isMut: false; + isSigner: false; + }, + { + name: "memoProgram"; + isMut: false; + isSigner: false; + }, + { + name: "eventAuthority"; + isMut: false; + isSigner: false; + }, + { + name: "program"; + isMut: false; + isSigner: false; + } + ]; + args: [ + { + name: "binLiquidityRemoval"; + type: { + vec: { + defined: "BinLiquidityReduction"; + }; + }; + }, + { + name: "remainingAccountsInfo"; + type: { + defined: "RemainingAccountsInfo"; + }; + } + ]; + }, + { + name: "removeLiquidityByRange2"; + accounts: [ + { + name: "position"; + isMut: true; + isSigner: false; + }, + { + name: "lbPair"; + isMut: true; + isSigner: false; + }, + { + name: "binArrayBitmapExtension"; + isMut: true; + isSigner: false; + isOptional: true; + }, + { + name: "userTokenX"; + isMut: true; + isSigner: false; + }, + { + name: "userTokenY"; + isMut: true; + isSigner: false; + }, + { + name: "reserveX"; + isMut: true; + isSigner: false; + }, + { + name: "reserveY"; + isMut: true; + isSigner: false; + }, + { + name: "tokenXMint"; + isMut: false; + isSigner: false; + }, + { + name: "tokenYMint"; + isMut: false; + isSigner: false; + }, + { + name: "sender"; + isMut: false; + isSigner: true; + }, + { + name: "tokenXProgram"; + isMut: false; + isSigner: false; + }, + { + name: "tokenYProgram"; + isMut: false; + isSigner: false; + }, + { + name: "memoProgram"; + isMut: false; + isSigner: false; + }, + { + name: "eventAuthority"; + isMut: false; + isSigner: false; + }, + { + name: "program"; + isMut: false; + isSigner: false; + } + ]; + args: [ + { + name: "fromBinId"; + type: "i32"; + }, + { + name: "toBinId"; + type: "i32"; + }, + { + name: "bpsToRemove"; + type: "u16"; + }, + { + name: "remainingAccountsInfo"; + type: { + defined: "RemainingAccountsInfo"; + }; + } + ]; + }, + { + name: "swap2"; + accounts: [ + { + name: "lbPair"; + isMut: true; + isSigner: false; + }, + { + name: "binArrayBitmapExtension"; + isMut: false; + isSigner: false; + isOptional: true; + }, + { + name: "reserveX"; + isMut: true; + isSigner: false; + }, + { + name: "reserveY"; + isMut: true; + isSigner: false; + }, + { + name: "userTokenIn"; + isMut: true; + isSigner: false; + }, + { + name: "userTokenOut"; + isMut: true; + isSigner: false; + }, + { + name: "tokenXMint"; + isMut: false; + isSigner: false; + }, + { + name: "tokenYMint"; + isMut: false; + isSigner: false; + }, + { + name: "oracle"; + isMut: true; + isSigner: false; + }, + { + name: "hostFeeIn"; + isMut: true; + isSigner: false; + isOptional: true; + }, + { + name: "user"; + isMut: false; + isSigner: true; + }, + { + name: "tokenXProgram"; + isMut: false; + isSigner: false; + }, + { + name: "tokenYProgram"; + isMut: false; + isSigner: false; + }, + { + name: "memoProgram"; + isMut: false; + isSigner: false; + }, + { + name: "eventAuthority"; + isMut: false; + isSigner: false; + }, + { + name: "program"; + isMut: false; + isSigner: false; + } + ]; + args: [ + { + name: "amountIn"; + type: "u64"; + }, + { + name: "minAmountOut"; + type: "u64"; + }, + { + name: "remainingAccountsInfo"; + type: { + defined: "RemainingAccountsInfo"; + }; + } + ]; + }, + { + name: "swapWithPriceImpact2"; + accounts: [ + { + name: "lbPair"; + isMut: true; + isSigner: false; + }, + { + name: "binArrayBitmapExtension"; + isMut: false; + isSigner: false; + isOptional: true; + }, + { + name: "reserveX"; + isMut: true; + isSigner: false; + }, + { + name: "reserveY"; + isMut: true; + isSigner: false; + }, + { + name: "userTokenIn"; + isMut: true; + isSigner: false; + }, + { + name: "userTokenOut"; + isMut: true; + isSigner: false; + }, + { + name: "tokenXMint"; + isMut: false; + isSigner: false; + }, + { + name: "tokenYMint"; + isMut: false; + isSigner: false; + }, + { + name: "oracle"; + isMut: true; + isSigner: false; + }, + { + name: "hostFeeIn"; + isMut: true; + isSigner: false; + isOptional: true; + }, + { + name: "user"; + isMut: false; + isSigner: true; + }, + { + name: "tokenXProgram"; + isMut: false; + isSigner: false; + }, + { + name: "tokenYProgram"; + isMut: false; + isSigner: false; + }, + { + name: "memoProgram"; + isMut: false; + isSigner: false; + }, + { + name: "eventAuthority"; + isMut: false; + isSigner: false; + }, + { + name: "program"; + isMut: false; + isSigner: false; + } + ]; + args: [ + { + name: "amountIn"; + type: "u64"; + }, + { + name: "activeId"; + type: { + option: "i32"; + }; + }, + { + name: "maxPriceImpactBps"; + type: "u16"; + }, + { + name: "remainingAccountsInfo"; + type: { + defined: "RemainingAccountsInfo"; + }; + } + ]; + } + ]; + accounts: [ + { + name: "binArrayBitmapExtension"; + type: { + kind: "struct"; + fields: [ + { + name: "lbPair"; + type: "publicKey"; + }, + { + name: "positiveBinArrayBitmap"; + docs: [ + "Packed initialized bin array state for start_bin_index is positive" + ]; + type: { + array: [ { - "array": [ - "u64", - 8 - ] + array: ["u64", 8]; }, 12 - ] - } + ]; + }; }, { - "name": "negativeBinArrayBitmap", - "docs": [ + name: "negativeBinArrayBitmap"; + docs: [ "Packed initialized bin array state for start_bin_index is negative" - ], - "type": { - "array": [ + ]; + type: { + array: [ { - "array": [ - "u64", - 8 - ] + array: ["u64", 8]; }, 12 - ] - } + ]; + }; } - ] - } + ]; + }; }, { - "name": "binArray", - "docs": [ + name: "binArray"; + docs: [ "An account to contain a range of bin. For example: Bin 100 <-> 200.", "For example:", "BinArray index: 0 contains bin 0 <-> 599", "index: 2 contains bin 600 <-> 1199, ..." - ], - "type": { - "kind": "struct", - "fields": [ + ]; + type: { + kind: "struct"; + fields: [ { - "name": "index", - "type": "i64" + name: "index"; + type: "i64"; }, { - "name": "version", - "docs": [ - "Version of binArray" - ], - "type": "u8" + name: "version"; + docs: ["Version of binArray"]; + type: "u8"; }, { - "name": "padding", - "type": { - "array": [ - "u8", - 7 - ] - } + name: "padding"; + type: { + array: ["u8", 7]; + }; }, { - "name": "lbPair", - "type": "publicKey" + name: "lbPair"; + type: "publicKey"; }, { - "name": "bins", - "type": { - "array": [ + name: "bins"; + type: { + array: [ { - "defined": "Bin" + defined: "Bin"; }, 70 - ] - } + ]; + }; } - ] - } + ]; + }; }, { - "name": "lbPair", - "type": { - "kind": "struct", - "fields": [ + name: "lbPair"; + type: { + kind: "struct"; + fields: [ { - "name": "parameters", - "type": { - "defined": "StaticParameters" - } + name: "parameters"; + type: { + defined: "StaticParameters"; + }; }, { - "name": "vParameters", - "type": { - "defined": "VariableParameters" - } + name: "vParameters"; + type: { + defined: "VariableParameters"; + }; }, { - "name": "bumpSeed", - "type": { - "array": [ - "u8", - 1 - ] - } + name: "bumpSeed"; + type: { + array: ["u8", 1]; + }; }, { - "name": "binStepSeed", - "docs": [ - "Bin step signer seed" - ], - "type": { - "array": [ - "u8", - 2 - ] - } + name: "binStepSeed"; + docs: ["Bin step signer seed"]; + type: { + array: ["u8", 2]; + }; }, { - "name": "pairType", - "docs": [ - "Type of the pair" - ], - "type": "u8" + name: "pairType"; + docs: ["Type of the pair"]; + type: "u8"; }, { - "name": "activeId", - "docs": [ - "Active bin id" - ], - "type": "i32" + name: "activeId"; + docs: ["Active bin id"]; + type: "i32"; }, { - "name": "binStep", - "docs": [ - "Bin step. Represent the price increment / decrement." - ], - "type": "u16" + name: "binStep"; + docs: ["Bin step. Represent the price increment / decrement."]; + type: "u16"; }, { - "name": "status", - "docs": [ - "Status of the pair. Check PairStatus enum." - ], - "type": "u8" + name: "status"; + docs: ["Status of the pair. Check PairStatus enum."]; + type: "u8"; }, { - "name": "requireBaseFactorSeed", - "docs": [ - "Require base factor seed" - ], - "type": "u8" + name: "requireBaseFactorSeed"; + docs: ["Require base factor seed"]; + type: "u8"; }, { - "name": "baseFactorSeed", - "docs": [ - "Base factor seed" - ], - "type": { - "array": [ - "u8", - 2 - ] - } + name: "baseFactorSeed"; + docs: ["Base factor seed"]; + type: { + array: ["u8", 2]; + }; }, { - "name": "activationType", - "docs": [ - "Activation type" - ], - "type": "u8" + name: "activationType"; + docs: ["Activation type"]; + type: "u8"; }, { - "name": "padding0", - "docs": [ - "padding 0" - ], - "type": "u8" + name: "padding0"; + docs: ["padding 0"]; + type: "u8"; }, { - "name": "tokenXMint", - "docs": [ - "Token X mint" - ], - "type": "publicKey" + name: "tokenXMint"; + docs: ["Token X mint"]; + type: "publicKey"; }, { - "name": "tokenYMint", - "docs": [ - "Token Y mint" - ], - "type": "publicKey" + name: "tokenYMint"; + docs: ["Token Y mint"]; + type: "publicKey"; }, { - "name": "reserveX", - "docs": [ - "LB token X vault" - ], - "type": "publicKey" + name: "reserveX"; + docs: ["LB token X vault"]; + type: "publicKey"; }, { - "name": "reserveY", - "docs": [ - "LB token Y vault" - ], - "type": "publicKey" + name: "reserveY"; + docs: ["LB token Y vault"]; + type: "publicKey"; }, { - "name": "protocolFee", - "docs": [ - "Uncollected protocol fee" - ], - "type": { - "defined": "ProtocolFee" - } + name: "protocolFee"; + docs: ["Uncollected protocol fee"]; + type: { + defined: "ProtocolFee"; + }; }, { - "name": "padding1", - "docs": [ + name: "padding1"; + docs: [ "_padding_1, previous Fee owner, BE CAREFUL FOR TOMBSTONE WHEN REUSE !!" - ], - "type": { - "array": [ - "u8", - 32 - ] - } + ]; + type: { + array: ["u8", 32]; + }; }, { - "name": "rewardInfos", - "docs": [ - "Farming reward information" - ], - "type": { - "array": [ + name: "rewardInfos"; + docs: ["Farming reward information"]; + type: { + array: [ { - "defined": "RewardInfo" + defined: "RewardInfo"; }, 2 - ] - } + ]; + }; }, { - "name": "oracle", - "docs": [ - "Oracle pubkey" - ], - "type": "publicKey" + name: "oracle"; + docs: ["Oracle pubkey"]; + type: "publicKey"; }, { - "name": "binArrayBitmap", - "docs": [ - "Packed initialized bin array state" - ], - "type": { - "array": [ - "u64", - 16 - ] - } + name: "binArrayBitmap"; + docs: ["Packed initialized bin array state"]; + type: { + array: ["u64", 16]; + }; }, { - "name": "lastUpdatedAt", - "docs": [ - "Last time the pool fee parameter was updated" - ], - "type": "i64" + name: "lastUpdatedAt"; + docs: ["Last time the pool fee parameter was updated"]; + type: "i64"; }, { - "name": "whitelistedWallet", - "docs": [ - "Whitelisted wallet" - ], - "type": "publicKey" + name: "whitelistedWallet"; + docs: ["Whitelisted wallet"]; + type: "publicKey"; }, { - "name": "preActivationSwapAddress", - "docs": [ + name: "preActivationSwapAddress"; + docs: [ "Address allowed to swap when the current point is greater than or equal to the pre-activation point. The pre-activation point is calculated as `activation_point - pre_activation_duration`." - ], - "type": "publicKey" + ]; + type: "publicKey"; }, { - "name": "baseKey", - "docs": [ - "Base keypair. Only required for permission pair" - ], - "type": "publicKey" + name: "baseKey"; + docs: ["Base keypair. Only required for permission pair"]; + type: "publicKey"; }, { - "name": "activationPoint", - "docs": [ + name: "activationPoint"; + docs: [ "Time point to enable the pair. Only applicable for permission pair." - ], - "type": "u64" + ]; + type: "u64"; }, { - "name": "preActivationDuration", - "docs": [ + name: "preActivationDuration"; + docs: [ "Duration before activation activation_point. Used to calculate pre-activation time point for pre_activation_swap_address" - ], - "type": "u64" + ]; + type: "u64"; }, { - "name": "padding2", - "docs": [ + name: "padding2"; + docs: [ "_padding 2 is reclaimed free space from swap_cap_deactivate_point and swap_cap_amount before, BE CAREFUL FOR TOMBSTONE WHEN REUSE !!" - ], - "type": { - "array": [ - "u8", - 8 - ] - } + ]; + type: { + array: ["u8", 8]; + }; }, { - "name": "lockDuration", - "docs": [ + name: "lockDuration"; + docs: [ "Liquidity lock duration for positions which created before activate. Only applicable for permission pair." - ], - "type": "u64" + ]; + type: "u64"; }, { - "name": "creator", - "docs": [ - "Pool creator" - ], - "type": "publicKey" + name: "creator"; + docs: ["Pool creator"]; + type: "publicKey"; }, { - "name": "reserved", - "docs": [ - "Reserved space for future use" - ], - "type": { - "array": [ - "u8", - 24 - ] - } + name: "tokenMintXProgramFlag"; + docs: ["token_mint_x_program_flag"]; + type: "u8"; + }, + { + name: "tokenMintYProgramFlag"; + docs: ["token_mint_y_program_flag"]; + type: "u8"; + }, + { + name: "reserved"; + docs: ["Reserved space for future use"]; + type: { + array: ["u8", 22]; + }; } - ] - } + ]; + }; }, { - "name": "oracle", - "type": { - "kind": "struct", - "fields": [ + name: "oracle"; + type: { + kind: "struct"; + fields: [ { - "name": "idx", - "docs": [ - "Index of latest observation" - ], - "type": "u64" + name: "idx"; + docs: ["Index of latest observation"]; + type: "u64"; }, { - "name": "activeSize", - "docs": [ + name: "activeSize"; + docs: [ "Size of active sample. Active sample is initialized observation." - ], - "type": "u64" + ]; + type: "u64"; }, { - "name": "length", - "docs": [ - "Number of observations" - ], - "type": "u64" + name: "length"; + docs: ["Number of observations"]; + type: "u64"; } - ] - } + ]; + }; }, { - "name": "position", - "type": { - "kind": "struct", - "fields": [ + name: "position"; + type: { + kind: "struct"; + fields: [ { - "name": "lbPair", - "docs": [ - "The LB pair of this position" - ], - "type": "publicKey" + name: "lbPair"; + docs: ["The LB pair of this position"]; + type: "publicKey"; }, { - "name": "owner", - "docs": [ + name: "owner"; + docs: [ "Owner of the position. Client rely on this to to fetch their positions." - ], - "type": "publicKey" + ]; + type: "publicKey"; }, { - "name": "liquidityShares", - "docs": [ + name: "liquidityShares"; + docs: [ "Liquidity shares of this position in bins (lower_bin_id <-> upper_bin_id). This is the same as LP concept." - ], - "type": { - "array": [ - "u64", - 70 - ] - } + ]; + type: { + array: ["u64", 70]; + }; }, { - "name": "rewardInfos", - "docs": [ - "Farming reward information" - ], - "type": { - "array": [ + name: "rewardInfos"; + docs: ["Farming reward information"]; + type: { + array: [ { - "defined": "UserRewardInfo" + defined: "UserRewardInfo"; }, 70 - ] - } + ]; + }; }, { - "name": "feeInfos", - "docs": [ - "Swap fee to claim information" - ], - "type": { - "array": [ + name: "feeInfos"; + docs: ["Swap fee to claim information"]; + type: { + array: [ { - "defined": "FeeInfo" + defined: "FeeInfo"; }, 70 - ] - } + ]; + }; }, { - "name": "lowerBinId", - "docs": [ - "Lower bin ID" - ], - "type": "i32" + name: "lowerBinId"; + docs: ["Lower bin ID"]; + type: "i32"; }, { - "name": "upperBinId", - "docs": [ - "Upper bin ID" - ], - "type": "i32" + name: "upperBinId"; + docs: ["Upper bin ID"]; + type: "i32"; }, { - "name": "lastUpdatedAt", - "docs": [ - "Last updated timestamp" - ], - "type": "i64" + name: "lastUpdatedAt"; + docs: ["Last updated timestamp"]; + type: "i64"; }, { - "name": "totalClaimedFeeXAmount", - "docs": [ - "Total claimed token fee X" - ], - "type": "u64" + name: "totalClaimedFeeXAmount"; + docs: ["Total claimed token fee X"]; + type: "u64"; }, { - "name": "totalClaimedFeeYAmount", - "docs": [ - "Total claimed token fee Y" - ], - "type": "u64" + name: "totalClaimedFeeYAmount"; + docs: ["Total claimed token fee Y"]; + type: "u64"; }, { - "name": "totalClaimedRewards", - "docs": [ - "Total claimed rewards" - ], - "type": { - "array": [ - "u64", - 2 - ] - } + name: "totalClaimedRewards"; + docs: ["Total claimed rewards"]; + type: { + array: ["u64", 2]; + }; }, { - "name": "reserved", - "docs": [ - "Reserved space for future use" - ], - "type": { - "array": [ - "u8", - 160 - ] - } + name: "reserved"; + docs: ["Reserved space for future use"]; + type: { + array: ["u8", 160]; + }; } - ] - } + ]; + }; }, { - "name": "positionV2", - "type": { - "kind": "struct", - "fields": [ + name: "positionV2"; + type: { + kind: "struct"; + fields: [ { - "name": "lbPair", - "docs": [ - "The LB pair of this position" - ], - "type": "publicKey" + name: "lbPair"; + docs: ["The LB pair of this position"]; + type: "publicKey"; }, { - "name": "owner", - "docs": [ + name: "owner"; + docs: [ "Owner of the position. Client rely on this to to fetch their positions." - ], - "type": "publicKey" + ]; + type: "publicKey"; }, { - "name": "liquidityShares", - "docs": [ + name: "liquidityShares"; + docs: [ "Liquidity shares of this position in bins (lower_bin_id <-> upper_bin_id). This is the same as LP concept." - ], - "type": { - "array": [ - "u128", - 70 - ] - } + ]; + type: { + array: ["u128", 70]; + }; }, { - "name": "rewardInfos", - "docs": [ - "Farming reward information" - ], - "type": { - "array": [ + name: "rewardInfos"; + docs: ["Farming reward information"]; + type: { + array: [ { - "defined": "UserRewardInfo" + defined: "UserRewardInfo"; }, 70 - ] - } + ]; + }; }, { - "name": "feeInfos", - "docs": [ - "Swap fee to claim information" - ], - "type": { - "array": [ + name: "feeInfos"; + docs: ["Swap fee to claim information"]; + type: { + array: [ { - "defined": "FeeInfo" + defined: "FeeInfo"; }, 70 - ] - } + ]; + }; }, { - "name": "lowerBinId", - "docs": [ - "Lower bin ID" - ], - "type": "i32" + name: "lowerBinId"; + docs: ["Lower bin ID"]; + type: "i32"; }, { - "name": "upperBinId", - "docs": [ - "Upper bin ID" - ], - "type": "i32" + name: "upperBinId"; + docs: ["Upper bin ID"]; + type: "i32"; }, { - "name": "lastUpdatedAt", - "docs": [ - "Last updated timestamp" - ], - "type": "i64" + name: "lastUpdatedAt"; + docs: ["Last updated timestamp"]; + type: "i64"; }, { - "name": "totalClaimedFeeXAmount", - "docs": [ - "Total claimed token fee X" - ], - "type": "u64" + name: "totalClaimedFeeXAmount"; + docs: ["Total claimed token fee X"]; + type: "u64"; }, { - "name": "totalClaimedFeeYAmount", - "docs": [ - "Total claimed token fee Y" - ], - "type": "u64" + name: "totalClaimedFeeYAmount"; + docs: ["Total claimed token fee Y"]; + type: "u64"; }, { - "name": "totalClaimedRewards", - "docs": [ - "Total claimed rewards" - ], - "type": { - "array": [ - "u64", - 2 - ] - } + name: "totalClaimedRewards"; + docs: ["Total claimed rewards"]; + type: { + array: ["u64", 2]; + }; }, { - "name": "operator", - "docs": [ - "Operator of position" - ], - "type": "publicKey" + name: "operator"; + docs: ["Operator of position"]; + type: "publicKey"; }, { - "name": "lockReleasePoint", - "docs": [ - "Time point which the locked liquidity can be withdraw" - ], - "type": "u64" + name: "lockReleasePoint"; + docs: ["Time point which the locked liquidity can be withdraw"]; + type: "u64"; }, { - "name": "subjectedToBootstrapLiquidityLocking", - "docs": [ + name: "subjectedToBootstrapLiquidityLocking"; + docs: [ "Is the position subjected to liquidity locking for the launch pool." - ], - "type": "u8" + ]; + type: "u8"; }, { - "name": "feeOwner", - "docs": [ + name: "feeOwner"; + docs: [ "Address is able to claim fee in this position, only valid for bootstrap_liquidity_position" - ], - "type": "publicKey" + ]; + type: "publicKey"; }, { - "name": "reserved", - "docs": [ - "Reserved space for future use" - ], - "type": { - "array": [ - "u8", - 87 - ] - } + name: "reserved"; + docs: ["Reserved space for future use"]; + type: { + array: ["u8", 87]; + }; } - ] - } + ]; + }; }, { - "name": "presetParameter", - "type": { - "kind": "struct", - "fields": [ + name: "presetParameter"; + type: { + kind: "struct"; + fields: [ { - "name": "binStep", - "docs": [ - "Bin step. Represent the price increment / decrement." - ], - "type": "u16" + name: "binStep"; + docs: ["Bin step. Represent the price increment / decrement."]; + type: "u16"; }, { - "name": "baseFactor", - "docs": [ + name: "baseFactor"; + docs: [ "Used for base fee calculation. base_fee_rate = base_factor * bin_step" - ], - "type": "u16" + ]; + type: "u16"; }, { - "name": "filterPeriod", - "docs": [ + name: "filterPeriod"; + docs: [ "Filter period determine high frequency trading time window." - ], - "type": "u16" + ]; + type: "u16"; }, { - "name": "decayPeriod", - "docs": [ + name: "decayPeriod"; + docs: [ "Decay period determine when the volatile fee start decay / decrease." - ], - "type": "u16" + ]; + type: "u16"; }, { - "name": "reductionFactor", - "docs": [ + name: "reductionFactor"; + docs: [ "Reduction factor controls the volatile fee rate decrement rate." - ], - "type": "u16" + ]; + type: "u16"; }, { - "name": "variableFeeControl", - "docs": [ + name: "variableFeeControl"; + docs: [ "Used to scale the variable fee component depending on the dynamic of the market" - ], - "type": "u32" + ]; + type: "u32"; }, { - "name": "maxVolatilityAccumulator", - "docs": [ + name: "maxVolatilityAccumulator"; + docs: [ "Maximum number of bin crossed can be accumulated. Used to cap volatile fee rate." - ], - "type": "u32" + ]; + type: "u32"; }, { - "name": "minBinId", - "docs": [ + name: "minBinId"; + docs: [ "Min bin id supported by the pool based on the configured bin step." - ], - "type": "i32" + ]; + type: "i32"; }, { - "name": "maxBinId", - "docs": [ + name: "maxBinId"; + docs: [ "Max bin id supported by the pool based on the configured bin step." - ], - "type": "i32" + ]; + type: "i32"; }, { - "name": "protocolShare", - "docs": [ + name: "protocolShare"; + docs: [ "Portion of swap fees retained by the protocol by controlling protocol_share parameter. protocol_swap_fee = protocol_share * total_swap_fee" - ], - "type": "u16" + ]; + type: "u16"; + } + ]; + }; + }, + { + name: "tokenBadge"; + docs: ["Parameter that set by the protocol"]; + type: { + kind: "struct"; + fields: [ + { + name: "tokenMint"; + docs: ["token mint"]; + type: "publicKey"; + }, + { + name: "padding"; + docs: ["Reserve"]; + type: { + array: ["u8", 128]; + }; } - ] - } + ]; + }; } - ], - "types": [ + ]; + types: [ { - "name": "LiquidityParameterByStrategyOneSide", - "type": { - "kind": "struct", - "fields": [ + name: "LiquidityParameterByStrategyOneSide"; + type: { + kind: "struct"; + fields: [ { - "name": "amount", - "docs": [ - "Amount of X token or Y token to deposit" - ], - "type": "u64" + name: "amount"; + docs: ["Amount of X token or Y token to deposit"]; + type: "u64"; }, { - "name": "activeId", - "docs": [ - "Active bin that integrator observe off-chain" - ], - "type": "i32" + name: "activeId"; + docs: ["Active bin that integrator observe off-chain"]; + type: "i32"; }, { - "name": "maxActiveBinSlippage", - "docs": [ - "max active bin slippage allowed" - ], - "type": "i32" + name: "maxActiveBinSlippage"; + docs: ["max active bin slippage allowed"]; + type: "i32"; }, { - "name": "strategyParameters", - "docs": [ - "strategy parameters" - ], - "type": { - "defined": "StrategyParameters" - } + name: "strategyParameters"; + docs: ["strategy parameters"]; + type: { + defined: "StrategyParameters"; + }; } - ] - } + ]; + }; }, { - "name": "LiquidityParameterByStrategy", - "type": { - "kind": "struct", - "fields": [ + name: "LiquidityParameterByStrategy"; + type: { + kind: "struct"; + fields: [ { - "name": "amountX", - "docs": [ - "Amount of X token to deposit" - ], - "type": "u64" + name: "amountX"; + docs: ["Amount of X token to deposit"]; + type: "u64"; }, { - "name": "amountY", - "docs": [ - "Amount of Y token to deposit" - ], - "type": "u64" + name: "amountY"; + docs: ["Amount of Y token to deposit"]; + type: "u64"; }, { - "name": "activeId", - "docs": [ - "Active bin that integrator observe off-chain" - ], - "type": "i32" + name: "activeId"; + docs: ["Active bin that integrator observe off-chain"]; + type: "i32"; }, { - "name": "maxActiveBinSlippage", - "docs": [ - "max active bin slippage allowed" - ], - "type": "i32" + name: "maxActiveBinSlippage"; + docs: ["max active bin slippage allowed"]; + type: "i32"; }, { - "name": "strategyParameters", - "docs": [ - "strategy parameters" - ], - "type": { - "defined": "StrategyParameters" - } + name: "strategyParameters"; + docs: ["strategy parameters"]; + type: { + defined: "StrategyParameters"; + }; } - ] - } + ]; + }; }, { - "name": "StrategyParameters", - "type": { - "kind": "struct", - "fields": [ + name: "StrategyParameters"; + type: { + kind: "struct"; + fields: [ { - "name": "minBinId", - "docs": [ - "min bin id" - ], - "type": "i32" + name: "minBinId"; + docs: ["min bin id"]; + type: "i32"; }, { - "name": "maxBinId", - "docs": [ - "max bin id" - ], - "type": "i32" + name: "maxBinId"; + docs: ["max bin id"]; + type: "i32"; }, { - "name": "strategyType", - "docs": [ - "strategy type" - ], - "type": { - "defined": "StrategyType" - } + name: "strategyType"; + docs: ["strategy type"]; + type: { + defined: "StrategyType"; + }; }, { - "name": "parameteres", - "docs": [ - "parameters" - ], - "type": { - "array": [ - "u8", - 64 - ] - } + name: "parameteres"; + docs: ["parameters"]; + type: { + array: ["u8", 64]; + }; } - ] - } + ]; + }; }, { - "name": "LiquidityOneSideParameter", - "type": { - "kind": "struct", - "fields": [ + name: "LiquidityOneSideParameter"; + type: { + kind: "struct"; + fields: [ { - "name": "amount", - "docs": [ - "Amount of X token or Y token to deposit" - ], - "type": "u64" + name: "amount"; + docs: ["Amount of X token or Y token to deposit"]; + type: "u64"; }, { - "name": "activeId", - "docs": [ - "Active bin that integrator observe off-chain" - ], - "type": "i32" + name: "activeId"; + docs: ["Active bin that integrator observe off-chain"]; + type: "i32"; }, { - "name": "maxActiveBinSlippage", - "docs": [ - "max active bin slippage allowed" - ], - "type": "i32" + name: "maxActiveBinSlippage"; + docs: ["max active bin slippage allowed"]; + type: "i32"; }, { - "name": "binLiquidityDist", - "docs": [ - "Liquidity distribution to each bins" - ], - "type": { - "vec": { - "defined": "BinLiquidityDistributionByWeight" - } - } + name: "binLiquidityDist"; + docs: ["Liquidity distribution to each bins"]; + type: { + vec: { + defined: "BinLiquidityDistributionByWeight"; + }; + }; } - ] - } + ]; + }; }, { - "name": "BinLiquidityDistributionByWeight", - "type": { - "kind": "struct", - "fields": [ + name: "BinLiquidityDistributionByWeight"; + type: { + kind: "struct"; + fields: [ { - "name": "binId", - "docs": [ - "Define the bin ID wish to deposit to." - ], - "type": "i32" + name: "binId"; + docs: ["Define the bin ID wish to deposit to."]; + type: "i32"; }, { - "name": "weight", - "docs": [ - "weight of liquidity distributed for this bin id" - ], - "type": "u16" + name: "weight"; + docs: ["weight of liquidity distributed for this bin id"]; + type: "u16"; } - ] - } + ]; + }; }, { - "name": "LiquidityParameterByWeight", - "type": { - "kind": "struct", - "fields": [ + name: "LiquidityParameterByWeight"; + type: { + kind: "struct"; + fields: [ { - "name": "amountX", - "docs": [ - "Amount of X token to deposit" - ], - "type": "u64" + name: "amountX"; + docs: ["Amount of X token to deposit"]; + type: "u64"; }, { - "name": "amountY", - "docs": [ - "Amount of Y token to deposit" - ], - "type": "u64" + name: "amountY"; + docs: ["Amount of Y token to deposit"]; + type: "u64"; }, { - "name": "activeId", - "docs": [ - "Active bin that integrator observe off-chain" - ], - "type": "i32" + name: "activeId"; + docs: ["Active bin that integrator observe off-chain"]; + type: "i32"; }, { - "name": "maxActiveBinSlippage", - "docs": [ - "max active bin slippage allowed" - ], - "type": "i32" + name: "maxActiveBinSlippage"; + docs: ["max active bin slippage allowed"]; + type: "i32"; }, { - "name": "binLiquidityDist", - "docs": [ - "Liquidity distribution to each bins" - ], - "type": { - "vec": { - "defined": "BinLiquidityDistributionByWeight" - } - } + name: "binLiquidityDist"; + docs: ["Liquidity distribution to each bins"]; + type: { + vec: { + defined: "BinLiquidityDistributionByWeight"; + }; + }; } - ] - } + ]; + }; }, { - "name": "AddLiquiditySingleSidePreciseParameter", - "type": { - "kind": "struct", - "fields": [ + name: "AddLiquiditySingleSidePreciseParameter"; + type: { + kind: "struct"; + fields: [ { - "name": "bins", - "type": { - "vec": { - "defined": "CompressedBinDepositAmount" - } - } + name: "bins"; + type: { + vec: { + defined: "CompressedBinDepositAmount"; + }; + }; }, { - "name": "decompressMultiplier", - "type": "u64" + name: "decompressMultiplier"; + type: "u64"; } - ] - } + ]; + }; }, { - "name": "CompressedBinDepositAmount", - "type": { - "kind": "struct", - "fields": [ + name: "CompressedBinDepositAmount"; + type: { + kind: "struct"; + fields: [ { - "name": "binId", - "type": "i32" + name: "binId"; + type: "i32"; }, { - "name": "amount", - "type": "u32" + name: "amount"; + type: "u32"; } - ] - } + ]; + }; }, { - "name": "BinLiquidityDistribution", - "type": { - "kind": "struct", - "fields": [ + name: "BinLiquidityDistribution"; + type: { + kind: "struct"; + fields: [ { - "name": "binId", - "docs": [ - "Define the bin ID wish to deposit to." - ], - "type": "i32" + name: "binId"; + docs: ["Define the bin ID wish to deposit to."]; + type: "i32"; }, { - "name": "distributionX", - "docs": [ + name: "distributionX"; + docs: [ "DistributionX (or distributionY) is the percentages of amountX (or amountY) you want to add to each bin." - ], - "type": "u16" + ]; + type: "u16"; }, { - "name": "distributionY", - "docs": [ + name: "distributionY"; + docs: [ "DistributionX (or distributionY) is the percentages of amountX (or amountY) you want to add to each bin." - ], - "type": "u16" + ]; + type: "u16"; } - ] - } + ]; + }; }, { - "name": "LiquidityParameter", - "type": { - "kind": "struct", - "fields": [ + name: "LiquidityParameter"; + type: { + kind: "struct"; + fields: [ { - "name": "amountX", - "docs": [ - "Amount of X token to deposit" - ], - "type": "u64" + name: "amountX"; + docs: ["Amount of X token to deposit"]; + type: "u64"; }, { - "name": "amountY", - "docs": [ - "Amount of Y token to deposit" - ], - "type": "u64" + name: "amountY"; + docs: ["Amount of Y token to deposit"]; + type: "u64"; }, { - "name": "binLiquidityDist", - "docs": [ - "Liquidity distribution to each bins" - ], - "type": { - "vec": { - "defined": "BinLiquidityDistribution" - } - } + name: "binLiquidityDist"; + docs: ["Liquidity distribution to each bins"]; + type: { + vec: { + defined: "BinLiquidityDistribution"; + }; + }; } - ] - } + ]; + }; }, { - "name": "InitPermissionPairIx", - "type": { - "kind": "struct", - "fields": [ + name: "InitPermissionPairIx"; + type: { + kind: "struct"; + fields: [ { - "name": "activeId", - "type": "i32" + name: "activeId"; + type: "i32"; }, { - "name": "binStep", - "type": "u16" + name: "binStep"; + type: "u16"; }, { - "name": "baseFactor", - "type": "u16" + name: "baseFactor"; + type: "u16"; }, { - "name": "minBinId", - "type": "i32" + name: "minBinId"; + type: "i32"; }, { - "name": "maxBinId", - "type": "i32" + name: "maxBinId"; + type: "i32"; }, { - "name": "lockDuration", - "type": "u64" + name: "lockDuration"; + type: "u64"; }, { - "name": "activationType", - "type": "u8" + name: "activationType"; + type: "u8"; } - ] - } + ]; + }; }, { - "name": "InitPresetParametersIx", - "type": { - "kind": "struct", - "fields": [ + name: "InitPresetParametersIx"; + type: { + kind: "struct"; + fields: [ { - "name": "binStep", - "docs": [ - "Bin step. Represent the price increment / decrement." - ], - "type": "u16" + name: "binStep"; + docs: ["Bin step. Represent the price increment / decrement."]; + type: "u16"; }, { - "name": "baseFactor", - "docs": [ + name: "baseFactor"; + docs: [ "Used for base fee calculation. base_fee_rate = base_factor * bin_step" - ], - "type": "u16" + ]; + type: "u16"; }, { - "name": "filterPeriod", - "docs": [ + name: "filterPeriod"; + docs: [ "Filter period determine high frequency trading time window." - ], - "type": "u16" + ]; + type: "u16"; }, { - "name": "decayPeriod", - "docs": [ + name: "decayPeriod"; + docs: [ "Decay period determine when the volatile fee start decay / decrease." - ], - "type": "u16" + ]; + type: "u16"; }, { - "name": "reductionFactor", - "docs": [ + name: "reductionFactor"; + docs: [ "Reduction factor controls the volatile fee rate decrement rate." - ], - "type": "u16" + ]; + type: "u16"; }, { - "name": "variableFeeControl", - "docs": [ + name: "variableFeeControl"; + docs: [ "Used to scale the variable fee component depending on the dynamic of the market" - ], - "type": "u32" + ]; + type: "u32"; }, { - "name": "maxVolatilityAccumulator", - "docs": [ + name: "maxVolatilityAccumulator"; + docs: [ "Maximum number of bin crossed can be accumulated. Used to cap volatile fee rate." - ], - "type": "u32" + ]; + type: "u32"; }, { - "name": "minBinId", - "docs": [ + name: "minBinId"; + docs: [ "Min bin id supported by the pool based on the configured bin step." - ], - "type": "i32" + ]; + type: "i32"; }, { - "name": "maxBinId", - "docs": [ + name: "maxBinId"; + docs: [ "Max bin id supported by the pool based on the configured bin step." - ], - "type": "i32" + ]; + type: "i32"; }, { - "name": "protocolShare", - "docs": [ + name: "protocolShare"; + docs: [ "Portion of swap fees retained by the protocol by controlling protocol_share parameter. protocol_swap_fee = protocol_share * total_swap_fee" - ], - "type": "u16" + ]; + type: "u16"; } - ] - } + ]; + }; }, { - "name": "FeeParameter", - "type": { - "kind": "struct", - "fields": [ + name: "FeeParameter"; + type: { + kind: "struct"; + fields: [ { - "name": "protocolShare", - "docs": [ + name: "protocolShare"; + docs: [ "Portion of swap fees retained by the protocol by controlling protocol_share parameter. protocol_swap_fee = protocol_share * total_swap_fee" - ], - "type": "u16" + ]; + type: "u16"; }, { - "name": "baseFactor", - "docs": [ - "Base factor for base fee rate" - ], - "type": "u16" + name: "baseFactor"; + docs: ["Base factor for base fee rate"]; + type: "u16"; } - ] - } + ]; + }; }, { - "name": "BinLiquidityReduction", - "type": { - "kind": "struct", - "fields": [ + name: "BinLiquidityReduction"; + type: { + kind: "struct"; + fields: [ { - "name": "binId", - "type": "i32" + name: "binId"; + type: "i32"; }, { - "name": "bpsToRemove", - "type": "u16" + name: "bpsToRemove"; + type: "u16"; } - ] - } + ]; + }; }, { - "name": "Bin", - "type": { - "kind": "struct", - "fields": [ + name: "Bin"; + type: { + kind: "struct"; + fields: [ { - "name": "amountX", - "docs": [ + name: "amountX"; + docs: [ "Amount of token X in the bin. This already excluded protocol fees." - ], - "type": "u64" + ]; + type: "u64"; }, { - "name": "amountY", - "docs": [ + name: "amountY"; + docs: [ "Amount of token Y in the bin. This already excluded protocol fees." - ], - "type": "u64" + ]; + type: "u64"; }, { - "name": "price", - "docs": [ - "Bin price" - ], - "type": "u128" + name: "price"; + docs: ["Bin price"]; + type: "u128"; }, { - "name": "liquiditySupply", - "docs": [ + name: "liquiditySupply"; + docs: [ "Liquidities of the bin. This is the same as LP mint supply. q-number" - ], - "type": "u128" + ]; + type: "u128"; }, { - "name": "rewardPerTokenStored", - "docs": [ - "reward_a_per_token_stored" - ], - "type": { - "array": [ - "u128", - 2 - ] - } + name: "rewardPerTokenStored"; + docs: ["reward_a_per_token_stored"]; + type: { + array: ["u128", 2]; + }; }, { - "name": "feeAmountXPerTokenStored", - "docs": [ - "Swap fee amount of token X per liquidity deposited." - ], - "type": "u128" + name: "feeAmountXPerTokenStored"; + docs: ["Swap fee amount of token X per liquidity deposited."]; + type: "u128"; }, { - "name": "feeAmountYPerTokenStored", - "docs": [ - "Swap fee amount of token Y per liquidity deposited." - ], - "type": "u128" + name: "feeAmountYPerTokenStored"; + docs: ["Swap fee amount of token Y per liquidity deposited."]; + type: "u128"; }, { - "name": "amountXIn", - "docs": [ + name: "amountXIn"; + docs: [ "Total token X swap into the bin. Only used for tracking purpose." - ], - "type": "u128" + ]; + type: "u128"; }, { - "name": "amountYIn", - "docs": [ + name: "amountYIn"; + docs: [ "Total token Y swap into he bin. Only used for tracking purpose." - ], - "type": "u128" + ]; + type: "u128"; } - ] - } + ]; + }; }, { - "name": "ProtocolFee", - "type": { - "kind": "struct", - "fields": [ + name: "ProtocolFee"; + type: { + kind: "struct"; + fields: [ { - "name": "amountX", - "type": "u64" + name: "amountX"; + type: "u64"; }, { - "name": "amountY", - "type": "u64" + name: "amountY"; + type: "u64"; } - ] - } + ]; + }; }, { - "name": "RewardInfo", - "docs": [ - "Stores the state relevant for tracking liquidity mining rewards" - ], - "type": { - "kind": "struct", - "fields": [ + name: "RewardInfo"; + docs: ["Stores the state relevant for tracking liquidity mining rewards"]; + type: { + kind: "struct"; + fields: [ { - "name": "mint", - "docs": [ - "Reward token mint." - ], - "type": "publicKey" + name: "mint"; + docs: ["Reward token mint."]; + type: "publicKey"; }, { - "name": "vault", - "docs": [ - "Reward vault token account." - ], - "type": "publicKey" + name: "vault"; + docs: ["Reward vault token account."]; + type: "publicKey"; }, { - "name": "funder", - "docs": [ - "Authority account that allows to fund rewards" - ], - "type": "publicKey" + name: "funder"; + docs: ["Authority account that allows to fund rewards"]; + type: "publicKey"; }, { - "name": "rewardDuration", - "docs": [ - "TODO check whether we need to store it in pool" - ], - "type": "u64" + name: "rewardDuration"; + docs: ["TODO check whether we need to store it in pool"]; + type: "u64"; }, { - "name": "rewardDurationEnd", - "docs": [ - "TODO check whether we need to store it in pool" - ], - "type": "u64" + name: "rewardDurationEnd"; + docs: ["TODO check whether we need to store it in pool"]; + type: "u64"; }, { - "name": "rewardRate", - "docs": [ - "TODO check whether we need to store it in pool" - ], - "type": "u128" + name: "rewardRate"; + docs: ["TODO check whether we need to store it in pool"]; + type: "u128"; }, { - "name": "lastUpdateTime", - "docs": [ - "The last time reward states were updated." - ], - "type": "u64" + name: "lastUpdateTime"; + docs: ["The last time reward states were updated."]; + type: "u64"; }, { - "name": "cumulativeSecondsWithEmptyLiquidityReward", - "docs": [ + name: "cumulativeSecondsWithEmptyLiquidityReward"; + docs: [ "Accumulated seconds where when farm distribute rewards, but the bin is empty. The reward will be accumulated for next reward time window." - ], - "type": "u64" + ]; + type: "u64"; } - ] - } + ]; + }; }, { - "name": "Observation", - "type": { - "kind": "struct", - "fields": [ + name: "Observation"; + type: { + kind: "struct"; + fields: [ { - "name": "cumulativeActiveBinId", - "docs": [ - "Cumulative active bin ID" - ], - "type": "i128" + name: "cumulativeActiveBinId"; + docs: ["Cumulative active bin ID"]; + type: "i128"; }, { - "name": "createdAt", - "docs": [ - "Observation sample created timestamp" - ], - "type": "i64" + name: "createdAt"; + docs: ["Observation sample created timestamp"]; + type: "i64"; }, { - "name": "lastUpdatedAt", - "docs": [ - "Observation sample last updated timestamp" - ], - "type": "i64" + name: "lastUpdatedAt"; + docs: ["Observation sample last updated timestamp"]; + type: "i64"; } - ] - } + ]; + }; }, { - "name": "StaticParameters", - "docs": [ - "Parameter that set by the protocol" - ], - "type": { - "kind": "struct", - "fields": [ + name: "StaticParameters"; + docs: ["Parameter that set by the protocol"]; + type: { + kind: "struct"; + fields: [ { - "name": "baseFactor", - "docs": [ + name: "baseFactor"; + docs: [ "Used for base fee calculation. base_fee_rate = base_factor * bin_step" - ], - "type": "u16" + ]; + type: "u16"; }, { - "name": "filterPeriod", - "docs": [ + name: "filterPeriod"; + docs: [ "Filter period determine high frequency trading time window." - ], - "type": "u16" + ]; + type: "u16"; }, { - "name": "decayPeriod", - "docs": [ + name: "decayPeriod"; + docs: [ "Decay period determine when the volatile fee start decay / decrease." - ], - "type": "u16" + ]; + type: "u16"; }, { - "name": "reductionFactor", - "docs": [ + name: "reductionFactor"; + docs: [ "Reduction factor controls the volatile fee rate decrement rate." - ], - "type": "u16" + ]; + type: "u16"; }, { - "name": "variableFeeControl", - "docs": [ + name: "variableFeeControl"; + docs: [ "Used to scale the variable fee component depending on the dynamic of the market" - ], - "type": "u32" + ]; + type: "u32"; }, { - "name": "maxVolatilityAccumulator", - "docs": [ + name: "maxVolatilityAccumulator"; + docs: [ "Maximum number of bin crossed can be accumulated. Used to cap volatile fee rate." - ], - "type": "u32" + ]; + type: "u32"; }, { - "name": "minBinId", - "docs": [ + name: "minBinId"; + docs: [ "Min bin id supported by the pool based on the configured bin step." - ], - "type": "i32" + ]; + type: "i32"; }, { - "name": "maxBinId", - "docs": [ + name: "maxBinId"; + docs: [ "Max bin id supported by the pool based on the configured bin step." - ], - "type": "i32" + ]; + type: "i32"; }, { - "name": "protocolShare", - "docs": [ + name: "protocolShare"; + docs: [ "Portion of swap fees retained by the protocol by controlling protocol_share parameter. protocol_swap_fee = protocol_share * total_swap_fee" - ], - "type": "u16" + ]; + type: "u16"; }, { - "name": "padding", - "docs": [ - "Padding for bytemuck safe alignment" - ], - "type": { - "array": [ - "u8", - 6 - ] - } + name: "padding"; + docs: ["Padding for bytemuck safe alignment"]; + type: { + array: ["u8", 6]; + }; } - ] - } + ]; + }; }, { - "name": "VariableParameters", - "docs": [ - "Parameters that changes based on dynamic of the market" - ], - "type": { - "kind": "struct", - "fields": [ + name: "VariableParameters"; + docs: ["Parameters that changes based on dynamic of the market"]; + type: { + kind: "struct"; + fields: [ { - "name": "volatilityAccumulator", - "docs": [ + name: "volatilityAccumulator"; + docs: [ "Volatility accumulator measure the number of bin crossed since reference bin ID. Normally (without filter period taken into consideration), reference bin ID is the active bin of last swap.", "It affects the variable fee rate" - ], - "type": "u32" + ]; + type: "u32"; }, { - "name": "volatilityReference", - "docs": [ + name: "volatilityReference"; + docs: [ "Volatility reference is decayed volatility accumulator. It is always <= volatility_accumulator" - ], - "type": "u32" + ]; + type: "u32"; }, { - "name": "indexReference", - "docs": [ - "Active bin id of last swap." - ], - "type": "i32" + name: "indexReference"; + docs: ["Active bin id of last swap."]; + type: "i32"; }, { - "name": "padding", - "docs": [ - "Padding for bytemuck safe alignment" - ], - "type": { - "array": [ - "u8", - 4 - ] - } + name: "padding"; + docs: ["Padding for bytemuck safe alignment"]; + type: { + array: ["u8", 4]; + }; }, { - "name": "lastUpdateTimestamp", - "docs": [ - "Last timestamp the variable parameters was updated" - ], - "type": "i64" + name: "lastUpdateTimestamp"; + docs: ["Last timestamp the variable parameters was updated"]; + type: "i64"; }, { - "name": "padding1", - "docs": [ - "Padding for bytemuck safe alignment" - ], - "type": { - "array": [ - "u8", - 8 - ] - } + name: "padding1"; + docs: ["Padding for bytemuck safe alignment"]; + type: { + array: ["u8", 8]; + }; } - ] - } + ]; + }; }, { - "name": "FeeInfo", - "type": { - "kind": "struct", - "fields": [ + name: "FeeInfo"; + type: { + kind: "struct"; + fields: [ { - "name": "feeXPerTokenComplete", - "type": "u128" + name: "feeXPerTokenComplete"; + type: "u128"; }, { - "name": "feeYPerTokenComplete", - "type": "u128" + name: "feeYPerTokenComplete"; + type: "u128"; }, { - "name": "feeXPending", - "type": "u64" + name: "feeXPending"; + type: "u64"; }, { - "name": "feeYPending", - "type": "u64" + name: "feeYPending"; + type: "u64"; } - ] - } + ]; + }; }, { - "name": "UserRewardInfo", - "type": { - "kind": "struct", - "fields": [ + name: "UserRewardInfo"; + type: { + kind: "struct"; + fields: [ { - "name": "rewardPerTokenCompletes", - "type": { - "array": [ - "u128", - 2 - ] - } + name: "rewardPerTokenCompletes"; + type: { + array: ["u128", 2]; + }; }, { - "name": "rewardPendings", - "type": { - "array": [ - "u64", - 2 - ] - } + name: "rewardPendings"; + type: { + array: ["u64", 2]; + }; } - ] - } + ]; + }; }, { - "name": "StrategyType", - "type": { - "kind": "enum", - "variants": [ + name: "RemainingAccountsSlice"; + type: { + kind: "struct"; + fields: [ { - "name": "SpotOneSide" + name: "accountsType"; + type: { + defined: "AccountsType"; + }; }, { - "name": "CurveOneSide" + name: "length"; + type: "u8"; + } + ]; + }; + }, + { + name: "RemainingAccountsInfo"; + type: { + kind: "struct"; + fields: [ + { + name: "slices"; + type: { + vec: { + defined: "RemainingAccountsSlice"; + }; + }; + } + ]; + }; + }, + { + name: "StrategyType"; + type: { + kind: "enum"; + variants: [ + { + name: "SpotOneSide"; }, { - "name": "BidAskOneSide" + name: "CurveOneSide"; }, { - "name": "SpotBalanced" + name: "BidAskOneSide"; }, { - "name": "CurveBalanced" + name: "SpotBalanced"; }, { - "name": "BidAskBalanced" + name: "CurveBalanced"; }, { - "name": "SpotImBalanced" + name: "BidAskBalanced"; }, { - "name": "CurveImBalanced" + name: "SpotImBalanced"; }, { - "name": "BidAskImBalanced" + name: "CurveImBalanced"; + }, + { + name: "BidAskImBalanced"; } - ] - } + ]; + }; }, { - "name": "Rounding", - "type": { - "kind": "enum", - "variants": [ + name: "Rounding"; + type: { + kind: "enum"; + variants: [ { - "name": "Up" + name: "Up"; }, { - "name": "Down" + name: "Down"; } - ] - } + ]; + }; }, { - "name": "LayoutVersion", - "docs": [ - "Layout version" - ], - "type": { - "kind": "enum", - "variants": [ + name: "LayoutVersion"; + docs: ["Layout version"]; + type: { + kind: "enum"; + variants: [ { - "name": "V0" + name: "V0"; }, { - "name": "V1" + name: "V1"; } - ] - } + ]; + }; }, { - "name": "ActivationType", - "docs": [ - "Type of the activation" - ], - "type": { - "kind": "enum", - "variants": [ + name: "ActivationType"; + docs: ["Type of the activation"]; + type: { + kind: "enum"; + variants: [ { - "name": "Slot" + name: "Slot"; }, { - "name": "Timestamp" + name: "Timestamp"; } - ] - } + ]; + }; }, { - "name": "PairType", - "docs": [ + name: "PairType"; + docs: [ "Type of the Pair. 0 = Permissionless, 1 = Permission. Putting 0 as permissionless for backward compatibility." - ], - "type": { - "kind": "enum", - "variants": [ + ]; + type: { + kind: "enum"; + variants: [ { - "name": "Permissionless" + name: "Permissionless"; }, { - "name": "Permission" + name: "Permission"; } - ] - } + ]; + }; }, { - "name": "PairStatus", - "docs": [ + name: "PairStatus"; + docs: [ "Pair status. 0 = Enabled, 1 = Disabled. Putting 0 as enabled for backward compatibility." - ], - "type": { - "kind": "enum", - "variants": [ + ]; + type: { + kind: "enum"; + variants: [ + { + name: "Enabled"; + }, { - "name": "Enabled" + name: "Disabled"; + } + ]; + }; + }, + { + name: "TokenProgramFlags"; + type: { + kind: "enum"; + variants: [ + { + name: "TokenProgram"; + }, + { + name: "TokenProgram2022"; + } + ]; + }; + }, + { + name: "AccountsType"; + type: { + kind: "enum"; + variants: [ + { + name: "TransferHookX"; + }, + { + name: "TransferHookY"; }, { - "name": "Disabled" + name: "TransferHookReward"; } - ] - } + ]; + }; } - ], - "events": [ + ]; + events: [ { - "name": "CompositionFee", - "fields": [ + name: "CompositionFee"; + fields: [ { - "name": "from", - "type": "publicKey", - "index": false + name: "from"; + type: "publicKey"; + index: false; }, { - "name": "binId", - "type": "i16", - "index": false + name: "binId"; + type: "i16"; + index: false; }, { - "name": "tokenXFeeAmount", - "type": "u64", - "index": false + name: "tokenXFeeAmount"; + type: "u64"; + index: false; }, { - "name": "tokenYFeeAmount", - "type": "u64", - "index": false + name: "tokenYFeeAmount"; + type: "u64"; + index: false; }, { - "name": "protocolTokenXFeeAmount", - "type": "u64", - "index": false + name: "protocolTokenXFeeAmount"; + type: "u64"; + index: false; }, { - "name": "protocolTokenYFeeAmount", - "type": "u64", - "index": false + name: "protocolTokenYFeeAmount"; + type: "u64"; + index: false; } - ] + ]; }, { - "name": "AddLiquidity", - "fields": [ + name: "AddLiquidity"; + fields: [ { - "name": "lbPair", - "type": "publicKey", - "index": false + name: "lbPair"; + type: "publicKey"; + index: false; }, { - "name": "from", - "type": "publicKey", - "index": false + name: "from"; + type: "publicKey"; + index: false; }, { - "name": "position", - "type": "publicKey", - "index": false + name: "position"; + type: "publicKey"; + index: false; }, { - "name": "amounts", - "type": { - "array": [ - "u64", - 2 - ] - }, - "index": false + name: "amounts"; + type: { + array: ["u64", 2]; + }; + index: false; }, { - "name": "activeBinId", - "type": "i32", - "index": false + name: "activeBinId"; + type: "i32"; + index: false; } - ] + ]; }, { - "name": "RemoveLiquidity", - "fields": [ + name: "RemoveLiquidity"; + fields: [ { - "name": "lbPair", - "type": "publicKey", - "index": false + name: "lbPair"; + type: "publicKey"; + index: false; }, { - "name": "from", - "type": "publicKey", - "index": false + name: "from"; + type: "publicKey"; + index: false; }, { - "name": "position", - "type": "publicKey", - "index": false + name: "position"; + type: "publicKey"; + index: false; }, { - "name": "amounts", - "type": { - "array": [ - "u64", - 2 - ] - }, - "index": false + name: "amounts"; + type: { + array: ["u64", 2]; + }; + index: false; }, { - "name": "activeBinId", - "type": "i32", - "index": false + name: "activeBinId"; + type: "i32"; + index: false; } - ] + ]; }, { - "name": "Swap", - "fields": [ + name: "Swap"; + fields: [ { - "name": "lbPair", - "type": "publicKey", - "index": false + name: "lbPair"; + type: "publicKey"; + index: false; }, { - "name": "from", - "type": "publicKey", - "index": false + name: "from"; + type: "publicKey"; + index: false; }, { - "name": "startBinId", - "type": "i32", - "index": false + name: "startBinId"; + type: "i32"; + index: false; }, { - "name": "endBinId", - "type": "i32", - "index": false + name: "endBinId"; + type: "i32"; + index: false; }, { - "name": "amountIn", - "type": "u64", - "index": false + name: "amountIn"; + type: "u64"; + index: false; }, { - "name": "amountOut", - "type": "u64", - "index": false + name: "amountOut"; + type: "u64"; + index: false; }, { - "name": "swapForY", - "type": "bool", - "index": false + name: "swapForY"; + type: "bool"; + index: false; }, { - "name": "fee", - "type": "u64", - "index": false + name: "fee"; + type: "u64"; + index: false; }, { - "name": "protocolFee", - "type": "u64", - "index": false + name: "protocolFee"; + type: "u64"; + index: false; }, { - "name": "feeBps", - "type": "u128", - "index": false + name: "feeBps"; + type: "u128"; + index: false; }, { - "name": "hostFee", - "type": "u64", - "index": false + name: "hostFee"; + type: "u64"; + index: false; } - ] + ]; }, { - "name": "ClaimReward", - "fields": [ + name: "ClaimReward"; + fields: [ { - "name": "lbPair", - "type": "publicKey", - "index": false + name: "lbPair"; + type: "publicKey"; + index: false; }, { - "name": "position", - "type": "publicKey", - "index": false + name: "position"; + type: "publicKey"; + index: false; }, { - "name": "owner", - "type": "publicKey", - "index": false + name: "owner"; + type: "publicKey"; + index: false; }, { - "name": "rewardIndex", - "type": "u64", - "index": false + name: "rewardIndex"; + type: "u64"; + index: false; }, { - "name": "totalReward", - "type": "u64", - "index": false + name: "totalReward"; + type: "u64"; + index: false; } - ] + ]; }, { - "name": "FundReward", - "fields": [ + name: "FundReward"; + fields: [ { - "name": "lbPair", - "type": "publicKey", - "index": false + name: "lbPair"; + type: "publicKey"; + index: false; }, { - "name": "funder", - "type": "publicKey", - "index": false + name: "funder"; + type: "publicKey"; + index: false; }, { - "name": "rewardIndex", - "type": "u64", - "index": false + name: "rewardIndex"; + type: "u64"; + index: false; }, { - "name": "amount", - "type": "u64", - "index": false + name: "amount"; + type: "u64"; + index: false; } - ] + ]; }, { - "name": "InitializeReward", - "fields": [ + name: "InitializeReward"; + fields: [ { - "name": "lbPair", - "type": "publicKey", - "index": false + name: "lbPair"; + type: "publicKey"; + index: false; }, { - "name": "rewardMint", - "type": "publicKey", - "index": false + name: "rewardMint"; + type: "publicKey"; + index: false; }, { - "name": "funder", - "type": "publicKey", - "index": false + name: "funder"; + type: "publicKey"; + index: false; }, { - "name": "rewardIndex", - "type": "u64", - "index": false + name: "rewardIndex"; + type: "u64"; + index: false; }, { - "name": "rewardDuration", - "type": "u64", - "index": false + name: "rewardDuration"; + type: "u64"; + index: false; } - ] + ]; }, { - "name": "UpdateRewardDuration", - "fields": [ + name: "UpdateRewardDuration"; + fields: [ { - "name": "lbPair", - "type": "publicKey", - "index": false + name: "lbPair"; + type: "publicKey"; + index: false; }, { - "name": "rewardIndex", - "type": "u64", - "index": false + name: "rewardIndex"; + type: "u64"; + index: false; }, { - "name": "oldRewardDuration", - "type": "u64", - "index": false + name: "oldRewardDuration"; + type: "u64"; + index: false; }, { - "name": "newRewardDuration", - "type": "u64", - "index": false + name: "newRewardDuration"; + type: "u64"; + index: false; } - ] + ]; }, { - "name": "UpdateRewardFunder", - "fields": [ + name: "UpdateRewardFunder"; + fields: [ { - "name": "lbPair", - "type": "publicKey", - "index": false + name: "lbPair"; + type: "publicKey"; + index: false; }, { - "name": "rewardIndex", - "type": "u64", - "index": false + name: "rewardIndex"; + type: "u64"; + index: false; }, { - "name": "oldFunder", - "type": "publicKey", - "index": false + name: "oldFunder"; + type: "publicKey"; + index: false; }, { - "name": "newFunder", - "type": "publicKey", - "index": false + name: "newFunder"; + type: "publicKey"; + index: false; } - ] + ]; }, { - "name": "PositionClose", - "fields": [ + name: "PositionClose"; + fields: [ { - "name": "position", - "type": "publicKey", - "index": false + name: "position"; + type: "publicKey"; + index: false; }, { - "name": "owner", - "type": "publicKey", - "index": false + name: "owner"; + type: "publicKey"; + index: false; } - ] + ]; }, { - "name": "ClaimFee", - "fields": [ + name: "ClaimFee"; + fields: [ { - "name": "lbPair", - "type": "publicKey", - "index": false + name: "lbPair"; + type: "publicKey"; + index: false; }, { - "name": "position", - "type": "publicKey", - "index": false + name: "position"; + type: "publicKey"; + index: false; }, { - "name": "owner", - "type": "publicKey", - "index": false + name: "owner"; + type: "publicKey"; + index: false; }, { - "name": "feeX", - "type": "u64", - "index": false + name: "feeX"; + type: "u64"; + index: false; }, { - "name": "feeY", - "type": "u64", - "index": false + name: "feeY"; + type: "u64"; + index: false; } - ] + ]; }, { - "name": "LbPairCreate", - "fields": [ + name: "LbPairCreate"; + fields: [ { - "name": "lbPair", - "type": "publicKey", - "index": false + name: "lbPair"; + type: "publicKey"; + index: false; }, { - "name": "binStep", - "type": "u16", - "index": false + name: "binStep"; + type: "u16"; + index: false; }, { - "name": "tokenX", - "type": "publicKey", - "index": false + name: "tokenX"; + type: "publicKey"; + index: false; }, { - "name": "tokenY", - "type": "publicKey", - "index": false + name: "tokenY"; + type: "publicKey"; + index: false; } - ] + ]; }, { - "name": "PositionCreate", - "fields": [ + name: "PositionCreate"; + fields: [ { - "name": "lbPair", - "type": "publicKey", - "index": false + name: "lbPair"; + type: "publicKey"; + index: false; }, { - "name": "position", - "type": "publicKey", - "index": false + name: "position"; + type: "publicKey"; + index: false; }, { - "name": "owner", - "type": "publicKey", - "index": false + name: "owner"; + type: "publicKey"; + index: false; } - ] + ]; }, { - "name": "FeeParameterUpdate", - "fields": [ + name: "FeeParameterUpdate"; + fields: [ { - "name": "lbPair", - "type": "publicKey", - "index": false + name: "lbPair"; + type: "publicKey"; + index: false; }, { - "name": "protocolShare", - "type": "u16", - "index": false + name: "protocolShare"; + type: "u16"; + index: false; }, { - "name": "baseFactor", - "type": "u16", - "index": false + name: "baseFactor"; + type: "u16"; + index: false; } - ] + ]; }, { - "name": "IncreaseObservation", - "fields": [ + name: "IncreaseObservation"; + fields: [ { - "name": "oracle", - "type": "publicKey", - "index": false + name: "oracle"; + type: "publicKey"; + index: false; }, { - "name": "newObservationLength", - "type": "u64", - "index": false + name: "newObservationLength"; + type: "u64"; + index: false; } - ] + ]; }, { - "name": "WithdrawIneligibleReward", - "fields": [ + name: "WithdrawIneligibleReward"; + fields: [ { - "name": "lbPair", - "type": "publicKey", - "index": false + name: "lbPair"; + type: "publicKey"; + index: false; }, { - "name": "rewardMint", - "type": "publicKey", - "index": false + name: "rewardMint"; + type: "publicKey"; + index: false; }, { - "name": "amount", - "type": "u64", - "index": false + name: "amount"; + type: "u64"; + index: false; } - ] + ]; }, { - "name": "UpdatePositionOperator", - "fields": [ + name: "UpdatePositionOperator"; + fields: [ { - "name": "position", - "type": "publicKey", - "index": false + name: "position"; + type: "publicKey"; + index: false; }, { - "name": "oldOperator", - "type": "publicKey", - "index": false + name: "oldOperator"; + type: "publicKey"; + index: false; }, { - "name": "newOperator", - "type": "publicKey", - "index": false + name: "newOperator"; + type: "publicKey"; + index: false; } - ] + ]; }, { - "name": "UpdatePositionLockReleasePoint", - "fields": [ + name: "UpdatePositionLockReleasePoint"; + fields: [ { - "name": "position", - "type": "publicKey", - "index": false + name: "position"; + type: "publicKey"; + index: false; }, { - "name": "currentPoint", - "type": "u64", - "index": false + name: "currentPoint"; + type: "u64"; + index: false; }, { - "name": "newLockReleasePoint", - "type": "u64", - "index": false + name: "newLockReleasePoint"; + type: "u64"; + index: false; }, { - "name": "oldLockReleasePoint", - "type": "u64", - "index": false + name: "oldLockReleasePoint"; + type: "u64"; + index: false; }, { - "name": "sender", - "type": "publicKey", - "index": false + name: "sender"; + type: "publicKey"; + index: false; } - ] + ]; }, { - "name": "GoToABin", - "fields": [ + name: "GoToABin"; + fields: [ { - "name": "lbPair", - "type": "publicKey", - "index": false + name: "lbPair"; + type: "publicKey"; + index: false; }, { - "name": "fromBinId", - "type": "i32", - "index": false + name: "fromBinId"; + type: "i32"; + index: false; }, { - "name": "toBinId", - "type": "i32", - "index": false + name: "toBinId"; + type: "i32"; + index: false; } - ] + ]; } - ], - "errors": [ + ]; + errors: [ + { + code: 6000; + name: "InvalidStartBinIndex"; + msg: "Invalid start bin index"; + }, + { + code: 6001; + name: "InvalidBinId"; + msg: "Invalid bin id"; + }, + { + code: 6002; + name: "InvalidInput"; + msg: "Invalid input data"; + }, + { + code: 6003; + name: "ExceededAmountSlippageTolerance"; + msg: "Exceeded amount slippage tolerance"; + }, + { + code: 6004; + name: "ExceededBinSlippageTolerance"; + msg: "Exceeded bin slippage tolerance"; + }, + { + code: 6005; + name: "CompositionFactorFlawed"; + msg: "Composition factor flawed"; + }, + { + code: 6006; + name: "NonPresetBinStep"; + msg: "Non preset bin step"; + }, + { + code: 6007; + name: "ZeroLiquidity"; + msg: "Zero liquidity"; + }, { - "code": 6000, - "name": "InvalidStartBinIndex", - "msg": "Invalid start bin index" + code: 6008; + name: "InvalidPosition"; + msg: "Invalid position"; }, { - "code": 6001, - "name": "InvalidBinId", - "msg": "Invalid bin id" + code: 6009; + name: "BinArrayNotFound"; + msg: "Bin array not found"; }, { - "code": 6002, - "name": "InvalidInput", - "msg": "Invalid input data" + code: 6010; + name: "InvalidTokenMint"; + msg: "Invalid token mint"; }, { - "code": 6003, - "name": "ExceededAmountSlippageTolerance", - "msg": "Exceeded amount slippage tolerance" + code: 6011; + name: "InvalidAccountForSingleDeposit"; + msg: "Invalid account for single deposit"; }, { - "code": 6004, - "name": "ExceededBinSlippageTolerance", - "msg": "Exceeded bin slippage tolerance" + code: 6012; + name: "PairInsufficientLiquidity"; + msg: "Pair insufficient liquidity"; }, { - "code": 6005, - "name": "CompositionFactorFlawed", - "msg": "Composition factor flawed" + code: 6013; + name: "InvalidFeeOwner"; + msg: "Invalid fee owner"; }, { - "code": 6006, - "name": "NonPresetBinStep", - "msg": "Non preset bin step" + code: 6014; + name: "InvalidFeeWithdrawAmount"; + msg: "Invalid fee withdraw amount"; }, { - "code": 6007, - "name": "ZeroLiquidity", - "msg": "Zero liquidity" + code: 6015; + name: "InvalidAdmin"; + msg: "Invalid admin"; }, { - "code": 6008, - "name": "InvalidPosition", - "msg": "Invalid position" + code: 6016; + name: "IdenticalFeeOwner"; + msg: "Identical fee owner"; }, { - "code": 6009, - "name": "BinArrayNotFound", - "msg": "Bin array not found" + code: 6017; + name: "InvalidBps"; + msg: "Invalid basis point"; }, { - "code": 6010, - "name": "InvalidTokenMint", - "msg": "Invalid token mint" + code: 6018; + name: "MathOverflow"; + msg: "Math operation overflow"; }, { - "code": 6011, - "name": "InvalidAccountForSingleDeposit", - "msg": "Invalid account for single deposit" + code: 6019; + name: "TypeCastFailed"; + msg: "Type cast error"; }, { - "code": 6012, - "name": "PairInsufficientLiquidity", - "msg": "Pair insufficient liquidity" + code: 6020; + name: "InvalidRewardIndex"; + msg: "Invalid reward index"; }, { - "code": 6013, - "name": "InvalidFeeOwner", - "msg": "Invalid fee owner" + code: 6021; + name: "InvalidRewardDuration"; + msg: "Invalid reward duration"; }, { - "code": 6014, - "name": "InvalidFeeWithdrawAmount", - "msg": "Invalid fee withdraw amount" + code: 6022; + name: "RewardInitialized"; + msg: "Reward already initialized"; }, { - "code": 6015, - "name": "InvalidAdmin", - "msg": "Invalid admin" + code: 6023; + name: "RewardUninitialized"; + msg: "Reward not initialized"; }, { - "code": 6016, - "name": "IdenticalFeeOwner", - "msg": "Identical fee owner" + code: 6024; + name: "IdenticalFunder"; + msg: "Identical funder"; }, { - "code": 6017, - "name": "InvalidBps", - "msg": "Invalid basis point" + code: 6025; + name: "RewardCampaignInProgress"; + msg: "Reward campaign in progress"; }, { - "code": 6018, - "name": "MathOverflow", - "msg": "Math operation overflow" + code: 6026; + name: "IdenticalRewardDuration"; + msg: "Reward duration is the same"; }, { - "code": 6019, - "name": "TypeCastFailed", - "msg": "Type cast error" + code: 6027; + name: "InvalidBinArray"; + msg: "Invalid bin array"; }, { - "code": 6020, - "name": "InvalidRewardIndex", - "msg": "Invalid reward index" + code: 6028; + name: "NonContinuousBinArrays"; + msg: "Bin arrays must be continuous"; }, { - "code": 6021, - "name": "InvalidRewardDuration", - "msg": "Invalid reward duration" + code: 6029; + name: "InvalidRewardVault"; + msg: "Invalid reward vault"; }, { - "code": 6022, - "name": "RewardInitialized", - "msg": "Reward already initialized" + code: 6030; + name: "NonEmptyPosition"; + msg: "Position is not empty"; }, { - "code": 6023, - "name": "RewardUninitialized", - "msg": "Reward not initialized" + code: 6031; + name: "UnauthorizedAccess"; + msg: "Unauthorized access"; }, { - "code": 6024, - "name": "IdenticalFunder", - "msg": "Identical funder" + code: 6032; + name: "InvalidFeeParameter"; + msg: "Invalid fee parameter"; }, { - "code": 6025, - "name": "RewardCampaignInProgress", - "msg": "Reward campaign in progress" + code: 6033; + name: "MissingOracle"; + msg: "Missing oracle account"; }, { - "code": 6026, - "name": "IdenticalRewardDuration", - "msg": "Reward duration is the same" + code: 6034; + name: "InsufficientSample"; + msg: "Insufficient observation sample"; }, { - "code": 6027, - "name": "InvalidBinArray", - "msg": "Invalid bin array" + code: 6035; + name: "InvalidLookupTimestamp"; + msg: "Invalid lookup timestamp"; }, { - "code": 6028, - "name": "NonContinuousBinArrays", - "msg": "Bin arrays must be continuous" + code: 6036; + name: "BitmapExtensionAccountIsNotProvided"; + msg: "Bitmap extension account is not provided"; }, { - "code": 6029, - "name": "InvalidRewardVault", - "msg": "Invalid reward vault" + code: 6037; + name: "CannotFindNonZeroLiquidityBinArrayId"; + msg: "Cannot find non-zero liquidity binArrayId"; }, { - "code": 6030, - "name": "NonEmptyPosition", - "msg": "Position is not empty" + code: 6038; + name: "BinIdOutOfBound"; + msg: "Bin id out of bound"; }, { - "code": 6031, - "name": "UnauthorizedAccess", - "msg": "Unauthorized access" + code: 6039; + name: "InsufficientOutAmount"; + msg: "Insufficient amount in for minimum out"; }, { - "code": 6032, - "name": "InvalidFeeParameter", - "msg": "Invalid fee parameter" + code: 6040; + name: "InvalidPositionWidth"; + msg: "Invalid position width"; }, { - "code": 6033, - "name": "MissingOracle", - "msg": "Missing oracle account" + code: 6041; + name: "ExcessiveFeeUpdate"; + msg: "Excessive fee update"; }, { - "code": 6034, - "name": "InsufficientSample", - "msg": "Insufficient observation sample" + code: 6042; + name: "PoolDisabled"; + msg: "Pool disabled"; }, { - "code": 6035, - "name": "InvalidLookupTimestamp", - "msg": "Invalid lookup timestamp" + code: 6043; + name: "InvalidPoolType"; + msg: "Invalid pool type"; }, { - "code": 6036, - "name": "BitmapExtensionAccountIsNotProvided", - "msg": "Bitmap extension account is not provided" + code: 6044; + name: "ExceedMaxWhitelist"; + msg: "Whitelist for wallet is full"; }, { - "code": 6037, - "name": "CannotFindNonZeroLiquidityBinArrayId", - "msg": "Cannot find non-zero liquidity binArrayId" + code: 6045; + name: "InvalidIndex"; + msg: "Invalid index"; }, { - "code": 6038, - "name": "BinIdOutOfBound", - "msg": "Bin id out of bound" + code: 6046; + name: "RewardNotEnded"; + msg: "Reward not ended"; }, { - "code": 6039, - "name": "InsufficientOutAmount", - "msg": "Insufficient amount in for minimum out" + code: 6047; + name: "MustWithdrawnIneligibleReward"; + msg: "Must withdraw ineligible reward"; }, { - "code": 6040, - "name": "InvalidPositionWidth", - "msg": "Invalid position width" + code: 6048; + name: "UnauthorizedAddress"; + msg: "Unauthorized address"; }, { - "code": 6041, - "name": "ExcessiveFeeUpdate", - "msg": "Excessive fee update" + code: 6049; + name: "OperatorsAreTheSame"; + msg: "Cannot update because operators are the same"; }, { - "code": 6042, - "name": "PoolDisabled", - "msg": "Pool disabled" + code: 6050; + name: "WithdrawToWrongTokenAccount"; + msg: "Withdraw to wrong token account"; }, { - "code": 6043, - "name": "InvalidPoolType", - "msg": "Invalid pool type" + code: 6051; + name: "WrongRentReceiver"; + msg: "Wrong rent receiver"; }, { - "code": 6044, - "name": "ExceedMaxWhitelist", - "msg": "Whitelist for wallet is full" + code: 6052; + name: "AlreadyPassActivationPoint"; + msg: "Already activated"; }, { - "code": 6045, - "name": "InvalidIndex", - "msg": "Invalid index" + code: 6053; + name: "ExceedMaxSwappedAmount"; + msg: "Swapped amount is exceeded max swapped amount"; }, { - "code": 6046, - "name": "RewardNotEnded", - "msg": "Reward not ended" + code: 6054; + name: "InvalidStrategyParameters"; + msg: "Invalid strategy parameters"; }, { - "code": 6047, - "name": "MustWithdrawnIneligibleReward", - "msg": "Must withdraw ineligible reward" + code: 6055; + name: "LiquidityLocked"; + msg: "Liquidity locked"; }, { - "code": 6048, - "name": "UnauthorizedAddress", - "msg": "Unauthorized address" + code: 6056; + name: "BinRangeIsNotEmpty"; + msg: "Bin range is not empty"; }, { - "code": 6049, - "name": "OperatorsAreTheSame", - "msg": "Cannot update because operators are the same" + code: 6057; + name: "NotExactAmountOut"; + msg: "Amount out is not matched with exact amount out"; }, { - "code": 6050, - "name": "WithdrawToWrongTokenAccount", - "msg": "Withdraw to wrong token account" + code: 6058; + name: "InvalidActivationType"; + msg: "Invalid activation type"; }, { - "code": 6051, - "name": "WrongRentReceiver", - "msg": "Wrong rent receiver" + code: 6059; + name: "NotSupportMint"; + msg: "Not support token_2022 mint extension"; }, { - "code": 6052, - "name": "AlreadyPassActivationPoint", - "msg": "Already activated" + code: 6060; + name: "UnsupportedMintExtension"; + msg: "Unsupported mint extension"; }, { - "code": 6053, - "name": "ExceedMaxSwappedAmount", - "msg": "Swapped amount is exceeded max swapped amount" + code: 6061; + name: "UnsupportNativeMintToken2022"; + msg: "Unsupported native mint token2022"; }, { - "code": 6054, - "name": "InvalidStrategyParameters", - "msg": "Invalid strategy parameters" + code: 6062; + name: "UnmatchTokenMint"; + msg: "Unmatch token mint"; }, { - "code": 6055, - "name": "LiquidityLocked", - "msg": "Liquidity locked" + code: 6063; + name: "UnsupportedTokenMint"; + msg: "Unsupported token mint"; }, { - "code": 6056, - "name": "BinRangeIsNotEmpty", - "msg": "Bin range is not empty" + code: 6064; + name: "InsufficientRemainingAccounts"; + msg: "Insufficient remaining accounts"; }, { - "code": 6057, - "name": "NotExactAmountOut", - "msg": "Amount out is not matched with exact amount out" + code: 6065; + name: "InvalidRemainingAccountSlice"; + msg: "Invalid remaining account slice"; }, { - "code": 6058, - "name": "InvalidActivationType", - "msg": "Invalid activation type" + code: 6066; + name: "DuplicatedRemainingAccountTypes"; + msg: "Duplicated remaining account types"; + }, + { + code: 6067; + name: "MissingRemainingAccountForTransferHook"; + msg: "Missing remaining account for transfer hook"; + }, + { + code: 6068; + name: "NoTransferHookProgram"; + msg: "Remaining account was passed for transfer hook but there's no hook program"; + }, + { + code: 6069; + name: "ZeroFundedAmount"; + msg: "Zero funded amount"; } - ] + ]; }; export const IDL: LbClmm = { - "version": "0.8.0", - "name": "lb_clmm", - "constants": [ + version: "0.9.0", + name: "lb_clmm", + constants: [ { - "name": "BASIS_POINT_MAX", - "type": "i32", - "value": "10000" + name: "BASIS_POINT_MAX", + type: "i32", + value: "10000", }, { - "name": "MAX_BIN_PER_ARRAY", - "type": { - "defined": "usize" + name: "MAX_BIN_PER_ARRAY", + type: { + defined: "usize", }, - "value": "70" + value: "70", }, { - "name": "MAX_BIN_PER_POSITION", - "type": { - "defined": "usize" + name: "MAX_BIN_PER_POSITION", + type: { + defined: "usize", }, - "value": "70" + value: "70", }, { - "name": "MIN_BIN_ID", - "type": "i32", - "value": "- 443636" + name: "MIN_BIN_ID", + type: "i32", + value: "- 443636", }, { - "name": "MAX_BIN_ID", - "type": "i32", - "value": "443636" + name: "MAX_BIN_ID", + type: "i32", + value: "443636", }, { - "name": "MAX_FEE_RATE", - "type": "u64", - "value": "100_000_000" + name: "MAX_FEE_RATE", + type: "u64", + value: "100_000_000", }, { - "name": "FEE_PRECISION", - "type": "u64", - "value": "1_000_000_000" + name: "FEE_PRECISION", + type: "u64", + value: "1_000_000_000", }, { - "name": "MAX_PROTOCOL_SHARE", - "type": "u16", - "value": "2_500" + name: "MAX_PROTOCOL_SHARE", + type: "u16", + value: "2_500", }, { - "name": "HOST_FEE_BPS", - "type": "u16", - "value": "2_000" + name: "HOST_FEE_BPS", + type: "u16", + value: "2_000", }, { - "name": "NUM_REWARDS", - "type": { - "defined": "usize" + name: "NUM_REWARDS", + type: { + defined: "usize", }, - "value": "2" + value: "2", }, { - "name": "MIN_REWARD_DURATION", - "type": "u64", - "value": "1" + name: "MIN_REWARD_DURATION", + type: "u64", + value: "1", }, { - "name": "MAX_REWARD_DURATION", - "type": "u64", - "value": "31536000" + name: "MAX_REWARD_DURATION", + type: "u64", + value: "31536000", }, { - "name": "EXTENSION_BINARRAY_BITMAP_SIZE", - "type": { - "defined": "usize" + name: "EXTENSION_BINARRAY_BITMAP_SIZE", + type: { + defined: "usize", }, - "value": "12" + value: "12", }, { - "name": "BIN_ARRAY_BITMAP_SIZE", - "type": "i32", - "value": "512" + name: "BIN_ARRAY_BITMAP_SIZE", + type: "i32", + value: "512", }, { - "name": "MAX_REWARD_BIN_SPLIT", - "type": { - "defined": "usize" + name: "MAX_REWARD_BIN_SPLIT", + type: { + defined: "usize", }, - "value": "15" + value: "15", }, { - "name": "BIN_ARRAY", - "type": "bytes", - "value": "[98, 105, 110, 95, 97, 114, 114, 97, 121]" + name: "BIN_ARRAY", + type: "bytes", + value: "[98, 105, 110, 95, 97, 114, 114, 97, 121]", }, { - "name": "ORACLE", - "type": "bytes", - "value": "[111, 114, 97, 99, 108, 101]" + name: "ORACLE", + type: "bytes", + value: "[111, 114, 97, 99, 108, 101]", }, { - "name": "BIN_ARRAY_BITMAP_SEED", - "type": "bytes", - "value": "[98, 105, 116, 109, 97, 112]" + name: "BIN_ARRAY_BITMAP_SEED", + type: "bytes", + value: "[98, 105, 116, 109, 97, 112]", }, { - "name": "PRESET_PARAMETER", - "type": "bytes", - "value": "[112, 114, 101, 115, 101, 116, 95, 112, 97, 114, 97, 109, 101, 116, 101, 114]" + name: "PRESET_PARAMETER", + type: "bytes", + value: + "[112, 114, 101, 115, 101, 116, 95, 112, 97, 114, 97, 109, 101, 116, 101, 114]", }, { - "name": "POSITION", - "type": "bytes", - "value": "[112, 111, 115, 105, 116, 105, 111, 110]" - } + name: "POSITION", + type: "bytes", + value: "[112, 111, 115, 105, 116, 105, 111, 110]", + }, ], - "instructions": [ + instructions: [ + { + name: "initializeLbPair", + accounts: [ + { + name: "lbPair", + isMut: true, + isSigner: false, + }, + { + name: "binArrayBitmapExtension", + isMut: true, + isSigner: false, + isOptional: true, + }, + { + name: "tokenMintX", + isMut: false, + isSigner: false, + }, + { + name: "tokenMintY", + isMut: false, + isSigner: false, + }, + { + name: "reserveX", + isMut: true, + isSigner: false, + }, + { + name: "reserveY", + isMut: true, + isSigner: false, + }, + { + name: "oracle", + isMut: true, + isSigner: false, + }, + { + name: "presetParameter", + isMut: false, + isSigner: false, + }, + { + name: "funder", + isMut: true, + isSigner: true, + }, + { + name: "tokenProgram", + isMut: false, + isSigner: false, + }, + { + name: "systemProgram", + isMut: false, + isSigner: false, + }, + { + name: "rent", + isMut: false, + isSigner: false, + }, + { + name: "eventAuthority", + isMut: false, + isSigner: false, + }, + { + name: "program", + isMut: false, + isSigner: false, + }, + ], + args: [ + { + name: "activeId", + type: "i32", + }, + { + name: "binStep", + type: "u16", + }, + ], + }, + { + name: "initializePermissionLbPair", + accounts: [ + { + name: "base", + isMut: false, + isSigner: true, + }, + { + name: "lbPair", + isMut: true, + isSigner: false, + }, + { + name: "binArrayBitmapExtension", + isMut: true, + isSigner: false, + isOptional: true, + }, + { + name: "tokenMintX", + isMut: false, + isSigner: false, + }, + { + name: "tokenMintY", + isMut: false, + isSigner: false, + }, + { + name: "reserveX", + isMut: true, + isSigner: false, + }, + { + name: "reserveY", + isMut: true, + isSigner: false, + }, + { + name: "oracle", + isMut: true, + isSigner: false, + }, + { + name: "admin", + isMut: true, + isSigner: true, + }, + { + name: "tokenBadgeX", + isMut: false, + isSigner: false, + isOptional: true, + }, + { + name: "tokenBadgeY", + isMut: false, + isSigner: false, + isOptional: true, + }, + { + name: "tokenProgramX", + isMut: false, + isSigner: false, + }, + { + name: "tokenProgramY", + isMut: false, + isSigner: false, + }, + { + name: "systemProgram", + isMut: false, + isSigner: false, + }, + { + name: "rent", + isMut: false, + isSigner: false, + }, + { + name: "eventAuthority", + isMut: false, + isSigner: false, + }, + { + name: "program", + isMut: false, + isSigner: false, + }, + ], + args: [ + { + name: "ixData", + type: { + defined: "InitPermissionPairIx", + }, + }, + ], + }, + { + name: "initializeBinArrayBitmapExtension", + accounts: [ + { + name: "lbPair", + isMut: false, + isSigner: false, + }, + { + name: "binArrayBitmapExtension", + isMut: true, + isSigner: false, + docs: [ + "Initialize an account to store if a bin array is initialized.", + ], + }, + { + name: "funder", + isMut: true, + isSigner: true, + }, + { + name: "systemProgram", + isMut: false, + isSigner: false, + }, + { + name: "rent", + isMut: false, + isSigner: false, + }, + ], + args: [], + }, + { + name: "initializeBinArray", + accounts: [ + { + name: "lbPair", + isMut: false, + isSigner: false, + }, + { + name: "binArray", + isMut: true, + isSigner: false, + }, + { + name: "funder", + isMut: true, + isSigner: true, + }, + { + name: "systemProgram", + isMut: false, + isSigner: false, + }, + ], + args: [ + { + name: "index", + type: "i64", + }, + ], + }, + { + name: "addLiquidity", + accounts: [ + { + name: "position", + isMut: true, + isSigner: false, + }, + { + name: "lbPair", + isMut: true, + isSigner: false, + }, + { + name: "binArrayBitmapExtension", + isMut: true, + isSigner: false, + isOptional: true, + }, + { + name: "userTokenX", + isMut: true, + isSigner: false, + }, + { + name: "userTokenY", + isMut: true, + isSigner: false, + }, + { + name: "reserveX", + isMut: true, + isSigner: false, + }, + { + name: "reserveY", + isMut: true, + isSigner: false, + }, + { + name: "tokenXMint", + isMut: false, + isSigner: false, + }, + { + name: "tokenYMint", + isMut: false, + isSigner: false, + }, + { + name: "binArrayLower", + isMut: true, + isSigner: false, + }, + { + name: "binArrayUpper", + isMut: true, + isSigner: false, + }, + { + name: "sender", + isMut: false, + isSigner: true, + }, + { + name: "tokenXProgram", + isMut: false, + isSigner: false, + }, + { + name: "tokenYProgram", + isMut: false, + isSigner: false, + }, + { + name: "eventAuthority", + isMut: false, + isSigner: false, + }, + { + name: "program", + isMut: false, + isSigner: false, + }, + ], + args: [ + { + name: "liquidityParameter", + type: { + defined: "LiquidityParameter", + }, + }, + ], + }, + { + name: "addLiquidityByWeight", + accounts: [ + { + name: "position", + isMut: true, + isSigner: false, + }, + { + name: "lbPair", + isMut: true, + isSigner: false, + }, + { + name: "binArrayBitmapExtension", + isMut: true, + isSigner: false, + isOptional: true, + }, + { + name: "userTokenX", + isMut: true, + isSigner: false, + }, + { + name: "userTokenY", + isMut: true, + isSigner: false, + }, + { + name: "reserveX", + isMut: true, + isSigner: false, + }, + { + name: "reserveY", + isMut: true, + isSigner: false, + }, + { + name: "tokenXMint", + isMut: false, + isSigner: false, + }, + { + name: "tokenYMint", + isMut: false, + isSigner: false, + }, + { + name: "binArrayLower", + isMut: true, + isSigner: false, + }, + { + name: "binArrayUpper", + isMut: true, + isSigner: false, + }, + { + name: "sender", + isMut: false, + isSigner: true, + }, + { + name: "tokenXProgram", + isMut: false, + isSigner: false, + }, + { + name: "tokenYProgram", + isMut: false, + isSigner: false, + }, + { + name: "eventAuthority", + isMut: false, + isSigner: false, + }, + { + name: "program", + isMut: false, + isSigner: false, + }, + ], + args: [ + { + name: "liquidityParameter", + type: { + defined: "LiquidityParameterByWeight", + }, + }, + ], + }, + { + name: "addLiquidityByStrategy", + accounts: [ + { + name: "position", + isMut: true, + isSigner: false, + }, + { + name: "lbPair", + isMut: true, + isSigner: false, + }, + { + name: "binArrayBitmapExtension", + isMut: true, + isSigner: false, + isOptional: true, + }, + { + name: "userTokenX", + isMut: true, + isSigner: false, + }, + { + name: "userTokenY", + isMut: true, + isSigner: false, + }, + { + name: "reserveX", + isMut: true, + isSigner: false, + }, + { + name: "reserveY", + isMut: true, + isSigner: false, + }, + { + name: "tokenXMint", + isMut: false, + isSigner: false, + }, + { + name: "tokenYMint", + isMut: false, + isSigner: false, + }, + { + name: "binArrayLower", + isMut: true, + isSigner: false, + }, + { + name: "binArrayUpper", + isMut: true, + isSigner: false, + }, + { + name: "sender", + isMut: false, + isSigner: true, + }, + { + name: "tokenXProgram", + isMut: false, + isSigner: false, + }, + { + name: "tokenYProgram", + isMut: false, + isSigner: false, + }, + { + name: "eventAuthority", + isMut: false, + isSigner: false, + }, + { + name: "program", + isMut: false, + isSigner: false, + }, + ], + args: [ + { + name: "liquidityParameter", + type: { + defined: "LiquidityParameterByStrategy", + }, + }, + ], + }, + { + name: "addLiquidityByStrategyOneSide", + accounts: [ + { + name: "position", + isMut: true, + isSigner: false, + }, + { + name: "lbPair", + isMut: true, + isSigner: false, + }, + { + name: "binArrayBitmapExtension", + isMut: true, + isSigner: false, + isOptional: true, + }, + { + name: "userToken", + isMut: true, + isSigner: false, + }, + { + name: "reserve", + isMut: true, + isSigner: false, + }, + { + name: "tokenMint", + isMut: false, + isSigner: false, + }, + { + name: "binArrayLower", + isMut: true, + isSigner: false, + }, + { + name: "binArrayUpper", + isMut: true, + isSigner: false, + }, + { + name: "sender", + isMut: false, + isSigner: true, + }, + { + name: "tokenProgram", + isMut: false, + isSigner: false, + }, + { + name: "eventAuthority", + isMut: false, + isSigner: false, + }, + { + name: "program", + isMut: false, + isSigner: false, + }, + ], + args: [ + { + name: "liquidityParameter", + type: { + defined: "LiquidityParameterByStrategyOneSide", + }, + }, + ], + }, + { + name: "addLiquidityOneSide", + accounts: [ + { + name: "position", + isMut: true, + isSigner: false, + }, + { + name: "lbPair", + isMut: true, + isSigner: false, + }, + { + name: "binArrayBitmapExtension", + isMut: true, + isSigner: false, + isOptional: true, + }, + { + name: "userToken", + isMut: true, + isSigner: false, + }, + { + name: "reserve", + isMut: true, + isSigner: false, + }, + { + name: "tokenMint", + isMut: false, + isSigner: false, + }, + { + name: "binArrayLower", + isMut: true, + isSigner: false, + }, + { + name: "binArrayUpper", + isMut: true, + isSigner: false, + }, + { + name: "sender", + isMut: false, + isSigner: true, + }, + { + name: "tokenProgram", + isMut: false, + isSigner: false, + }, + { + name: "eventAuthority", + isMut: false, + isSigner: false, + }, + { + name: "program", + isMut: false, + isSigner: false, + }, + ], + args: [ + { + name: "liquidityParameter", + type: { + defined: "LiquidityOneSideParameter", + }, + }, + ], + }, + { + name: "removeLiquidity", + accounts: [ + { + name: "position", + isMut: true, + isSigner: false, + }, + { + name: "lbPair", + isMut: true, + isSigner: false, + }, + { + name: "binArrayBitmapExtension", + isMut: true, + isSigner: false, + isOptional: true, + }, + { + name: "userTokenX", + isMut: true, + isSigner: false, + }, + { + name: "userTokenY", + isMut: true, + isSigner: false, + }, + { + name: "reserveX", + isMut: true, + isSigner: false, + }, + { + name: "reserveY", + isMut: true, + isSigner: false, + }, + { + name: "tokenXMint", + isMut: false, + isSigner: false, + }, + { + name: "tokenYMint", + isMut: false, + isSigner: false, + }, + { + name: "binArrayLower", + isMut: true, + isSigner: false, + }, + { + name: "binArrayUpper", + isMut: true, + isSigner: false, + }, + { + name: "sender", + isMut: false, + isSigner: true, + }, + { + name: "tokenXProgram", + isMut: false, + isSigner: false, + }, + { + name: "tokenYProgram", + isMut: false, + isSigner: false, + }, + { + name: "eventAuthority", + isMut: false, + isSigner: false, + }, + { + name: "program", + isMut: false, + isSigner: false, + }, + ], + args: [ + { + name: "binLiquidityRemoval", + type: { + vec: { + defined: "BinLiquidityReduction", + }, + }, + }, + ], + }, + { + name: "initializePosition", + accounts: [ + { + name: "payer", + isMut: true, + isSigner: true, + }, + { + name: "position", + isMut: true, + isSigner: true, + }, + { + name: "lbPair", + isMut: false, + isSigner: false, + }, + { + name: "owner", + isMut: false, + isSigner: true, + }, + { + name: "systemProgram", + isMut: false, + isSigner: false, + }, + { + name: "rent", + isMut: false, + isSigner: false, + }, + { + name: "eventAuthority", + isMut: false, + isSigner: false, + }, + { + name: "program", + isMut: false, + isSigner: false, + }, + ], + args: [ + { + name: "lowerBinId", + type: "i32", + }, + { + name: "width", + type: "i32", + }, + ], + }, + { + name: "initializePositionPda", + accounts: [ + { + name: "payer", + isMut: true, + isSigner: true, + }, + { + name: "base", + isMut: false, + isSigner: true, + }, + { + name: "position", + isMut: true, + isSigner: false, + }, + { + name: "lbPair", + isMut: false, + isSigner: false, + }, + { + name: "owner", + isMut: false, + isSigner: true, + docs: ["owner"], + }, + { + name: "systemProgram", + isMut: false, + isSigner: false, + }, + { + name: "rent", + isMut: false, + isSigner: false, + }, + { + name: "eventAuthority", + isMut: false, + isSigner: false, + }, + { + name: "program", + isMut: false, + isSigner: false, + }, + ], + args: [ + { + name: "lowerBinId", + type: "i32", + }, + { + name: "width", + type: "i32", + }, + ], + }, + { + name: "initializePositionByOperator", + accounts: [ + { + name: "payer", + isMut: true, + isSigner: true, + }, + { + name: "base", + isMut: false, + isSigner: true, + }, + { + name: "position", + isMut: true, + isSigner: false, + }, + { + name: "lbPair", + isMut: false, + isSigner: false, + }, + { + name: "operator", + isMut: false, + isSigner: true, + docs: ["operator"], + }, + { + name: "systemProgram", + isMut: false, + isSigner: false, + }, + { + name: "rent", + isMut: false, + isSigner: false, + }, + { + name: "eventAuthority", + isMut: false, + isSigner: false, + }, + { + name: "program", + isMut: false, + isSigner: false, + }, + ], + args: [ + { + name: "lowerBinId", + type: "i32", + }, + { + name: "width", + type: "i32", + }, + { + name: "owner", + type: "publicKey", + }, + { + name: "feeOwner", + type: "publicKey", + }, + ], + }, + { + name: "updatePositionOperator", + accounts: [ + { + name: "position", + isMut: true, + isSigner: false, + }, + { + name: "owner", + isMut: false, + isSigner: true, + }, + { + name: "eventAuthority", + isMut: false, + isSigner: false, + }, + { + name: "program", + isMut: false, + isSigner: false, + }, + ], + args: [ + { + name: "operator", + type: "publicKey", + }, + ], + }, { - "name": "initializeLbPair", - "accounts": [ + name: "swap", + accounts: [ { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "lbPair", + isMut: true, + isSigner: false, }, { - "name": "binArrayBitmapExtension", - "isMut": true, - "isSigner": false, - "isOptional": true + name: "binArrayBitmapExtension", + isMut: false, + isSigner: false, + isOptional: true, }, { - "name": "tokenMintX", - "isMut": false, - "isSigner": false + name: "reserveX", + isMut: true, + isSigner: false, }, { - "name": "tokenMintY", - "isMut": false, - "isSigner": false + name: "reserveY", + isMut: true, + isSigner: false, }, { - "name": "reserveX", - "isMut": true, - "isSigner": false + name: "userTokenIn", + isMut: true, + isSigner: false, }, { - "name": "reserveY", - "isMut": true, - "isSigner": false + name: "userTokenOut", + isMut: true, + isSigner: false, }, { - "name": "oracle", - "isMut": true, - "isSigner": false + name: "tokenXMint", + isMut: false, + isSigner: false, }, { - "name": "presetParameter", - "isMut": false, - "isSigner": false + name: "tokenYMint", + isMut: false, + isSigner: false, }, { - "name": "funder", - "isMut": true, - "isSigner": true + name: "oracle", + isMut: true, + isSigner: false, }, { - "name": "tokenProgram", - "isMut": false, - "isSigner": false + name: "hostFeeIn", + isMut: true, + isSigner: false, + isOptional: true, }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false + name: "user", + isMut: false, + isSigner: true, }, { - "name": "rent", - "isMut": false, - "isSigner": false + name: "tokenXProgram", + isMut: false, + isSigner: false, }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "tokenYProgram", + isMut: false, + isSigner: false, }, { - "name": "program", - "isMut": false, - "isSigner": false - } + name: "eventAuthority", + isMut: false, + isSigner: false, + }, + { + name: "program", + isMut: false, + isSigner: false, + }, ], - "args": [ + args: [ { - "name": "activeId", - "type": "i32" + name: "amountIn", + type: "u64", }, { - "name": "binStep", - "type": "u16" - } - ] + name: "minAmountOut", + type: "u64", + }, + ], }, { - "name": "initializePermissionLbPair", - "accounts": [ + name: "swapExactOut", + accounts: [ { - "name": "base", - "isMut": false, - "isSigner": true + name: "lbPair", + isMut: true, + isSigner: false, }, { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "binArrayBitmapExtension", + isMut: false, + isSigner: false, + isOptional: true, }, { - "name": "binArrayBitmapExtension", - "isMut": true, - "isSigner": false, - "isOptional": true + name: "reserveX", + isMut: true, + isSigner: false, }, { - "name": "tokenMintX", - "isMut": false, - "isSigner": false + name: "reserveY", + isMut: true, + isSigner: false, }, { - "name": "tokenMintY", - "isMut": false, - "isSigner": false + name: "userTokenIn", + isMut: true, + isSigner: false, }, { - "name": "reserveX", - "isMut": true, - "isSigner": false + name: "userTokenOut", + isMut: true, + isSigner: false, }, { - "name": "reserveY", - "isMut": true, - "isSigner": false + name: "tokenXMint", + isMut: false, + isSigner: false, }, { - "name": "oracle", - "isMut": true, - "isSigner": false + name: "tokenYMint", + isMut: false, + isSigner: false, }, { - "name": "admin", - "isMut": true, - "isSigner": true + name: "oracle", + isMut: true, + isSigner: false, }, { - "name": "tokenProgram", - "isMut": false, - "isSigner": false + name: "hostFeeIn", + isMut: true, + isSigner: false, + isOptional: true, }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false + name: "user", + isMut: false, + isSigner: true, }, { - "name": "rent", - "isMut": false, - "isSigner": false + name: "tokenXProgram", + isMut: false, + isSigner: false, }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "tokenYProgram", + isMut: false, + isSigner: false, }, { - "name": "program", - "isMut": false, - "isSigner": false - } - ], - "args": [ - { - "name": "ixData", - "type": { - "defined": "InitPermissionPairIx" - } - } - ] - }, - { - "name": "initializeBinArrayBitmapExtension", - "accounts": [ - { - "name": "lbPair", - "isMut": false, - "isSigner": false + name: "eventAuthority", + isMut: false, + isSigner: false, }, { - "name": "binArrayBitmapExtension", - "isMut": true, - "isSigner": false, - "docs": [ - "Initialize an account to store if a bin array is initialized." - ] + name: "program", + isMut: false, + isSigner: false, }, + ], + args: [ { - "name": "funder", - "isMut": true, - "isSigner": true + name: "maxInAmount", + type: "u64", }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false + name: "outAmount", + type: "u64", }, - { - "name": "rent", - "isMut": false, - "isSigner": false - } ], - "args": [] }, { - "name": "initializeBinArray", - "accounts": [ + name: "swapWithPriceImpact", + accounts: [ { - "name": "lbPair", - "isMut": false, - "isSigner": false + name: "lbPair", + isMut: true, + isSigner: false, }, { - "name": "binArray", - "isMut": true, - "isSigner": false + name: "binArrayBitmapExtension", + isMut: false, + isSigner: false, + isOptional: true, }, { - "name": "funder", - "isMut": true, - "isSigner": true + name: "reserveX", + isMut: true, + isSigner: false, }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false - } - ], - "args": [ - { - "name": "index", - "type": "i64" - } - ] - }, - { - "name": "addLiquidity", - "accounts": [ - { - "name": "position", - "isMut": true, - "isSigner": false + name: "reserveY", + isMut: true, + isSigner: false, }, { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "userTokenIn", + isMut: true, + isSigner: false, }, { - "name": "binArrayBitmapExtension", - "isMut": true, - "isSigner": false, - "isOptional": true + name: "userTokenOut", + isMut: true, + isSigner: false, }, { - "name": "userTokenX", - "isMut": true, - "isSigner": false + name: "tokenXMint", + isMut: false, + isSigner: false, }, { - "name": "userTokenY", - "isMut": true, - "isSigner": false + name: "tokenYMint", + isMut: false, + isSigner: false, }, { - "name": "reserveX", - "isMut": true, - "isSigner": false + name: "oracle", + isMut: true, + isSigner: false, }, { - "name": "reserveY", - "isMut": true, - "isSigner": false + name: "hostFeeIn", + isMut: true, + isSigner: false, + isOptional: true, }, { - "name": "tokenXMint", - "isMut": false, - "isSigner": false + name: "user", + isMut: false, + isSigner: true, }, { - "name": "tokenYMint", - "isMut": false, - "isSigner": false + name: "tokenXProgram", + isMut: false, + isSigner: false, }, { - "name": "binArrayLower", - "isMut": true, - "isSigner": false + name: "tokenYProgram", + isMut: false, + isSigner: false, }, { - "name": "binArrayUpper", - "isMut": true, - "isSigner": false + name: "eventAuthority", + isMut: false, + isSigner: false, }, { - "name": "sender", - "isMut": false, - "isSigner": true + name: "program", + isMut: false, + isSigner: false, }, + ], + args: [ { - "name": "tokenXProgram", - "isMut": false, - "isSigner": false + name: "amountIn", + type: "u64", }, { - "name": "tokenYProgram", - "isMut": false, - "isSigner": false + name: "activeId", + type: { + option: "i32", + }, }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "maxPriceImpactBps", + type: "u16", }, - { - "name": "program", - "isMut": false, - "isSigner": false - } ], - "args": [ - { - "name": "liquidityParameter", - "type": { - "defined": "LiquidityParameter" - } - } - ] }, { - "name": "addLiquidityByWeight", - "accounts": [ - { - "name": "position", - "isMut": true, - "isSigner": false - }, + name: "withdrawProtocolFee", + accounts: [ { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "lbPair", + isMut: true, + isSigner: false, }, { - "name": "binArrayBitmapExtension", - "isMut": true, - "isSigner": false, - "isOptional": true + name: "reserveX", + isMut: true, + isSigner: false, }, { - "name": "userTokenX", - "isMut": true, - "isSigner": false + name: "reserveY", + isMut: true, + isSigner: false, }, { - "name": "userTokenY", - "isMut": true, - "isSigner": false + name: "tokenXMint", + isMut: false, + isSigner: false, }, { - "name": "reserveX", - "isMut": true, - "isSigner": false + name: "tokenYMint", + isMut: false, + isSigner: false, }, { - "name": "reserveY", - "isMut": true, - "isSigner": false + name: "receiverTokenX", + isMut: true, + isSigner: false, }, { - "name": "tokenXMint", - "isMut": false, - "isSigner": false + name: "receiverTokenY", + isMut: true, + isSigner: false, }, { - "name": "tokenYMint", - "isMut": false, - "isSigner": false + name: "tokenXProgram", + isMut: false, + isSigner: false, }, { - "name": "binArrayLower", - "isMut": true, - "isSigner": false + name: "tokenYProgram", + isMut: false, + isSigner: false, }, { - "name": "binArrayUpper", - "isMut": true, - "isSigner": false - }, - { - "name": "sender", - "isMut": false, - "isSigner": true + name: "memoProgram", + isMut: false, + isSigner: false, }, + ], + args: [ { - "name": "tokenXProgram", - "isMut": false, - "isSigner": false + name: "amountX", + type: "u64", }, { - "name": "tokenYProgram", - "isMut": false, - "isSigner": false + name: "amountY", + type: "u64", }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "remainingAccountsInfo", + type: { + defined: "RemainingAccountsInfo", + }, }, - { - "name": "program", - "isMut": false, - "isSigner": false - } ], - "args": [ - { - "name": "liquidityParameter", - "type": { - "defined": "LiquidityParameterByWeight" - } - } - ] }, { - "name": "addLiquidityByStrategy", - "accounts": [ - { - "name": "position", - "isMut": true, - "isSigner": false - }, - { - "name": "lbPair", - "isMut": true, - "isSigner": false - }, + name: "initializeReward", + accounts: [ { - "name": "binArrayBitmapExtension", - "isMut": true, - "isSigner": false, - "isOptional": true + name: "lbPair", + isMut: true, + isSigner: false, }, { - "name": "userTokenX", - "isMut": true, - "isSigner": false + name: "rewardVault", + isMut: true, + isSigner: false, }, { - "name": "userTokenY", - "isMut": true, - "isSigner": false + name: "rewardMint", + isMut: false, + isSigner: false, }, { - "name": "reserveX", - "isMut": true, - "isSigner": false + name: "tokenBadge", + isMut: false, + isSigner: false, + isOptional: true, }, { - "name": "reserveY", - "isMut": true, - "isSigner": false + name: "admin", + isMut: true, + isSigner: true, }, { - "name": "tokenXMint", - "isMut": false, - "isSigner": false + name: "tokenProgram", + isMut: false, + isSigner: false, }, { - "name": "tokenYMint", - "isMut": false, - "isSigner": false + name: "systemProgram", + isMut: false, + isSigner: false, }, { - "name": "binArrayLower", - "isMut": true, - "isSigner": false + name: "rent", + isMut: false, + isSigner: false, }, { - "name": "binArrayUpper", - "isMut": true, - "isSigner": false + name: "eventAuthority", + isMut: false, + isSigner: false, }, { - "name": "sender", - "isMut": false, - "isSigner": true + name: "program", + isMut: false, + isSigner: false, }, + ], + args: [ { - "name": "tokenXProgram", - "isMut": false, - "isSigner": false + name: "rewardIndex", + type: "u64", }, { - "name": "tokenYProgram", - "isMut": false, - "isSigner": false + name: "rewardDuration", + type: "u64", }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "funder", + type: "publicKey", }, - { - "name": "program", - "isMut": false, - "isSigner": false - } ], - "args": [ - { - "name": "liquidityParameter", - "type": { - "defined": "LiquidityParameterByStrategy" - } - } - ] }, { - "name": "addLiquidityByStrategyOneSide", - "accounts": [ + name: "fundReward", + accounts: [ + { + name: "lbPair", + isMut: true, + isSigner: false, + }, { - "name": "position", - "isMut": true, - "isSigner": false + name: "rewardVault", + isMut: true, + isSigner: false, }, { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "rewardMint", + isMut: false, + isSigner: false, }, { - "name": "binArrayBitmapExtension", - "isMut": true, - "isSigner": false, - "isOptional": true + name: "funderTokenAccount", + isMut: true, + isSigner: false, }, { - "name": "userToken", - "isMut": true, - "isSigner": false + name: "funder", + isMut: false, + isSigner: true, }, { - "name": "reserve", - "isMut": true, - "isSigner": false + name: "binArray", + isMut: true, + isSigner: false, }, { - "name": "tokenMint", - "isMut": false, - "isSigner": false + name: "tokenProgram", + isMut: false, + isSigner: false, }, { - "name": "binArrayLower", - "isMut": true, - "isSigner": false + name: "eventAuthority", + isMut: false, + isSigner: false, }, { - "name": "binArrayUpper", - "isMut": true, - "isSigner": false + name: "program", + isMut: false, + isSigner: false, }, + ], + args: [ { - "name": "sender", - "isMut": false, - "isSigner": true + name: "rewardIndex", + type: "u64", }, { - "name": "tokenProgram", - "isMut": false, - "isSigner": false + name: "amount", + type: "u64", }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "carryForward", + type: "bool", }, { - "name": "program", - "isMut": false, - "isSigner": false - } + name: "remainingAccountsInfo", + type: { + defined: "RemainingAccountsInfo", + }, + }, ], - "args": [ - { - "name": "liquidityParameter", - "type": { - "defined": "LiquidityParameterByStrategyOneSide" - } - } - ] }, { - "name": "addLiquidityOneSide", - "accounts": [ + name: "updateRewardFunder", + accounts: [ { - "name": "position", - "isMut": true, - "isSigner": false + name: "lbPair", + isMut: true, + isSigner: false, }, { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "admin", + isMut: false, + isSigner: true, }, { - "name": "binArrayBitmapExtension", - "isMut": true, - "isSigner": false, - "isOptional": true + name: "eventAuthority", + isMut: false, + isSigner: false, }, { - "name": "userToken", - "isMut": true, - "isSigner": false + name: "program", + isMut: false, + isSigner: false, }, + ], + args: [ { - "name": "reserve", - "isMut": true, - "isSigner": false + name: "rewardIndex", + type: "u64", }, { - "name": "tokenMint", - "isMut": false, - "isSigner": false + name: "newFunder", + type: "publicKey", }, + ], + }, + { + name: "updateRewardDuration", + accounts: [ { - "name": "binArrayLower", - "isMut": true, - "isSigner": false + name: "lbPair", + isMut: true, + isSigner: false, }, { - "name": "binArrayUpper", - "isMut": true, - "isSigner": false + name: "admin", + isMut: false, + isSigner: true, }, { - "name": "sender", - "isMut": false, - "isSigner": true + name: "binArray", + isMut: true, + isSigner: false, }, { - "name": "tokenProgram", - "isMut": false, - "isSigner": false + name: "eventAuthority", + isMut: false, + isSigner: false, }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "program", + isMut: false, + isSigner: false, }, - { - "name": "program", - "isMut": false, - "isSigner": false - } ], - "args": [ + args: [ { - "name": "liquidityParameter", - "type": { - "defined": "LiquidityOneSideParameter" - } - } - ] + name: "rewardIndex", + type: "u64", + }, + { + name: "newDuration", + type: "u64", + }, + ], }, { - "name": "removeLiquidity", - "accounts": [ + name: "claimReward", + accounts: [ { - "name": "position", - "isMut": true, - "isSigner": false + name: "lbPair", + isMut: true, + isSigner: false, }, { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "position", + isMut: true, + isSigner: false, }, { - "name": "binArrayBitmapExtension", - "isMut": true, - "isSigner": false, - "isOptional": true + name: "binArrayLower", + isMut: true, + isSigner: false, }, { - "name": "userTokenX", - "isMut": true, - "isSigner": false + name: "binArrayUpper", + isMut: true, + isSigner: false, }, { - "name": "userTokenY", - "isMut": true, - "isSigner": false + name: "sender", + isMut: false, + isSigner: true, }, { - "name": "reserveX", - "isMut": true, - "isSigner": false + name: "rewardVault", + isMut: true, + isSigner: false, }, { - "name": "reserveY", - "isMut": true, - "isSigner": false + name: "rewardMint", + isMut: false, + isSigner: false, }, { - "name": "tokenXMint", - "isMut": false, - "isSigner": false + name: "userTokenAccount", + isMut: true, + isSigner: false, }, { - "name": "tokenYMint", - "isMut": false, - "isSigner": false + name: "tokenProgram", + isMut: false, + isSigner: false, }, { - "name": "binArrayLower", - "isMut": true, - "isSigner": false + name: "eventAuthority", + isMut: false, + isSigner: false, }, { - "name": "binArrayUpper", - "isMut": true, - "isSigner": false + name: "program", + isMut: false, + isSigner: false, }, + ], + args: [ { - "name": "sender", - "isMut": false, - "isSigner": true + name: "rewardIndex", + type: "u64", }, + ], + }, + { + name: "claimFee", + accounts: [ { - "name": "tokenXProgram", - "isMut": false, - "isSigner": false + name: "lbPair", + isMut: true, + isSigner: false, }, { - "name": "tokenYProgram", - "isMut": false, - "isSigner": false + name: "position", + isMut: true, + isSigner: false, }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "binArrayLower", + isMut: true, + isSigner: false, }, { - "name": "program", - "isMut": false, - "isSigner": false - } - ], - "args": [ - { - "name": "binLiquidityRemoval", - "type": { - "vec": { - "defined": "BinLiquidityReduction" - } - } - } - ] - }, - { - "name": "initializePosition", - "accounts": [ + name: "binArrayUpper", + isMut: true, + isSigner: false, + }, { - "name": "payer", - "isMut": true, - "isSigner": true + name: "sender", + isMut: false, + isSigner: true, }, { - "name": "position", - "isMut": true, - "isSigner": true + name: "reserveX", + isMut: true, + isSigner: false, }, { - "name": "lbPair", - "isMut": false, - "isSigner": false + name: "reserveY", + isMut: true, + isSigner: false, }, { - "name": "owner", - "isMut": false, - "isSigner": true + name: "userTokenX", + isMut: true, + isSigner: false, }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false + name: "userTokenY", + isMut: true, + isSigner: false, }, { - "name": "rent", - "isMut": false, - "isSigner": false + name: "tokenXMint", + isMut: false, + isSigner: false, }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "tokenYMint", + isMut: false, + isSigner: false, }, { - "name": "program", - "isMut": false, - "isSigner": false - } - ], - "args": [ + name: "tokenProgram", + isMut: false, + isSigner: false, + }, { - "name": "lowerBinId", - "type": "i32" + name: "eventAuthority", + isMut: false, + isSigner: false, }, { - "name": "width", - "type": "i32" - } - ] + name: "program", + isMut: false, + isSigner: false, + }, + ], + args: [], }, { - "name": "initializePositionPda", - "accounts": [ + name: "closePosition", + accounts: [ { - "name": "payer", - "isMut": true, - "isSigner": true + name: "position", + isMut: true, + isSigner: false, }, { - "name": "base", - "isMut": false, - "isSigner": true + name: "lbPair", + isMut: true, + isSigner: false, }, { - "name": "position", - "isMut": true, - "isSigner": false + name: "binArrayLower", + isMut: true, + isSigner: false, }, { - "name": "lbPair", - "isMut": false, - "isSigner": false + name: "binArrayUpper", + isMut: true, + isSigner: false, }, { - "name": "owner", - "isMut": false, - "isSigner": true, - "docs": [ - "owner" - ] + name: "sender", + isMut: false, + isSigner: true, }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false + name: "rentReceiver", + isMut: true, + isSigner: false, }, { - "name": "rent", - "isMut": false, - "isSigner": false + name: "eventAuthority", + isMut: false, + isSigner: false, }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "program", + isMut: false, + isSigner: false, }, - { - "name": "program", - "isMut": false, - "isSigner": false - } ], - "args": [ + args: [], + }, + { + name: "updateFeeParameters", + accounts: [ { - "name": "lowerBinId", - "type": "i32" + name: "lbPair", + isMut: true, + isSigner: false, }, { - "name": "width", - "type": "i32" - } - ] - }, - { - "name": "initializePositionByOperator", - "accounts": [ + name: "admin", + isMut: false, + isSigner: true, + }, { - "name": "payer", - "isMut": true, - "isSigner": true + name: "eventAuthority", + isMut: false, + isSigner: false, }, { - "name": "base", - "isMut": false, - "isSigner": true + name: "program", + isMut: false, + isSigner: false, }, + ], + args: [ { - "name": "position", - "isMut": true, - "isSigner": false + name: "feeParameter", + type: { + defined: "FeeParameter", + }, }, + ], + }, + { + name: "increaseOracleLength", + accounts: [ { - "name": "lbPair", - "isMut": false, - "isSigner": false + name: "oracle", + isMut: true, + isSigner: false, }, { - "name": "operator", - "isMut": false, - "isSigner": true, - "docs": [ - "operator" - ] + name: "funder", + isMut: true, + isSigner: true, }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false + name: "systemProgram", + isMut: false, + isSigner: false, }, { - "name": "rent", - "isMut": false, - "isSigner": false + name: "eventAuthority", + isMut: false, + isSigner: false, }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "program", + isMut: false, + isSigner: false, }, + ], + args: [ { - "name": "program", - "isMut": false, - "isSigner": false - } + name: "lengthToAdd", + type: "u64", + }, ], - "args": [ + }, + { + name: "initializePresetParameter", + accounts: [ { - "name": "lowerBinId", - "type": "i32" + name: "presetParameter", + isMut: true, + isSigner: false, }, { - "name": "width", - "type": "i32" + name: "admin", + isMut: true, + isSigner: true, }, { - "name": "owner", - "type": "publicKey" + name: "systemProgram", + isMut: false, + isSigner: false, }, { - "name": "feeOwner", - "type": "publicKey" - } - ] + name: "rent", + isMut: false, + isSigner: false, + }, + ], + args: [ + { + name: "ix", + type: { + defined: "InitPresetParametersIx", + }, + }, + ], }, { - "name": "updatePositionOperator", - "accounts": [ + name: "closePresetParameter", + accounts: [ { - "name": "position", - "isMut": true, - "isSigner": false + name: "presetParameter", + isMut: true, + isSigner: false, }, { - "name": "owner", - "isMut": false, - "isSigner": true + name: "admin", + isMut: true, + isSigner: true, }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "rentReceiver", + isMut: true, + isSigner: false, }, - { - "name": "program", - "isMut": false, - "isSigner": false - } ], - "args": [ - { - "name": "operator", - "type": "publicKey" - } - ] + args: [], }, { - "name": "swap", - "accounts": [ + name: "removeAllLiquidity", + accounts: [ { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "position", + isMut: true, + isSigner: false, }, { - "name": "binArrayBitmapExtension", - "isMut": false, - "isSigner": false, - "isOptional": true + name: "lbPair", + isMut: true, + isSigner: false, }, { - "name": "reserveX", - "isMut": true, - "isSigner": false + name: "binArrayBitmapExtension", + isMut: true, + isSigner: false, + isOptional: true, }, { - "name": "reserveY", - "isMut": true, - "isSigner": false + name: "userTokenX", + isMut: true, + isSigner: false, }, { - "name": "userTokenIn", - "isMut": true, - "isSigner": false + name: "userTokenY", + isMut: true, + isSigner: false, }, { - "name": "userTokenOut", - "isMut": true, - "isSigner": false + name: "reserveX", + isMut: true, + isSigner: false, }, { - "name": "tokenXMint", - "isMut": false, - "isSigner": false + name: "reserveY", + isMut: true, + isSigner: false, }, { - "name": "tokenYMint", - "isMut": false, - "isSigner": false + name: "tokenXMint", + isMut: false, + isSigner: false, }, { - "name": "oracle", - "isMut": true, - "isSigner": false + name: "tokenYMint", + isMut: false, + isSigner: false, }, { - "name": "hostFeeIn", - "isMut": true, - "isSigner": false, - "isOptional": true + name: "binArrayLower", + isMut: true, + isSigner: false, }, { - "name": "user", - "isMut": false, - "isSigner": true + name: "binArrayUpper", + isMut: true, + isSigner: false, }, { - "name": "tokenXProgram", - "isMut": false, - "isSigner": false + name: "sender", + isMut: false, + isSigner: true, }, { - "name": "tokenYProgram", - "isMut": false, - "isSigner": false + name: "tokenXProgram", + isMut: false, + isSigner: false, }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "tokenYProgram", + isMut: false, + isSigner: false, }, { - "name": "program", - "isMut": false, - "isSigner": false - } - ], - "args": [ - { - "name": "amountIn", - "type": "u64" + name: "eventAuthority", + isMut: false, + isSigner: false, }, { - "name": "minAmountOut", - "type": "u64" - } - ] + name: "program", + isMut: false, + isSigner: false, + }, + ], + args: [], }, { - "name": "swapExactOut", - "accounts": [ + name: "togglePairStatus", + accounts: [ { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "lbPair", + isMut: true, + isSigner: false, }, { - "name": "binArrayBitmapExtension", - "isMut": false, - "isSigner": false, - "isOptional": true + name: "admin", + isMut: false, + isSigner: true, }, + ], + args: [], + }, + { + name: "updateWhitelistedWallet", + accounts: [ { - "name": "reserveX", - "isMut": true, - "isSigner": false + name: "lbPair", + isMut: true, + isSigner: false, }, { - "name": "reserveY", - "isMut": true, - "isSigner": false + name: "creator", + isMut: false, + isSigner: true, }, + ], + args: [ { - "name": "userTokenIn", - "isMut": true, - "isSigner": false + name: "wallet", + type: "publicKey", }, + ], + }, + { + name: "migratePosition", + accounts: [ { - "name": "userTokenOut", - "isMut": true, - "isSigner": false + name: "positionV2", + isMut: true, + isSigner: true, }, { - "name": "tokenXMint", - "isMut": false, - "isSigner": false + name: "positionV1", + isMut: true, + isSigner: false, }, { - "name": "tokenYMint", - "isMut": false, - "isSigner": false + name: "lbPair", + isMut: false, + isSigner: false, }, { - "name": "oracle", - "isMut": true, - "isSigner": false + name: "binArrayLower", + isMut: true, + isSigner: false, }, { - "name": "hostFeeIn", - "isMut": true, - "isSigner": false, - "isOptional": true + name: "binArrayUpper", + isMut: true, + isSigner: false, }, { - "name": "user", - "isMut": false, - "isSigner": true + name: "owner", + isMut: true, + isSigner: true, }, { - "name": "tokenXProgram", - "isMut": false, - "isSigner": false + name: "systemProgram", + isMut: false, + isSigner: false, }, { - "name": "tokenYProgram", - "isMut": false, - "isSigner": false + name: "rentReceiver", + isMut: true, + isSigner: false, }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "eventAuthority", + isMut: false, + isSigner: false, }, { - "name": "program", - "isMut": false, - "isSigner": false - } + name: "program", + isMut: false, + isSigner: false, + }, ], - "args": [ + args: [], + }, + { + name: "migrateBinArray", + accounts: [ { - "name": "maxInAmount", - "type": "u64" + name: "lbPair", + isMut: false, + isSigner: false, }, - { - "name": "outAmount", - "type": "u64" - } - ] + ], + args: [], }, { - "name": "swapWithPriceImpact", - "accounts": [ + name: "updateFeesAndRewards", + accounts: [ { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "position", + isMut: true, + isSigner: false, }, { - "name": "binArrayBitmapExtension", - "isMut": false, - "isSigner": false, - "isOptional": true + name: "lbPair", + isMut: true, + isSigner: false, }, { - "name": "reserveX", - "isMut": true, - "isSigner": false + name: "binArrayLower", + isMut: true, + isSigner: false, }, { - "name": "reserveY", - "isMut": true, - "isSigner": false + name: "binArrayUpper", + isMut: true, + isSigner: false, }, { - "name": "userTokenIn", - "isMut": true, - "isSigner": false + name: "owner", + isMut: false, + isSigner: true, }, + ], + args: [], + }, + { + name: "withdrawIneligibleReward", + accounts: [ { - "name": "userTokenOut", - "isMut": true, - "isSigner": false + name: "lbPair", + isMut: true, + isSigner: false, }, { - "name": "tokenXMint", - "isMut": false, - "isSigner": false + name: "rewardVault", + isMut: true, + isSigner: false, }, { - "name": "tokenYMint", - "isMut": false, - "isSigner": false + name: "rewardMint", + isMut: false, + isSigner: false, }, { - "name": "oracle", - "isMut": true, - "isSigner": false + name: "funderTokenAccount", + isMut: true, + isSigner: false, }, { - "name": "hostFeeIn", - "isMut": true, - "isSigner": false, - "isOptional": true + name: "funder", + isMut: false, + isSigner: true, }, { - "name": "user", - "isMut": false, - "isSigner": true + name: "binArray", + isMut: true, + isSigner: false, }, { - "name": "tokenXProgram", - "isMut": false, - "isSigner": false + name: "tokenProgram", + isMut: false, + isSigner: false, }, { - "name": "tokenYProgram", - "isMut": false, - "isSigner": false + name: "memoProgram", + isMut: false, + isSigner: false, }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "eventAuthority", + isMut: false, + isSigner: false, }, { - "name": "program", - "isMut": false, - "isSigner": false - } + name: "program", + isMut: false, + isSigner: false, + }, ], - "args": [ + args: [ { - "name": "amountIn", - "type": "u64" + name: "rewardIndex", + type: "u64", }, { - "name": "activeId", - "type": { - "option": "i32" - } + name: "remainingAccountsInfo", + type: { + defined: "RemainingAccountsInfo", + }, }, - { - "name": "maxPriceImpactBps", - "type": "u16" - } - ] + ], }, { - "name": "withdrawProtocolFee", - "accounts": [ + name: "setActivationPoint", + accounts: [ { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "lbPair", + isMut: true, + isSigner: false, }, { - "name": "reserveX", - "isMut": true, - "isSigner": false + name: "admin", + isMut: true, + isSigner: true, }, + ], + args: [ { - "name": "reserveY", - "isMut": true, - "isSigner": false + name: "activationPoint", + type: "u64", }, + ], + }, + { + name: "setLockReleasePoint", + accounts: [ { - "name": "tokenXMint", - "isMut": false, - "isSigner": false + name: "position", + isMut: true, + isSigner: false, }, { - "name": "tokenYMint", - "isMut": false, - "isSigner": false + name: "lbPair", + isMut: false, + isSigner: false, }, { - "name": "receiverTokenX", - "isMut": true, - "isSigner": false + name: "sender", + isMut: false, + isSigner: true, }, { - "name": "receiverTokenY", - "isMut": true, - "isSigner": false + name: "eventAuthority", + isMut: false, + isSigner: false, }, { - "name": "tokenXProgram", - "isMut": false, - "isSigner": false + name: "program", + isMut: false, + isSigner: false, }, - { - "name": "tokenYProgram", - "isMut": false, - "isSigner": false - } ], - "args": [ + args: [ { - "name": "amountX", - "type": "u64" + name: "newLockReleasePoint", + type: "u64", }, - { - "name": "amountY", - "type": "u64" - } - ] + ], }, { - "name": "initializeReward", - "accounts": [ + name: "removeLiquidityByRange", + accounts: [ { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "position", + isMut: true, + isSigner: false, }, { - "name": "rewardVault", - "isMut": true, - "isSigner": false + name: "lbPair", + isMut: true, + isSigner: false, }, { - "name": "rewardMint", - "isMut": false, - "isSigner": false + name: "binArrayBitmapExtension", + isMut: true, + isSigner: false, + isOptional: true, }, { - "name": "admin", - "isMut": true, - "isSigner": true + name: "userTokenX", + isMut: true, + isSigner: false, }, { - "name": "tokenProgram", - "isMut": false, - "isSigner": false + name: "userTokenY", + isMut: true, + isSigner: false, }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false + name: "reserveX", + isMut: true, + isSigner: false, }, { - "name": "rent", - "isMut": false, - "isSigner": false + name: "reserveY", + isMut: true, + isSigner: false, }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "tokenXMint", + isMut: false, + isSigner: false, }, { - "name": "program", - "isMut": false, - "isSigner": false - } + name: "tokenYMint", + isMut: false, + isSigner: false, + }, + { + name: "binArrayLower", + isMut: true, + isSigner: false, + }, + { + name: "binArrayUpper", + isMut: true, + isSigner: false, + }, + { + name: "sender", + isMut: false, + isSigner: true, + }, + { + name: "tokenXProgram", + isMut: false, + isSigner: false, + }, + { + name: "tokenYProgram", + isMut: false, + isSigner: false, + }, + { + name: "eventAuthority", + isMut: false, + isSigner: false, + }, + { + name: "program", + isMut: false, + isSigner: false, + }, ], - "args": [ + args: [ { - "name": "rewardIndex", - "type": "u64" + name: "fromBinId", + type: "i32", }, { - "name": "rewardDuration", - "type": "u64" + name: "toBinId", + type: "i32", }, { - "name": "funder", - "type": "publicKey" - } - ] + name: "bpsToRemove", + type: "u16", + }, + ], }, { - "name": "fundReward", - "accounts": [ + name: "addLiquidityOneSidePrecise", + accounts: [ { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "position", + isMut: true, + isSigner: false, }, { - "name": "rewardVault", - "isMut": true, - "isSigner": false + name: "lbPair", + isMut: true, + isSigner: false, }, { - "name": "rewardMint", - "isMut": false, - "isSigner": false + name: "binArrayBitmapExtension", + isMut: true, + isSigner: false, + isOptional: true, }, { - "name": "funderTokenAccount", - "isMut": true, - "isSigner": false + name: "userToken", + isMut: true, + isSigner: false, }, { - "name": "funder", - "isMut": false, - "isSigner": true + name: "reserve", + isMut: true, + isSigner: false, }, { - "name": "binArray", - "isMut": true, - "isSigner": false + name: "tokenMint", + isMut: false, + isSigner: false, }, { - "name": "tokenProgram", - "isMut": false, - "isSigner": false + name: "binArrayLower", + isMut: true, + isSigner: false, }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "binArrayUpper", + isMut: true, + isSigner: false, }, { - "name": "program", - "isMut": false, - "isSigner": false - } - ], - "args": [ + name: "sender", + isMut: false, + isSigner: true, + }, { - "name": "rewardIndex", - "type": "u64" + name: "tokenProgram", + isMut: false, + isSigner: false, }, { - "name": "amount", - "type": "u64" + name: "eventAuthority", + isMut: false, + isSigner: false, }, { - "name": "carryForward", - "type": "bool" - } - ] + name: "program", + isMut: false, + isSigner: false, + }, + ], + args: [ + { + name: "parameter", + type: { + defined: "AddLiquiditySingleSidePreciseParameter", + }, + }, + ], }, { - "name": "updateRewardFunder", - "accounts": [ + name: "goToABin", + accounts: [ { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "lbPair", + isMut: true, + isSigner: false, }, { - "name": "admin", - "isMut": false, - "isSigner": true + name: "binArrayBitmapExtension", + isMut: false, + isSigner: false, + isOptional: true, }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "fromBinArray", + isMut: false, + isSigner: false, + isOptional: true, }, { - "name": "program", - "isMut": false, - "isSigner": false - } - ], - "args": [ + name: "toBinArray", + isMut: false, + isSigner: false, + isOptional: true, + }, { - "name": "rewardIndex", - "type": "u64" + name: "eventAuthority", + isMut: false, + isSigner: false, }, { - "name": "newFunder", - "type": "publicKey" - } - ] + name: "program", + isMut: false, + isSigner: false, + }, + ], + args: [ + { + name: "binId", + type: "i32", + }, + ], }, { - "name": "updateRewardDuration", - "accounts": [ + name: "setPreActivationDuration", + accounts: [ { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "lbPair", + isMut: true, + isSigner: false, }, { - "name": "admin", - "isMut": false, - "isSigner": true + name: "creator", + isMut: false, + isSigner: true, }, + ], + args: [ { - "name": "binArray", - "isMut": true, - "isSigner": false + name: "preActivationDuration", + type: "u64", }, + ], + }, + { + name: "setPreActivationSwapAddress", + accounts: [ { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "lbPair", + isMut: true, + isSigner: false, }, { - "name": "program", - "isMut": false, - "isSigner": false - } + name: "creator", + isMut: false, + isSigner: true, + }, ], - "args": [ + args: [ { - "name": "rewardIndex", - "type": "u64" + name: "preActivationSwapAddress", + type: "publicKey", }, - { - "name": "newDuration", - "type": "u64" - } - ] + ], }, { - "name": "claimReward", - "accounts": [ + name: "initializeTokenBadge", + accounts: [ { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "tokenMint", + isMut: false, + isSigner: false, }, { - "name": "position", - "isMut": true, - "isSigner": false + name: "tokenBadge", + isMut: true, + isSigner: false, }, { - "name": "binArrayLower", - "isMut": true, - "isSigner": false + name: "admin", + isMut: true, + isSigner: true, }, { - "name": "binArrayUpper", - "isMut": true, - "isSigner": false + name: "systemProgram", + isMut: false, + isSigner: false, }, + ], + args: [], + }, + { + name: "initializeLbPair2", + accounts: [ { - "name": "sender", - "isMut": false, - "isSigner": true + name: "lbPair", + isMut: true, + isSigner: false, }, { - "name": "rewardVault", - "isMut": true, - "isSigner": false + name: "binArrayBitmapExtension", + isMut: true, + isSigner: false, + isOptional: true, }, { - "name": "rewardMint", - "isMut": false, - "isSigner": false + name: "tokenMintX", + isMut: false, + isSigner: false, }, { - "name": "userTokenAccount", - "isMut": true, - "isSigner": false + name: "tokenMintY", + isMut: false, + isSigner: false, }, { - "name": "tokenProgram", - "isMut": false, - "isSigner": false + name: "reserveX", + isMut: true, + isSigner: false, }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "reserveY", + isMut: true, + isSigner: false, }, { - "name": "program", - "isMut": false, - "isSigner": false - } - ], - "args": [ - { - "name": "rewardIndex", - "type": "u64" - } - ] - }, - { - "name": "claimFee", - "accounts": [ - { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "oracle", + isMut: true, + isSigner: false, }, { - "name": "position", - "isMut": true, - "isSigner": false + name: "presetParameter", + isMut: false, + isSigner: false, }, { - "name": "binArrayLower", - "isMut": true, - "isSigner": false + name: "funder", + isMut: true, + isSigner: true, }, { - "name": "binArrayUpper", - "isMut": true, - "isSigner": false + name: "tokenBadgeX", + isMut: false, + isSigner: false, + isOptional: true, }, { - "name": "sender", - "isMut": false, - "isSigner": true + name: "tokenBadgeY", + isMut: false, + isSigner: false, + isOptional: true, }, { - "name": "reserveX", - "isMut": true, - "isSigner": false + name: "tokenProgramX", + isMut: false, + isSigner: false, }, { - "name": "reserveY", - "isMut": true, - "isSigner": false + name: "tokenProgramY", + isMut: false, + isSigner: false, }, { - "name": "userTokenX", - "isMut": true, - "isSigner": false + name: "systemProgram", + isMut: false, + isSigner: false, }, { - "name": "userTokenY", - "isMut": true, - "isSigner": false + name: "rent", + isMut: false, + isSigner: false, }, { - "name": "tokenXMint", - "isMut": false, - "isSigner": false + name: "eventAuthority", + isMut: false, + isSigner: false, }, { - "name": "tokenYMint", - "isMut": false, - "isSigner": false + name: "program", + isMut: false, + isSigner: false, }, + ], + args: [ { - "name": "tokenProgram", - "isMut": false, - "isSigner": false + name: "activeId", + type: "i32", }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "binStep", + type: "u16", }, - { - "name": "program", - "isMut": false, - "isSigner": false - } ], - "args": [] }, { - "name": "closePosition", - "accounts": [ + name: "claimFee2", + accounts: [ { - "name": "position", - "isMut": true, - "isSigner": false + name: "lbPair", + isMut: true, + isSigner: false, }, { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "position", + isMut: true, + isSigner: false, }, { - "name": "binArrayLower", - "isMut": true, - "isSigner": false + name: "sender", + isMut: false, + isSigner: true, }, { - "name": "binArrayUpper", - "isMut": true, - "isSigner": false + name: "reserveX", + isMut: true, + isSigner: false, }, { - "name": "sender", - "isMut": false, - "isSigner": true + name: "reserveY", + isMut: true, + isSigner: false, }, { - "name": "rentReceiver", - "isMut": true, - "isSigner": false + name: "userTokenX", + isMut: true, + isSigner: false, }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "userTokenY", + isMut: true, + isSigner: false, }, { - "name": "program", - "isMut": false, - "isSigner": false - } - ], - "args": [] - }, - { - "name": "updateFeeParameters", - "accounts": [ + name: "tokenXMint", + isMut: false, + isSigner: false, + }, { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "tokenYMint", + isMut: false, + isSigner: false, }, { - "name": "admin", - "isMut": false, - "isSigner": true + name: "tokenProgramX", + isMut: false, + isSigner: false, }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "tokenProgramY", + isMut: false, + isSigner: false, }, { - "name": "program", - "isMut": false, - "isSigner": false - } + name: "memoProgram", + isMut: false, + isSigner: false, + }, + { + name: "eventAuthority", + isMut: false, + isSigner: false, + }, + { + name: "program", + isMut: false, + isSigner: false, + }, ], - "args": [ + args: [ { - "name": "feeParameter", - "type": { - "defined": "FeeParameter" - } - } - ] + name: "minBinId", + type: "i32", + }, + { + name: "maxBinId", + type: "i32", + }, + { + name: "remainingAccountsInfo", + type: { + defined: "RemainingAccountsInfo", + }, + }, + ], }, { - "name": "increaseOracleLength", - "accounts": [ + name: "claimReward2", + accounts: [ { - "name": "oracle", - "isMut": true, - "isSigner": false + name: "lbPair", + isMut: true, + isSigner: false, }, { - "name": "funder", - "isMut": true, - "isSigner": true + name: "position", + isMut: true, + isSigner: false, }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false + name: "sender", + isMut: false, + isSigner: true, }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "rewardVault", + isMut: true, + isSigner: false, }, { - "name": "program", - "isMut": false, - "isSigner": false - } - ], - "args": [ - { - "name": "lengthToAdd", - "type": "u64" - } - ] - }, - { - "name": "initializePresetParameter", - "accounts": [ + name: "rewardMint", + isMut: false, + isSigner: false, + }, { - "name": "presetParameter", - "isMut": true, - "isSigner": false + name: "userTokenAccount", + isMut: true, + isSigner: false, }, { - "name": "admin", - "isMut": true, - "isSigner": true + name: "tokenProgram", + isMut: false, + isSigner: false, }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false + name: "memoProgram", + isMut: false, + isSigner: false, }, { - "name": "rent", - "isMut": false, - "isSigner": false - } - ], - "args": [ + name: "eventAuthority", + isMut: false, + isSigner: false, + }, { - "name": "ix", - "type": { - "defined": "InitPresetParametersIx" - } - } - ] - }, - { - "name": "closePresetParameter", - "accounts": [ + name: "program", + isMut: false, + isSigner: false, + }, + ], + args: [ { - "name": "presetParameter", - "isMut": true, - "isSigner": false + name: "rewardIndex", + type: "u64", }, { - "name": "admin", - "isMut": true, - "isSigner": true + name: "minBinId", + type: "i32", }, { - "name": "rentReceiver", - "isMut": true, - "isSigner": false - } + name: "maxBinId", + type: "i32", + }, + { + name: "remainingAccountsInfo", + type: { + defined: "RemainingAccountsInfo", + }, + }, ], - "args": [] }, { - "name": "removeAllLiquidity", - "accounts": [ + name: "addLiquidity2", + accounts: [ + { + name: "position", + isMut: true, + isSigner: false, + }, { - "name": "position", - "isMut": true, - "isSigner": false + name: "lbPair", + isMut: true, + isSigner: false, }, { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "binArrayBitmapExtension", + isMut: true, + isSigner: false, + isOptional: true, }, { - "name": "binArrayBitmapExtension", - "isMut": true, - "isSigner": false, - "isOptional": true + name: "userTokenX", + isMut: true, + isSigner: false, }, { - "name": "userTokenX", - "isMut": true, - "isSigner": false + name: "userTokenY", + isMut: true, + isSigner: false, }, { - "name": "userTokenY", - "isMut": true, - "isSigner": false + name: "reserveX", + isMut: true, + isSigner: false, }, { - "name": "reserveX", - "isMut": true, - "isSigner": false + name: "reserveY", + isMut: true, + isSigner: false, }, { - "name": "reserveY", - "isMut": true, - "isSigner": false + name: "tokenXMint", + isMut: false, + isSigner: false, }, { - "name": "tokenXMint", - "isMut": false, - "isSigner": false + name: "tokenYMint", + isMut: false, + isSigner: false, }, { - "name": "tokenYMint", - "isMut": false, - "isSigner": false + name: "sender", + isMut: false, + isSigner: true, }, { - "name": "binArrayLower", - "isMut": true, - "isSigner": false + name: "tokenXProgram", + isMut: false, + isSigner: false, }, { - "name": "binArrayUpper", - "isMut": true, - "isSigner": false + name: "tokenYProgram", + isMut: false, + isSigner: false, }, { - "name": "sender", - "isMut": false, - "isSigner": true + name: "memoProgram", + isMut: false, + isSigner: false, }, { - "name": "tokenXProgram", - "isMut": false, - "isSigner": false + name: "eventAuthority", + isMut: false, + isSigner: false, }, { - "name": "tokenYProgram", - "isMut": false, - "isSigner": false + name: "program", + isMut: false, + isSigner: false, }, + ], + args: [ { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "liquidityParameter", + type: { + defined: "LiquidityParameter", + }, }, { - "name": "program", - "isMut": false, - "isSigner": false - } + name: "remainingAccountsInfo", + type: { + defined: "RemainingAccountsInfo", + }, + }, ], - "args": [] }, { - "name": "removeLiquiditySingleSide", - "accounts": [ + name: "addLiquidityByStrategy2", + accounts: [ { - "name": "position", - "isMut": true, - "isSigner": false + name: "position", + isMut: true, + isSigner: false, }, { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "lbPair", + isMut: true, + isSigner: false, }, { - "name": "binArrayBitmapExtension", - "isMut": true, - "isSigner": false, - "isOptional": true + name: "binArrayBitmapExtension", + isMut: true, + isSigner: false, + isOptional: true, }, { - "name": "userToken", - "isMut": true, - "isSigner": false + name: "userTokenX", + isMut: true, + isSigner: false, }, { - "name": "reserve", - "isMut": true, - "isSigner": false + name: "userTokenY", + isMut: true, + isSigner: false, }, { - "name": "tokenMint", - "isMut": false, - "isSigner": false + name: "reserveX", + isMut: true, + isSigner: false, }, { - "name": "binArrayLower", - "isMut": true, - "isSigner": false + name: "reserveY", + isMut: true, + isSigner: false, }, { - "name": "binArrayUpper", - "isMut": true, - "isSigner": false + name: "tokenXMint", + isMut: false, + isSigner: false, }, { - "name": "sender", - "isMut": false, - "isSigner": true + name: "tokenYMint", + isMut: false, + isSigner: false, }, { - "name": "tokenProgram", - "isMut": false, - "isSigner": false + name: "sender", + isMut: false, + isSigner: true, }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "tokenXProgram", + isMut: false, + isSigner: false, }, { - "name": "program", - "isMut": false, - "isSigner": false - } - ], - "args": [] - }, - { - "name": "togglePairStatus", - "accounts": [ + name: "tokenYProgram", + isMut: false, + isSigner: false, + }, { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "memoProgram", + isMut: false, + isSigner: false, }, { - "name": "admin", - "isMut": false, - "isSigner": true - } + name: "eventAuthority", + isMut: false, + isSigner: false, + }, + { + name: "program", + isMut: false, + isSigner: false, + }, ], - "args": [] - }, - { - "name": "updateWhitelistedWallet", - "accounts": [ + args: [ { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "liquidityParameter", + type: { + defined: "LiquidityParameterByStrategy", + }, }, { - "name": "creator", - "isMut": false, - "isSigner": true - } + name: "remainingAccountsInfo", + type: { + defined: "RemainingAccountsInfo", + }, + }, ], - "args": [ - { - "name": "wallet", - "type": "publicKey" - } - ] }, { - "name": "migratePosition", - "accounts": [ + name: "removeLiquidity2", + accounts: [ { - "name": "positionV2", - "isMut": true, - "isSigner": true + name: "position", + isMut: true, + isSigner: false, }, { - "name": "positionV1", - "isMut": true, - "isSigner": false + name: "lbPair", + isMut: true, + isSigner: false, }, { - "name": "lbPair", - "isMut": false, - "isSigner": false + name: "binArrayBitmapExtension", + isMut: true, + isSigner: false, + isOptional: true, }, { - "name": "binArrayLower", - "isMut": true, - "isSigner": false + name: "userTokenX", + isMut: true, + isSigner: false, }, { - "name": "binArrayUpper", - "isMut": true, - "isSigner": false + name: "userTokenY", + isMut: true, + isSigner: false, }, { - "name": "owner", - "isMut": true, - "isSigner": true + name: "reserveX", + isMut: true, + isSigner: false, }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false + name: "reserveY", + isMut: true, + isSigner: false, }, { - "name": "rentReceiver", - "isMut": true, - "isSigner": false + name: "tokenXMint", + isMut: false, + isSigner: false, }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "tokenYMint", + isMut: false, + isSigner: false, }, { - "name": "program", - "isMut": false, - "isSigner": false - } - ], - "args": [] - }, - { - "name": "migrateBinArray", - "accounts": [ + name: "sender", + isMut: false, + isSigner: true, + }, { - "name": "lbPair", - "isMut": false, - "isSigner": false - } - ], - "args": [] - }, - { - "name": "updateFeesAndRewards", - "accounts": [ + name: "tokenXProgram", + isMut: false, + isSigner: false, + }, { - "name": "position", - "isMut": true, - "isSigner": false + name: "tokenYProgram", + isMut: false, + isSigner: false, }, { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "memoProgram", + isMut: false, + isSigner: false, }, { - "name": "binArrayLower", - "isMut": true, - "isSigner": false + name: "eventAuthority", + isMut: false, + isSigner: false, }, { - "name": "binArrayUpper", - "isMut": true, - "isSigner": false + name: "program", + isMut: false, + isSigner: false, }, + ], + args: [ { - "name": "owner", - "isMut": false, - "isSigner": true - } + name: "binLiquidityRemoval", + type: { + vec: { + defined: "BinLiquidityReduction", + }, + }, + }, + { + name: "remainingAccountsInfo", + type: { + defined: "RemainingAccountsInfo", + }, + }, ], - "args": [] }, { - "name": "withdrawIneligibleReward", - "accounts": [ + name: "removeLiquidityByRange2", + accounts: [ { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "position", + isMut: true, + isSigner: false, }, { - "name": "rewardVault", - "isMut": true, - "isSigner": false + name: "lbPair", + isMut: true, + isSigner: false, }, { - "name": "rewardMint", - "isMut": false, - "isSigner": false + name: "binArrayBitmapExtension", + isMut: true, + isSigner: false, + isOptional: true, }, { - "name": "funderTokenAccount", - "isMut": true, - "isSigner": false + name: "userTokenX", + isMut: true, + isSigner: false, }, { - "name": "funder", - "isMut": false, - "isSigner": true + name: "userTokenY", + isMut: true, + isSigner: false, }, { - "name": "binArray", - "isMut": true, - "isSigner": false + name: "reserveX", + isMut: true, + isSigner: false, }, { - "name": "tokenProgram", - "isMut": false, - "isSigner": false + name: "reserveY", + isMut: true, + isSigner: false, }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "tokenXMint", + isMut: false, + isSigner: false, }, { - "name": "program", - "isMut": false, - "isSigner": false - } - ], - "args": [ + name: "tokenYMint", + isMut: false, + isSigner: false, + }, { - "name": "rewardIndex", - "type": "u64" - } - ] - }, - { - "name": "setActivationPoint", - "accounts": [ + name: "sender", + isMut: false, + isSigner: true, + }, { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "tokenXProgram", + isMut: false, + isSigner: false, }, { - "name": "admin", - "isMut": true, - "isSigner": true - } - ], - "args": [ + name: "tokenYProgram", + isMut: false, + isSigner: false, + }, { - "name": "activationPoint", - "type": "u64" - } - ] - }, - { - "name": "setLockReleasePoint", - "accounts": [ + name: "memoProgram", + isMut: false, + isSigner: false, + }, { - "name": "position", - "isMut": true, - "isSigner": false + name: "eventAuthority", + isMut: false, + isSigner: false, }, { - "name": "lbPair", - "isMut": false, - "isSigner": false + name: "program", + isMut: false, + isSigner: false, }, + ], + args: [ { - "name": "sender", - "isMut": false, - "isSigner": true + name: "fromBinId", + type: "i32", }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "toBinId", + type: "i32", }, { - "name": "program", - "isMut": false, - "isSigner": false - } - ], - "args": [ + name: "bpsToRemove", + type: "u16", + }, { - "name": "newLockReleasePoint", - "type": "u64" - } - ] + name: "remainingAccountsInfo", + type: { + defined: "RemainingAccountsInfo", + }, + }, + ], }, { - "name": "removeLiquidityByRange", - "accounts": [ + name: "swap2", + accounts: [ { - "name": "position", - "isMut": true, - "isSigner": false + name: "lbPair", + isMut: true, + isSigner: false, }, { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "binArrayBitmapExtension", + isMut: false, + isSigner: false, + isOptional: true, }, { - "name": "binArrayBitmapExtension", - "isMut": true, - "isSigner": false, - "isOptional": true + name: "reserveX", + isMut: true, + isSigner: false, }, { - "name": "userTokenX", - "isMut": true, - "isSigner": false + name: "reserveY", + isMut: true, + isSigner: false, }, { - "name": "userTokenY", - "isMut": true, - "isSigner": false + name: "userTokenIn", + isMut: true, + isSigner: false, }, { - "name": "reserveX", - "isMut": true, - "isSigner": false + name: "userTokenOut", + isMut: true, + isSigner: false, }, { - "name": "reserveY", - "isMut": true, - "isSigner": false + name: "tokenXMint", + isMut: false, + isSigner: false, }, { - "name": "tokenXMint", - "isMut": false, - "isSigner": false + name: "tokenYMint", + isMut: false, + isSigner: false, }, { - "name": "tokenYMint", - "isMut": false, - "isSigner": false + name: "oracle", + isMut: true, + isSigner: false, }, { - "name": "binArrayLower", - "isMut": true, - "isSigner": false + name: "hostFeeIn", + isMut: true, + isSigner: false, + isOptional: true, }, { - "name": "binArrayUpper", - "isMut": true, - "isSigner": false + name: "user", + isMut: false, + isSigner: true, }, { - "name": "sender", - "isMut": false, - "isSigner": true + name: "tokenXProgram", + isMut: false, + isSigner: false, }, { - "name": "tokenXProgram", - "isMut": false, - "isSigner": false + name: "tokenYProgram", + isMut: false, + isSigner: false, }, { - "name": "tokenYProgram", - "isMut": false, - "isSigner": false + name: "memoProgram", + isMut: false, + isSigner: false, }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "eventAuthority", + isMut: false, + isSigner: false, }, { - "name": "program", - "isMut": false, - "isSigner": false - } + name: "program", + isMut: false, + isSigner: false, + }, ], - "args": [ + args: [ { - "name": "fromBinId", - "type": "i32" + name: "amountIn", + type: "u64", }, { - "name": "toBinId", - "type": "i32" + name: "minAmountOut", + type: "u64", }, { - "name": "bpsToRemove", - "type": "u16" - } - ] + name: "remainingAccountsInfo", + type: { + defined: "RemainingAccountsInfo", + }, + }, + ], }, { - "name": "addLiquidityOneSidePrecise", - "accounts": [ + name: "swapWithPriceImpact2", + accounts: [ { - "name": "position", - "isMut": true, - "isSigner": false + name: "lbPair", + isMut: true, + isSigner: false, }, { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "binArrayBitmapExtension", + isMut: false, + isSigner: false, + isOptional: true, }, { - "name": "binArrayBitmapExtension", - "isMut": true, - "isSigner": false, - "isOptional": true + name: "reserveX", + isMut: true, + isSigner: false, }, { - "name": "userToken", - "isMut": true, - "isSigner": false + name: "reserveY", + isMut: true, + isSigner: false, }, { - "name": "reserve", - "isMut": true, - "isSigner": false + name: "userTokenIn", + isMut: true, + isSigner: false, }, { - "name": "tokenMint", - "isMut": false, - "isSigner": false + name: "userTokenOut", + isMut: true, + isSigner: false, }, { - "name": "binArrayLower", - "isMut": true, - "isSigner": false + name: "tokenXMint", + isMut: false, + isSigner: false, }, { - "name": "binArrayUpper", - "isMut": true, - "isSigner": false + name: "tokenYMint", + isMut: false, + isSigner: false, }, { - "name": "sender", - "isMut": false, - "isSigner": true + name: "oracle", + isMut: true, + isSigner: false, }, { - "name": "tokenProgram", - "isMut": false, - "isSigner": false + name: "hostFeeIn", + isMut: true, + isSigner: false, + isOptional: true, }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "user", + isMut: false, + isSigner: true, }, { - "name": "program", - "isMut": false, - "isSigner": false - } - ], - "args": [ - { - "name": "parameter", - "type": { - "defined": "AddLiquiditySingleSidePreciseParameter" - } - } - ] - }, - { - "name": "goToABin", - "accounts": [ - { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "tokenXProgram", + isMut: false, + isSigner: false, }, { - "name": "binArrayBitmapExtension", - "isMut": false, - "isSigner": false, - "isOptional": true + name: "tokenYProgram", + isMut: false, + isSigner: false, }, { - "name": "fromBinArray", - "isMut": false, - "isSigner": false, - "isOptional": true + name: "memoProgram", + isMut: false, + isSigner: false, }, { - "name": "toBinArray", - "isMut": false, - "isSigner": false, - "isOptional": true + name: "eventAuthority", + isMut: false, + isSigner: false, }, { - "name": "eventAuthority", - "isMut": false, - "isSigner": false + name: "program", + isMut: false, + isSigner: false, }, - { - "name": "program", - "isMut": false, - "isSigner": false - } ], - "args": [ - { - "name": "binId", - "type": "i32" - } - ] - }, - { - "name": "setPreActivationDuration", - "accounts": [ + args: [ { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "amountIn", + type: "u64", }, { - "name": "creator", - "isMut": false, - "isSigner": true - } - ], - "args": [ - { - "name": "preActivationDuration", - "type": "u16" - } - ] - }, - { - "name": "setPreActivationSwapAddress", - "accounts": [ + name: "activeId", + type: { + option: "i32", + }, + }, { - "name": "lbPair", - "isMut": true, - "isSigner": false + name: "maxPriceImpactBps", + type: "u16", }, { - "name": "creator", - "isMut": false, - "isSigner": true - } + name: "remainingAccountsInfo", + type: { + defined: "RemainingAccountsInfo", + }, + }, ], - "args": [ - { - "name": "preActivationSwapAddress", - "type": "publicKey" - } - ] - } + }, ], - "accounts": [ + accounts: [ { - "name": "binArrayBitmapExtension", - "type": { - "kind": "struct", - "fields": [ + name: "binArrayBitmapExtension", + type: { + kind: "struct", + fields: [ { - "name": "lbPair", - "type": "publicKey" + name: "lbPair", + type: "publicKey", }, { - "name": "positiveBinArrayBitmap", - "docs": [ - "Packed initialized bin array state for start_bin_index is positive" + name: "positiveBinArrayBitmap", + docs: [ + "Packed initialized bin array state for start_bin_index is positive", ], - "type": { - "array": [ + type: { + array: [ { - "array": [ - "u64", - 8 - ] + array: ["u64", 8], }, - 12 - ] - } + 12, + ], + }, }, { - "name": "negativeBinArrayBitmap", - "docs": [ - "Packed initialized bin array state for start_bin_index is negative" + name: "negativeBinArrayBitmap", + docs: [ + "Packed initialized bin array state for start_bin_index is negative", ], - "type": { - "array": [ + type: { + array: [ { - "array": [ - "u64", - 8 - ] + array: ["u64", 8], }, - 12 - ] - } - } - ] - } + 12, + ], + }, + }, + ], + }, }, { - "name": "binArray", - "docs": [ + name: "binArray", + docs: [ "An account to contain a range of bin. For example: Bin 100 <-> 200.", "For example:", "BinArray index: 0 contains bin 0 <-> 599", - "index: 2 contains bin 600 <-> 1199, ..." + "index: 2 contains bin 600 <-> 1199, ...", ], - "type": { - "kind": "struct", - "fields": [ + type: { + kind: "struct", + fields: [ { - "name": "index", - "type": "i64" + name: "index", + type: "i64", }, { - "name": "version", - "docs": [ - "Version of binArray" - ], - "type": "u8" + name: "version", + docs: ["Version of binArray"], + type: "u8", }, { - "name": "padding", - "type": { - "array": [ - "u8", - 7 - ] - } + name: "padding", + type: { + array: ["u8", 7], + }, }, { - "name": "lbPair", - "type": "publicKey" + name: "lbPair", + type: "publicKey", }, { - "name": "bins", - "type": { - "array": [ + name: "bins", + type: { + array: [ { - "defined": "Bin" + defined: "Bin", }, - 70 - ] - } - } - ] - } + 70, + ], + }, + }, + ], + }, }, { - "name": "lbPair", - "type": { - "kind": "struct", - "fields": [ + name: "lbPair", + type: { + kind: "struct", + fields: [ { - "name": "parameters", - "type": { - "defined": "StaticParameters" - } + name: "parameters", + type: { + defined: "StaticParameters", + }, }, { - "name": "vParameters", - "type": { - "defined": "VariableParameters" - } + name: "vParameters", + type: { + defined: "VariableParameters", + }, }, { - "name": "bumpSeed", - "type": { - "array": [ - "u8", - 1 - ] - } + name: "bumpSeed", + type: { + array: ["u8", 1], + }, }, { - "name": "binStepSeed", - "docs": [ - "Bin step signer seed" - ], - "type": { - "array": [ - "u8", - 2 - ] - } + name: "binStepSeed", + docs: ["Bin step signer seed"], + type: { + array: ["u8", 2], + }, }, { - "name": "pairType", - "docs": [ - "Type of the pair" - ], - "type": "u8" + name: "pairType", + docs: ["Type of the pair"], + type: "u8", }, { - "name": "activeId", - "docs": [ - "Active bin id" - ], - "type": "i32" + name: "activeId", + docs: ["Active bin id"], + type: "i32", }, { - "name": "binStep", - "docs": [ - "Bin step. Represent the price increment / decrement." - ], - "type": "u16" + name: "binStep", + docs: ["Bin step. Represent the price increment / decrement."], + type: "u16", }, { - "name": "status", - "docs": [ - "Status of the pair. Check PairStatus enum." - ], - "type": "u8" + name: "status", + docs: ["Status of the pair. Check PairStatus enum."], + type: "u8", }, { - "name": "requireBaseFactorSeed", - "docs": [ - "Require base factor seed" - ], - "type": "u8" + name: "requireBaseFactorSeed", + docs: ["Require base factor seed"], + type: "u8", }, { - "name": "baseFactorSeed", - "docs": [ - "Base factor seed" - ], - "type": { - "array": [ - "u8", - 2 - ] - } + name: "baseFactorSeed", + docs: ["Base factor seed"], + type: { + array: ["u8", 2], + }, }, { - "name": "activationType", - "docs": [ - "Activation type" - ], - "type": "u8" + name: "activationType", + docs: ["Activation type"], + type: "u8", }, { - "name": "padding0", - "docs": [ - "padding 0" - ], - "type": "u8" + name: "padding0", + docs: ["padding 0"], + type: "u8", }, { - "name": "tokenXMint", - "docs": [ - "Token X mint" - ], - "type": "publicKey" + name: "tokenXMint", + docs: ["Token X mint"], + type: "publicKey", }, { - "name": "tokenYMint", - "docs": [ - "Token Y mint" - ], - "type": "publicKey" + name: "tokenYMint", + docs: ["Token Y mint"], + type: "publicKey", }, { - "name": "reserveX", - "docs": [ - "LB token X vault" - ], - "type": "publicKey" + name: "reserveX", + docs: ["LB token X vault"], + type: "publicKey", }, { - "name": "reserveY", - "docs": [ - "LB token Y vault" - ], - "type": "publicKey" + name: "reserveY", + docs: ["LB token Y vault"], + type: "publicKey", }, { - "name": "protocolFee", - "docs": [ - "Uncollected protocol fee" - ], - "type": { - "defined": "ProtocolFee" - } + name: "protocolFee", + docs: ["Uncollected protocol fee"], + type: { + defined: "ProtocolFee", + }, }, { - "name": "padding1", - "docs": [ - "_padding_1, previous Fee owner, BE CAREFUL FOR TOMBSTONE WHEN REUSE !!" + name: "padding1", + docs: [ + "_padding_1, previous Fee owner, BE CAREFUL FOR TOMBSTONE WHEN REUSE !!", ], - "type": { - "array": [ - "u8", - 32 - ] - } + type: { + array: ["u8", 32], + }, }, { - "name": "rewardInfos", - "docs": [ - "Farming reward information" - ], - "type": { - "array": [ + name: "rewardInfos", + docs: ["Farming reward information"], + type: { + array: [ { - "defined": "RewardInfo" + defined: "RewardInfo", }, - 2 - ] - } + 2, + ], + }, }, { - "name": "oracle", - "docs": [ - "Oracle pubkey" - ], - "type": "publicKey" + name: "oracle", + docs: ["Oracle pubkey"], + type: "publicKey", }, { - "name": "binArrayBitmap", - "docs": [ - "Packed initialized bin array state" - ], - "type": { - "array": [ - "u64", - 16 - ] - } + name: "binArrayBitmap", + docs: ["Packed initialized bin array state"], + type: { + array: ["u64", 16], + }, }, { - "name": "lastUpdatedAt", - "docs": [ - "Last time the pool fee parameter was updated" - ], - "type": "i64" + name: "lastUpdatedAt", + docs: ["Last time the pool fee parameter was updated"], + type: "i64", }, { - "name": "whitelistedWallet", - "docs": [ - "Whitelisted wallet" - ], - "type": "publicKey" + name: "whitelistedWallet", + docs: ["Whitelisted wallet"], + type: "publicKey", }, { - "name": "preActivationSwapAddress", - "docs": [ - "Address allowed to swap when the current point is greater than or equal to the pre-activation point. The pre-activation point is calculated as `activation_point - pre_activation_duration`." + name: "preActivationSwapAddress", + docs: [ + "Address allowed to swap when the current point is greater than or equal to the pre-activation point. The pre-activation point is calculated as `activation_point - pre_activation_duration`.", ], - "type": "publicKey" + type: "publicKey", }, { - "name": "baseKey", - "docs": [ - "Base keypair. Only required for permission pair" - ], - "type": "publicKey" + name: "baseKey", + docs: ["Base keypair. Only required for permission pair"], + type: "publicKey", }, { - "name": "activationPoint", - "docs": [ - "Time point to enable the pair. Only applicable for permission pair." + name: "activationPoint", + docs: [ + "Time point to enable the pair. Only applicable for permission pair.", ], - "type": "u64" + type: "u64", }, { - "name": "preActivationDuration", - "docs": [ - "Duration before activation activation_point. Used to calculate pre-activation time point for pre_activation_swap_address" + name: "preActivationDuration", + docs: [ + "Duration before activation activation_point. Used to calculate pre-activation time point for pre_activation_swap_address", ], - "type": "u64" + type: "u64", }, { - "name": "padding2", - "docs": [ - "_padding 2 is reclaimed free space from swap_cap_deactivate_point and swap_cap_amount before, BE CAREFUL FOR TOMBSTONE WHEN REUSE !!" + name: "padding2", + docs: [ + "_padding 2 is reclaimed free space from swap_cap_deactivate_point and swap_cap_amount before, BE CAREFUL FOR TOMBSTONE WHEN REUSE !!", ], - "type": { - "array": [ - "u8", - 8 - ] - } + type: { + array: ["u8", 8], + }, }, { - "name": "lockDuration", - "docs": [ - "Liquidity lock duration for positions which created before activate. Only applicable for permission pair." + name: "lockDuration", + docs: [ + "Liquidity lock duration for positions which created before activate. Only applicable for permission pair.", ], - "type": "u64" + type: "u64", }, { - "name": "creator", - "docs": [ - "Pool creator" - ], - "type": "publicKey" + name: "creator", + docs: ["Pool creator"], + type: "publicKey", }, { - "name": "reserved", - "docs": [ - "Reserved space for future use" - ], - "type": { - "array": [ - "u8", - 24 - ] - } - } - ] - } + name: "tokenMintXProgramFlag", + docs: ["token_mint_x_program_flag"], + type: "u8", + }, + { + name: "tokenMintYProgramFlag", + docs: ["token_mint_y_program_flag"], + type: "u8", + }, + { + name: "reserved", + docs: ["Reserved space for future use"], + type: { + array: ["u8", 22], + }, + }, + ], + }, }, { - "name": "oracle", - "type": { - "kind": "struct", - "fields": [ + name: "oracle", + type: { + kind: "struct", + fields: [ { - "name": "idx", - "docs": [ - "Index of latest observation" - ], - "type": "u64" + name: "idx", + docs: ["Index of latest observation"], + type: "u64", }, { - "name": "activeSize", - "docs": [ - "Size of active sample. Active sample is initialized observation." + name: "activeSize", + docs: [ + "Size of active sample. Active sample is initialized observation.", ], - "type": "u64" + type: "u64", }, { - "name": "length", - "docs": [ - "Number of observations" - ], - "type": "u64" - } - ] - } + name: "length", + docs: ["Number of observations"], + type: "u64", + }, + ], + }, }, { - "name": "position", - "type": { - "kind": "struct", - "fields": [ + name: "position", + type: { + kind: "struct", + fields: [ { - "name": "lbPair", - "docs": [ - "The LB pair of this position" - ], - "type": "publicKey" + name: "lbPair", + docs: ["The LB pair of this position"], + type: "publicKey", }, { - "name": "owner", - "docs": [ - "Owner of the position. Client rely on this to to fetch their positions." + name: "owner", + docs: [ + "Owner of the position. Client rely on this to to fetch their positions.", ], - "type": "publicKey" + type: "publicKey", }, { - "name": "liquidityShares", - "docs": [ - "Liquidity shares of this position in bins (lower_bin_id <-> upper_bin_id). This is the same as LP concept." + name: "liquidityShares", + docs: [ + "Liquidity shares of this position in bins (lower_bin_id <-> upper_bin_id). This is the same as LP concept.", ], - "type": { - "array": [ - "u64", - 70 - ] - } + type: { + array: ["u64", 70], + }, }, { - "name": "rewardInfos", - "docs": [ - "Farming reward information" - ], - "type": { - "array": [ + name: "rewardInfos", + docs: ["Farming reward information"], + type: { + array: [ { - "defined": "UserRewardInfo" + defined: "UserRewardInfo", }, - 70 - ] - } + 70, + ], + }, }, { - "name": "feeInfos", - "docs": [ - "Swap fee to claim information" - ], - "type": { - "array": [ + name: "feeInfos", + docs: ["Swap fee to claim information"], + type: { + array: [ { - "defined": "FeeInfo" + defined: "FeeInfo", }, - 70 - ] - } + 70, + ], + }, }, { - "name": "lowerBinId", - "docs": [ - "Lower bin ID" - ], - "type": "i32" + name: "lowerBinId", + docs: ["Lower bin ID"], + type: "i32", }, { - "name": "upperBinId", - "docs": [ - "Upper bin ID" - ], - "type": "i32" + name: "upperBinId", + docs: ["Upper bin ID"], + type: "i32", }, { - "name": "lastUpdatedAt", - "docs": [ - "Last updated timestamp" - ], - "type": "i64" + name: "lastUpdatedAt", + docs: ["Last updated timestamp"], + type: "i64", }, { - "name": "totalClaimedFeeXAmount", - "docs": [ - "Total claimed token fee X" - ], - "type": "u64" + name: "totalClaimedFeeXAmount", + docs: ["Total claimed token fee X"], + type: "u64", }, { - "name": "totalClaimedFeeYAmount", - "docs": [ - "Total claimed token fee Y" - ], - "type": "u64" + name: "totalClaimedFeeYAmount", + docs: ["Total claimed token fee Y"], + type: "u64", }, { - "name": "totalClaimedRewards", - "docs": [ - "Total claimed rewards" - ], - "type": { - "array": [ - "u64", - 2 - ] - } + name: "totalClaimedRewards", + docs: ["Total claimed rewards"], + type: { + array: ["u64", 2], + }, }, { - "name": "reserved", - "docs": [ - "Reserved space for future use" - ], - "type": { - "array": [ - "u8", - 160 - ] - } - } - ] - } + name: "reserved", + docs: ["Reserved space for future use"], + type: { + array: ["u8", 160], + }, + }, + ], + }, }, { - "name": "positionV2", - "type": { - "kind": "struct", - "fields": [ + name: "positionV2", + type: { + kind: "struct", + fields: [ { - "name": "lbPair", - "docs": [ - "The LB pair of this position" - ], - "type": "publicKey" + name: "lbPair", + docs: ["The LB pair of this position"], + type: "publicKey", }, { - "name": "owner", - "docs": [ - "Owner of the position. Client rely on this to to fetch their positions." + name: "owner", + docs: [ + "Owner of the position. Client rely on this to to fetch their positions.", ], - "type": "publicKey" + type: "publicKey", }, { - "name": "liquidityShares", - "docs": [ - "Liquidity shares of this position in bins (lower_bin_id <-> upper_bin_id). This is the same as LP concept." + name: "liquidityShares", + docs: [ + "Liquidity shares of this position in bins (lower_bin_id <-> upper_bin_id). This is the same as LP concept.", ], - "type": { - "array": [ - "u128", - 70 - ] - } + type: { + array: ["u128", 70], + }, }, { - "name": "rewardInfos", - "docs": [ - "Farming reward information" - ], - "type": { - "array": [ + name: "rewardInfos", + docs: ["Farming reward information"], + type: { + array: [ { - "defined": "UserRewardInfo" + defined: "UserRewardInfo", }, - 70 - ] - } + 70, + ], + }, }, { - "name": "feeInfos", - "docs": [ - "Swap fee to claim information" - ], - "type": { - "array": [ + name: "feeInfos", + docs: ["Swap fee to claim information"], + type: { + array: [ { - "defined": "FeeInfo" + defined: "FeeInfo", }, - 70 - ] - } + 70, + ], + }, }, { - "name": "lowerBinId", - "docs": [ - "Lower bin ID" - ], - "type": "i32" + name: "lowerBinId", + docs: ["Lower bin ID"], + type: "i32", }, { - "name": "upperBinId", - "docs": [ - "Upper bin ID" - ], - "type": "i32" + name: "upperBinId", + docs: ["Upper bin ID"], + type: "i32", }, { - "name": "lastUpdatedAt", - "docs": [ - "Last updated timestamp" - ], - "type": "i64" + name: "lastUpdatedAt", + docs: ["Last updated timestamp"], + type: "i64", }, { - "name": "totalClaimedFeeXAmount", - "docs": [ - "Total claimed token fee X" - ], - "type": "u64" + name: "totalClaimedFeeXAmount", + docs: ["Total claimed token fee X"], + type: "u64", }, { - "name": "totalClaimedFeeYAmount", - "docs": [ - "Total claimed token fee Y" - ], - "type": "u64" + name: "totalClaimedFeeYAmount", + docs: ["Total claimed token fee Y"], + type: "u64", }, { - "name": "totalClaimedRewards", - "docs": [ - "Total claimed rewards" - ], - "type": { - "array": [ - "u64", - 2 - ] - } + name: "totalClaimedRewards", + docs: ["Total claimed rewards"], + type: { + array: ["u64", 2], + }, }, { - "name": "operator", - "docs": [ - "Operator of position" - ], - "type": "publicKey" + name: "operator", + docs: ["Operator of position"], + type: "publicKey", }, { - "name": "lockReleasePoint", - "docs": [ - "Time point which the locked liquidity can be withdraw" - ], - "type": "u64" + name: "lockReleasePoint", + docs: ["Time point which the locked liquidity can be withdraw"], + type: "u64", }, { - "name": "subjectedToBootstrapLiquidityLocking", - "docs": [ - "Is the position subjected to liquidity locking for the launch pool." + name: "subjectedToBootstrapLiquidityLocking", + docs: [ + "Is the position subjected to liquidity locking for the launch pool.", ], - "type": "u8" + type: "u8", }, { - "name": "feeOwner", - "docs": [ - "Address is able to claim fee in this position, only valid for bootstrap_liquidity_position" + name: "feeOwner", + docs: [ + "Address is able to claim fee in this position, only valid for bootstrap_liquidity_position", ], - "type": "publicKey" + type: "publicKey", }, { - "name": "reserved", - "docs": [ - "Reserved space for future use" - ], - "type": { - "array": [ - "u8", - 87 - ] - } - } - ] - } + name: "reserved", + docs: ["Reserved space for future use"], + type: { + array: ["u8", 87], + }, + }, + ], + }, }, { - "name": "presetParameter", - "type": { - "kind": "struct", - "fields": [ + name: "presetParameter", + type: { + kind: "struct", + fields: [ { - "name": "binStep", - "docs": [ - "Bin step. Represent the price increment / decrement." - ], - "type": "u16" + name: "binStep", + docs: ["Bin step. Represent the price increment / decrement."], + type: "u16", }, { - "name": "baseFactor", - "docs": [ - "Used for base fee calculation. base_fee_rate = base_factor * bin_step" + name: "baseFactor", + docs: [ + "Used for base fee calculation. base_fee_rate = base_factor * bin_step", ], - "type": "u16" + type: "u16", }, { - "name": "filterPeriod", - "docs": [ - "Filter period determine high frequency trading time window." + name: "filterPeriod", + docs: [ + "Filter period determine high frequency trading time window.", ], - "type": "u16" + type: "u16", }, { - "name": "decayPeriod", - "docs": [ - "Decay period determine when the volatile fee start decay / decrease." + name: "decayPeriod", + docs: [ + "Decay period determine when the volatile fee start decay / decrease.", ], - "type": "u16" + type: "u16", }, { - "name": "reductionFactor", - "docs": [ - "Reduction factor controls the volatile fee rate decrement rate." + name: "reductionFactor", + docs: [ + "Reduction factor controls the volatile fee rate decrement rate.", ], - "type": "u16" + type: "u16", }, { - "name": "variableFeeControl", - "docs": [ - "Used to scale the variable fee component depending on the dynamic of the market" + name: "variableFeeControl", + docs: [ + "Used to scale the variable fee component depending on the dynamic of the market", ], - "type": "u32" + type: "u32", }, { - "name": "maxVolatilityAccumulator", - "docs": [ - "Maximum number of bin crossed can be accumulated. Used to cap volatile fee rate." + name: "maxVolatilityAccumulator", + docs: [ + "Maximum number of bin crossed can be accumulated. Used to cap volatile fee rate.", ], - "type": "u32" + type: "u32", }, { - "name": "minBinId", - "docs": [ - "Min bin id supported by the pool based on the configured bin step." + name: "minBinId", + docs: [ + "Min bin id supported by the pool based on the configured bin step.", ], - "type": "i32" + type: "i32", }, { - "name": "maxBinId", - "docs": [ - "Max bin id supported by the pool based on the configured bin step." + name: "maxBinId", + docs: [ + "Max bin id supported by the pool based on the configured bin step.", ], - "type": "i32" + type: "i32", }, { - "name": "protocolShare", - "docs": [ - "Portion of swap fees retained by the protocol by controlling protocol_share parameter. protocol_swap_fee = protocol_share * total_swap_fee" + name: "protocolShare", + docs: [ + "Portion of swap fees retained by the protocol by controlling protocol_share parameter. protocol_swap_fee = protocol_share * total_swap_fee", ], - "type": "u16" - } - ] - } - } + type: "u16", + }, + ], + }, + }, + { + name: "tokenBadge", + docs: ["Parameter that set by the protocol"], + type: { + kind: "struct", + fields: [ + { + name: "tokenMint", + docs: ["token mint"], + type: "publicKey", + }, + { + name: "padding", + docs: ["Reserve"], + type: { + array: ["u8", 128], + }, + }, + ], + }, + }, ], - "types": [ + types: [ { - "name": "LiquidityParameterByStrategyOneSide", - "type": { - "kind": "struct", - "fields": [ + name: "LiquidityParameterByStrategyOneSide", + type: { + kind: "struct", + fields: [ { - "name": "amount", - "docs": [ - "Amount of X token or Y token to deposit" - ], - "type": "u64" + name: "amount", + docs: ["Amount of X token or Y token to deposit"], + type: "u64", }, { - "name": "activeId", - "docs": [ - "Active bin that integrator observe off-chain" - ], - "type": "i32" + name: "activeId", + docs: ["Active bin that integrator observe off-chain"], + type: "i32", }, { - "name": "maxActiveBinSlippage", - "docs": [ - "max active bin slippage allowed" - ], - "type": "i32" + name: "maxActiveBinSlippage", + docs: ["max active bin slippage allowed"], + type: "i32", }, { - "name": "strategyParameters", - "docs": [ - "strategy parameters" - ], - "type": { - "defined": "StrategyParameters" - } - } - ] - } + name: "strategyParameters", + docs: ["strategy parameters"], + type: { + defined: "StrategyParameters", + }, + }, + ], + }, }, { - "name": "LiquidityParameterByStrategy", - "type": { - "kind": "struct", - "fields": [ + name: "LiquidityParameterByStrategy", + type: { + kind: "struct", + fields: [ { - "name": "amountX", - "docs": [ - "Amount of X token to deposit" - ], - "type": "u64" + name: "amountX", + docs: ["Amount of X token to deposit"], + type: "u64", }, { - "name": "amountY", - "docs": [ - "Amount of Y token to deposit" - ], - "type": "u64" + name: "amountY", + docs: ["Amount of Y token to deposit"], + type: "u64", }, { - "name": "activeId", - "docs": [ - "Active bin that integrator observe off-chain" - ], - "type": "i32" + name: "activeId", + docs: ["Active bin that integrator observe off-chain"], + type: "i32", }, { - "name": "maxActiveBinSlippage", - "docs": [ - "max active bin slippage allowed" - ], - "type": "i32" + name: "maxActiveBinSlippage", + docs: ["max active bin slippage allowed"], + type: "i32", }, { - "name": "strategyParameters", - "docs": [ - "strategy parameters" - ], - "type": { - "defined": "StrategyParameters" - } - } - ] - } + name: "strategyParameters", + docs: ["strategy parameters"], + type: { + defined: "StrategyParameters", + }, + }, + ], + }, }, { - "name": "StrategyParameters", - "type": { - "kind": "struct", - "fields": [ + name: "StrategyParameters", + type: { + kind: "struct", + fields: [ { - "name": "minBinId", - "docs": [ - "min bin id" - ], - "type": "i32" + name: "minBinId", + docs: ["min bin id"], + type: "i32", }, { - "name": "maxBinId", - "docs": [ - "max bin id" - ], - "type": "i32" + name: "maxBinId", + docs: ["max bin id"], + type: "i32", }, { - "name": "strategyType", - "docs": [ - "strategy type" - ], - "type": { - "defined": "StrategyType" - } + name: "strategyType", + docs: ["strategy type"], + type: { + defined: "StrategyType", + }, }, { - "name": "parameteres", - "docs": [ - "parameters" - ], - "type": { - "array": [ - "u8", - 64 - ] - } - } - ] - } + name: "parameteres", + docs: ["parameters"], + type: { + array: ["u8", 64], + }, + }, + ], + }, }, { - "name": "LiquidityOneSideParameter", - "type": { - "kind": "struct", - "fields": [ + name: "LiquidityOneSideParameter", + type: { + kind: "struct", + fields: [ { - "name": "amount", - "docs": [ - "Amount of X token or Y token to deposit" - ], - "type": "u64" + name: "amount", + docs: ["Amount of X token or Y token to deposit"], + type: "u64", }, { - "name": "activeId", - "docs": [ - "Active bin that integrator observe off-chain" - ], - "type": "i32" + name: "activeId", + docs: ["Active bin that integrator observe off-chain"], + type: "i32", }, { - "name": "maxActiveBinSlippage", - "docs": [ - "max active bin slippage allowed" - ], - "type": "i32" + name: "maxActiveBinSlippage", + docs: ["max active bin slippage allowed"], + type: "i32", }, { - "name": "binLiquidityDist", - "docs": [ - "Liquidity distribution to each bins" - ], - "type": { - "vec": { - "defined": "BinLiquidityDistributionByWeight" - } - } - } - ] - } + name: "binLiquidityDist", + docs: ["Liquidity distribution to each bins"], + type: { + vec: { + defined: "BinLiquidityDistributionByWeight", + }, + }, + }, + ], + }, }, { - "name": "BinLiquidityDistributionByWeight", - "type": { - "kind": "struct", - "fields": [ + name: "BinLiquidityDistributionByWeight", + type: { + kind: "struct", + fields: [ { - "name": "binId", - "docs": [ - "Define the bin ID wish to deposit to." - ], - "type": "i32" + name: "binId", + docs: ["Define the bin ID wish to deposit to."], + type: "i32", }, { - "name": "weight", - "docs": [ - "weight of liquidity distributed for this bin id" - ], - "type": "u16" - } - ] - } + name: "weight", + docs: ["weight of liquidity distributed for this bin id"], + type: "u16", + }, + ], + }, }, { - "name": "LiquidityParameterByWeight", - "type": { - "kind": "struct", - "fields": [ + name: "LiquidityParameterByWeight", + type: { + kind: "struct", + fields: [ { - "name": "amountX", - "docs": [ - "Amount of X token to deposit" - ], - "type": "u64" + name: "amountX", + docs: ["Amount of X token to deposit"], + type: "u64", }, { - "name": "amountY", - "docs": [ - "Amount of Y token to deposit" - ], - "type": "u64" + name: "amountY", + docs: ["Amount of Y token to deposit"], + type: "u64", }, { - "name": "activeId", - "docs": [ - "Active bin that integrator observe off-chain" - ], - "type": "i32" + name: "activeId", + docs: ["Active bin that integrator observe off-chain"], + type: "i32", }, { - "name": "maxActiveBinSlippage", - "docs": [ - "max active bin slippage allowed" - ], - "type": "i32" + name: "maxActiveBinSlippage", + docs: ["max active bin slippage allowed"], + type: "i32", }, { - "name": "binLiquidityDist", - "docs": [ - "Liquidity distribution to each bins" - ], - "type": { - "vec": { - "defined": "BinLiquidityDistributionByWeight" - } - } - } - ] - } + name: "binLiquidityDist", + docs: ["Liquidity distribution to each bins"], + type: { + vec: { + defined: "BinLiquidityDistributionByWeight", + }, + }, + }, + ], + }, }, { - "name": "AddLiquiditySingleSidePreciseParameter", - "type": { - "kind": "struct", - "fields": [ + name: "AddLiquiditySingleSidePreciseParameter", + type: { + kind: "struct", + fields: [ { - "name": "bins", - "type": { - "vec": { - "defined": "CompressedBinDepositAmount" - } - } + name: "bins", + type: { + vec: { + defined: "CompressedBinDepositAmount", + }, + }, }, { - "name": "decompressMultiplier", - "type": "u64" - } - ] - } + name: "decompressMultiplier", + type: "u64", + }, + ], + }, }, { - "name": "CompressedBinDepositAmount", - "type": { - "kind": "struct", - "fields": [ + name: "CompressedBinDepositAmount", + type: { + kind: "struct", + fields: [ { - "name": "binId", - "type": "i32" + name: "binId", + type: "i32", }, { - "name": "amount", - "type": "u32" - } - ] - } + name: "amount", + type: "u32", + }, + ], + }, }, { - "name": "BinLiquidityDistribution", - "type": { - "kind": "struct", - "fields": [ + name: "BinLiquidityDistribution", + type: { + kind: "struct", + fields: [ { - "name": "binId", - "docs": [ - "Define the bin ID wish to deposit to." - ], - "type": "i32" + name: "binId", + docs: ["Define the bin ID wish to deposit to."], + type: "i32", }, { - "name": "distributionX", - "docs": [ - "DistributionX (or distributionY) is the percentages of amountX (or amountY) you want to add to each bin." + name: "distributionX", + docs: [ + "DistributionX (or distributionY) is the percentages of amountX (or amountY) you want to add to each bin.", ], - "type": "u16" + type: "u16", }, { - "name": "distributionY", - "docs": [ - "DistributionX (or distributionY) is the percentages of amountX (or amountY) you want to add to each bin." + name: "distributionY", + docs: [ + "DistributionX (or distributionY) is the percentages of amountX (or amountY) you want to add to each bin.", ], - "type": "u16" - } - ] - } + type: "u16", + }, + ], + }, }, { - "name": "LiquidityParameter", - "type": { - "kind": "struct", - "fields": [ + name: "LiquidityParameter", + type: { + kind: "struct", + fields: [ { - "name": "amountX", - "docs": [ - "Amount of X token to deposit" - ], - "type": "u64" + name: "amountX", + docs: ["Amount of X token to deposit"], + type: "u64", }, { - "name": "amountY", - "docs": [ - "Amount of Y token to deposit" - ], - "type": "u64" + name: "amountY", + docs: ["Amount of Y token to deposit"], + type: "u64", }, { - "name": "binLiquidityDist", - "docs": [ - "Liquidity distribution to each bins" - ], - "type": { - "vec": { - "defined": "BinLiquidityDistribution" - } - } - } - ] - } + name: "binLiquidityDist", + docs: ["Liquidity distribution to each bins"], + type: { + vec: { + defined: "BinLiquidityDistribution", + }, + }, + }, + ], + }, }, { - "name": "InitPermissionPairIx", - "type": { - "kind": "struct", - "fields": [ + name: "InitPermissionPairIx", + type: { + kind: "struct", + fields: [ { - "name": "activeId", - "type": "i32" + name: "activeId", + type: "i32", }, { - "name": "binStep", - "type": "u16" + name: "binStep", + type: "u16", }, { - "name": "baseFactor", - "type": "u16" + name: "baseFactor", + type: "u16", }, { - "name": "minBinId", - "type": "i32" + name: "minBinId", + type: "i32", }, { - "name": "maxBinId", - "type": "i32" + name: "maxBinId", + type: "i32", }, { - "name": "lockDuration", - "type": "u64" + name: "lockDuration", + type: "u64", }, { - "name": "activationType", - "type": "u8" - } - ] - } + name: "activationType", + type: "u8", + }, + ], + }, }, { - "name": "InitPresetParametersIx", - "type": { - "kind": "struct", - "fields": [ + name: "InitPresetParametersIx", + type: { + kind: "struct", + fields: [ { - "name": "binStep", - "docs": [ - "Bin step. Represent the price increment / decrement." - ], - "type": "u16" + name: "binStep", + docs: ["Bin step. Represent the price increment / decrement."], + type: "u16", }, { - "name": "baseFactor", - "docs": [ - "Used for base fee calculation. base_fee_rate = base_factor * bin_step" + name: "baseFactor", + docs: [ + "Used for base fee calculation. base_fee_rate = base_factor * bin_step", ], - "type": "u16" + type: "u16", }, { - "name": "filterPeriod", - "docs": [ - "Filter period determine high frequency trading time window." + name: "filterPeriod", + docs: [ + "Filter period determine high frequency trading time window.", ], - "type": "u16" + type: "u16", }, { - "name": "decayPeriod", - "docs": [ - "Decay period determine when the volatile fee start decay / decrease." + name: "decayPeriod", + docs: [ + "Decay period determine when the volatile fee start decay / decrease.", ], - "type": "u16" + type: "u16", }, { - "name": "reductionFactor", - "docs": [ - "Reduction factor controls the volatile fee rate decrement rate." + name: "reductionFactor", + docs: [ + "Reduction factor controls the volatile fee rate decrement rate.", ], - "type": "u16" + type: "u16", }, { - "name": "variableFeeControl", - "docs": [ - "Used to scale the variable fee component depending on the dynamic of the market" + name: "variableFeeControl", + docs: [ + "Used to scale the variable fee component depending on the dynamic of the market", ], - "type": "u32" + type: "u32", }, { - "name": "maxVolatilityAccumulator", - "docs": [ - "Maximum number of bin crossed can be accumulated. Used to cap volatile fee rate." + name: "maxVolatilityAccumulator", + docs: [ + "Maximum number of bin crossed can be accumulated. Used to cap volatile fee rate.", ], - "type": "u32" + type: "u32", }, { - "name": "minBinId", - "docs": [ - "Min bin id supported by the pool based on the configured bin step." + name: "minBinId", + docs: [ + "Min bin id supported by the pool based on the configured bin step.", ], - "type": "i32" + type: "i32", }, { - "name": "maxBinId", - "docs": [ - "Max bin id supported by the pool based on the configured bin step." + name: "maxBinId", + docs: [ + "Max bin id supported by the pool based on the configured bin step.", ], - "type": "i32" + type: "i32", }, { - "name": "protocolShare", - "docs": [ - "Portion of swap fees retained by the protocol by controlling protocol_share parameter. protocol_swap_fee = protocol_share * total_swap_fee" + name: "protocolShare", + docs: [ + "Portion of swap fees retained by the protocol by controlling protocol_share parameter. protocol_swap_fee = protocol_share * total_swap_fee", ], - "type": "u16" - } - ] - } + type: "u16", + }, + ], + }, }, { - "name": "FeeParameter", - "type": { - "kind": "struct", - "fields": [ + name: "FeeParameter", + type: { + kind: "struct", + fields: [ { - "name": "protocolShare", - "docs": [ - "Portion of swap fees retained by the protocol by controlling protocol_share parameter. protocol_swap_fee = protocol_share * total_swap_fee" + name: "protocolShare", + docs: [ + "Portion of swap fees retained by the protocol by controlling protocol_share parameter. protocol_swap_fee = protocol_share * total_swap_fee", ], - "type": "u16" + type: "u16", }, { - "name": "baseFactor", - "docs": [ - "Base factor for base fee rate" - ], - "type": "u16" - } - ] - } + name: "baseFactor", + docs: ["Base factor for base fee rate"], + type: "u16", + }, + ], + }, }, { - "name": "BinLiquidityReduction", - "type": { - "kind": "struct", - "fields": [ + name: "BinLiquidityReduction", + type: { + kind: "struct", + fields: [ { - "name": "binId", - "type": "i32" + name: "binId", + type: "i32", }, { - "name": "bpsToRemove", - "type": "u16" - } - ] - } + name: "bpsToRemove", + type: "u16", + }, + ], + }, }, { - "name": "Bin", - "type": { - "kind": "struct", - "fields": [ + name: "Bin", + type: { + kind: "struct", + fields: [ { - "name": "amountX", - "docs": [ - "Amount of token X in the bin. This already excluded protocol fees." + name: "amountX", + docs: [ + "Amount of token X in the bin. This already excluded protocol fees.", ], - "type": "u64" + type: "u64", }, { - "name": "amountY", - "docs": [ - "Amount of token Y in the bin. This already excluded protocol fees." + name: "amountY", + docs: [ + "Amount of token Y in the bin. This already excluded protocol fees.", ], - "type": "u64" + type: "u64", }, { - "name": "price", - "docs": [ - "Bin price" - ], - "type": "u128" + name: "price", + docs: ["Bin price"], + type: "u128", }, { - "name": "liquiditySupply", - "docs": [ - "Liquidities of the bin. This is the same as LP mint supply. q-number" + name: "liquiditySupply", + docs: [ + "Liquidities of the bin. This is the same as LP mint supply. q-number", ], - "type": "u128" + type: "u128", }, { - "name": "rewardPerTokenStored", - "docs": [ - "reward_a_per_token_stored" - ], - "type": { - "array": [ - "u128", - 2 - ] - } + name: "rewardPerTokenStored", + docs: ["reward_a_per_token_stored"], + type: { + array: ["u128", 2], + }, }, { - "name": "feeAmountXPerTokenStored", - "docs": [ - "Swap fee amount of token X per liquidity deposited." - ], - "type": "u128" + name: "feeAmountXPerTokenStored", + docs: ["Swap fee amount of token X per liquidity deposited."], + type: "u128", }, { - "name": "feeAmountYPerTokenStored", - "docs": [ - "Swap fee amount of token Y per liquidity deposited." - ], - "type": "u128" + name: "feeAmountYPerTokenStored", + docs: ["Swap fee amount of token Y per liquidity deposited."], + type: "u128", }, { - "name": "amountXIn", - "docs": [ - "Total token X swap into the bin. Only used for tracking purpose." + name: "amountXIn", + docs: [ + "Total token X swap into the bin. Only used for tracking purpose.", ], - "type": "u128" + type: "u128", }, { - "name": "amountYIn", - "docs": [ - "Total token Y swap into he bin. Only used for tracking purpose." + name: "amountYIn", + docs: [ + "Total token Y swap into he bin. Only used for tracking purpose.", ], - "type": "u128" - } - ] - } + type: "u128", + }, + ], + }, }, { - "name": "ProtocolFee", - "type": { - "kind": "struct", - "fields": [ + name: "ProtocolFee", + type: { + kind: "struct", + fields: [ { - "name": "amountX", - "type": "u64" + name: "amountX", + type: "u64", }, { - "name": "amountY", - "type": "u64" - } - ] - } + name: "amountY", + type: "u64", + }, + ], + }, }, { - "name": "RewardInfo", - "docs": [ - "Stores the state relevant for tracking liquidity mining rewards" - ], - "type": { - "kind": "struct", - "fields": [ + name: "RewardInfo", + docs: ["Stores the state relevant for tracking liquidity mining rewards"], + type: { + kind: "struct", + fields: [ { - "name": "mint", - "docs": [ - "Reward token mint." - ], - "type": "publicKey" + name: "mint", + docs: ["Reward token mint."], + type: "publicKey", }, { - "name": "vault", - "docs": [ - "Reward vault token account." - ], - "type": "publicKey" + name: "vault", + docs: ["Reward vault token account."], + type: "publicKey", }, { - "name": "funder", - "docs": [ - "Authority account that allows to fund rewards" - ], - "type": "publicKey" + name: "funder", + docs: ["Authority account that allows to fund rewards"], + type: "publicKey", }, { - "name": "rewardDuration", - "docs": [ - "TODO check whether we need to store it in pool" - ], - "type": "u64" + name: "rewardDuration", + docs: ["TODO check whether we need to store it in pool"], + type: "u64", }, { - "name": "rewardDurationEnd", - "docs": [ - "TODO check whether we need to store it in pool" - ], - "type": "u64" + name: "rewardDurationEnd", + docs: ["TODO check whether we need to store it in pool"], + type: "u64", }, { - "name": "rewardRate", - "docs": [ - "TODO check whether we need to store it in pool" - ], - "type": "u128" + name: "rewardRate", + docs: ["TODO check whether we need to store it in pool"], + type: "u128", }, { - "name": "lastUpdateTime", - "docs": [ - "The last time reward states were updated." - ], - "type": "u64" + name: "lastUpdateTime", + docs: ["The last time reward states were updated."], + type: "u64", }, { - "name": "cumulativeSecondsWithEmptyLiquidityReward", - "docs": [ - "Accumulated seconds where when farm distribute rewards, but the bin is empty. The reward will be accumulated for next reward time window." + name: "cumulativeSecondsWithEmptyLiquidityReward", + docs: [ + "Accumulated seconds where when farm distribute rewards, but the bin is empty. The reward will be accumulated for next reward time window.", ], - "type": "u64" - } - ] - } + type: "u64", + }, + ], + }, }, { - "name": "Observation", - "type": { - "kind": "struct", - "fields": [ + name: "Observation", + type: { + kind: "struct", + fields: [ { - "name": "cumulativeActiveBinId", - "docs": [ - "Cumulative active bin ID" - ], - "type": "i128" + name: "cumulativeActiveBinId", + docs: ["Cumulative active bin ID"], + type: "i128", }, { - "name": "createdAt", - "docs": [ - "Observation sample created timestamp" - ], - "type": "i64" + name: "createdAt", + docs: ["Observation sample created timestamp"], + type: "i64", }, { - "name": "lastUpdatedAt", - "docs": [ - "Observation sample last updated timestamp" - ], - "type": "i64" - } - ] - } + name: "lastUpdatedAt", + docs: ["Observation sample last updated timestamp"], + type: "i64", + }, + ], + }, }, { - "name": "StaticParameters", - "docs": [ - "Parameter that set by the protocol" - ], - "type": { - "kind": "struct", - "fields": [ + name: "StaticParameters", + docs: ["Parameter that set by the protocol"], + type: { + kind: "struct", + fields: [ { - "name": "baseFactor", - "docs": [ - "Used for base fee calculation. base_fee_rate = base_factor * bin_step" + name: "baseFactor", + docs: [ + "Used for base fee calculation. base_fee_rate = base_factor * bin_step", ], - "type": "u16" + type: "u16", }, { - "name": "filterPeriod", - "docs": [ - "Filter period determine high frequency trading time window." + name: "filterPeriod", + docs: [ + "Filter period determine high frequency trading time window.", ], - "type": "u16" + type: "u16", }, { - "name": "decayPeriod", - "docs": [ - "Decay period determine when the volatile fee start decay / decrease." + name: "decayPeriod", + docs: [ + "Decay period determine when the volatile fee start decay / decrease.", ], - "type": "u16" + type: "u16", }, { - "name": "reductionFactor", - "docs": [ - "Reduction factor controls the volatile fee rate decrement rate." + name: "reductionFactor", + docs: [ + "Reduction factor controls the volatile fee rate decrement rate.", ], - "type": "u16" + type: "u16", }, { - "name": "variableFeeControl", - "docs": [ - "Used to scale the variable fee component depending on the dynamic of the market" + name: "variableFeeControl", + docs: [ + "Used to scale the variable fee component depending on the dynamic of the market", ], - "type": "u32" + type: "u32", }, { - "name": "maxVolatilityAccumulator", - "docs": [ - "Maximum number of bin crossed can be accumulated. Used to cap volatile fee rate." + name: "maxVolatilityAccumulator", + docs: [ + "Maximum number of bin crossed can be accumulated. Used to cap volatile fee rate.", ], - "type": "u32" + type: "u32", }, { - "name": "minBinId", - "docs": [ - "Min bin id supported by the pool based on the configured bin step." + name: "minBinId", + docs: [ + "Min bin id supported by the pool based on the configured bin step.", ], - "type": "i32" + type: "i32", }, { - "name": "maxBinId", - "docs": [ - "Max bin id supported by the pool based on the configured bin step." + name: "maxBinId", + docs: [ + "Max bin id supported by the pool based on the configured bin step.", ], - "type": "i32" + type: "i32", }, { - "name": "protocolShare", - "docs": [ - "Portion of swap fees retained by the protocol by controlling protocol_share parameter. protocol_swap_fee = protocol_share * total_swap_fee" + name: "protocolShare", + docs: [ + "Portion of swap fees retained by the protocol by controlling protocol_share parameter. protocol_swap_fee = protocol_share * total_swap_fee", ], - "type": "u16" + type: "u16", }, { - "name": "padding", - "docs": [ - "Padding for bytemuck safe alignment" - ], - "type": { - "array": [ - "u8", - 6 - ] - } - } - ] - } + name: "padding", + docs: ["Padding for bytemuck safe alignment"], + type: { + array: ["u8", 6], + }, + }, + ], + }, }, { - "name": "VariableParameters", - "docs": [ - "Parameters that changes based on dynamic of the market" - ], - "type": { - "kind": "struct", - "fields": [ + name: "VariableParameters", + docs: ["Parameters that changes based on dynamic of the market"], + type: { + kind: "struct", + fields: [ { - "name": "volatilityAccumulator", - "docs": [ + name: "volatilityAccumulator", + docs: [ "Volatility accumulator measure the number of bin crossed since reference bin ID. Normally (without filter period taken into consideration), reference bin ID is the active bin of last swap.", - "It affects the variable fee rate" + "It affects the variable fee rate", ], - "type": "u32" + type: "u32", }, { - "name": "volatilityReference", - "docs": [ - "Volatility reference is decayed volatility accumulator. It is always <= volatility_accumulator" + name: "volatilityReference", + docs: [ + "Volatility reference is decayed volatility accumulator. It is always <= volatility_accumulator", ], - "type": "u32" + type: "u32", }, { - "name": "indexReference", - "docs": [ - "Active bin id of last swap." - ], - "type": "i32" + name: "indexReference", + docs: ["Active bin id of last swap."], + type: "i32", }, { - "name": "padding", - "docs": [ - "Padding for bytemuck safe alignment" - ], - "type": { - "array": [ - "u8", - 4 - ] - } + name: "padding", + docs: ["Padding for bytemuck safe alignment"], + type: { + array: ["u8", 4], + }, }, { - "name": "lastUpdateTimestamp", - "docs": [ - "Last timestamp the variable parameters was updated" - ], - "type": "i64" + name: "lastUpdateTimestamp", + docs: ["Last timestamp the variable parameters was updated"], + type: "i64", }, { - "name": "padding1", - "docs": [ - "Padding for bytemuck safe alignment" - ], - "type": { - "array": [ - "u8", - 8 - ] - } - } - ] - } + name: "padding1", + docs: ["Padding for bytemuck safe alignment"], + type: { + array: ["u8", 8], + }, + }, + ], + }, }, { - "name": "FeeInfo", - "type": { - "kind": "struct", - "fields": [ + name: "FeeInfo", + type: { + kind: "struct", + fields: [ { - "name": "feeXPerTokenComplete", - "type": "u128" + name: "feeXPerTokenComplete", + type: "u128", }, { - "name": "feeYPerTokenComplete", - "type": "u128" + name: "feeYPerTokenComplete", + type: "u128", }, { - "name": "feeXPending", - "type": "u64" + name: "feeXPending", + type: "u64", }, { - "name": "feeYPending", - "type": "u64" - } - ] - } + name: "feeYPending", + type: "u64", + }, + ], + }, }, { - "name": "UserRewardInfo", - "type": { - "kind": "struct", - "fields": [ + name: "UserRewardInfo", + type: { + kind: "struct", + fields: [ { - "name": "rewardPerTokenCompletes", - "type": { - "array": [ - "u128", - 2 - ] - } + name: "rewardPerTokenCompletes", + type: { + array: ["u128", 2], + }, }, { - "name": "rewardPendings", - "type": { - "array": [ - "u64", - 2 - ] - } - } - ] - } + name: "rewardPendings", + type: { + array: ["u64", 2], + }, + }, + ], + }, }, { - "name": "StrategyType", - "type": { - "kind": "enum", - "variants": [ + name: "RemainingAccountsSlice", + type: { + kind: "struct", + fields: [ { - "name": "SpotOneSide" + name: "accountsType", + type: { + defined: "AccountsType", + }, }, { - "name": "CurveOneSide" + name: "length", + type: "u8", }, + ], + }, + }, + { + name: "RemainingAccountsInfo", + type: { + kind: "struct", + fields: [ { - "name": "BidAskOneSide" + name: "slices", + type: { + vec: { + defined: "RemainingAccountsSlice", + }, + }, }, + ], + }, + }, + { + name: "StrategyType", + type: { + kind: "enum", + variants: [ { - "name": "SpotBalanced" + name: "SpotOneSide", }, { - "name": "CurveBalanced" + name: "CurveOneSide", }, { - "name": "BidAskBalanced" + name: "BidAskOneSide", }, { - "name": "SpotImBalanced" + name: "SpotBalanced", }, { - "name": "CurveImBalanced" + name: "CurveBalanced", }, { - "name": "BidAskImBalanced" - } - ] - } + name: "BidAskBalanced", + }, + { + name: "SpotImBalanced", + }, + { + name: "CurveImBalanced", + }, + { + name: "BidAskImBalanced", + }, + ], + }, }, { - "name": "Rounding", - "type": { - "kind": "enum", - "variants": [ + name: "Rounding", + type: { + kind: "enum", + variants: [ { - "name": "Up" + name: "Up", }, { - "name": "Down" - } - ] - } + name: "Down", + }, + ], + }, }, { - "name": "LayoutVersion", - "docs": [ - "Layout version" - ], - "type": { - "kind": "enum", - "variants": [ + name: "LayoutVersion", + docs: ["Layout version"], + type: { + kind: "enum", + variants: [ { - "name": "V0" + name: "V0", }, { - "name": "V1" - } - ] - } + name: "V1", + }, + ], + }, }, { - "name": "ActivationType", - "docs": [ - "Type of the activation" - ], - "type": { - "kind": "enum", - "variants": [ + name: "ActivationType", + docs: ["Type of the activation"], + type: { + kind: "enum", + variants: [ { - "name": "Slot" + name: "Slot", }, { - "name": "Timestamp" - } - ] - } + name: "Timestamp", + }, + ], + }, }, { - "name": "PairType", - "docs": [ - "Type of the Pair. 0 = Permissionless, 1 = Permission. Putting 0 as permissionless for backward compatibility." + name: "PairType", + docs: [ + "Type of the Pair. 0 = Permissionless, 1 = Permission. Putting 0 as permissionless for backward compatibility.", ], - "type": { - "kind": "enum", - "variants": [ + type: { + kind: "enum", + variants: [ { - "name": "Permissionless" + name: "Permissionless", }, { - "name": "Permission" - } - ] - } + name: "Permission", + }, + ], + }, }, { - "name": "PairStatus", - "docs": [ - "Pair status. 0 = Enabled, 1 = Disabled. Putting 0 as enabled for backward compatibility." + name: "PairStatus", + docs: [ + "Pair status. 0 = Enabled, 1 = Disabled. Putting 0 as enabled for backward compatibility.", ], - "type": { - "kind": "enum", - "variants": [ + type: { + kind: "enum", + variants: [ { - "name": "Enabled" + name: "Enabled", }, { - "name": "Disabled" - } - ] - } - } + name: "Disabled", + }, + ], + }, + }, + { + name: "TokenProgramFlags", + type: { + kind: "enum", + variants: [ + { + name: "TokenProgram", + }, + { + name: "TokenProgram2022", + }, + ], + }, + }, + { + name: "AccountsType", + type: { + kind: "enum", + variants: [ + { + name: "TransferHookX", + }, + { + name: "TransferHookY", + }, + { + name: "TransferHookReward", + }, + ], + }, + }, ], - "events": [ + events: [ { - "name": "CompositionFee", - "fields": [ + name: "CompositionFee", + fields: [ { - "name": "from", - "type": "publicKey", - "index": false + name: "from", + type: "publicKey", + index: false, }, { - "name": "binId", - "type": "i16", - "index": false + name: "binId", + type: "i16", + index: false, }, { - "name": "tokenXFeeAmount", - "type": "u64", - "index": false + name: "tokenXFeeAmount", + type: "u64", + index: false, }, { - "name": "tokenYFeeAmount", - "type": "u64", - "index": false + name: "tokenYFeeAmount", + type: "u64", + index: false, }, { - "name": "protocolTokenXFeeAmount", - "type": "u64", - "index": false + name: "protocolTokenXFeeAmount", + type: "u64", + index: false, }, { - "name": "protocolTokenYFeeAmount", - "type": "u64", - "index": false - } - ] + name: "protocolTokenYFeeAmount", + type: "u64", + index: false, + }, + ], }, { - "name": "AddLiquidity", - "fields": [ + name: "AddLiquidity", + fields: [ { - "name": "lbPair", - "type": "publicKey", - "index": false + name: "lbPair", + type: "publicKey", + index: false, }, { - "name": "from", - "type": "publicKey", - "index": false + name: "from", + type: "publicKey", + index: false, }, { - "name": "position", - "type": "publicKey", - "index": false + name: "position", + type: "publicKey", + index: false, }, { - "name": "amounts", - "type": { - "array": [ - "u64", - 2 - ] + name: "amounts", + type: { + array: ["u64", 2], }, - "index": false + index: false, }, { - "name": "activeBinId", - "type": "i32", - "index": false - } - ] + name: "activeBinId", + type: "i32", + index: false, + }, + ], }, { - "name": "RemoveLiquidity", - "fields": [ + name: "RemoveLiquidity", + fields: [ { - "name": "lbPair", - "type": "publicKey", - "index": false + name: "lbPair", + type: "publicKey", + index: false, }, { - "name": "from", - "type": "publicKey", - "index": false + name: "from", + type: "publicKey", + index: false, }, { - "name": "position", - "type": "publicKey", - "index": false + name: "position", + type: "publicKey", + index: false, }, { - "name": "amounts", - "type": { - "array": [ - "u64", - 2 - ] + name: "amounts", + type: { + array: ["u64", 2], }, - "index": false + index: false, }, { - "name": "activeBinId", - "type": "i32", - "index": false - } - ] + name: "activeBinId", + type: "i32", + index: false, + }, + ], }, { - "name": "Swap", - "fields": [ + name: "Swap", + fields: [ { - "name": "lbPair", - "type": "publicKey", - "index": false + name: "lbPair", + type: "publicKey", + index: false, }, { - "name": "from", - "type": "publicKey", - "index": false + name: "from", + type: "publicKey", + index: false, }, { - "name": "startBinId", - "type": "i32", - "index": false + name: "startBinId", + type: "i32", + index: false, }, { - "name": "endBinId", - "type": "i32", - "index": false + name: "endBinId", + type: "i32", + index: false, }, { - "name": "amountIn", - "type": "u64", - "index": false + name: "amountIn", + type: "u64", + index: false, }, { - "name": "amountOut", - "type": "u64", - "index": false + name: "amountOut", + type: "u64", + index: false, }, { - "name": "swapForY", - "type": "bool", - "index": false + name: "swapForY", + type: "bool", + index: false, }, { - "name": "fee", - "type": "u64", - "index": false + name: "fee", + type: "u64", + index: false, }, { - "name": "protocolFee", - "type": "u64", - "index": false + name: "protocolFee", + type: "u64", + index: false, }, { - "name": "feeBps", - "type": "u128", - "index": false + name: "feeBps", + type: "u128", + index: false, }, { - "name": "hostFee", - "type": "u64", - "index": false - } - ] + name: "hostFee", + type: "u64", + index: false, + }, + ], }, { - "name": "ClaimReward", - "fields": [ + name: "ClaimReward", + fields: [ { - "name": "lbPair", - "type": "publicKey", - "index": false + name: "lbPair", + type: "publicKey", + index: false, }, { - "name": "position", - "type": "publicKey", - "index": false + name: "position", + type: "publicKey", + index: false, }, { - "name": "owner", - "type": "publicKey", - "index": false + name: "owner", + type: "publicKey", + index: false, }, { - "name": "rewardIndex", - "type": "u64", - "index": false + name: "rewardIndex", + type: "u64", + index: false, }, { - "name": "totalReward", - "type": "u64", - "index": false - } - ] + name: "totalReward", + type: "u64", + index: false, + }, + ], }, { - "name": "FundReward", - "fields": [ + name: "FundReward", + fields: [ { - "name": "lbPair", - "type": "publicKey", - "index": false + name: "lbPair", + type: "publicKey", + index: false, }, { - "name": "funder", - "type": "publicKey", - "index": false + name: "funder", + type: "publicKey", + index: false, }, { - "name": "rewardIndex", - "type": "u64", - "index": false + name: "rewardIndex", + type: "u64", + index: false, }, { - "name": "amount", - "type": "u64", - "index": false - } - ] + name: "amount", + type: "u64", + index: false, + }, + ], }, { - "name": "InitializeReward", - "fields": [ + name: "InitializeReward", + fields: [ { - "name": "lbPair", - "type": "publicKey", - "index": false + name: "lbPair", + type: "publicKey", + index: false, }, { - "name": "rewardMint", - "type": "publicKey", - "index": false + name: "rewardMint", + type: "publicKey", + index: false, }, { - "name": "funder", - "type": "publicKey", - "index": false + name: "funder", + type: "publicKey", + index: false, }, { - "name": "rewardIndex", - "type": "u64", - "index": false + name: "rewardIndex", + type: "u64", + index: false, }, { - "name": "rewardDuration", - "type": "u64", - "index": false - } - ] + name: "rewardDuration", + type: "u64", + index: false, + }, + ], }, { - "name": "UpdateRewardDuration", - "fields": [ + name: "UpdateRewardDuration", + fields: [ { - "name": "lbPair", - "type": "publicKey", - "index": false + name: "lbPair", + type: "publicKey", + index: false, }, { - "name": "rewardIndex", - "type": "u64", - "index": false + name: "rewardIndex", + type: "u64", + index: false, }, { - "name": "oldRewardDuration", - "type": "u64", - "index": false + name: "oldRewardDuration", + type: "u64", + index: false, }, { - "name": "newRewardDuration", - "type": "u64", - "index": false - } - ] + name: "newRewardDuration", + type: "u64", + index: false, + }, + ], }, { - "name": "UpdateRewardFunder", - "fields": [ + name: "UpdateRewardFunder", + fields: [ { - "name": "lbPair", - "type": "publicKey", - "index": false + name: "lbPair", + type: "publicKey", + index: false, }, { - "name": "rewardIndex", - "type": "u64", - "index": false + name: "rewardIndex", + type: "u64", + index: false, }, { - "name": "oldFunder", - "type": "publicKey", - "index": false + name: "oldFunder", + type: "publicKey", + index: false, }, { - "name": "newFunder", - "type": "publicKey", - "index": false - } - ] + name: "newFunder", + type: "publicKey", + index: false, + }, + ], }, { - "name": "PositionClose", - "fields": [ + name: "PositionClose", + fields: [ { - "name": "position", - "type": "publicKey", - "index": false + name: "position", + type: "publicKey", + index: false, }, { - "name": "owner", - "type": "publicKey", - "index": false - } - ] + name: "owner", + type: "publicKey", + index: false, + }, + ], }, { - "name": "ClaimFee", - "fields": [ + name: "ClaimFee", + fields: [ { - "name": "lbPair", - "type": "publicKey", - "index": false + name: "lbPair", + type: "publicKey", + index: false, }, { - "name": "position", - "type": "publicKey", - "index": false + name: "position", + type: "publicKey", + index: false, }, { - "name": "owner", - "type": "publicKey", - "index": false + name: "owner", + type: "publicKey", + index: false, }, { - "name": "feeX", - "type": "u64", - "index": false + name: "feeX", + type: "u64", + index: false, }, { - "name": "feeY", - "type": "u64", - "index": false - } - ] + name: "feeY", + type: "u64", + index: false, + }, + ], }, { - "name": "LbPairCreate", - "fields": [ + name: "LbPairCreate", + fields: [ { - "name": "lbPair", - "type": "publicKey", - "index": false + name: "lbPair", + type: "publicKey", + index: false, }, { - "name": "binStep", - "type": "u16", - "index": false + name: "binStep", + type: "u16", + index: false, }, { - "name": "tokenX", - "type": "publicKey", - "index": false + name: "tokenX", + type: "publicKey", + index: false, }, { - "name": "tokenY", - "type": "publicKey", - "index": false - } - ] + name: "tokenY", + type: "publicKey", + index: false, + }, + ], }, { - "name": "PositionCreate", - "fields": [ + name: "PositionCreate", + fields: [ { - "name": "lbPair", - "type": "publicKey", - "index": false + name: "lbPair", + type: "publicKey", + index: false, }, { - "name": "position", - "type": "publicKey", - "index": false + name: "position", + type: "publicKey", + index: false, }, { - "name": "owner", - "type": "publicKey", - "index": false - } - ] + name: "owner", + type: "publicKey", + index: false, + }, + ], }, { - "name": "FeeParameterUpdate", - "fields": [ + name: "FeeParameterUpdate", + fields: [ { - "name": "lbPair", - "type": "publicKey", - "index": false + name: "lbPair", + type: "publicKey", + index: false, }, { - "name": "protocolShare", - "type": "u16", - "index": false + name: "protocolShare", + type: "u16", + index: false, }, { - "name": "baseFactor", - "type": "u16", - "index": false - } - ] + name: "baseFactor", + type: "u16", + index: false, + }, + ], }, { - "name": "IncreaseObservation", - "fields": [ + name: "IncreaseObservation", + fields: [ { - "name": "oracle", - "type": "publicKey", - "index": false + name: "oracle", + type: "publicKey", + index: false, }, { - "name": "newObservationLength", - "type": "u64", - "index": false - } - ] + name: "newObservationLength", + type: "u64", + index: false, + }, + ], }, { - "name": "WithdrawIneligibleReward", - "fields": [ + name: "WithdrawIneligibleReward", + fields: [ { - "name": "lbPair", - "type": "publicKey", - "index": false + name: "lbPair", + type: "publicKey", + index: false, }, { - "name": "rewardMint", - "type": "publicKey", - "index": false + name: "rewardMint", + type: "publicKey", + index: false, }, { - "name": "amount", - "type": "u64", - "index": false - } - ] + name: "amount", + type: "u64", + index: false, + }, + ], }, { - "name": "UpdatePositionOperator", - "fields": [ + name: "UpdatePositionOperator", + fields: [ { - "name": "position", - "type": "publicKey", - "index": false + name: "position", + type: "publicKey", + index: false, }, { - "name": "oldOperator", - "type": "publicKey", - "index": false + name: "oldOperator", + type: "publicKey", + index: false, }, { - "name": "newOperator", - "type": "publicKey", - "index": false - } - ] + name: "newOperator", + type: "publicKey", + index: false, + }, + ], }, { - "name": "UpdatePositionLockReleasePoint", - "fields": [ + name: "UpdatePositionLockReleasePoint", + fields: [ { - "name": "position", - "type": "publicKey", - "index": false + name: "position", + type: "publicKey", + index: false, }, { - "name": "currentPoint", - "type": "u64", - "index": false + name: "currentPoint", + type: "u64", + index: false, }, { - "name": "newLockReleasePoint", - "type": "u64", - "index": false + name: "newLockReleasePoint", + type: "u64", + index: false, }, { - "name": "oldLockReleasePoint", - "type": "u64", - "index": false + name: "oldLockReleasePoint", + type: "u64", + index: false, }, { - "name": "sender", - "type": "publicKey", - "index": false - } - ] + name: "sender", + type: "publicKey", + index: false, + }, + ], }, { - "name": "GoToABin", - "fields": [ + name: "GoToABin", + fields: [ { - "name": "lbPair", - "type": "publicKey", - "index": false + name: "lbPair", + type: "publicKey", + index: false, }, { - "name": "fromBinId", - "type": "i32", - "index": false + name: "fromBinId", + type: "i32", + index: false, }, { - "name": "toBinId", - "type": "i32", - "index": false - } - ] - } + name: "toBinId", + type: "i32", + index: false, + }, + ], + }, ], - "errors": [ + errors: [ { - "code": 6000, - "name": "InvalidStartBinIndex", - "msg": "Invalid start bin index" + code: 6000, + name: "InvalidStartBinIndex", + msg: "Invalid start bin index", }, { - "code": 6001, - "name": "InvalidBinId", - "msg": "Invalid bin id" + code: 6001, + name: "InvalidBinId", + msg: "Invalid bin id", }, { - "code": 6002, - "name": "InvalidInput", - "msg": "Invalid input data" + code: 6002, + name: "InvalidInput", + msg: "Invalid input data", }, { - "code": 6003, - "name": "ExceededAmountSlippageTolerance", - "msg": "Exceeded amount slippage tolerance" + code: 6003, + name: "ExceededAmountSlippageTolerance", + msg: "Exceeded amount slippage tolerance", }, { - "code": 6004, - "name": "ExceededBinSlippageTolerance", - "msg": "Exceeded bin slippage tolerance" + code: 6004, + name: "ExceededBinSlippageTolerance", + msg: "Exceeded bin slippage tolerance", }, { - "code": 6005, - "name": "CompositionFactorFlawed", - "msg": "Composition factor flawed" + code: 6005, + name: "CompositionFactorFlawed", + msg: "Composition factor flawed", }, { - "code": 6006, - "name": "NonPresetBinStep", - "msg": "Non preset bin step" + code: 6006, + name: "NonPresetBinStep", + msg: "Non preset bin step", }, { - "code": 6007, - "name": "ZeroLiquidity", - "msg": "Zero liquidity" + code: 6007, + name: "ZeroLiquidity", + msg: "Zero liquidity", }, { - "code": 6008, - "name": "InvalidPosition", - "msg": "Invalid position" + code: 6008, + name: "InvalidPosition", + msg: "Invalid position", }, { - "code": 6009, - "name": "BinArrayNotFound", - "msg": "Bin array not found" + code: 6009, + name: "BinArrayNotFound", + msg: "Bin array not found", }, { - "code": 6010, - "name": "InvalidTokenMint", - "msg": "Invalid token mint" + code: 6010, + name: "InvalidTokenMint", + msg: "Invalid token mint", }, { - "code": 6011, - "name": "InvalidAccountForSingleDeposit", - "msg": "Invalid account for single deposit" + code: 6011, + name: "InvalidAccountForSingleDeposit", + msg: "Invalid account for single deposit", }, { - "code": 6012, - "name": "PairInsufficientLiquidity", - "msg": "Pair insufficient liquidity" + code: 6012, + name: "PairInsufficientLiquidity", + msg: "Pair insufficient liquidity", }, { - "code": 6013, - "name": "InvalidFeeOwner", - "msg": "Invalid fee owner" + code: 6013, + name: "InvalidFeeOwner", + msg: "Invalid fee owner", }, { - "code": 6014, - "name": "InvalidFeeWithdrawAmount", - "msg": "Invalid fee withdraw amount" + code: 6014, + name: "InvalidFeeWithdrawAmount", + msg: "Invalid fee withdraw amount", }, { - "code": 6015, - "name": "InvalidAdmin", - "msg": "Invalid admin" + code: 6015, + name: "InvalidAdmin", + msg: "Invalid admin", }, { - "code": 6016, - "name": "IdenticalFeeOwner", - "msg": "Identical fee owner" + code: 6016, + name: "IdenticalFeeOwner", + msg: "Identical fee owner", }, { - "code": 6017, - "name": "InvalidBps", - "msg": "Invalid basis point" + code: 6017, + name: "InvalidBps", + msg: "Invalid basis point", }, { - "code": 6018, - "name": "MathOverflow", - "msg": "Math operation overflow" + code: 6018, + name: "MathOverflow", + msg: "Math operation overflow", }, { - "code": 6019, - "name": "TypeCastFailed", - "msg": "Type cast error" + code: 6019, + name: "TypeCastFailed", + msg: "Type cast error", }, { - "code": 6020, - "name": "InvalidRewardIndex", - "msg": "Invalid reward index" + code: 6020, + name: "InvalidRewardIndex", + msg: "Invalid reward index", }, { - "code": 6021, - "name": "InvalidRewardDuration", - "msg": "Invalid reward duration" + code: 6021, + name: "InvalidRewardDuration", + msg: "Invalid reward duration", }, { - "code": 6022, - "name": "RewardInitialized", - "msg": "Reward already initialized" + code: 6022, + name: "RewardInitialized", + msg: "Reward already initialized", }, { - "code": 6023, - "name": "RewardUninitialized", - "msg": "Reward not initialized" + code: 6023, + name: "RewardUninitialized", + msg: "Reward not initialized", }, { - "code": 6024, - "name": "IdenticalFunder", - "msg": "Identical funder" + code: 6024, + name: "IdenticalFunder", + msg: "Identical funder", }, { - "code": 6025, - "name": "RewardCampaignInProgress", - "msg": "Reward campaign in progress" + code: 6025, + name: "RewardCampaignInProgress", + msg: "Reward campaign in progress", }, { - "code": 6026, - "name": "IdenticalRewardDuration", - "msg": "Reward duration is the same" + code: 6026, + name: "IdenticalRewardDuration", + msg: "Reward duration is the same", }, { - "code": 6027, - "name": "InvalidBinArray", - "msg": "Invalid bin array" + code: 6027, + name: "InvalidBinArray", + msg: "Invalid bin array", }, { - "code": 6028, - "name": "NonContinuousBinArrays", - "msg": "Bin arrays must be continuous" + code: 6028, + name: "NonContinuousBinArrays", + msg: "Bin arrays must be continuous", }, { - "code": 6029, - "name": "InvalidRewardVault", - "msg": "Invalid reward vault" + code: 6029, + name: "InvalidRewardVault", + msg: "Invalid reward vault", }, { - "code": 6030, - "name": "NonEmptyPosition", - "msg": "Position is not empty" + code: 6030, + name: "NonEmptyPosition", + msg: "Position is not empty", }, { - "code": 6031, - "name": "UnauthorizedAccess", - "msg": "Unauthorized access" + code: 6031, + name: "UnauthorizedAccess", + msg: "Unauthorized access", }, { - "code": 6032, - "name": "InvalidFeeParameter", - "msg": "Invalid fee parameter" + code: 6032, + name: "InvalidFeeParameter", + msg: "Invalid fee parameter", }, { - "code": 6033, - "name": "MissingOracle", - "msg": "Missing oracle account" + code: 6033, + name: "MissingOracle", + msg: "Missing oracle account", }, { - "code": 6034, - "name": "InsufficientSample", - "msg": "Insufficient observation sample" + code: 6034, + name: "InsufficientSample", + msg: "Insufficient observation sample", }, { - "code": 6035, - "name": "InvalidLookupTimestamp", - "msg": "Invalid lookup timestamp" + code: 6035, + name: "InvalidLookupTimestamp", + msg: "Invalid lookup timestamp", }, { - "code": 6036, - "name": "BitmapExtensionAccountIsNotProvided", - "msg": "Bitmap extension account is not provided" + code: 6036, + name: "BitmapExtensionAccountIsNotProvided", + msg: "Bitmap extension account is not provided", }, { - "code": 6037, - "name": "CannotFindNonZeroLiquidityBinArrayId", - "msg": "Cannot find non-zero liquidity binArrayId" + code: 6037, + name: "CannotFindNonZeroLiquidityBinArrayId", + msg: "Cannot find non-zero liquidity binArrayId", }, { - "code": 6038, - "name": "BinIdOutOfBound", - "msg": "Bin id out of bound" + code: 6038, + name: "BinIdOutOfBound", + msg: "Bin id out of bound", }, { - "code": 6039, - "name": "InsufficientOutAmount", - "msg": "Insufficient amount in for minimum out" + code: 6039, + name: "InsufficientOutAmount", + msg: "Insufficient amount in for minimum out", }, { - "code": 6040, - "name": "InvalidPositionWidth", - "msg": "Invalid position width" + code: 6040, + name: "InvalidPositionWidth", + msg: "Invalid position width", }, { - "code": 6041, - "name": "ExcessiveFeeUpdate", - "msg": "Excessive fee update" + code: 6041, + name: "ExcessiveFeeUpdate", + msg: "Excessive fee update", }, { - "code": 6042, - "name": "PoolDisabled", - "msg": "Pool disabled" + code: 6042, + name: "PoolDisabled", + msg: "Pool disabled", }, { - "code": 6043, - "name": "InvalidPoolType", - "msg": "Invalid pool type" + code: 6043, + name: "InvalidPoolType", + msg: "Invalid pool type", }, { - "code": 6044, - "name": "ExceedMaxWhitelist", - "msg": "Whitelist for wallet is full" + code: 6044, + name: "ExceedMaxWhitelist", + msg: "Whitelist for wallet is full", }, { - "code": 6045, - "name": "InvalidIndex", - "msg": "Invalid index" + code: 6045, + name: "InvalidIndex", + msg: "Invalid index", }, { - "code": 6046, - "name": "RewardNotEnded", - "msg": "Reward not ended" + code: 6046, + name: "RewardNotEnded", + msg: "Reward not ended", }, { - "code": 6047, - "name": "MustWithdrawnIneligibleReward", - "msg": "Must withdraw ineligible reward" + code: 6047, + name: "MustWithdrawnIneligibleReward", + msg: "Must withdraw ineligible reward", }, { - "code": 6048, - "name": "UnauthorizedAddress", - "msg": "Unauthorized address" + code: 6048, + name: "UnauthorizedAddress", + msg: "Unauthorized address", }, { - "code": 6049, - "name": "OperatorsAreTheSame", - "msg": "Cannot update because operators are the same" + code: 6049, + name: "OperatorsAreTheSame", + msg: "Cannot update because operators are the same", }, { - "code": 6050, - "name": "WithdrawToWrongTokenAccount", - "msg": "Withdraw to wrong token account" + code: 6050, + name: "WithdrawToWrongTokenAccount", + msg: "Withdraw to wrong token account", }, { - "code": 6051, - "name": "WrongRentReceiver", - "msg": "Wrong rent receiver" + code: 6051, + name: "WrongRentReceiver", + msg: "Wrong rent receiver", }, { - "code": 6052, - "name": "AlreadyPassActivationPoint", - "msg": "Already activated" + code: 6052, + name: "AlreadyPassActivationPoint", + msg: "Already activated", }, { - "code": 6053, - "name": "ExceedMaxSwappedAmount", - "msg": "Swapped amount is exceeded max swapped amount" + code: 6053, + name: "ExceedMaxSwappedAmount", + msg: "Swapped amount is exceeded max swapped amount", }, { - "code": 6054, - "name": "InvalidStrategyParameters", - "msg": "Invalid strategy parameters" + code: 6054, + name: "InvalidStrategyParameters", + msg: "Invalid strategy parameters", }, { - "code": 6055, - "name": "LiquidityLocked", - "msg": "Liquidity locked" + code: 6055, + name: "LiquidityLocked", + msg: "Liquidity locked", }, { - "code": 6056, - "name": "BinRangeIsNotEmpty", - "msg": "Bin range is not empty" + code: 6056, + name: "BinRangeIsNotEmpty", + msg: "Bin range is not empty", }, { - "code": 6057, - "name": "NotExactAmountOut", - "msg": "Amount out is not matched with exact amount out" + code: 6057, + name: "NotExactAmountOut", + msg: "Amount out is not matched with exact amount out", }, { - "code": 6058, - "name": "InvalidActivationType", - "msg": "Invalid activation type" - } - ] + code: 6058, + name: "InvalidActivationType", + msg: "Invalid activation type", + }, + { + code: 6059, + name: "NotSupportMint", + msg: "Not support token_2022 mint extension", + }, + { + code: 6060, + name: "UnsupportedMintExtension", + msg: "Unsupported mint extension", + }, + { + code: 6061, + name: "UnsupportNativeMintToken2022", + msg: "Unsupported native mint token2022", + }, + { + code: 6062, + name: "UnmatchTokenMint", + msg: "Unmatch token mint", + }, + { + code: 6063, + name: "UnsupportedTokenMint", + msg: "Unsupported token mint", + }, + { + code: 6064, + name: "InsufficientRemainingAccounts", + msg: "Insufficient remaining accounts", + }, + { + code: 6065, + name: "InvalidRemainingAccountSlice", + msg: "Invalid remaining account slice", + }, + { + code: 6066, + name: "DuplicatedRemainingAccountTypes", + msg: "Duplicated remaining account types", + }, + { + code: 6067, + name: "MissingRemainingAccountForTransferHook", + msg: "Missing remaining account for transfer hook", + }, + { + code: 6068, + name: "NoTransferHookProgram", + msg: "Remaining account was passed for transfer hook but there's no hook program", + }, + { + code: 6069, + name: "ZeroFundedAmount", + msg: "Zero funded amount", + }, + ], }; diff --git a/ts-client/src/dlmm/index.ts b/ts-client/src/dlmm/index.ts index 969679d4..4e7be22f 100644 --- a/ts-client/src/dlmm/index.ts +++ b/ts-client/src/dlmm/index.ts @@ -8,6 +8,7 @@ import { SYSVAR_RENT_PUBKEY, SystemProgram, SYSVAR_CLOCK_PUBKEY, + AccountInfo, } from "@solana/web3.js"; import { IDL } from "./idl"; import { @@ -24,6 +25,7 @@ import { BIN_ARRAY_FEE, POSITION_FEE, MAX_BIN_PER_TX, + MEMO_PROGRAM_ID, } from "./constants"; import { BinLiquidity, @@ -71,6 +73,9 @@ import { ClockLayout, PairStatus, PairType, + RewardMintInfo, + RemainingAccountsInfo, + AccountsType, } from "./types"; import { AnchorProvider, BN, Program } from "@coral-xyz/anchor"; import { @@ -105,6 +110,8 @@ import { swapExactOutQuoteAtBin, getPriceOfBinByBinId, computeFee, + deriveTokenBadge, + getBinArrayAccounstMetaByBinRange, } from "./helpers"; import { bs58 } from "@coral-xyz/anchor/dist/cjs/utils/bytes"; import Decimal from "decimal.js"; @@ -112,8 +119,10 @@ import { AccountLayout, MintLayout, NATIVE_MINT, + RawMint, TOKEN_PROGRAM_ID, getAssociatedTokenAddressSync, + unpackMint, } from "@solana/spl-token"; import { Rounding, @@ -129,6 +138,7 @@ import { shlDiv, } from "./helpers/math"; import { DlmmSdkError } from "./error"; +import { getExtraAccountMetasForTransferHook } from "./helpers/token2022"; type Opt = { cluster?: Cluster | "localhost"; @@ -144,6 +154,7 @@ export class DLMM { public tokenX: TokenReserve, public tokenY: TokenReserve, public clock: Clock, + public rewardMintInfo: RewardMintInfo[], private opt?: Opt ) {} @@ -287,6 +298,9 @@ export class DLMM { const clockAccountInfoBuffer = accountsInfo[2]?.data; if (!clockAccountInfoBuffer) throw new Error(`Clock account not found`); const clock = ClockLayout.decode(clockAccountInfoBuffer) as Clock; + const rewardPubkeys = lbPairAccInfo.rewardInfos + .filter((info) => !info.mint.equals(PublicKey.default)) + .map((info) => info.mint); const reserveAccountsInfo = await chunkedGetMultipleAccountInfos( program.provider.connection, @@ -295,6 +309,7 @@ export class DLMM { lbPairAccInfo.reserveY, lbPairAccInfo.tokenXMint, lbPairAccInfo.tokenYMint, + ...rewardPubkeys, ] ); let binArrayBitmapExtension: BinArrayBitmapExtensionAccount | null; @@ -307,24 +322,80 @@ export class DLMM { const reserveXBalance = AccountLayout.decode(reserveAccountsInfo[0].data); const reserveYBalance = AccountLayout.decode(reserveAccountsInfo[1].data); - const tokenXDecimal = MintLayout.decode( - reserveAccountsInfo[2].data - ).decimals; - const tokenYDecimal = MintLayout.decode( - reserveAccountsInfo[3].data - ).decimals; - const tokenX = { + + const mintXAccountInfo = reserveAccountsInfo[2]; + const mintYAccountInfo = reserveAccountsInfo[3]; + + const [mintXHookAccountsMeta, mintYHookAccountsMeta] = await Promise.all([ + getExtraAccountMetasForTransferHook( + connection, + lbPairAccInfo.tokenXMint, + mintXAccountInfo + ), + getExtraAccountMetasForTransferHook( + connection, + lbPairAccInfo.tokenYMint, + mintYAccountInfo + ), + ]); + + const mintXState = unpackMint( + lbPairAccInfo.tokenXMint, + mintXAccountInfo, + mintXAccountInfo.owner + ); + + const mintYState = unpackMint( + lbPairAccInfo.tokenXMint, + mintYAccountInfo, + mintYAccountInfo.owner + ); + + let rewardInfos: RewardMintInfo[] = []; + + const rewardMintAccountsInfo = reserveAccountsInfo.slice(4); + + for (const reward of lbPairAccInfo.rewardInfos) { + if (reward.mint.equals(PublicKey.default)) { + rewardInfos.push({ + publicKey: PublicKey.default, + owner: SystemProgram.programId, + extraAccountsMetaForTransferHook: [], + }); + } else { + const mintAccountInfo = rewardMintAccountsInfo.shift(); + const rewardMintHookAccountsMeta = + await getExtraAccountMetasForTransferHook( + connection, + reward.mint, + mintAccountInfo + ); + rewardInfos.push({ + publicKey: reward.mint, + owner: mintAccountInfo.owner, + extraAccountsMetaForTransferHook: rewardMintHookAccountsMeta, + }); + } + } + + const tokenX: TokenReserve = { publicKey: lbPairAccInfo.tokenXMint, reserve: lbPairAccInfo.reserveX, amount: reserveXBalance.amount, - decimal: tokenXDecimal, + decimal: mintXState.decimals, + owner: mintXAccountInfo.owner, + extraAccountsMetaForTransferHook: mintXHookAccountsMeta, }; - const tokenY = { + + const tokenY: TokenReserve = { publicKey: lbPairAccInfo.tokenYMint, reserve: lbPairAccInfo.reserveY, amount: reserveYBalance.amount, - decimal: tokenYDecimal, + decimal: mintYState.decimals, + owner: mintYAccountInfo.owner, + extraAccountsMetaForTransferHook: mintYHookAccountsMeta, }; + return new DLMM( dlmm, program, @@ -333,6 +404,7 @@ export class DLMM { tokenX, tokenY, clock, + rewardInfos, opt ); } @@ -430,6 +502,76 @@ export class DLMM { ...tokenMintPublicKeys, ]); + const rewardMintPublicKeys = Array.from(lbPairArraysMap.values()).flatMap( + ({ rewardInfos }) => { + return rewardInfos + .filter((reward) => !reward.mint.equals(PublicKey.default)) + .map((reward) => reward.mint); + } + ); + + const rewardMintAccountsInfo = await chunkedGetMultipleAccountInfos( + program.provider.connection, + rewardMintPublicKeys + ); + + const rewardMintAccountInfoMap = rewardMintPublicKeys.reduce( + (map, key, idx) => { + map.set(key, rewardMintAccountsInfo[idx]); + return map; + }, + new Map>() + ); + + const rewardMintHookAccountsMetaMap = ( + await Promise.all( + Array.from(rewardMintAccountInfoMap.keys()).map(async (key) => { + const mintAccountInfo = rewardMintAccountInfoMap.get(key); + const extraAccountMetas = await getExtraAccountMetasForTransferHook( + connection, + key, + mintAccountInfo + ); + return { + key, + extraAccountMetas, + }; + }) + ) + ).reduce((map, { key, extraAccountMetas }) => { + map.set(key, extraAccountMetas); + return map; + }, new Map()); + + const mintAccountsInfoSlice = reserveAndTokenMintAccountsInfo.slice( + reservePublicKeys.length + ); + + const mintAccountsInfoMap = tokenMintPublicKeys.reduce((map, key, idx) => { + map.set(key, mintAccountsInfoSlice[idx]); + return map; + }, new Map>()); + + const mintHookAccountsMetaMap = ( + await Promise.all( + Array.from(mintAccountsInfoMap.keys()).map(async (key) => { + const mintAccountInfo = mintAccountsInfoMap.get(key); + const extraAccountMetas = await getExtraAccountMetasForTransferHook( + connection, + key, + mintAccountInfo + ); + return { + key, + extraAccountMetas, + }; + }) + ) + ).reduce((map, { key, extraAccountMetas }) => { + map.set(key, extraAccountMetas); + return map; + }, new Map()); + const lbClmmImpl = await Promise.all( dlmmList.map(async (lbPair, index) => { const lbPairState = lbPairArraysMap.get(lbPair.toBase58()); @@ -467,24 +609,65 @@ export class DLMM { const reserveXBalance = AccountLayout.decode(reserveXAccountInfo.data); const reserveYBalance = AccountLayout.decode(reserveYAccountInfo.data); - const tokenXDecimal = MintLayout.decode( - tokenXMintAccountInfo.data - ).decimals; - const tokenYDecimal = MintLayout.decode( - tokenYMintAccountInfo.data - ).decimals; - const tokenX = { + + const mintXHookAccountsMeta = mintHookAccountsMetaMap.get( + lbPairState.tokenXMint + ); + const mintYHookAccountsMeta = mintHookAccountsMetaMap.get( + lbPairState.tokenYMint + ); + + const mintXState = unpackMint( + lbPairState.tokenXMint, + tokenXMintAccountInfo, + tokenXMintAccountInfo.owner + ); + + const mintYState = unpackMint( + lbPairState.tokenYMint, + tokenYMintAccountInfo, + tokenYMintAccountInfo.owner + ); + + const tokenX: TokenReserve = { publicKey: lbPairState.tokenXMint, reserve: lbPairState.reserveX, amount: reserveXBalance.amount, - decimal: tokenXDecimal, + decimal: mintXState.decimals, + owner: tokenXMintAccountInfo.owner, + extraAccountsMetaForTransferHook: mintXHookAccountsMeta, }; - const tokenY = { + + const tokenY: TokenReserve = { publicKey: lbPairState.tokenYMint, reserve: lbPairState.reserveY, amount: reserveYBalance.amount, - decimal: tokenYDecimal, + decimal: mintYState.decimals, + owner: tokenYMintAccountInfo.owner, + extraAccountsMetaForTransferHook: mintYHookAccountsMeta, }; + + let rewardInfos: RewardMintInfo[] = []; + + for (const reward of lbPairState.rewardInfos) { + if (reward.mint.equals(PublicKey.default)) { + rewardInfos.push({ + publicKey: PublicKey.default, + owner: SystemProgram.programId, + extraAccountsMetaForTransferHook: [], + }); + } else { + const mintAccountInfo = rewardMintAccountInfoMap.get(reward.mint); + const rewardMintHookAccountsMeta = + rewardMintHookAccountsMetaMap.get(reward.mint); + rewardInfos.push({ + publicKey: reward.mint, + owner: mintAccountInfo.owner, + extraAccountsMetaForTransferHook: rewardMintHookAccountsMeta, + }); + } + } + return new DLMM( lbPair, program, @@ -493,6 +676,7 @@ export class DLMM { tokenX, tokenY, clock, + rewardInfos, opt ); }) @@ -729,19 +913,24 @@ export class DLMM { ]) .flat(); + const reserveAndMintKeys = [...reservePublicKeys, ...reservePublicKeysV2]; + const reserveAccountsInfo = await chunkedGetMultipleAccountInfos( program.provider.connection, - [...reservePublicKeys, ...reservePublicKeysV2] + reserveAndMintKeys ); + type LbPairMintInfo = { mint: RawMint; owner: PublicKey }; + const lbPairReserveMap = new Map< string, { reserveX: bigint; reserveY: bigint } >(); const lbPairMintMap = new Map< string, - { mintXDecimal: number; mintYDecimal: number } + { mintX: LbPairMintInfo; mintY: LbPairMintInfo } >(); + const mintAccountInfoMap = new Map>(); lbPairArray.forEach((lbPair, idx) => { const index = idx * 4; const reserveAccBufferX = reserveAccountsInfo[index]; @@ -760,6 +949,13 @@ export class DLMM { const mintXBuffer = reserveAccountsInfo[index + 2]; const mintYBuffer = reserveAccountsInfo[index + 3]; + + const mintXKey = reserveAndMintKeys[index + 2]; + const mintYKey = reserveAndMintKeys[index + 3]; + + mintAccountInfoMap.set(mintXKey, mintXBuffer); + mintAccountInfoMap.set(mintYKey, mintYBuffer); + if (!mintXBuffer || !mintYBuffer) throw new Error( `Mint account for LB Pair ${lbPair.toBase58()} not found` @@ -768,8 +964,8 @@ export class DLMM { const mintY = MintLayout.decode(mintYBuffer.data); lbPairMintMap.set(lbPair.toBase58(), { - mintXDecimal: mintX.decimals, - mintYDecimal: mintY.decimals, + mintX: { mint: mintX, owner: mintXBuffer.owner }, + mintY: { mint: mintY, owner: mintYBuffer.owner }, }); }); @@ -779,7 +975,7 @@ export class DLMM { >(); const lbPairMintMapV2 = new Map< string, - { mintXDecimal: number; mintYDecimal: number } + { mintX: LbPairMintInfo; mintY: LbPairMintInfo } >(); lbPairArrayV2.forEach((lbPair, idx) => { const index = idx * 4; @@ -803,18 +999,52 @@ export class DLMM { reserveAccountsInfo[reservePublicKeys.length + index + 2]; const mintYBufferV2 = reserveAccountsInfo[reservePublicKeys.length + index + 3]; + + const mintXKey = reserveAndMintKeys[reservePublicKeys.length + index + 2]; + const mintYKey = reserveAndMintKeys[reservePublicKeys.length + index + 3]; + + mintAccountInfoMap.set(mintXKey, mintXBufferV2); + mintAccountInfoMap.set(mintYKey, mintYBufferV2); + if (!mintXBufferV2 || !mintYBufferV2) throw new Error( `Mint account for LB Pair ${lbPair.toBase58()} not found` ); const mintX = MintLayout.decode(mintXBufferV2.data); const mintY = MintLayout.decode(mintYBufferV2.data); + lbPairMintMapV2.set(lbPair.toBase58(), { - mintXDecimal: mintX.decimals, - mintYDecimal: mintY.decimals, + mintX: { + mint: mintX, + owner: mintXBufferV2.owner, + }, + mintY: { + mint: mintY, + owner: mintYBufferV2.owner, + }, }); }); + const mintHookAccountsMetaMap = ( + await Promise.all( + Array.from(mintAccountInfoMap.keys()).map(async (key) => { + const mintAccountInfo = mintAccountInfoMap.get(key); + const extraAccountMetas = await getExtraAccountMetasForTransferHook( + connection, + key, + mintAccountInfo + ); + return { + key, + extraAccountMetas, + }; + }) + ) + ).reduce((map, { key, extraAccountMetas }) => { + map.set(key, extraAccountMetas); + return map; + }, new Map()); + const onChainTimestamp = new BN( clockAccInfo.data.readBigInt64LE(32).toString() ).toNumber(); @@ -856,24 +1086,34 @@ export class DLMM { upperBinArrayPubKey.toBase58() ); const lbPairAcc = lbPairArraysMap.get(lbPair.toBase58()); - const { mintXDecimal, mintYDecimal } = lbPairMintMap.get( - lbPair.toBase58() - ); + const { mintX, mintY } = lbPairMintMap.get(lbPair.toBase58()); const reserveXBalance = lbPairReserveMap.get(lbPair.toBase58())?.reserveX ?? BigInt(0); const reserveYBalance = lbPairReserveMap.get(lbPair.toBase58())?.reserveY ?? BigInt(0); - const tokenX = { + + const mintXHookAccountsMeta = mintHookAccountsMetaMap.get( + lbPairAcc.tokenXMint + ); + const mintYHookAccountsMeta = mintHookAccountsMetaMap.get( + lbPairAcc.tokenYMint + ); + + const tokenX: TokenReserve = { publicKey: lbPairAcc.tokenXMint, reserve: lbPairAcc.reserveX, amount: reserveXBalance, - decimal: mintXDecimal, + decimal: mintX.mint.decimals, + owner: mintX.owner, + extraAccountsMetaForTransferHook: mintXHookAccountsMeta ?? [], }; - const tokenY = { + const tokenY: TokenReserve = { publicKey: lbPairAcc.tokenYMint, reserve: lbPairAcc.reserveY, amount: reserveYBalance, - decimal: mintYDecimal, + decimal: mintY.mint.decimals, + owner: mintY.owner, + extraAccountsMetaForTransferHook: mintYHookAccountsMeta ?? [], }; const positionData = await DLMM.processPosition( program, @@ -881,8 +1121,8 @@ export class DLMM { lbPairAcc, onChainTimestamp, account, - mintXDecimal, - mintYDecimal, + mintX.mint.decimals, + mintY.mint.decimals, lowerBinArray, upperBinArray, PublicKey.default @@ -930,25 +1170,41 @@ export class DLMM { upperBinArrayPubKey.toBase58() ); const lbPairAcc = lbPairArraysMapV2.get(lbPair.toBase58()); - const [baseTokenDecimal, quoteTokenDecimal] = await Promise.all([ - getTokenDecimals(program.provider.connection, lbPairAcc.tokenXMint), - getTokenDecimals(program.provider.connection, lbPairAcc.tokenYMint), - ]); + const [baseMintAccountInfo, quoteMintAccountInfo] = + await program.provider.connection.getMultipleAccountsInfo([ + lbPairAcc.tokenXMint, + lbPairAcc.tokenYMint, + ]); + const baseMint = MintLayout.decode(baseMintAccountInfo.data); + const quoteMint = MintLayout.decode(quoteMintAccountInfo.data); const reserveXBalance = lbPairReserveMapV2.get(lbPair.toBase58())?.reserveX ?? BigInt(0); const reserveYBalance = lbPairReserveMapV2.get(lbPair.toBase58())?.reserveY ?? BigInt(0); - const tokenX = { + + const mintXHookAccountsMeta = mintHookAccountsMetaMap.get( + lbPairAcc.tokenXMint + ); + + const mintYHookAccountsMeta = mintHookAccountsMetaMap.get( + lbPairAcc.tokenYMint + ); + + const tokenX: TokenReserve = { publicKey: lbPairAcc.tokenXMint, reserve: lbPairAcc.reserveX, amount: reserveXBalance, - decimal: baseTokenDecimal, + decimal: baseMint.decimals, + owner: baseMintAccountInfo.owner, + extraAccountsMetaForTransferHook: mintXHookAccountsMeta ?? [], }; - const tokenY = { + const tokenY: TokenReserve = { publicKey: lbPairAcc.tokenYMint, reserve: lbPairAcc.reserveY, amount: reserveYBalance, - decimal: quoteTokenDecimal, + decimal: quoteMint.decimals, + owner: quoteMintAccountInfo.owner, + extraAccountsMetaForTransferHook: mintYHookAccountsMeta ?? [], }; const positionData = await DLMM.processPosition( program, @@ -956,8 +1212,8 @@ export class DLMM { lbPairAcc, onChainTimestamp, account, - baseTokenDecimal, - quoteTokenDecimal, + baseMint.decimals, + quoteMint.decimals, lowerBinArray, upperBinArray, feeOwner @@ -1130,6 +1386,18 @@ export class DLMM { activationType, }; + const [tokenXBadge, tokenYBadge] = [tokenX, tokenY].map((token) => { + return deriveTokenBadge(token, program.programId)[0]; + }); + + const [mintXAccountInfo, mintYAccountInfo, mintXBadge, mintYBadge] = + await program.provider.connection.getMultipleAccountsInfo([ + tokenX, + tokenY, + tokenXBadge, + tokenYBadge, + ]); + return program.methods .initializePermissionLbPair(ixData) .accounts({ @@ -1140,7 +1408,10 @@ export class DLMM { binArrayBitmapExtension, tokenMintX: tokenX, tokenMintY: tokenY, - tokenProgram: TOKEN_PROGRAM_ID, + tokenBadgeX: mintXBadge ? tokenXBadge : program.programId, + tokenBadgeY: mintYBadge ? tokenYBadge : program.programId, + tokenProgramX: mintXAccountInfo.owner, + tokenProgramY: mintYAccountInfo.owner, oracle, systemProgram: SystemProgram.programId, admin: creatorKey, @@ -1200,8 +1471,20 @@ export class DLMM { ? deriveBinArrayBitmapExtension(lbPair, program.programId)[0] : null; + const [tokenXBadge, tokenYBadge] = [tokenX, tokenY].map((token) => { + return deriveTokenBadge(token, program.programId)[0]; + }); + + const [mintXAccountInfo, mintYAccountInfo, mintXBadge, mintYBadge] = + await program.provider.connection.getMultipleAccountsInfo([ + tokenX, + tokenY, + tokenXBadge, + tokenYBadge, + ]); + return program.methods - .initializeLbPair(activeId.toNumber(), binStep.toNumber()) + .initializeLbPair2(activeId.toNumber(), binStep.toNumber()) .accounts({ funder, lbPair, @@ -1211,7 +1494,10 @@ export class DLMM { binArrayBitmapExtension, tokenMintX: tokenX, tokenMintY: tokenY, - tokenProgram: TOKEN_PROGRAM_ID, + tokenBadgeX: mintXBadge ? tokenXBadge : program.programId, + tokenBadgeY: mintYBadge ? tokenYBadge : program.programId, + tokenProgramX: mintXAccountInfo.owner, + tokenProgramY: mintYAccountInfo.owner, oracle, presetParameter, systemProgram: SystemProgram.programId, @@ -1233,11 +1519,17 @@ export class DLMM { binArrayBitmapExtensionAccountInfo, reserveXAccountInfo, reserveYAccountInfo, + mintXAccountInfo, + mintYAccountInfo, + clockAccountInfo, ] = await chunkedGetMultipleAccountInfos(this.program.provider.connection, [ this.pubkey, binArrayBitmapExtensionPubkey, this.lbPair.reserveX, this.lbPair.reserveY, + this.lbPair.tokenXMint, + this.lbPair.tokenYMint, + SYSVAR_CLOCK_PUBKEY, ]); const lbPairState = this.program.coder.accounts.decode( @@ -1260,30 +1552,53 @@ export class DLMM { const reserveXBalance = AccountLayout.decode(reserveXAccountInfo.data); const reserveYBalance = AccountLayout.decode(reserveYAccountInfo.data); - const [tokenXDecimal, tokenYDecimal] = await Promise.all([ - getTokenDecimals( - this.program.provider.connection, - lbPairState.tokenXMint + + const mintXState = unpackMint( + this.lbPair.tokenXMint, + mintXAccountInfo, + mintXAccountInfo.owner + ); + + const mintYState = unpackMint( + this.lbPair.tokenYMint, + mintYAccountInfo, + mintYAccountInfo.owner + ); + + const connection = this.program.provider.connection; + const [mintXHookAccountsMeta, mintYHookAccountsMeta] = await Promise.all([ + getExtraAccountMetasForTransferHook( + connection, + this.lbPair.tokenXMint, + mintXAccountInfo ), - getTokenDecimals( - this.program.provider.connection, - lbPairState.tokenYMint + getExtraAccountMetasForTransferHook( + connection, + this.lbPair.tokenYMint, + mintYAccountInfo ), ]); + const clock = ClockLayout.decode(clockAccountInfo.data) as Clock; + this.tokenX = { amount: reserveXBalance.amount, - decimal: tokenXDecimal, + decimal: mintXState.decimals, publicKey: lbPairState.tokenXMint, reserve: lbPairState.reserveX, + owner: this.tokenX.owner, + extraAccountsMetaForTransferHook: mintXHookAccountsMeta, }; this.tokenY = { amount: reserveYBalance.amount, - decimal: tokenYDecimal, + decimal: mintYState.decimals, publicKey: lbPairState.tokenYMint, reserve: lbPairState.reserveY, + owner: this.tokenY.owner, + extraAccountsMetaForTransferHook: mintYHookAccountsMeta, }; + this.clock = clock; this.lbPair = lbPairState; } @@ -1965,436 +2280,9 @@ export class DLMM { position: positionPubKey, lbPair: this.pubkey, owner: user, - }) - .instruction(); - preInstructions.push(initializePositionIx); - - const lowerBinArrayIndex = binIdToBinArrayIndex(new BN(minBinId)); - const [binArrayLower] = deriveBinArray( - this.pubkey, - lowerBinArrayIndex, - this.program.programId - ); - - const upperBinArrayIndex = BN.max( - lowerBinArrayIndex.add(new BN(1)), - binIdToBinArrayIndex(new BN(maxBinId)) - ); - const [binArrayUpper] = deriveBinArray( - this.pubkey, - upperBinArrayIndex, - this.program.programId - ); - - const createBinArrayIxs = await this.createBinArraysIfNeeded( - upperBinArrayIndex, - lowerBinArrayIndex, - user - ); - preInstructions.push(...createBinArrayIxs); - - const [ - { ataPubKey: userTokenX, ix: createPayerTokenXIx }, - { ataPubKey: userTokenY, ix: createPayerTokenYIx }, - ] = await Promise.all([ - getOrCreateATAInstruction( - this.program.provider.connection, - this.tokenX.publicKey, - user - ), - getOrCreateATAInstruction( - this.program.provider.connection, - this.tokenY.publicKey, - user - ), - ]); - createPayerTokenXIx && preInstructions.push(createPayerTokenXIx); - createPayerTokenYIx && preInstructions.push(createPayerTokenYIx); - - if (this.tokenX.publicKey.equals(NATIVE_MINT) && !totalXAmount.isZero()) { - const wrapSOLIx = wrapSOLInstruction( - user, - userTokenX, - BigInt(totalXAmount.toString()) - ); - - preInstructions.push(...wrapSOLIx); - } - - if (this.tokenY.publicKey.equals(NATIVE_MINT) && !totalYAmount.isZero()) { - const wrapSOLIx = wrapSOLInstruction( - user, - userTokenY, - BigInt(totalYAmount.toString()) - ); - - preInstructions.push(...wrapSOLIx); - } - - const postInstructions: Array = []; - if ( - [ - this.tokenX.publicKey.toBase58(), - this.tokenY.publicKey.toBase58(), - ].includes(NATIVE_MINT.toBase58()) - ) { - const closeWrappedSOLIx = await unwrapSOLInstruction(user); - closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx); - } - - const minBinArrayIndex = binIdToBinArrayIndex(new BN(minBinId)); - const maxBinArrayIndex = binIdToBinArrayIndex(new BN(maxBinId)); - - const useExtension = - isOverflowDefaultBinArrayBitmap(minBinArrayIndex) || - isOverflowDefaultBinArrayBitmap(maxBinArrayIndex); - - const binArrayBitmapExtension = useExtension - ? deriveBinArrayBitmapExtension(this.pubkey, this.program.programId)[0] - : null; - - const activeId = this.lbPair.activeId; - - const strategyParameters: LiquidityParameterByStrategy["strategyParameters"] = - toStrategyParameters(strategy) as ProgramStrategyParameter; - - const liquidityParams: LiquidityParameterByStrategy = { - amountX: totalXAmount, - amountY: totalYAmount, - activeId, - maxActiveBinSlippage, - strategyParameters, - }; - - const addLiquidityAccounts = { - position: positionPubKey, - lbPair: this.pubkey, - userTokenX, - userTokenY, - reserveX: this.lbPair.reserveX, - reserveY: this.lbPair.reserveY, - tokenXMint: this.lbPair.tokenXMint, - tokenYMint: this.lbPair.tokenYMint, - binArrayLower, - binArrayUpper, - binArrayBitmapExtension, - sender: user, - tokenXProgram: TOKEN_PROGRAM_ID, - tokenYProgram: TOKEN_PROGRAM_ID, - }; - - const programMethod = - this.program.methods.addLiquidityByStrategy(liquidityParams); - - const createPositionTx = await programMethod - .accounts(addLiquidityAccounts) - .preInstructions(preInstructions) - .postInstructions(postInstructions) - .transaction(); - - const { blockhash, lastValidBlockHeight } = - await this.program.provider.connection.getLatestBlockhash("confirmed"); - return new Transaction({ - blockhash, - lastValidBlockHeight, - feePayer: user, - }).add(createPositionTx); - } - - /** - * The function `initializePositionAndAddLiquidityByWeight` function is used to initializes a position and adds liquidity - * @param {TInitializePositionAndAddLiquidityParams} - * - `positionPubKey`: The public key of the position account. (usually use `new Keypair()`) - * - `totalXAmount`: The total amount of token X to be added to the liquidity pool. - * - `totalYAmount`: The total amount of token Y to be added to the liquidity pool. - * - `xYAmountDistribution`: An array of objects of type `XYAmountDistribution` that represents (can use `calculateSpotDistribution`, `calculateBidAskDistribution` & `calculateNormalDistribution`) - * - `user`: The public key of the user account. - * - `slippage`: The slippage percentage to be used for the liquidity pool. - * @returns {Promise} The function `initializePositionAndAddLiquidityByWeight` returns a `Promise` that - * resolves to either a single `Transaction` object (if less than 26bin involved) or an array of `Transaction` objects. - */ - public async initializePositionAndAddLiquidityByWeight({ - positionPubKey, - totalXAmount, - totalYAmount, - xYAmountDistribution, - user, - slippage, - }: TInitializePositionAndAddLiquidityParams): Promise< - Transaction | Transaction[] - > { - const { lowerBinId, upperBinId, binIds } = - this.processXYAmountDistribution(xYAmountDistribution); - - const maxActiveBinSlippage = slippage - ? Math.ceil(slippage / (this.lbPair.binStep / 100)) - : MAX_ACTIVE_BIN_SLIPPAGE; - - if (upperBinId >= lowerBinId + MAX_BIN_PER_POSITION.toNumber()) { - throw new Error( - `Position must be within a range of 1 to ${MAX_BIN_PER_POSITION.toNumber()} bins.` - ); - } - - const preInstructions: Array = []; - const initializePositionIx = await this.program.methods - .initializePosition(lowerBinId, upperBinId - lowerBinId + 1) - .accounts({ - payer: user, - position: positionPubKey, - lbPair: this.pubkey, - owner: user, - }) - .instruction(); - preInstructions.push(initializePositionIx); - - const lowerBinArrayIndex = binIdToBinArrayIndex(new BN(lowerBinId)); - const [binArrayLower] = deriveBinArray( - this.pubkey, - lowerBinArrayIndex, - this.program.programId - ); - - const upperBinArrayIndex = BN.max( - lowerBinArrayIndex.add(new BN(1)), - binIdToBinArrayIndex(new BN(upperBinId)) - ); - const [binArrayUpper] = deriveBinArray( - this.pubkey, - upperBinArrayIndex, - this.program.programId - ); - - const createBinArrayIxs = await this.createBinArraysIfNeeded( - upperBinArrayIndex, - lowerBinArrayIndex, - user - ); - preInstructions.push(...createBinArrayIxs); - - const [ - { ataPubKey: userTokenX, ix: createPayerTokenXIx }, - { ataPubKey: userTokenY, ix: createPayerTokenYIx }, - ] = await Promise.all([ - getOrCreateATAInstruction( - this.program.provider.connection, - this.tokenX.publicKey, - user - ), - getOrCreateATAInstruction( - this.program.provider.connection, - this.tokenY.publicKey, - user - ), - ]); - createPayerTokenXIx && preInstructions.push(createPayerTokenXIx); - createPayerTokenYIx && preInstructions.push(createPayerTokenYIx); - - if (this.tokenX.publicKey.equals(NATIVE_MINT) && !totalXAmount.isZero()) { - const wrapSOLIx = wrapSOLInstruction( - user, - userTokenX, - BigInt(totalXAmount.toString()) - ); - - preInstructions.push(...wrapSOLIx); - } - - if (this.tokenY.publicKey.equals(NATIVE_MINT) && !totalYAmount.isZero()) { - const wrapSOLIx = wrapSOLInstruction( - user, - userTokenY, - BigInt(totalYAmount.toString()) - ); - - preInstructions.push(...wrapSOLIx); - } - - const postInstructions: Array = []; - if ( - [ - this.tokenX.publicKey.toBase58(), - this.tokenY.publicKey.toBase58(), - ].includes(NATIVE_MINT.toBase58()) - ) { - const closeWrappedSOLIx = await unwrapSOLInstruction(user); - closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx); - } - - const setComputeUnitLimitIx = computeBudgetIx(); - - const minBinId = Math.min(...binIds); - const maxBinId = Math.max(...binIds); - - const minBinArrayIndex = binIdToBinArrayIndex(new BN(minBinId)); - const maxBinArrayIndex = binIdToBinArrayIndex(new BN(maxBinId)); - - const useExtension = - isOverflowDefaultBinArrayBitmap(minBinArrayIndex) || - isOverflowDefaultBinArrayBitmap(maxBinArrayIndex); - - const binArrayBitmapExtension = useExtension - ? deriveBinArrayBitmapExtension(this.pubkey, this.program.programId)[0] - : null; - - const activeId = this.lbPair.activeId; - - const binLiquidityDist: LiquidityParameterByWeight["binLiquidityDist"] = - toWeightDistribution( - totalXAmount, - totalYAmount, - xYAmountDistribution.map((item) => ({ - binId: item.binId, - xAmountBpsOfTotal: item.xAmountBpsOfTotal, - yAmountBpsOfTotal: item.yAmountBpsOfTotal, - })), - this.lbPair.binStep - ); - - if (binLiquidityDist.length === 0) { - throw new Error("No liquidity to add"); - } - - const liquidityParams: LiquidityParameterByWeight = { - amountX: totalXAmount, - amountY: totalYAmount, - binLiquidityDist, - activeId, - maxActiveBinSlippage, - }; - - const addLiquidityAccounts = { - position: positionPubKey, - lbPair: this.pubkey, - userTokenX, - userTokenY, - reserveX: this.lbPair.reserveX, - reserveY: this.lbPair.reserveY, - tokenXMint: this.lbPair.tokenXMint, - tokenYMint: this.lbPair.tokenYMint, - binArrayLower, - binArrayUpper, - binArrayBitmapExtension, - sender: user, - tokenXProgram: TOKEN_PROGRAM_ID, - tokenYProgram: TOKEN_PROGRAM_ID, - }; - - const oneSideLiquidityParams: LiquidityOneSideParameter = { - amount: totalXAmount.isZero() ? totalYAmount : totalXAmount, - activeId, - maxActiveBinSlippage, - binLiquidityDist, - }; - - const oneSideAddLiquidityAccounts = { - binArrayLower, - binArrayUpper, - lbPair: this.pubkey, - binArrayBitmapExtension: null, - sender: user, - position: positionPubKey, - reserve: totalXAmount.isZero() - ? this.lbPair.reserveY - : this.lbPair.reserveX, - tokenMint: totalXAmount.isZero() - ? this.lbPair.tokenYMint - : this.lbPair.tokenXMint, - tokenProgram: TOKEN_PROGRAM_ID, - userToken: totalXAmount.isZero() ? userTokenY : userTokenX, - }; - - const isOneSideDeposit = totalXAmount.isZero() || totalYAmount.isZero(); - const programMethod = isOneSideDeposit - ? this.program.methods.addLiquidityOneSide(oneSideLiquidityParams) - : this.program.methods.addLiquidityByWeight(liquidityParams); - - if (xYAmountDistribution.length < MAX_BIN_LENGTH_ALLOWED_IN_ONE_TX) { - const addLiqTx = await programMethod - .accounts( - isOneSideDeposit ? oneSideAddLiquidityAccounts : addLiquidityAccounts - ) - .preInstructions([setComputeUnitLimitIx, ...preInstructions]) - .postInstructions(postInstructions) - .transaction(); - - const { blockhash, lastValidBlockHeight } = - await this.program.provider.connection.getLatestBlockhash("confirmed"); - return new Transaction({ - blockhash, - lastValidBlockHeight, - feePayer: user, - }).add(addLiqTx); - } - - const addLiqTx = await programMethod - .accounts( - isOneSideDeposit ? oneSideAddLiquidityAccounts : addLiquidityAccounts - ) - .preInstructions([setComputeUnitLimitIx]) - .transaction(); - - const transactions: Transaction[] = []; - const { blockhash, lastValidBlockHeight } = - await this.program.provider.connection.getLatestBlockhash("confirmed"); - if (preInstructions.length) { - const preInstructionsTx = new Transaction({ - blockhash, - lastValidBlockHeight, - feePayer: user, - }).add(...preInstructions); - transactions.push(preInstructionsTx); - } - - const mainTx = new Transaction({ - blockhash, - lastValidBlockHeight, - feePayer: user, - }).add(addLiqTx); - transactions.push(mainTx); - - if (postInstructions.length) { - const postInstructionsTx = new Transaction({ - blockhash, - lastValidBlockHeight, - feePayer: user, - }).add(...postInstructions); - transactions.push(postInstructionsTx); - } - - return transactions; - } - - /** - * The `addLiquidityByStrategy` function is used to add liquidity to existing position - * @param {TInitializePositionAndAddLiquidityParamsByStrategy} - * - `positionPubKey`: The public key of the position account. (usually use `new Keypair()`) - * - `totalXAmount`: The total amount of token X to be added to the liquidity pool. - * - `totalYAmount`: The total amount of token Y to be added to the liquidity pool. - * - `strategy`: The strategy parameters to be used for the liquidity pool (Can use `calculateStrategyParameter` to calculate). - * - `user`: The public key of the user account. - * - `slippage`: The slippage percentage to be used for the liquidity pool. - * @returns {Promise} The function `addLiquidityByWeight` returns a `Promise` that resolves to either a single - * `Transaction` object - */ - public async addLiquidityByStrategy({ - positionPubKey, - totalXAmount, - totalYAmount, - strategy, - user, - slippage, - }: TInitializePositionAndAddLiquidityParamsByStrategy): Promise { - const { maxBinId, minBinId } = strategy; - - const maxActiveBinSlippage = slippage - ? Math.ceil(slippage / (this.lbPair.binStep / 100)) - : MAX_ACTIVE_BIN_SLIPPAGE; - - const preInstructions: TransactionInstruction[] = []; - - const setComputeUnitLimitIx = computeBudgetIx(); - preInstructions.push(setComputeUnitLimitIx); + }) + .instruction(); + preInstructions.push(initializePositionIx); const minBinArrayIndex = binIdToBinArrayIndex(new BN(minBinId)); const maxBinArrayIndex = binIdToBinArrayIndex(new BN(maxBinId)); @@ -2407,31 +2295,9 @@ export class DLMM { ? deriveBinArrayBitmapExtension(this.pubkey, this.program.programId)[0] : null; - const activeId = this.lbPair.activeId; - - const strategyParameters: LiquidityParameterByStrategy["strategyParameters"] = - toStrategyParameters(strategy) as ProgramStrategyParameter; - - const lowerBinArrayIndex = binIdToBinArrayIndex(new BN(minBinId)); - const [binArrayLower] = deriveBinArray( - this.pubkey, - lowerBinArrayIndex, - this.program.programId - ); - - const upperBinArrayIndex = BN.max( - lowerBinArrayIndex.add(new BN(1)), - binIdToBinArrayIndex(new BN(maxBinId)) - ); - const [binArrayUpper] = deriveBinArray( - this.pubkey, - upperBinArrayIndex, - this.program.programId - ); - const createBinArrayIxs = await this.createBinArraysIfNeeded( - upperBinArrayIndex, - lowerBinArrayIndex, + maxBinArrayIndex, + minBinArrayIndex, user ); preInstructions.push(...createBinArrayIxs); @@ -2485,14 +2351,39 @@ export class DLMM { closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx); } + const activeId = this.lbPair.activeId; + + const strategyParameters: LiquidityParameterByStrategy["strategyParameters"] = + toStrategyParameters(strategy) as ProgramStrategyParameter; + const liquidityParams: LiquidityParameterByStrategy = { amountX: totalXAmount, amountY: totalYAmount, - activeId: this.lbPair.activeId, + activeId, maxActiveBinSlippage, strategyParameters, }; + const binArrayAccountsMeta = getBinArrayAccounstMetaByBinRange( + this.pubkey, + new BN(minBinId), + new BN(maxBinId), + this.program.programId + ); + + const remainingAccountsInfo: RemainingAccountsInfo = { + slices: [ + { + accountsType: AccountsType.TransferHookX, + length: this.tokenX.extraAccountsMetaForTransferHook.length, + }, + { + accountsType: AccountsType.TransferHookY, + length: this.tokenY.extraAccountsMetaForTransferHook.length, + }, + ], + }; + const addLiquidityAccounts = { position: positionPubKey, lbPair: this.pubkey, @@ -2502,19 +2393,25 @@ export class DLMM { reserveY: this.lbPair.reserveY, tokenXMint: this.lbPair.tokenXMint, tokenYMint: this.lbPair.tokenYMint, - binArrayLower, - binArrayUpper, binArrayBitmapExtension, sender: user, - tokenXProgram: TOKEN_PROGRAM_ID, - tokenYProgram: TOKEN_PROGRAM_ID, + tokenXProgram: this.tokenX.owner, + tokenYProgram: this.tokenY.owner, + memoProgram: MEMO_PROGRAM_ID, }; - const programMethod = - this.program.methods.addLiquidityByStrategy(liquidityParams); + const programMethod = this.program.methods.addLiquidityByStrategy2( + liquidityParams, + remainingAccountsInfo + ); const createPositionTx = await programMethod .accounts(addLiquidityAccounts) + .remainingAccounts([ + ...this.tokenX.extraAccountsMetaForTransferHook, + ...this.tokenY.extraAccountsMetaForTransferHook, + ...binArrayAccountsMeta, + ]) .preInstructions(preInstructions) .postInstructions(postInstructions) .transaction(); @@ -2529,48 +2426,35 @@ export class DLMM { } /** - * The `addLiquidityByWeight` function is used to add liquidity to existing position - * @param {TInitializePositionAndAddLiquidityParams} + * The `addLiquidityByStrategy` function is used to add liquidity to existing position + * @param {TInitializePositionAndAddLiquidityParamsByStrategy} * - `positionPubKey`: The public key of the position account. (usually use `new Keypair()`) * - `totalXAmount`: The total amount of token X to be added to the liquidity pool. * - `totalYAmount`: The total amount of token Y to be added to the liquidity pool. - * - `xYAmountDistribution`: An array of objects of type `XYAmountDistribution` that represents (can use `calculateSpotDistribution`, `calculateBidAskDistribution` & `calculateNormalDistribution`) + * - `strategy`: The strategy parameters to be used for the liquidity pool (Can use `calculateStrategyParameter` to calculate). * - `user`: The public key of the user account. * - `slippage`: The slippage percentage to be used for the liquidity pool. - * @returns {Promise} The function `addLiquidityByWeight` returns a `Promise` that resolves to either a single - * `Transaction` object (if less than 26bin involved) or an array of `Transaction` objects. + * @returns {Promise} The function `addLiquidityByWeight` returns a `Promise` that resolves to either a single + * `Transaction` object */ - public async addLiquidityByWeight({ + public async addLiquidityByStrategy({ positionPubKey, totalXAmount, totalYAmount, - xYAmountDistribution, + strategy, user, slippage, - }: TInitializePositionAndAddLiquidityParams): Promise< - Transaction | Transaction[] - > { + }: TInitializePositionAndAddLiquidityParamsByStrategy): Promise { + const { maxBinId, minBinId } = strategy; + const maxActiveBinSlippage = slippage ? Math.ceil(slippage / (this.lbPair.binStep / 100)) : MAX_ACTIVE_BIN_SLIPPAGE; - const positionAccount = await this.program.account.positionV2.fetch( - positionPubKey - ); - const { lowerBinId, upperBinId, binIds } = - this.processXYAmountDistribution(xYAmountDistribution); - - if (lowerBinId < positionAccount.lowerBinId) - throw new Error( - `Lower Bin ID (${lowerBinId}) lower than Position Lower Bin Id (${positionAccount.lowerBinId})` - ); - if (upperBinId > positionAccount.upperBinId) - throw new Error( - `Upper Bin ID (${upperBinId}) higher than Position Upper Bin Id (${positionAccount.upperBinId})` - ); + const preInstructions: TransactionInstruction[] = []; - const minBinId = Math.min(...binIds); - const maxBinId = Math.max(...binIds); + const setComputeUnitLimitIx = computeBudgetIx(); + preInstructions.push(setComputeUnitLimitIx); const minBinArrayIndex = binIdToBinArrayIndex(new BN(minBinId)); const maxBinArrayIndex = binIdToBinArrayIndex(new BN(maxBinId)); @@ -2583,47 +2467,12 @@ export class DLMM { ? deriveBinArrayBitmapExtension(this.pubkey, this.program.programId)[0] : null; - const activeId = this.lbPair.activeId; - - const binLiquidityDist: LiquidityParameterByWeight["binLiquidityDist"] = - toWeightDistribution( - totalXAmount, - totalYAmount, - xYAmountDistribution.map((item) => ({ - binId: item.binId, - xAmountBpsOfTotal: item.xAmountBpsOfTotal, - yAmountBpsOfTotal: item.yAmountBpsOfTotal, - })), - this.lbPair.binStep - ); - - if (binLiquidityDist.length === 0) { - throw new Error("No liquidity to add"); - } - - const lowerBinArrayIndex = binIdToBinArrayIndex( - new BN(positionAccount.lowerBinId) - ); - const [binArrayLower] = deriveBinArray( - this.pubkey, - lowerBinArrayIndex, - this.program.programId - ); - - const upperBinArrayIndex = BN.max( - lowerBinArrayIndex.add(new BN(1)), - binIdToBinArrayIndex(new BN(positionAccount.upperBinId)) - ); - const [binArrayUpper] = deriveBinArray( - this.pubkey, - upperBinArrayIndex, - this.program.programId - ); + const strategyParameters: LiquidityParameterByStrategy["strategyParameters"] = + toStrategyParameters(strategy) as ProgramStrategyParameter; - const preInstructions: TransactionInstruction[] = []; const createBinArrayIxs = await this.createBinArraysIfNeeded( - upperBinArrayIndex, - lowerBinArrayIndex, + maxBinArrayIndex, + minBinArrayIndex, user ); preInstructions.push(...createBinArrayIxs); @@ -2677,14 +2526,12 @@ export class DLMM { closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx); } - const setComputeUnitLimitIx = computeBudgetIx(); - - const liquidityParams: LiquidityParameterByWeight = { + const liquidityParams: LiquidityParameterByStrategy = { amountX: totalXAmount, amountY: totalYAmount, - binLiquidityDist, - activeId, + activeId: this.lbPair.activeId, maxActiveBinSlippage, + strategyParameters, }; const addLiquidityAccounts = { @@ -2696,97 +2543,56 @@ export class DLMM { reserveY: this.lbPair.reserveY, tokenXMint: this.lbPair.tokenXMint, tokenYMint: this.lbPair.tokenYMint, - binArrayLower, - binArrayUpper, binArrayBitmapExtension, sender: user, - tokenXProgram: TOKEN_PROGRAM_ID, - tokenYProgram: TOKEN_PROGRAM_ID, + tokenXProgram: this.tokenX.owner, + tokenYProgram: this.tokenY.owner, + memoProgram: MEMO_PROGRAM_ID, }; - const oneSideLiquidityParams: LiquidityOneSideParameter = { - amount: totalXAmount.isZero() ? totalYAmount : totalXAmount, - activeId, - maxActiveBinSlippage, - binLiquidityDist, - }; + const binArrayAccountsMeta = getBinArrayAccounstMetaByBinRange( + this.pubkey, + new BN(minBinId), + new BN(maxBinId), + this.program.programId + ); - const oneSideAddLiquidityAccounts = { - binArrayLower, - binArrayUpper, - lbPair: this.pubkey, - binArrayBitmapExtension: null, - sender: user, - position: positionPubKey, - reserve: totalXAmount.isZero() - ? this.lbPair.reserveY - : this.lbPair.reserveX, - tokenMint: totalXAmount.isZero() - ? this.lbPair.tokenYMint - : this.lbPair.tokenXMint, - tokenProgram: TOKEN_PROGRAM_ID, - userToken: totalXAmount.isZero() ? userTokenY : userTokenX, + const remainingAccountsInfo: RemainingAccountsInfo = { + slices: [ + { + accountsType: AccountsType.TransferHookX, + length: this.tokenX.extraAccountsMetaForTransferHook.length, + }, + { + accountsType: AccountsType.TransferHookY, + length: this.tokenY.extraAccountsMetaForTransferHook.length, + }, + ], }; - const isOneSideDeposit = totalXAmount.isZero() || totalYAmount.isZero(); - const programMethod = isOneSideDeposit - ? this.program.methods.addLiquidityOneSide(oneSideLiquidityParams) - : this.program.methods.addLiquidityByWeight(liquidityParams); - - if (xYAmountDistribution.length < MAX_BIN_LENGTH_ALLOWED_IN_ONE_TX) { - const addLiqTx = await programMethod - .accounts( - isOneSideDeposit ? oneSideAddLiquidityAccounts : addLiquidityAccounts - ) - .preInstructions([setComputeUnitLimitIx, ...preInstructions]) - .postInstructions(postInstructions) - .transaction(); - - const { blockhash, lastValidBlockHeight } = - await this.program.provider.connection.getLatestBlockhash("confirmed"); - return new Transaction({ - blockhash, - lastValidBlockHeight, - feePayer: user, - }).add(addLiqTx); - } + const programMethod = this.program.methods.addLiquidityByStrategy2( + liquidityParams, + remainingAccountsInfo + ); - const addLiqTx = await programMethod - .accounts( - isOneSideDeposit ? oneSideAddLiquidityAccounts : addLiquidityAccounts - ) - .preInstructions([setComputeUnitLimitIx]) + const createPositionTx = await programMethod + .accounts(addLiquidityAccounts) + .remainingAccounts([ + ...this.tokenX.extraAccountsMetaForTransferHook, + ...this.tokenY.extraAccountsMetaForTransferHook, + ...binArrayAccountsMeta, + ]) + .preInstructions(preInstructions) + .postInstructions(postInstructions) .transaction(); - const transactions: Transaction[] = []; const { blockhash, lastValidBlockHeight } = await this.program.provider.connection.getLatestBlockhash("confirmed"); - if (preInstructions.length) { - const preInstructionsTx = new Transaction({ - blockhash, - lastValidBlockHeight, - feePayer: user, - }).add(...preInstructions); - transactions.push(preInstructionsTx); - } - - const mainTx = new Transaction({ + return new Transaction({ blockhash, lastValidBlockHeight, feePayer: user, - }).add(addLiqTx); - transactions.push(mainTx); - - if (postInstructions.length) { - const postInstructionsTx = new Transaction({ - blockhash, - lastValidBlockHeight, - feePayer: user, - }).add(...postInstructions); - transactions.push(postInstructionsTx); - } - - return transactions; + }).add(createPositionTx); } /** @@ -2818,18 +2624,9 @@ export class DLMM { const { reserveX, reserveY, tokenXMint, tokenYMint } = await this.program.account.lbPair.fetch(lbPair); - const lowerBinArrayIndex = binIdToBinArrayIndex(new BN(lowerBinId)); - const upperBinArrayIndex = lowerBinArrayIndex.add(new BN(1)); - const [binArrayLower] = deriveBinArray( - lbPair, - lowerBinArrayIndex, - this.program.programId - ); - const [binArrayUpper] = deriveBinArray( - lbPair, - upperBinArrayIndex, - this.program.programId - ); + + const minBinId = Math.min(...binIds); + const maxBinId = Math.max(...binIds); const preInstructions: Array = []; const setComputeUnitLimitIx = computeBudgetIx(); @@ -2882,23 +2679,48 @@ export class DLMM { const secondTransactionsIx: TransactionInstruction[] = []; const postInstructions: Array = []; + let mintXYRemainingAccountsInfo: RemainingAccountsInfo = { + slices: [ + { + accountsType: AccountsType.TransferHookX, + length: this.tokenX.extraAccountsMetaForTransferHook.length, + }, + { + accountsType: AccountsType.TransferHookY, + length: this.tokenY.extraAccountsMetaForTransferHook.length, + }, + ], + }; + + const binArrayAccountsMeta = getBinArrayAccounstMetaByBinRange( + this.pubkey, + new BN(minBinId), + new BN(maxBinId), + this.program.programId + ); + if (shouldClaimAndClose) { const claimSwapFeeIx = await this.program.methods - .claimFee() + .claimFee2(minBinId, maxBinId, mintXYRemainingAccountsInfo) .accounts({ - binArrayLower, - binArrayUpper, lbPair: this.pubkey, sender: user, position, reserveX, reserveY, - tokenProgram: TOKEN_PROGRAM_ID, + tokenProgramX: this.tokenX.owner, + tokenProgramY: this.tokenY.owner, tokenXMint: this.tokenX.publicKey, tokenYMint: this.tokenY.publicKey, userTokenX: feeOwnerTokenX, userTokenY: feeOwnerTokenY, + memoProgram: MEMO_PROGRAM_ID, }) + .remainingAccounts([ + ...this.tokenX.extraAccountsMetaForTransferHook, + ...this.tokenY.extraAccountsMetaForTransferHook, + ...binArrayAccountsMeta, + ]) .instruction(); postInstructions.push(claimSwapFeeIx); @@ -2906,6 +2728,16 @@ export class DLMM { const rewardInfo = this.lbPair.rewardInfos[i]; if (!rewardInfo || rewardInfo.mint.equals(PublicKey.default)) continue; + const rewardMintRemainingAccountsInfo: RemainingAccountsInfo = { + slices: [ + { + accountsType: AccountsType.TransferHookReward, + length: + this.rewardMintInfo[i].extraAccountsMetaForTransferHook.length, + }, + ], + }; + const { ataPubKey, ix: rewardAtaIx } = await getOrCreateATAInstruction( this.program.provider.connection, rewardInfo.mint, @@ -2914,22 +2746,43 @@ export class DLMM { rewardAtaIx && preInstructions.push(rewardAtaIx); const claimRewardIx = await this.program.methods - .claimReward(new BN(i)) + .claimReward2( + new BN(i), + minBinId, + maxBinId, + rewardMintRemainingAccountsInfo + ) .accounts({ lbPair: this.pubkey, sender: user, position, - binArrayLower, - binArrayUpper, rewardVault: rewardInfo.vault, rewardMint: rewardInfo.mint, - tokenProgram: TOKEN_PROGRAM_ID, + tokenProgram: this.rewardMintInfo[i].owner, userTokenAccount: ataPubKey, + memoProgram: MEMO_PROGRAM_ID, }) + .remainingAccounts([ + ...this.rewardMintInfo[i].extraAccountsMetaForTransferHook, + ...binArrayAccountsMeta, + ]) .instruction(); secondTransactionsIx.push(claimRewardIx); } + const lowerBinArrayIndex = binIdToBinArrayIndex(new BN(lowerBinId)); + const upperBinArrayIndex = lowerBinArrayIndex.add(new BN(1)); + const [binArrayLower] = deriveBinArray( + lbPair, + lowerBinArrayIndex, + this.program.programId + ); + const [binArrayUpper] = deriveBinArray( + lbPair, + upperBinArrayIndex, + this.program.programId + ); + const closePositionIx = await this.program.methods .closePosition() .accounts({ @@ -2958,9 +2811,6 @@ export class DLMM { closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx); } - const minBinId = Math.min(...binIds); - const maxBinId = Math.max(...binIds); - const minBinArrayIndex = binIdToBinArrayIndex(new BN(minBinId)); const maxBinArrayIndex = binIdToBinArrayIndex(new BN(maxBinId)); @@ -2973,7 +2823,12 @@ export class DLMM { : null; const removeLiquidityTx = await this.program.methods - .removeLiquidityByRange(minBinId, maxBinId, bps.toNumber()) + .removeLiquidityByRange2( + minBinId, + maxBinId, + bps.toNumber(), + mintXYRemainingAccountsInfo + ) .accounts({ position, lbPair, @@ -2983,13 +2838,17 @@ export class DLMM { reserveY, tokenXMint, tokenYMint, - binArrayLower, - binArrayUpper, binArrayBitmapExtension, - tokenXProgram: TOKEN_PROGRAM_ID, - tokenYProgram: TOKEN_PROGRAM_ID, + tokenXProgram: this.tokenX.owner, + tokenYProgram: this.tokenY.owner, sender: user, + memoProgram: MEMO_PROGRAM_ID, }) + .remainingAccounts([ + ...this.tokenX.extraAccountsMetaForTransferHook, + ...this.tokenY.extraAccountsMetaForTransferHook, + ...binArrayAccountsMeta, + ]) .preInstructions(preInstructions) .postInstructions(postInstructions) .transaction(); @@ -3206,7 +3065,7 @@ export class DLMM { } /** - * The `swapQuote` function returns a quote for a swap + * The `swapQuote` function returns a quote for a swap. Do not support token 2022. * @param * - `inAmount`: Amount of lamport to swap in * - `swapForY`: Swap token X to Y when it is true, else reversed. @@ -3513,8 +3372,18 @@ export class DLMM { closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx); } - let swapForY = true; - if (outToken.equals(tokenXMint)) swapForY = false; + const remainingAccountsInfo: RemainingAccountsInfo = { + slices: [ + { + accountsType: AccountsType.TransferHookX, + length: this.tokenX.extraAccountsMetaForTransferHook.length, + }, + { + accountsType: AccountsType.TransferHookY, + length: this.tokenY.extraAccountsMetaForTransferHook.length, + }, + ], + }; // TODO: needs some refinement in case binArray not yet initialized const binArrays: AccountMeta[] = binArraysPubkey.map((pubkey) => { @@ -3526,10 +3395,11 @@ export class DLMM { }); const swapTx = await this.program.methods - .swapWithPriceImpact( + .swapWithPriceImpact2( inAmount, this.lbPair.activeId, - priceImpact.toNumber() + priceImpact.toNumber(), + remainingAccountsInfo ) .accounts({ lbPair, @@ -3547,8 +3417,13 @@ export class DLMM { : null, oracle, hostFeeIn: null, + memoProgram: MEMO_PROGRAM_ID, }) - .remainingAccounts(binArrays) + .remainingAccounts([ + ...this.tokenX.extraAccountsMetaForTransferHook, + ...this.tokenY.extraAccountsMetaForTransferHook, + ...binArrays, + ]) .preInstructions(preInstructions) .postInstructions(postInstructions) .transaction(); @@ -3622,8 +3497,18 @@ export class DLMM { closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx); } - let swapForY = true; - if (outToken.equals(tokenXMint)) swapForY = false; + const remainingAccountsInfo: RemainingAccountsInfo = { + slices: [ + { + accountsType: AccountsType.TransferHookX, + length: this.tokenX.extraAccountsMetaForTransferHook.length, + }, + { + accountsType: AccountsType.TransferHookY, + length: this.tokenY.extraAccountsMetaForTransferHook.length, + }, + ], + }; // TODO: needs some refinement in case binArray not yet initialized const binArrays: AccountMeta[] = binArraysPubkey.map((pubkey) => { @@ -3635,15 +3520,15 @@ export class DLMM { }); const swapTx = await this.program.methods - .swap(inAmount, minOutAmount) + .swap2(inAmount, minOutAmount, remainingAccountsInfo) .accounts({ lbPair, reserveX, reserveY, tokenXMint, tokenYMint, - tokenXProgram: TOKEN_PROGRAM_ID, // dont use 2022 first; lack familiarity - tokenYProgram: TOKEN_PROGRAM_ID, // dont use 2022 first; lack familiarity + tokenXProgram: this.tokenX.owner, + tokenYProgram: this.tokenY.owner, user, userTokenIn, userTokenOut, @@ -3652,8 +3537,13 @@ export class DLMM { : null, oracle, hostFeeIn: null, + memoProgram: MEMO_PROGRAM_ID, }) - .remainingAccounts(binArrays) + .remainingAccounts([ + ...this.tokenX.extraAccountsMetaForTransferHook, + ...this.tokenY.extraAccountsMetaForTransferHook, + ...binArrays, + ]) .preInstructions(preInstructions) .postInstructions(postInstructions) .transaction(); @@ -5459,23 +5349,16 @@ export class DLMM { position: LbPosition; shouldIncludePreIx?: boolean; }) { - const lowerBinArrayIndex = binIdToBinArrayIndex( - new BN(position.positionData.lowerBinId) - ); - const [binArrayLower] = deriveBinArray( - this.pubkey, - lowerBinArrayIndex, - this.program.programId - ); + const { lowerBinId, upperBinId } = position.positionData; + const claimTransactions: Transaction[] = []; - const upperBinArrayIndex = lowerBinArrayIndex.add(new BN(1)); - const [binArrayUpper] = deriveBinArray( + const binArrayAccountsMeta = getBinArrayAccounstMetaByBinRange( this.pubkey, - upperBinArrayIndex, + new BN(lowerBinId), + new BN(upperBinId), this.program.programId ); - const claimTransactions: Transaction[] = []; for (let i = 0; i < 2; i++) { const rewardInfo = this.lbPair.rewardInfos[i]; if (!rewardInfo || rewardInfo.mint.equals(PublicKey.default)) continue; @@ -5487,19 +5370,32 @@ export class DLMM { owner ); ix && preInstructions.push(ix); + + const remainingAccountsInfo: RemainingAccountsInfo = { + slices: [ + { + accountsType: AccountsType.TransferHookReward, + length: + this.rewardMintInfo[i].extraAccountsMetaForTransferHook.length, + }, + ], + }; + const claimTransaction = await this.program.methods - .claimReward(new BN(i)) + .claimReward2(new BN(i), lowerBinId, upperBinId, remainingAccountsInfo) .accounts({ lbPair: this.pubkey, sender: owner, position: position.publicKey, - binArrayLower, - binArrayUpper, rewardVault: rewardInfo.vault, rewardMint: rewardInfo.mint, - tokenProgram: TOKEN_PROGRAM_ID, + tokenProgram: this.rewardMintInfo[i].owner, userTokenAccount: ataPubKey, }) + .remainingAccounts([ + ...this.rewardMintInfo[i].extraAccountsMetaForTransferHook, + ...binArrayAccountsMeta, + ]) .preInstructions(shouldIncludePreIx ? preInstructions : []) .transaction(); claimTransactions.push(claimTransaction); @@ -5519,21 +5415,7 @@ export class DLMM { shouldIncludePretIx?: boolean; shouldIncludePostIx?: boolean; }) { - const { lowerBinId, feeOwner } = position.positionData; - - const lowerBinArrayIndex = binIdToBinArrayIndex(new BN(lowerBinId)); - const [binArrayLower] = deriveBinArray( - this.pubkey, - lowerBinArrayIndex, - this.program.programId - ); - - const upperBinArrayIndex = lowerBinArrayIndex.add(new BN(1)); - const [binArrayUpper] = deriveBinArray( - this.pubkey, - upperBinArrayIndex, - this.program.programId - ); + const { lowerBinId, upperBinId, feeOwner } = position.positionData; const [reserveX] = deriveReserve( this.tokenX.publicKey, @@ -5582,22 +5464,47 @@ export class DLMM { closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx); } + const binArrayAccountsMeta = getBinArrayAccounstMetaByBinRange( + this.pubkey, + new BN(lowerBinId), + new BN(upperBinId), + this.program.programId + ); + + const remainingAccountsInfo: RemainingAccountsInfo = { + slices: [ + { + accountsType: AccountsType.TransferHookX, + length: this.tokenX.extraAccountsMetaForTransferHook.length, + }, + { + accountsType: AccountsType.TransferHookY, + length: this.tokenY.extraAccountsMetaForTransferHook.length, + }, + ], + }; + const claimFeeTx = await this.program.methods - .claimFee() + .claimFee2(lowerBinId, upperBinId, remainingAccountsInfo) .accounts({ - binArrayLower, - binArrayUpper, lbPair: this.pubkey, sender: owner, position: position.publicKey, reserveX, reserveY, - tokenProgram: TOKEN_PROGRAM_ID, + tokenProgramX: this.tokenX.owner, + tokenProgramY: this.tokenY.owner, tokenXMint: this.tokenX.publicKey, tokenYMint: this.tokenY.publicKey, userTokenX, userTokenY, + memoProgram: MEMO_PROGRAM_ID, }) + .remainingAccounts([ + ...this.tokenX.extraAccountsMetaForTransferHook, + ...this.tokenY.extraAccountsMetaForTransferHook, + ...binArrayAccountsMeta, + ]) .preInstructions(shouldIncludePretIx ? preInstructions : []) .postInstructions(shouldIncludePostIx ? postInstructions : []) .transaction(); diff --git a/ts-client/src/dlmm/types/index.ts b/ts-client/src/dlmm/types/index.ts index 261dab1a..ff244244 100644 --- a/ts-client/src/dlmm/types/index.ts +++ b/ts-client/src/dlmm/types/index.ts @@ -6,7 +6,11 @@ import { ProgramAccount, } from "@coral-xyz/anchor"; import { LbClmm } from "../idl"; -import { PublicKey, TransactionInstruction } from "@solana/web3.js"; +import { + AccountMeta, + PublicKey, + TransactionInstruction, +} from "@solana/web3.js"; import Decimal from "decimal.js"; import { u64, i64, struct } from "@coral-xyz/borsh"; @@ -27,6 +31,14 @@ export interface TokenReserve { reserve: PublicKey; amount: bigint; decimal: number; + owner: PublicKey; + extraAccountsMetaForTransferHook: AccountMeta[]; +} + +export interface RewardMintInfo { + publicKey: PublicKey; + owner: PublicKey; + extraAccountsMetaForTransferHook: AccountMeta[]; } export type ClmmProgram = Program; @@ -73,6 +85,8 @@ export type CompressedBinDepositAmount = IdlTypes["CompressedBinDepositAmount"]; export type CompressedBinDepositAmounts = CompressedBinDepositAmount[]; +export type RemainingAccountsInfo = IdlTypes["RemainingAccountsInfo"]; + export interface LbPosition { publicKey: PublicKey; positionData: PositionData; @@ -147,6 +161,18 @@ export enum ActivationType { Timestamp, } +export const AccountsType = { + TransferHookX: { + transferHookX: {}, + }, + TransferHookY: { + transferHookY: {}, + }, + TransferHookReward: { + transferHookReward: {}, + }, +}; + export interface StrategyParameters { maxBinId: number; minBinId: number; diff --git a/ts-client/src/test/sdk.test.ts b/ts-client/src/test/sdk.test.ts index 30b6144d..b514b3d4 100644 --- a/ts-client/src/test/sdk.test.ts +++ b/ts-client/src/test/sdk.test.ts @@ -471,11 +471,18 @@ describe.only("SDK test", () => { await pair.refetchStates(); - let addLiquidityTxs = await pair.addLiquidityByWeight({ + const minBinId = lowerBinId; + const maxBinId = minBinId.add(MAX_BIN_PER_POSITION).sub(new BN(1)); + + let addLiquidityTxs = await pair.addLiquidityByStrategy({ positionPubKey: customFeeOwnerPosition, totalXAmount: btcInAmount, totalYAmount: usdcInAmount, - xYAmountDistribution, + strategy: { + strategyType: StrategyType.SpotBalanced, + minBinId: minBinId.toNumber(), + maxBinId: maxBinId.toNumber(), + }, user: keypair.publicKey, slippage: 0, }); @@ -1622,30 +1629,19 @@ describe.only("SDK test", () => { const btcInAmount = new BN(1).mul(new BN(10 ** btcDecimal)); const usdcInAmount = new BN(24000).mul(new BN(10 ** usdcDecimal)); - const xYAmountDistribution = [ - { - binId: DEFAULT_ACTIVE_ID.sub(new BN(1)).toNumber(), - xAmountBpsOfTotal: new BN(0), - yAmountBpsOfTotal: new BN(7500), - }, - { - binId: DEFAULT_ACTIVE_ID.toNumber(), - xAmountBpsOfTotal: new BN(2500), - yAmountBpsOfTotal: new BN(2500), - }, - { - binId: DEFAULT_ACTIVE_ID.add(new BN(1)).toNumber(), - xAmountBpsOfTotal: new BN(7500), - yAmountBpsOfTotal: new BN(0), - }, - ]; + const minBinId = DEFAULT_ACTIVE_ID.sub(new BN(1)); + const maxBinId = DEFAULT_ACTIVE_ID.add(new BN(1)); - const rawTxs = await lbClmm.initializePositionAndAddLiquidityByWeight({ + const rawTxs = await lbClmm.initializePositionAndAddLiquidityByStrategy({ user: keypair.publicKey, positionPubKey: positionKeypair.publicKey, totalXAmount: btcInAmount, totalYAmount: usdcInAmount, - xYAmountDistribution, + strategy: { + strategyType: StrategyType.SpotBalanced, + minBinId: minBinId.toNumber(), + maxBinId: maxBinId.toNumber(), + }, }); if (Array.isArray(rawTxs)) { @@ -1705,28 +1701,9 @@ describe.only("SDK test", () => { const positionBinWithLiquidity = positionData.positionBinData.filter( (p) => p.positionLiquidity != "0" ); - expect(positionBinWithLiquidity.length).toBe(xYAmountDistribution.length); - - for (const [idx, binData] of positionBinWithLiquidity.entries()) { - const xYDist = xYAmountDistribution[idx]; - expect(binData.binId).toBe(xYDist.binId); - assertAmountWithPrecision( - +binData.binXAmount, - xYDist.xAmountBpsOfTotal - .mul(btcInAmount) - .div(new BN(BASIS_POINT_MAX)) - .toNumber(), - 15 - ); - assertAmountWithPrecision( - +binData.binYAmount, - xYDist.yAmountBpsOfTotal - .mul(usdcInAmount) - .div(new BN(BASIS_POINT_MAX)) - .toNumber(), - 15 - ); - } + expect(positionBinWithLiquidity.length).toBe( + maxBinId.sub(minBinId).add(new BN(1)).toNumber() + ); }); it("get user positions in pool", async () => {